21#define GET_INSTRINFO_CTOR_DTOR
22#include "NVPTXGenInstrInfo.inc"
25void NVPTXInstrInfo::anchor() {}
33 bool RenamableDest,
bool RenamableSrc)
const {
38 if (RegInfo.getRegSizeInBits(*DestRC) != RegInfo.getRegSizeInBits(*SrcRC))
42 if (DestRC == &NVPTX::Int1RegsRegClass) {
44 }
else if (DestRC == &NVPTX::Int16RegsRegClass) {
46 }
else if (DestRC == &NVPTX::Int32RegsRegClass) {
47 Op = (SrcRC == &NVPTX::Int32RegsRegClass ? NVPTX::IMOV32rr
48 : NVPTX::BITCONVERT_32_F2I);
49 }
else if (DestRC == &NVPTX::Int64RegsRegClass) {
50 Op = (SrcRC == &NVPTX::Int64RegsRegClass ? NVPTX::IMOV64rr
51 : NVPTX::BITCONVERT_64_F2I);
52 }
else if (DestRC == &NVPTX::Int128RegsRegClass) {
53 Op = NVPTX::IMOV128rr;
54 }
else if (DestRC == &NVPTX::Float32RegsRegClass) {
55 Op = (SrcRC == &NVPTX::Float32RegsRegClass ? NVPTX::FMOV32rr
56 : NVPTX::BITCONVERT_32_I2F);
57 }
else if (DestRC == &NVPTX::Float64RegsRegClass) {
58 Op = (SrcRC == &NVPTX::Float64RegsRegClass ? NVPTX::FMOV64rr
59 : NVPTX::BITCONVERT_64_I2F);
94 bool AllowModify)
const {
97 if (
I ==
MBB.
begin() || !isUnpredicatedTerminator(*--
I))
104 if (
I ==
MBB.
begin() || !isUnpredicatedTerminator(*--
I)) {
105 if (LastInst.
getOpcode() == NVPTX::GOTO) {
108 }
else if (LastInst.
getOpcode() == NVPTX::CBranch) {
122 if (
I !=
MBB.
begin() && isUnpredicatedTerminator(*--
I))
126 if (SecondLastInst.
getOpcode() == NVPTX::CBranch &&
136 if (SecondLastInst.
getOpcode() == NVPTX::GOTO &&
141 I->eraseFromParent();
150 int *BytesRemoved)
const {
151 assert(!BytesRemoved &&
"code size not handled");
156 if (
I->getOpcode() != NVPTX::GOTO &&
I->getOpcode() != NVPTX::CBranch)
160 I->eraseFromParent();
167 if (
I->getOpcode() != NVPTX::CBranch)
171 I->eraseFromParent();
180 int *BytesAdded)
const {
181 assert(!BytesAdded &&
"code size not handled");
184 assert(
TBB &&
"insertBranch must not be told to insert a fallthrough");
186 "NVPTX branch conditions have two components!");
209 switch (
MI.getOpcode()) {
210 case NVPTX::CallUniPrintCallRetInst1:
211 case NVPTX::CallArgBeginInst:
212 case NVPTX::CallArgI32imm:
213 case NVPTX::CallArgParam:
214 case NVPTX::LastCallArgI32imm:
215 case NVPTX::LastCallArgParam:
216 case NVPTX::CallArgEndInst1:
unsigned const MachineRegisterInfo * MRI
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
const SmallVectorImpl< MachineOperand > MachineBasicBlock * TBB
const SmallVectorImpl< MachineOperand > & Cond
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
This class represents an Operation in the Expression.
Wrapper class representing physical registers. Should be passed by value.
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
bool isSchedulingBoundary(const MachineInstr &MI, const MachineBasicBlock *MBB, const MachineFunction &MF) const override
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg, bool KillSrc, bool RenamableDest=false, bool RenamableSrc=false) 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...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
virtual bool isSchedulingBoundary(const MachineInstr &MI, const MachineBasicBlock *MBB, const MachineFunction &MF) const
Test if the given instruction should be considered a scheduling boundary.
#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)
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
unsigned getKillRegState(bool B)
DWARFExpression::Operation Op