21#define GET_INSTRINFO_CTOR_DTOR
22#include "NVPTXGenInstrInfo.inc"
25void NVPTXInstrInfo::anchor() {}
33 bool RenamableDest,
bool RenamableSrc)
const {
42 if (DestRC == &NVPTX::B1RegClass)
44 else if (DestRC == &NVPTX::B16RegClass)
45 Op = NVPTX::MOV_B16_r;
46 else if (DestRC == &NVPTX::B32RegClass)
47 Op = NVPTX::MOV_B32_r;
48 else if (DestRC == &NVPTX::B64RegClass)
49 Op = NVPTX::MOV_B64_r;
50 else if (DestRC == &NVPTX::B128RegClass)
51 Op = NVPTX::MOV_B128_r;
86 bool AllowModify)
const {
89 if (
I ==
MBB.
begin() || !isUnpredicatedTerminator(*--
I))
96 if (
I ==
MBB.
begin() || !isUnpredicatedTerminator(*--
I)) {
97 if (LastInst.
getOpcode() == NVPTX::GOTO) {
100 }
else if (LastInst.
getOpcode() == NVPTX::CBranch) {
114 if (
I !=
MBB.
begin() && isUnpredicatedTerminator(*--
I))
118 if (SecondLastInst.
getOpcode() == NVPTX::CBranch &&
128 if (SecondLastInst.
getOpcode() == NVPTX::GOTO &&
133 I->eraseFromParent();
142 int *BytesRemoved)
const {
143 assert(!BytesRemoved &&
"code size not handled");
148 if (
I->getOpcode() != NVPTX::GOTO &&
I->getOpcode() != NVPTX::CBranch)
152 I->eraseFromParent();
159 if (
I->getOpcode() != NVPTX::CBranch)
163 I->eraseFromParent();
172 int *BytesAdded)
const {
173 assert(!BytesAdded &&
"code size not handled");
176 assert(
TBB &&
"insertBranch must not be told to insert a fallthrough");
178 "NVPTX branch conditions have two components!");
unsigned const MachineRegisterInfo * MRI
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
const SmallVectorImpl< MachineOperand > MachineBasicBlock * TBB
const SmallVectorImpl< MachineOperand > & Cond
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
This class represents an Operation in the Expression.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
const MachineInstrBuilder & add(const MachineOperand &MO) const
const MachineInstrBuilder & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
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
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.
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)
unsigned getKillRegState(bool B)
DWARFExpression::Operation Op