LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
llvm::AMDGPUInstrInfo Class Referenceabstract

#include <AMDGPUInstrInfo.h>

Inheritance diagram for llvm::AMDGPUInstrInfo:
Inheritance graph
[legend]
Collaboration diagram for llvm::AMDGPUInstrInfo:
Collaboration graph
[legend]

Public Member Functions

 AMDGPUInstrInfo (TargetMachine &tm)
 
virtual const AMDGPURegisterInfogetRegisterInfo () const =0
 
bool isCoalescableExtInstr (const MachineInstr &MI, unsigned &SrcReg, unsigned &DstReg, unsigned &SubIdx) const
 
unsigned isLoadFromStackSlot (const MachineInstr *MI, int &FrameIndex) const
 
unsigned isLoadFromStackSlotPostFE (const MachineInstr *MI, int &FrameIndex) const
 
bool hasLoadFromStackSlot (const MachineInstr *MI, const MachineMemOperand *&MMO, int &FrameIndex) const
 
unsigned isStoreFromStackSlot (const MachineInstr *MI, int &FrameIndex) const
 
unsigned isStoreFromStackSlotPostFE (const MachineInstr *MI, int &FrameIndex) const
 
bool hasStoreFromStackSlot (const MachineInstr *MI, const MachineMemOperand *&MMO, int &FrameIndex) const
 
MachineInstrconvertToThreeAddress (MachineFunction::iterator &MFI, MachineBasicBlock::iterator &MBBI, LiveVariables *LV) const
 
virtual void copyPhysReg (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, DebugLoc DL, unsigned DestReg, unsigned SrcReg, bool KillSrc) const =0
 
