23#define GET_INSTRINFO_CTOR_DTOR
24#include "NVPTXGenInstrInfo.inc"
27void NVPTXInstrInfo::anchor() {}
36 bool RenamableDest,
bool RenamableSrc)
const {
45 if (DestRC == &NVPTX::B1RegClass)
47 else if (DestRC == &NVPTX::B16RegClass)
48 Op = NVPTX::MOV_B16_r;
49 else if (DestRC == &NVPTX::B32RegClass)
50 Op = NVPTX::MOV_B32_r;
51 else if (DestRC == &NVPTX::B64RegClass)
52 Op = NVPTX::MOV_B64_r;
53 else if (DestRC == &NVPTX::B128RegClass)
54 Op = NVPTX::MOV_B128_r;
89 bool AllowModify)
const {
92 if (
I ==
MBB.begin() || !isUnpredicatedTerminator(*--
I))
99 if (
I ==
MBB.begin() || !isUnpredicatedTerminator(*--
I)) {
100 if (LastInst.
getOpcode() == NVPTX::GOTO) {
103 }
else if (LastInst.
getOpcode() == NVPTX::CBranch) {
118 if (
I !=
MBB.begin() && isUnpredicatedTerminator(*--
I))
122 if (SecondLastInst.
getOpcode() == NVPTX::CBranch &&
133 if (SecondLastInst.
getOpcode() == NVPTX::GOTO &&
138 I->eraseFromParent();
147 int *BytesRemoved)
const {
148 assert(!BytesRemoved &&
"code size not handled");
150 if (
I ==
MBB.begin())
153 if (
I->getOpcode() != NVPTX::GOTO &&
I->getOpcode() != NVPTX::CBranch)
157 I->eraseFromParent();
161 if (
I ==
MBB.begin())
164 if (
I->getOpcode() != NVPTX::CBranch)
168 I->eraseFromParent();
177 int *BytesAdded)
const {
178 assert(!BytesAdded &&
"code size not handled");
181 assert(
TBB &&
"insertBranch must not be told to insert a fallthrough");
183 "NVPTX branch conditions have two components!");
205 assert(
Cond.size() == 2 &&
"Invalid NVPTX branch condition!");
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
SmallVector< MachineOperand, 4 > Cond
MachineRegisterInfo & MRI
const SmallVectorImpl< MachineOperand > MachineBasicBlock * TBB
Represent a constant reference to an array (0 or more elements consecutively in memory),...
MachineInstrBundleIterator< MachineInstr > iterator
const MachineInstrBuilder & addReg(Register RegNo, RegState Flags={}, unsigned SubReg=0) const
Add a new virtual register operand.
const MachineInstrBuilder & add(const MachineOperand &MO) const
const MachineInstrBuilder & addMBB(MachineBasicBlock *MBB, unsigned TargetFlags=0) const
Representation of each machine instruction.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
const MachineOperand & getOperand(unsigned i) const
MachineBasicBlock * getMBB() const
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, ArrayRef< MachineOperand > Cond, const DebugLoc &DL, int *BytesAdded=nullptr) const override
NVPTXInstrInfo(const NVPTXSubtarget &STI)
bool reverseBranchCondition(SmallVectorImpl< MachineOperand > &Cond) const override
unsigned removeBranch(MachineBasicBlock &MBB, int *BytesRemoved=nullptr) const override
bool 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 understo...
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, Register DestReg, Register SrcReg, bool KillSrc, bool RenamableDest=false, bool RenamableSrc=false) const override
Wrapper class representing virtual and physical registers.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
constexpr RegState getKillRegState(bool B)
MachineInstr * getImm(const MachineOperand &MO, const MachineRegisterInfo *MRI)
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)
DWARFExpression::Operation Op
MCRegisterClass TargetRegisterClass