27#define GET_REGINFO_TARGET_DESC
28#include "LanaiGenRegisterInfo.inc"
70 case Lanai::ADD_F_I_LO:
71 case Lanai::SUB_F_I_LO:
72 case Lanai::ADDC_I_LO:
73 case Lanai::SUBB_I_LO:
74 case Lanai::ADDC_F_I_LO:
75 case Lanai::SUBB_F_I_LO:
85 return Lanai::SUB_I_LO;
87 return Lanai::ADD_I_LO;
88 case Lanai::ADD_F_I_LO:
89 return Lanai::SUB_F_I_LO;
90 case Lanai::SUB_F_I_LO:
91 return Lanai::ADD_F_I_LO;
92 case Lanai::ADDC_I_LO:
93 return Lanai::SUBB_I_LO;
94 case Lanai::SUBB_I_LO:
95 return Lanai::ADDC_I_LO;
96 case Lanai::ADDC_F_I_LO:
97 return Lanai::SUBB_F_I_LO;
98 case Lanai::SUBB_F_I_LO:
99 return Lanai::ADDC_F_I_LO;
108 return Lanai::LDBs_RR;
110 return Lanai::LDBz_RR;
112 return Lanai::LDHs_RR;
114 return Lanai::LDHz_RR;
116 return Lanai::LDW_RR;
118 return Lanai::STB_RR;
120 return Lanai::STH_RR;
129 int SPAdj,
unsigned FIOperandNum,
131 assert(SPAdj == 0 &&
"Unexpected");
137 bool HasFP = TFI->
hasFP(MF);
140 int FrameIndex =
MI.getOperand(FIOperandNum).getIndex();
143 MI.getOperand(FIOperandNum + 1).getImm();
147 if (!HasFP || (hasStackRealignment(MF) && FrameIndex >= 0))
151 if (FrameIndex >= 0) {
154 else if (hasStackRealignment(MF))
155 FrameReg = Lanai::SP;
164 assert(RS &&
"Register scavenging must be on");
168 assert(Reg &&
"Register scavenger failed");
170 bool HasNegOffset =
false;
192 if (
MI.getOpcode() == Lanai::ADD_I_LO) {
194 HasNegOffset ?
TII->get(Lanai::SUB_R) :
TII->get(Lanai::ADD_R),
195 MI.getOperand(0).getReg())
199 MI.eraseFromParent();
208 "Unexpected ALU op in RRM instruction");
214 MI.getOperand(FIOperandNum).ChangeToRegister(FrameReg,
false);
215 MI.getOperand(FIOperandNum + 1)
216 .ChangeToRegister(Reg,
false,
false,
231 MI.getOperand(0).getReg())
234 MI.eraseFromParent();
238 MI.getOperand(FIOperandNum).ChangeToRegister(FrameReg,
false);
239 MI.getOperand(FIOperandNum + 1).ChangeToImmediate(
Offset);
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
This file implements the BitVector class.
const HexagonInstrInfo * TII
static unsigned getRRMOpcodeVariant(unsigned Opcode)
static bool isALUArithLoOpcode(unsigned Opcode)
static unsigned getOppositeALULoOpcode(unsigned Opcode)
uint64_t IntrinsicInst * II
This file declares the machine register scavenger class.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
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 ...
uint64_t getStackSize() const
Return the number of bytes that must be allocated to hold all of the fixed size frame objects.
int64_t getObjectOffset(int ObjectIdx) const
Return the assigned stack offset of the specified object from the incoming stack pointer.
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.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
const MachineInstrBuilder & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
Representation of each machine instruction.
Register FindUnusedReg(const TargetRegisterClass *RC) const
Find an unused register of the specified register class.
Register scavengeRegisterBackwards(const TargetRegisterClass &RC, MachineBasicBlock::iterator To, bool RestoreAfter, int SPAdj, bool AllowSpill=true)
Make a register of the specific register class available from the current position backwards to the p...
Wrapper class representing virtual and physical registers.
Information about stack frame layout on the target.
bool hasFP(const MachineFunction &MF) const
hasFP - Return true if the specified function should have a dedicated frame pointer register.
TargetInstrInfo - Interface to description of machine instruction set.
virtual const TargetFrameLowering * getFrameLowering() const
virtual const TargetInstrInfo * getInstrInfo() const
#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.
static bool isRMOpcode(unsigned Opcode)
static bool isSPLSOpcode(unsigned Opcode)
Register getBaseRegister() const
unsigned getRARegister() const
bool hasBasePointer(const MachineFunction &MF) const
bool requiresRegisterScavenging(const MachineFunction &MF) const override
const uint16_t * getCalleeSavedRegs(const MachineFunction *MF=nullptr) const override
const uint32_t * getCallPreservedMask(const MachineFunction &MF, CallingConv::ID) const override
bool eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj, unsigned FIOperandNum, RegScavenger *RS=nullptr) const override
Register getFrameRegister(const MachineFunction &MF) const override
BitVector getReservedRegs(const MachineFunction &MF) const override