void storeRegToStackSlot (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, unsigned SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const
 
void loadRegFromStackSlot (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, unsigned DestReg, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const
 
virtual bool expandPostRAPseudo (MachineBasicBlock::iterator MI) const
 
bool canFoldMemoryOperand (const MachineInstr *MI, const SmallVectorImpl< unsigned > &Ops) const
 
bool unfoldMemoryOperand (MachineFunction &MF, MachineInstr *MI, unsigned Reg, bool UnfoldLoad, bool UnfoldStore, SmallVectorImpl< MachineInstr * > &NewMIs) const
 
bool unfoldMemoryOperand (SelectionDAG &DAG, SDNode *N, SmallVectorImpl< SDNode * > &NewNodes) const
 
unsigned getOpcodeAfterMemoryUnfold (unsigned Opc, bool UnfoldLoad, bool UnfoldStore, unsigned *LoadRegIndex=0) const
 
bool shouldScheduleLoadsNear (SDNode *Load1, SDNode *Load2, int64_t Offset1, int64_t Offset2, unsigned NumLoads) const
 
bool ReverseBranchCondition (SmallVectorImpl< MachineOperand > &Cond) const
 
void insertNoop (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const
 
bool isPredicated (const MachineInstr *MI) const
 
bool SubsumesPredicate (const SmallVectorImpl< MachineOperand > &Pred1, const SmallVectorImpl< MachineOperand > &Pred2) const
 
bool DefinesPredicate (MachineInstr *MI, std::vector< MachineOperand > &Pred) const
 
bool isPredicable (MachineInstr *MI) const
 
bool isSafeToMoveRegClassDefs (const TargetRegisterClass *RC) const
 
bool isLoadInst (llvm::MachineInstr *MI) const
 
bool isExtLoadInst (llvm::MachineInstr *MI) const
 
bool isSWSExtLoadInst (llvm::MachineInstr *MI) const
 
bool isSExtLoadInst (llvm::MachineInstr *MI) const
 
bool isZExtLoadInst (llvm::MachineInstr *MI) const
 
bool isAExtLoadInst (llvm::MachineInstr *MI) const
 
bool isStoreInst (llvm::MachineInstr *MI) const
 
bool isTruncStoreInst (llvm::MachineInstr *MI) const
 
bool isRegisterStore (const MachineInstr &MI) const
 
bool isRegisterLoad (const MachineInstr &MI) const
 
virtual unsigned getIEQOpcode () const =0
 
virtual bool isMov (unsigned opcode) const =0
 
virtual unsigned calculateIndirectAddress (unsigned RegIndex, unsigned Channel) const =0
 Calculate the "Indirect Address" for the given RegIndex and Channel. More...
 
virtual const TargetRegisterClassgetIndirectAddrRegClass () const =0
 
virtual MachineInstrBuilder buildIndirectWrite (MachineBasicBlock *MBB, MachineBasicBlock::iterator I, unsigned ValueReg, unsigned Address, unsigned OffsetReg) const =0
 Build instruction(s) for an indirect register write. More...
 
virtual MachineInstrBuilder buildIndirectRead (MachineBasicBlock *MBB, MachineBasicBlock::iterator I, unsigned ValueReg, unsigned Address, unsigned OffsetReg) const =0
 Build instruction(s) for an indirect register read. More...
 
virtual void convertToISA (MachineInstr &MI, MachineFunction &MF, DebugLoc DL) const
 Convert the AMDIL MachineInstr to a supported ISA MachineInstr. More...
 
virtual MachineInstrbuildMovInstr (MachineBasicBlock *MBB, MachineBasicBlock::iterator I, unsigned DstReg, unsigned SrcReg) const =0
 Build a MOV instruction. More...
 
int getMaskedMIMGOp (uint16_t Opcode, unsigned Channels) const
 Given a MIMG Opcode that writes all 4 channels, return the equivalent opcode that writes Channels Channels. More...
 

Protected Member Functions

MachineInstrfoldMemoryOperandImpl (MachineFunction &MF, MachineInstr *MI, const SmallVectorImpl< unsigned > &Ops, int FrameIndex) const
 
MachineInstrfoldMemoryOperandImpl (MachineFunction &MF, MachineInstr *MI, const SmallVectorImpl< unsigned > &Ops, MachineInstr *LoadMI) const
 
virtual int getIndirectIndexBegin (const MachineFunction &MF) const
 
virtual int getIndirectIndexEnd (const MachineFunction &MF) const
 

Protected Attributes

TargetMachineTM
 

Detailed Description

Definition at line 41 of file AMDGPUInstrInfo.h.

Constructor & Destructor Documentation

AMDGPUInstrInfo::AMDGPUInstrInfo ( TargetMachine tm)
explicit

Definition at line 34 of file AMDGPUInstrInfo.cpp.

Member Function Documentation

virtual MachineInstrBuilder llvm::AMDGPUInstrInfo::buildIndirectRead ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  I,
unsigned  ValueReg,
unsigned  Address,
unsigned  OffsetReg 
) const
pure virtual

Build instruction(s) for an indirect register read.

Returns
The instruction that performs the indirect register read

Implemented in llvm::R600InstrInfo, and llvm::SIInstrInfo.

Referenced by expandPostRAPseudo().

virtual MachineInstrBuilder llvm::AMDGPUInstrInfo::buildIndirectWrite ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  I,
unsigned  ValueReg,
unsigned  Address,
unsigned  OffsetReg 
) const
pure virtual

Build instruction(s) for an indirect register write.

Returns
The instruction that performs the indirect register write

Implemented in llvm::R600InstrInfo, and llvm::SIInstrInfo.

Referenced by expandPostRAPseudo().

virtual MachineInstr* llvm::AMDGPUInstrInfo::buildMovInstr ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  I,
unsigned  DstReg,
unsigned  SrcReg 
) const
pure virtual

Build a MOV instruction.

Implemented in llvm::R600InstrInfo, and llvm::SIInstrInfo.

Referenced by expandPostRAPseudo().

virtual unsigned llvm::AMDGPUInstrInfo::calculateIndirectAddress ( unsigned  RegIndex,
unsigned  Channel 
) const
pure virtual

Calculate the "Indirect Address" for the given RegIndex and Channel.

We model indirect addressing using a virtual address space that can be accesed with loads and stores. The "Indirect Address" is the memory address in this virtual address space that maps to the given RegIndex and Channel.

Implemented in llvm::R600InstrInfo, and llvm::SIInstrInfo.

Referenced by expandPostRAPseudo().

bool AMDGPUInstrInfo::canFoldMemoryOperand ( const MachineInstr MI,
const SmallVectorImpl< unsigned > &  Ops 
) const

Definition at line 191 of file AMDGPUInstrInfo.cpp.

void AMDGPUInstrInfo::convertToISA ( MachineInstr MI,
MachineFunction MF,
DebugLoc  DL 
) const
virtual
MachineInstr * AMDGPUInstrInfo::convertToThreeAddress ( MachineFunction::iterator MFI,
MachineBasicBlock::iterator MBBI,
LiveVariables LV 
) const

Definition at line 84 of file AMDGPUInstrInfo.cpp.

