LLVM API Documentation
#include <NVPTXInstrInfo.h>
Definition at line 26 of file NVPTXInstrInfo.h.
NVPTXInstrInfo::NVPTXInstrInfo | ( | NVPTXSubtarget & | STI | ) | [explicit] |
Definition at line 32 of file NVPTXInstrInfo.cpp.
bool NVPTXInstrInfo::AnalyzeBranch | ( | MachineBasicBlock & | MBB, |
MachineBasicBlock *& | TBB, | ||
MachineBasicBlock *& | FBB, | ||
SmallVectorImpl< MachineOperand > & | Cond, | ||
bool | AllowModify | ||
) | const [override] |
AnalyzeBranch - Analyze the branching code at the end of MBB, returning true if it cannot be understood (e.g. it's a switch dispatch or isn't implemented for a target). Upon success, this returns false and returns with the following information in various cases:
1. If this block ends with no branches (it just falls through to its succ) just return false, leaving TBB/FBB null. 2. If this block ends with only an unconditional branch, it sets TBB to be the destination block. 3. If this block ends with an conditional branch and it falls through to an successor block, it sets TBB to be the branch destination block and a list of operands that evaluate the condition. These operands can be passed to other TargetInstrInfo methods to create new branches. 4. If this block ends with an conditional branch and an unconditional block, it returns the 'true' destination in TBB, the 'false' destination in FBB, and a list of operands that evaluate the condition. These operands can be passed to other TargetInstrInfo methods to create new branches.
Note that RemoveBranch and InsertBranch must be implemented to support cases where this method returns success.
Definition at line 170 of file NVPTXInstrInfo.cpp.
References llvm::MachineBasicBlock::begin(), llvm::MachineBasicBlock::end(), llvm::MachineInstr::eraseFromParent(), llvm::MachineOperand::getMBB(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), I, and llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back().
bool NVPTXInstrInfo::CanTailMerge | ( | const MachineInstr * | MI | ) | const [virtual] |
Definition at line 134 of file NVPTXInstrInfo.cpp.
References llvm::MachineInstr::getOpcode(), isLoadInstr(), isStoreInstr(), and llvm::NVPTX::PTXLdStInstCode::SHARED.
void NVPTXInstrInfo::copyPhysReg | ( | MachineBasicBlock & | MBB, |
MachineBasicBlock::iterator | I, | ||
DebugLoc | DL, | ||
unsigned | DestReg, | ||
unsigned | SrcReg, | ||
bool | KillSrc | ||
) | const [override] |
Definition at line 35 of file NVPTXInstrInfo.cpp.
References llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::getKillRegState(), llvm::MachineBasicBlock::getParent(), llvm::MachineRegisterInfo::getRegClass(), llvm::MachineFunction::getRegInfo(), llvm_unreachable, and llvm::report_fatal_error().
unsigned llvm::NVPTXInstrInfo::getLdStCodeAddrSpace | ( | const MachineInstr & | MI | ) | const [inline] |
Definition at line 70 of file NVPTXInstrInfo.h.
References llvm::MachineOperand::getImm(), and llvm::MachineInstr::getOperand().
Referenced by isLoadInstr(), and isStoreInstr().
const NVPTXRegisterInfo& llvm::NVPTXInstrInfo::getRegisterInfo | ( | ) | const [inline] |
Definition at line 32 of file NVPTXInstrInfo.h.
Referenced by llvm::NVPTXSubtarget::getRegisterInfo().
unsigned NVPTXInstrInfo::InsertBranch | ( | MachineBasicBlock & | MBB, |
MachineBasicBlock * | TBB, | ||
MachineBasicBlock * | FBB, | ||
const SmallVectorImpl< MachineOperand > & | Cond, | ||
DebugLoc | DL | ||
) | const [override] |
Definition at line 251 of file NVPTXInstrInfo.cpp.
References llvm::MachineInstrBuilder::addMBB(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::SmallVectorBase::empty(), getReg(), and llvm::SmallVectorTemplateCommon< T >::size().
bool NVPTXInstrInfo::isLoadInstr | ( | const MachineInstr & | MI, |
unsigned & | AddrSpace | ||
) | const |
Definition at line 112 of file NVPTXInstrInfo.cpp.
References llvm::MachineInstr::getDesc(), getLdStCodeAddrSpace(), llvm::NVPTX::isLoadMask, llvm::NVPTX::isLoadShift, and llvm::MCInstrDesc::TSFlags.
Referenced by CanTailMerge().
bool NVPTXInstrInfo::isMoveInstr | ( | const MachineInstr & | MI, |
unsigned & | SrcReg, | ||
unsigned & | DestReg | ||
) | const [virtual] |
Definition at line 68 of file NVPTXInstrInfo.cpp.
References llvm::MachineInstr::getDesc(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isReg(), llvm::NVPTX::SimpleMoveMask, llvm::NVPTX::SimpleMoveShift, and llvm::MCInstrDesc::TSFlags.
bool NVPTXInstrInfo::isReadSpecialReg | ( | MachineInstr & | MI | ) | const |
Definition at line 91 of file NVPTXInstrInfo.cpp.
References llvm::MachineInstr::getOpcode().
bool NVPTXInstrInfo::isStoreInstr | ( | const MachineInstr & | MI, |
unsigned & | AddrSpace | ||
) | const |
Definition at line 123 of file NVPTXInstrInfo.cpp.
References llvm::MachineInstr::getDesc(), getLdStCodeAddrSpace(), llvm::NVPTX::isStoreMask, llvm::NVPTX::isStoreShift, and llvm::MCInstrDesc::TSFlags.
Referenced by CanTailMerge().
unsigned NVPTXInstrInfo::RemoveBranch | ( | MachineBasicBlock & | MBB | ) | const [override] |
Definition at line 227 of file NVPTXInstrInfo.cpp.
References llvm::MachineBasicBlock::begin(), llvm::MachineBasicBlock::end(), and I.