16 #ifndef AMDGPUINSTRUCTIONINFO_H
17 #define AMDGPUINSTRUCTIONINFO_H
24 #define GET_INSTRINFO_HEADER
25 #define GET_INSTRINFO_ENUM
26 #define GET_INSTRINFO_OPERAND_ENUM
27 #include "AMDGPUGenInstrInfo.inc"
29 #define OPCODE_IS_ZERO_INT AMDGPU::PRED_SETE_INT
30 #define OPCODE_IS_NOT_ZERO_INT AMDGPU::PRED_SETNE_INT
31 #define OPCODE_IS_ZERO AMDGPU::PRED_SETE
32 #define OPCODE_IS_NOT_ZERO AMDGPU::PRED_SETNE
36 class AMDGPUTargetMachine;
37 class MachineFunction;
39 class MachineInstrBuilder;
46 virtual void anchor();
55 unsigned &DstReg,
unsigned &SubIdx)
const;
78 unsigned DestReg,
unsigned SrcReg,
79 bool KillSrc)
const = 0;
115 unsigned Reg,
bool UnfoldLoad,
bool UnfoldStore,
120 bool UnfoldLoad,
bool UnfoldStore,
121 unsigned *LoadRegIndex = 0)
const;
123 int64_t Offset1, int64_t Offset2,
124 unsigned NumLoads)
const;
133 std::vector<MachineOperand> &Pred)
const;
154 virtual bool isMov(
unsigned opcode)
const = 0;
164 unsigned Channel)
const = 0;
175 unsigned ValueReg,
unsigned Address,
176 unsigned OffsetReg)
const = 0;
183 unsigned ValueReg,
unsigned Address,
184 unsigned OffsetReg)
const = 0;
195 unsigned DstReg,
unsigned SrcReg)
const = 0;
209 #define AMDGPU_FLAG_REGISTER_LOAD (UINT64_C(1) << 63)
210 #define AMDGPU_FLAG_REGISTER_STORE (UINT64_C(1) << 62)
212 #endif // AMDGPUINSTRINFO_H
int getMaskedMIMGOp(uint16_t Opcode, unsigned Channels) const
Given a MIMG Opcode that writes all 4 channels, return the equivalent opcode that writes Channels Cha...
bool ReverseBranchCondition(SmallVectorImpl< MachineOperand > &Cond) const
bool isExtLoadInst(llvm::MachineInstr *MI) const
bool isSWSExtLoadInst(llvm::MachineInstr *MI) const
MachineInstr * convertToThreeAddress(MachineFunction::iterator &MFI, MachineBasicBlock::iterator &MBBI, LiveVariables *LV) const
MachineInstr * foldMemoryOperandImpl(MachineFunction &MF, MachineInstr *MI, const SmallVectorImpl< unsigned > &Ops, int FrameIndex) const
bool hasStoreFromStackSlot(const MachineInstr *MI, const MachineMemOperand *&MMO, int &FrameIndex) const
AMDGPUInstrInfo(TargetMachine &tm)
virtual const AMDGPURegisterInfo & getRegisterInfo() const =0
unsigned getOpcodeAfterMemoryUnfold(unsigned Opc, bool UnfoldLoad, bool UnfoldStore, unsigned *LoadRegIndex=0) const
TargetRegisterInfo interface that is implemented by all hw codegen targets.
virtual unsigned getIEQOpcode() const =0
void loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, unsigned DestReg, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const
bool isZExtLoadInst(llvm::MachineInstr *MI) const
bool isPredicable(MachineInstr *MI) const
bool SubsumesPredicate(const SmallVectorImpl< MachineOperand > &Pred1, const SmallVectorImpl< MachineOperand > &Pred2) const
bool isStoreInst(llvm::MachineInstr *MI) const
virtual unsigned calculateIndirectAddress(unsigned RegIndex, unsigned Channel) const =0
Calculate the "Indirect Address" for the given RegIndex and Channel.
bool canFoldMemoryOperand(const MachineInstr *MI, const SmallVectorImpl< unsigned > &Ops) const
bool isLoadInst(llvm::MachineInstr *MI) const
bundle_iterator< MachineInstr, instr_iterator > iterator
virtual MachineInstrBuilder buildIndirectWrite(MachineBasicBlock *MBB, MachineBasicBlock::iterator I, unsigned ValueReg, unsigned Address, unsigned OffsetReg) const =0
Build instruction(s) for an indirect register write.
void insertNoop(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const
bool isRegisterLoad(const MachineInstr &MI) const
virtual bool expandPostRAPseudo(MachineBasicBlock::iterator MI) const
unsigned isLoadFromStackSlot(const MachineInstr *MI, int &FrameIndex) const
virtual const TargetRegisterClass * getIndirectAddrRegClass() const =0
virtual MachineInstr * buildMovInstr(MachineBasicBlock *MBB, MachineBasicBlock::iterator I, unsigned DstReg, unsigned SrcReg) const =0
Build a MOV instruction.
unsigned isLoadFromStackSlotPostFE(const MachineInstr *MI, int &FrameIndex) const
bool isPredicated(const MachineInstr *MI) const
bool isTruncStoreInst(llvm::MachineInstr *MI) const
bool hasLoadFromStackSlot(const MachineInstr *MI, const MachineMemOperand *&MMO, int &FrameIndex) const
unsigned isStoreFromStackSlot(const MachineInstr *MI, int &FrameIndex) const
virtual void convertToISA(MachineInstr &MI, MachineFunction &MF, DebugLoc DL) const
Convert the AMDIL MachineInstr to a supported ISA MachineInstr.
unsigned isStoreFromStackSlotPostFE(const MachineInstr *MI, int &FrameIndex) const
bool DefinesPredicate(MachineInstr *MI, std::vector< MachineOperand > &Pred) const
virtual int getIndirectIndexEnd(const MachineFunction &MF) const
Contains the definition of a TargetInstrInfo class that is common to all AMD GPUs.
bool isAExtLoadInst(llvm::MachineInstr *MI) const
bool isSExtLoadInst(llvm::MachineInstr *MI) const
virtual void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, DebugLoc DL, unsigned DestReg, unsigned SrcReg, bool KillSrc) const =0
bool unfoldMemoryOperand(MachineFunction &MF, MachineInstr *MI, unsigned Reg, bool UnfoldLoad, bool UnfoldStore, SmallVectorImpl< MachineInstr * > &NewMIs) const
void storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, unsigned SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const
bool isRegisterStore(const MachineInstr &MI) const
virtual int getIndirectIndexBegin(const MachineFunction &MF) const
BasicBlockListType::iterator iterator
int16_t getNamedOperandIdx(uint16_t Opcode, uint16_t NamedIndex)
bool shouldScheduleLoadsNear(SDNode *Load1, SDNode *Load2, int64_t Offset1, int64_t Offset2, unsigned NumLoads) const
virtual MachineInstrBuilder buildIndirectRead(MachineBasicBlock *MBB, MachineBasicBlock::iterator I, unsigned ValueReg, unsigned Address, unsigned OffsetReg) const =0
Build instruction(s) for an indirect register read.
bool isCoalescableExtInstr(const MachineInstr &MI, unsigned &SrcReg, unsigned &DstReg, unsigned &SubIdx) const
virtual bool isMov(unsigned opcode) const =0
bool isSafeToMoveRegClassDefs(const TargetRegisterClass *RC) const