virtual void llvm::AMDGPUInstrInfo::copyPhysReg ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI,
DebugLoc  DL,
unsigned  DestReg,
unsigned  SrcReg,
bool  KillSrc 
) const
pure virtual

Implemented in llvm::R600InstrInfo, and llvm::SIInstrInfo.

bool AMDGPUInstrInfo::DefinesPredicate ( MachineInstr MI,
std::vector< MachineOperand > &  Pred 
) const

Definition at line 254 of file AMDGPUInstrInfo.cpp.

bool AMDGPUInstrInfo::expandPostRAPseudo ( MachineBasicBlock::iterator  MI) const
virtual
MachineInstr * AMDGPUInstrInfo::foldMemoryOperandImpl ( MachineFunction MF,
MachineInstr MI,
const SmallVectorImpl< unsigned > &  Ops,
int  FrameIndex 
) const
protected

Definition at line 175 of file AMDGPUInstrInfo.cpp.

MachineInstr * AMDGPUInstrInfo::foldMemoryOperandImpl ( MachineFunction MF,
MachineInstr MI,
const SmallVectorImpl< unsigned > &  Ops,
MachineInstr LoadMI 
) const
protected

Definition at line 183 of file AMDGPUInstrInfo.cpp.

virtual unsigned llvm::AMDGPUInstrInfo::getIEQOpcode ( ) const
pure virtual

Implemented in llvm::R600InstrInfo, and llvm::SIInstrInfo.

virtual const TargetRegisterClass* llvm::AMDGPUInstrInfo::getIndirectAddrRegClass ( ) const
pure virtual
Returns
The register class to be used for loading and storing values from an "Indirect Address" .

Implemented in llvm::R600InstrInfo, and llvm::SIInstrInfo.

Referenced by expandPostRAPseudo(), and getIndirectIndexBegin().

int AMDGPUInstrInfo::getIndirectIndexBegin ( const MachineFunction MF) const
protectedvirtual
int AMDGPUInstrInfo::getIndirectIndexEnd ( const MachineFunction MF) const
protectedvirtual
int AMDGPUInstrInfo::getMaskedMIMGOp ( uint16_t  Opcode,
unsigned  Channels 
) const

Given a MIMG Opcode that writes all 4 channels, return the equivalent opcode that writes Channels Channels.

Definition at line 352 of file AMDGPUInstrInfo.cpp.

Referenced by llvm::SITargetLowering::AdjustInstrPostInstrSelection().

unsigned AMDGPUInstrInfo::getOpcodeAfterMemoryUnfold ( unsigned  Opc,
bool  UnfoldLoad,
bool  UnfoldStore,
unsigned LoadRegIndex = 0 
) const

Definition at line 213 of file AMDGPUInstrInfo.cpp.

const AMDGPURegisterInfo & AMDGPUInstrInfo::getRegisterInfo ( ) const
pure virtual

Implemented in llvm::R600InstrInfo, and llvm::SIInstrInfo.

Definition at line 37 of file AMDGPUInstrInfo.cpp.

Referenced by convertToISA().

bool AMDGPUInstrInfo::hasLoadFromStackSlot ( const MachineInstr MI,
const MachineMemOperand *&  MMO,
int &  FrameIndex 
) const

Definition at line 60 of file AMDGPUInstrInfo.cpp.

bool AMDGPUInstrInfo::hasStoreFromStackSlot ( const MachineInstr MI,
const MachineMemOperand *&  MMO,
int &  FrameIndex 
) const

Definition at line 76 of file AMDGPUInstrInfo.cpp.

void AMDGPUInstrInfo::insertNoop ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI 
) const

Definition at line 237 of file AMDGPUInstrInfo.cpp.

bool llvm::AMDGPUInstrInfo::isAExtLoadInst ( llvm::MachineInstr MI) const
bool AMDGPUInstrInfo::isCoalescableExtInstr ( const MachineInstr MI,
unsigned SrcReg,
unsigned DstReg,
unsigned SubIdx 
) const

Definition at line 41 of file AMDGPUInstrInfo.cpp.

bool llvm::AMDGPUInstrInfo::isExtLoadInst ( llvm::MachineInstr MI) const
unsigned AMDGPUInstrInfo::isLoadFromStackSlot ( const MachineInstr MI,
int &  FrameIndex 
) const

Definition at line 48 of file AMDGPUInstrInfo.cpp.

unsigned AMDGPUInstrInfo::isLoadFromStackSlotPostFE ( const MachineInstr MI,
int &  FrameIndex 
) const

Definition at line 54 of file AMDGPUInstrInfo.cpp.

