| Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 1 | //===-- AMDGPUInstrInfo.h - AMDGPU Instruction Information ------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | /// \file |
| 11 | /// \brief Contains the definition of a TargetInstrInfo class that is common |
| 12 | /// to all AMD GPUs. |
| 13 | // |
| 14 | //===----------------------------------------------------------------------===// |
| 15 | |
| Matt Arsenault | 6b6a2c3 | 2016-03-11 08:00:27 +0000 | [diff] [blame] | 16 | #ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUINSTRINFO_H |
| 17 | #define LLVM_LIB_TARGET_AMDGPU_AMDGPUINSTRINFO_H |
| Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 18 | |
| Yaxun Liu | 1a14bfa | 2017-03-27 14:04:01 +0000 | [diff] [blame] | 19 | #include "AMDGPU.h" |
| Sam Kolton | a3ec5c1 | 2016-10-07 14:46:06 +0000 | [diff] [blame] | 20 | #include "Utils/AMDGPUBaseInfo.h" |
| David Blaikie | 3f833ed | 2017-11-08 01:01:31 +0000 | [diff] [blame] | 21 | #include "llvm/CodeGen/TargetInstrInfo.h" |
| Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 22 | |
| 23 | #define GET_INSTRINFO_HEADER |
| Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 24 | #include "AMDGPUGenInstrInfo.inc" |
| Matt Arsenault | cad7fa8 | 2017-12-13 21:07:51 +0000 | [diff] [blame] | 25 | #undef GET_INSTRINFO_HEADER |
| Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 26 | |
| Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 27 | namespace llvm { |
| 28 | |
| Tom Stellard | 2e59a45 | 2014-06-13 01:32:00 +0000 | [diff] [blame] | 29 | class AMDGPUSubtarget; |
| Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 30 | class MachineFunction; |
| 31 | class MachineInstr; |
| 32 | class MachineInstrBuilder; |
| 33 | |
| 34 | class AMDGPUInstrInfo : public AMDGPUGenInstrInfo { |
| 35 | private: |
| Tom Stellard | 2e59a45 | 2014-06-13 01:32:00 +0000 | [diff] [blame] | 36 | const AMDGPUSubtarget &ST; |
| Matt Arsenault | 43e92fe | 2016-06-24 06:30:11 +0000 | [diff] [blame] | 37 | |
| 38 | virtual void anchor(); |
| Yaxun Liu | 1a14bfa | 2017-03-27 14:04:01 +0000 | [diff] [blame] | 39 | protected: |
| 40 | AMDGPUAS AMDGPUASI; |
| Matt Arsenault | 43e92fe | 2016-06-24 06:30:11 +0000 | [diff] [blame] | 41 | |
| Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 42 | public: |
| Tom Stellard | 2e59a45 | 2014-06-13 01:32:00 +0000 | [diff] [blame] | 43 | explicit AMDGPUInstrInfo(const AMDGPUSubtarget &st); |
| Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 44 | |
| Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 45 | bool shouldScheduleLoadsNear(SDNode *Load1, SDNode *Load2, |
| 46 | int64_t Offset1, int64_t Offset2, |
| Craig Topper | 5656db4 | 2014-04-29 07:57:24 +0000 | [diff] [blame] | 47 | unsigned NumLoads) const override; |
| Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 48 | |
| Marek Olsak | a93603d | 2015-01-15 18:42:51 +0000 | [diff] [blame] | 49 | /// \brief Return a target-specific opcode if Opcode is a pseudo instruction. |
| 50 | /// Return -1 if the target-specific opcode for the pseudo instruction does |
| 51 | /// not exist. If Opcode is not a pseudo instruction, this is identity. |
| 52 | int pseudoToMCOpcode(int Opcode) const; |
| Matt Arsenault | bcf7bec | 2018-02-09 16:57:48 +0000 | [diff] [blame^] | 53 | |
| 54 | static bool isUniformMMO(const MachineMemOperand *MMO); |
| Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 55 | }; |
| Alexander Kornienko | f00654e | 2015-06-23 09:49:53 +0000 | [diff] [blame] | 56 | } // End llvm namespace |
| Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 57 | |
| Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 58 | #endif |