29 #define GET_REGINFO_TARGET_DESC 30 #include "LanaiGenRegisterInfo.inc" 44 Reserved.
set(Lanai::R0);
45 Reserved.
set(Lanai::R1);
46 Reserved.
set(Lanai::PC);
48 Reserved.
set(Lanai::SP);
51 Reserved.
set(Lanai::R5);
52 Reserved.
set(Lanai::RR1);
53 Reserved.
set(Lanai::R10);
54 Reserved.
set(Lanai::RR2);
55 Reserved.
set(Lanai::R11);
56 Reserved.
set(Lanai::RCA);
57 Reserved.
set(Lanai::R15);
77 case Lanai::ADD_F_I_LO:
78 case Lanai::SUB_F_I_LO:
79 case Lanai::ADDC_I_LO:
80 case Lanai::SUBB_I_LO:
81 case Lanai::ADDC_F_I_LO:
82 case Lanai::SUBB_F_I_LO:
92 return Lanai::SUB_I_LO;
94 return Lanai::ADD_I_LO;
95 case Lanai::ADD_F_I_LO:
96 return Lanai::SUB_F_I_LO;
97 case Lanai::SUB_F_I_LO:
98 return Lanai::ADD_F_I_LO;
99 case Lanai::ADDC_I_LO:
100 return Lanai::SUBB_I_LO;
101 case Lanai::SUBB_I_LO:
102 return Lanai::ADDC_I_LO;
103 case Lanai::ADDC_F_I_LO:
104 return Lanai::SUBB_F_I_LO;
105 case Lanai::SUBB_F_I_LO:
106 return Lanai::ADDC_F_I_LO;
115 return Lanai::LDBs_RR;
117 return Lanai::LDBz_RR;
119 return Lanai::LDHs_RR;
121 return Lanai::LDHz_RR;
123 return Lanai::LDW_RR;
125 return Lanai::STB_RR;
127 return Lanai::STH_RR;
136 int SPAdj,
unsigned FIOperandNum,
138 assert(SPAdj == 0 &&
"Unexpected");
144 bool HasFP = TFI->
hasFP(MF);
154 if (!HasFP || (needsStackRealignment(MF) && FrameIndex >= 0))
158 if (FrameIndex >= 0) {
161 else if (needsStackRealignment(MF))
162 FrameReg = Lanai::SP;
171 assert(RS &&
"Register scavenging must be on");
175 assert(Reg &&
"Register scavenger failed");
177 bool HasNegOffset =
false;
188 .addImm(static_cast<uint32_t>(Offset) >> 16);
191 .
addImm(Offset & 0xffffU);
201 HasNegOffset ? TII->
get(Lanai::SUB_R) : TII->
get(Lanai::ADD_R),
215 "Unexpected ALU op in RRM instruction");
This class represents lattice values for constants.
static unsigned getOppositeALULoOpcode(unsigned Opcode)
static bool isALUArithLoOpcode(unsigned Opcode)
void ChangeToRegister(unsigned Reg, bool isDef, bool isImp=false, bool isKill=false, bool isDead=false, bool isUndef=false, bool isDebug=false)
ChangeToRegister - Replace this operand with a new register operand of the specified value...
static unsigned getRRMOpcodeVariant(unsigned Opcode)
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
unsigned getReg() const
getReg - Returns the register number.
const uint32_t * getCallPreservedMask(const MachineFunction &MF, CallingConv::ID) const override
const uint16_t * getCalleeSavedRegs(const MachineFunction *MF=nullptr) const override
constexpr bool isInt< 16 >(int64_t x)
bool hasBasePointer(const MachineFunction &MF) const
const HexagonInstrInfo * TII
virtual bool hasFP(const MachineFunction &MF) const =0
hasFP - Return true if the specified function should have a dedicated frame pointer register...
unsigned getFrameRegister(const MachineFunction &MF) const override
void eraseFromParent()
Unlink 'this' from the containing basic block and delete it.
int64_t getObjectOffset(int ObjectIdx) const
Return the assigned stack offset of the specified object from the incoming stack pointer.
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
bool hasVarSizedObjects() const
This method may be called any time after instruction selection is complete to determine if the stack ...
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
unsigned FindUnusedReg(const TargetRegisterClass *RC) const
Find an unused register of the specified register class.
virtual const TargetInstrInfo * getInstrInfo() const
void ChangeToImmediate(int64_t ImmVal)
ChangeToImmediate - Replace this operand with a new immediate operand of the specified value...
TargetInstrInfo - Interface to description of machine instruction set.
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
This file declares the machine register scavenger class.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
void eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj, unsigned FIOperandNum, RegScavenger *RS=nullptr) const override
void setImm(int64_t immVal)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
unsigned getBaseRegister() const
void setDesc(const MCInstrDesc &tid)
Replace the instruction descriptor (thus opcode) of the current instruction with a new one...
Information about stack frame layout on the target.
BitVector getReservedRegs(const MachineFunction &MF) const override
const MachineBasicBlock * getParent() const
Representation of each machine instruction.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
static bool isRMOpcode(unsigned Opcode)
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
unsigned getRARegister() const
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode...
virtual const TargetFrameLowering * getFrameLowering() const
unsigned scavengeRegister(const TargetRegisterClass *RC, MachineBasicBlock::iterator I, int SPAdj)
Make a register of the specific register class available and do the appropriate bookkeeping.
const MachineInstrBuilder & addReg(unsigned RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static bool isSPLSOpcode(unsigned Opcode)
bool trackLivenessAfterRegAlloc(const MachineFunction &MF) const override
const MachineOperand & getOperand(unsigned i) const
uint64_t getStackSize() const
Return the number of bytes that must be allocated to hold all of the fixed size frame objects...
bool requiresRegisterScavenging(const MachineFunction &MF) const override