bool llvm::AMDGPUInstrInfo::isLoadInst ( llvm::MachineInstr MI) const
virtual bool llvm::AMDGPUInstrInfo::isMov ( unsigned  opcode) const
pure virtual

Implemented in llvm::R600InstrInfo, and llvm::SIInstrInfo.

bool AMDGPUInstrInfo::isPredicable ( MachineInstr MI) const
bool AMDGPUInstrInfo::isPredicated ( const MachineInstr MI) const

Definition at line 242 of file AMDGPUInstrInfo.cpp.

bool AMDGPUInstrInfo::isRegisterLoad ( const MachineInstr MI) const

Definition at line 275 of file AMDGPUInstrInfo.cpp.

References AMDGPU_FLAG_REGISTER_LOAD, and llvm::MachineInstr::getOpcode().

Referenced by expandPostRAPseudo().

bool AMDGPUInstrInfo::isRegisterStore ( const MachineInstr MI) const

Definition at line 271 of file AMDGPUInstrInfo.cpp.

References AMDGPU_FLAG_REGISTER_STORE, and llvm::MachineInstr::getOpcode().

Referenced by expandPostRAPseudo().

bool AMDGPUInstrInfo::isSafeToMoveRegClassDefs ( const TargetRegisterClass RC) const

Definition at line 266 of file AMDGPUInstrInfo.cpp.

bool llvm::AMDGPUInstrInfo::isSExtLoadInst ( llvm::MachineInstr MI) const
unsigned AMDGPUInstrInfo::isStoreFromStackSlot ( const MachineInstr MI,
int &  FrameIndex 
) const

Definition at line 66 of file AMDGPUInstrInfo.cpp.

unsigned AMDGPUInstrInfo::isStoreFromStackSlotPostFE ( const MachineInstr MI,
int &  FrameIndex 
) const

Definition at line 71 of file AMDGPUInstrInfo.cpp.

bool llvm::AMDGPUInstrInfo::isStoreInst ( llvm::MachineInstr MI) const
bool llvm::AMDGPUInstrInfo::isSWSExtLoadInst ( llvm::MachineInstr MI) const
bool llvm::AMDGPUInstrInfo::isTruncStoreInst ( llvm::MachineInstr MI) const
bool llvm::AMDGPUInstrInfo::isZExtLoadInst ( llvm::MachineInstr MI) const
void AMDGPUInstrInfo::loadRegFromStackSlot ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI,
unsigned  DestReg,
int  FrameIndex,
const TargetRegisterClass RC,
const TargetRegisterInfo TRI 
) const

Definition at line 117 of file AMDGPUInstrInfo.cpp.

bool AMDGPUInstrInfo::ReverseBranchCondition ( SmallVectorImpl< MachineOperand > &  Cond) const

Definition at line 232 of file AMDGPUInstrInfo.cpp.

bool AMDGPUInstrInfo::shouldScheduleLoadsNear ( SDNode Load1,
SDNode Load2,
int64_t  Offset1,
int64_t  Offset2,
unsigned  NumLoads 
) const

Definition at line 220 of file AMDGPUInstrInfo.cpp.

void AMDGPUInstrInfo::storeRegToStackSlot ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI,
unsigned  SrcReg,
bool  isKill,
int  FrameIndex,
const TargetRegisterClass RC,
const TargetRegisterInfo TRI 
) const

Definition at line 107 of file AMDGPUInstrInfo.cpp.

bool AMDGPUInstrInfo::SubsumesPredicate ( const SmallVectorImpl< MachineOperand > &  Pred1,
const SmallVectorImpl< MachineOperand > &  Pred2 
) const

Definition at line 247 of file AMDGPUInstrInfo.cpp.

bool AMDGPUInstrInfo::unfoldMemoryOperand ( MachineFunction MF,
MachineInstr MI,
unsigned  Reg,
bool  UnfoldLoad,
bool  UnfoldStore,
SmallVectorImpl< MachineInstr * > &  NewMIs 
) const

Definition at line 197 of file AMDGPUInstrInfo.cpp.

bool AMDGPUInstrInfo::unfoldMemoryOperand ( SelectionDAG DAG,
SDNode N,
SmallVectorImpl< SDNode * > &  NewNodes 
) const

Definition at line 206 of file AMDGPUInstrInfo.cpp.

Member Data Documentation

TargetMachine& llvm::AMDGPUInstrInfo::TM
protected

The documentation for this class was generated from the following files: