39 #define GET_REGINFO_TARGET_DESC 40 #include "HexagonGenRegisterInfo.inc" 50 return R == Hexagon::R0 || R == Hexagon::R1 || R ==
Hexagon::R2 ||
51 R == Hexagon::R3 || R == Hexagon::D0 || R == Hexagon::D1;
57 using namespace Hexagon;
60 R0, R1,
R2, R3,
R4, R5,
R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, 0
63 D0, D1, D2, D3, D4, D5, D6, D7, 0
69 V0, V1,
V2, V3,
V4, V5, V6, V7, V8, V9, V10, V11, V12, V13,
70 V14, V15, V16, V17, V18, V19, V20, V21, V22, V23, V24, V25, V26, V27,
74 W0, W1, W2, W3, W4, W5, W6, W7, W8, W9, W10, W11, W12, W13, W14, W15, 0
80 switch (RC->
getID()) {
81 case IntRegsRegClassID:
83 case DoubleRegsRegClassID:
85 case PredRegsRegClassID:
99 dbgs() <<
"Register class: " << getRegClassName(RC) <<
"\n";
108 static const MCPhysReg CalleeSavedRegsV3[] = {
109 Hexagon::R16, Hexagon::R17, Hexagon::R18, Hexagon::R19,
110 Hexagon::R20, Hexagon::R21, Hexagon::R22, Hexagon::R23,
111 Hexagon::R24, Hexagon::R25, Hexagon::R26, Hexagon::R27, 0
116 static const MCPhysReg CalleeSavedRegsV3EHReturn[] = {
117 Hexagon::R0, Hexagon::R1,
Hexagon::R2, Hexagon::R3,
118 Hexagon::R16, Hexagon::R17, Hexagon::R18, Hexagon::R19,
119 Hexagon::R20, Hexagon::R21, Hexagon::R22, Hexagon::R23,
120 Hexagon::R24, Hexagon::R25, Hexagon::R26, Hexagon::R27, 0
125 return HasEHReturn ? CalleeSavedRegsV3EHReturn : CalleeSavedRegsV3;
131 return HexagonCSR_RegMask;
138 Reserved.
set(Hexagon::R29);
139 Reserved.
set(Hexagon::R30);
140 Reserved.
set(Hexagon::R31);
141 Reserved.
set(Hexagon::VTMP);
144 Reserved.
set(Hexagon::GELR);
145 Reserved.
set(Hexagon::GSR);
146 Reserved.
set(Hexagon::GOSP);
147 Reserved.
set(Hexagon::G3);
150 Reserved.
set(Hexagon::SA0);
151 Reserved.
set(Hexagon::LC0);
152 Reserved.
set(Hexagon::SA1);
153 Reserved.
set(Hexagon::LC1);
154 Reserved.
set(Hexagon::P3_0);
155 Reserved.
set(Hexagon::USR);
156 Reserved.
set(Hexagon::PC);
157 Reserved.
set(Hexagon::UGP);
158 Reserved.
set(Hexagon::GP);
159 Reserved.
set(Hexagon::CS0);
160 Reserved.
set(Hexagon::CS1);
161 Reserved.
set(Hexagon::UPCYCLELO);
162 Reserved.
set(Hexagon::UPCYCLEHI);
163 Reserved.
set(Hexagon::FRAMELIMIT);
164 Reserved.
set(Hexagon::FRAMEKEY);
165 Reserved.
set(Hexagon::PKTCOUNTLO);
166 Reserved.
set(Hexagon::PKTCOUNTHI);
167 Reserved.
set(Hexagon::UTIMERLO);
168 Reserved.
set(Hexagon::UTIMERHI);
172 Reserved.
set(Hexagon::C8);
173 Reserved.
set(Hexagon::USR_OVF);
176 Reserved.
set(Hexagon::R19);
179 markSuperRegs(Reserved, x);
186 int SPAdj,
unsigned FIOp,
190 assert(SPAdj == 0 &&
"Unexpected");
197 auto &HFI = *HST.getFrameLowering();
203 int Offset = HFI.getFrameIndexReference(MF, FI, BP);
210 case Hexagon::PS_fia:
211 MI.
setDesc(HII.get(Hexagon::A2_addi));
217 MI.
setDesc(HII.get(Hexagon::A2_addi));
221 if (!HII.isValidOffset(Opc, RealOffset,
this)) {
225 Register TmpR =
MRI.createVirtualRegister(&Hexagon::IntRegsRegClass);
227 BuildMI(MB, II, DL, HII.get(Hexagon::A2_addi), TmpR)
250 if (!HST.
useHVXOps() || NewRC->
getID() != Hexagon::HvxWRRegClass.getID())
252 bool SmallSrc = SrcRC->
getID() == Hexagon::HvxVRRegClass.getID();
253 bool SmallDst = DstRC->
getID() == Hexagon::HvxVRRegClass.getID();
254 if (!SmallSrc && !SmallDst)
261 for (
SlotIndex I = S.start.getBaseIndex(),
E = S.end.getBaseIndex();
262 I !=
E;
I =
I.getNextIndex()) {
270 if (SmallSrc == SmallDst) {
282 unsigned SmallReg = SmallSrc ? SrcReg : DstReg;
283 unsigned LargeReg = SmallSrc ? DstReg : SrcReg;
317 static const unsigned ISub[] = { Hexagon::isub_lo, Hexagon::isub_hi };
318 static const unsigned VSub[] = { Hexagon::vsub_lo, Hexagon::vsub_hi };
319 static const unsigned WSub[] = { Hexagon::wsub_lo, Hexagon::wsub_hi };
321 switch (RC.
getID()) {
322 case Hexagon::CtrRegs64RegClassID:
323 case Hexagon::DoubleRegsRegClassID:
325 case Hexagon::HvxWRRegClassID:
327 case Hexagon::HvxVQRRegClassID:
344 unsigned Kind)
const {
345 return &Hexagon::IntRegsRegClass;
bool isCall(QueryType Type=AnyInBundle) const
This class represents lattice values for constants.
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
Hexagon target-specific information for each MachineFunction.
This represents a simple continuous liveness interval for a value.
unsigned getStackRegister() const
bool isEHReturnCalleeSaveReg(unsigned Reg) const
int find_first() const
find_first - Returns the index of the first set bit, -1 if none of the bits are set.
int find_next(unsigned Prev) const
find_next - Returns the index of the next set bit following the "Prev" bit.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
unsigned getID() const
Return the register class ID number.
bool hasReservedR19() const
void eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj, unsigned FIOperandNum, RegScavenger *RS=nullptr) const override
const MCPhysReg * getCallerSavedRegs(const MachineFunction *MF, const TargetRegisterClass *RC) const
void ChangeToImmediate(int64_t ImmVal)
ChangeToImmediate - Replace this operand with a new immediate operand of the specified value...
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
sc_iterator getSuperClasses() const
Returns a NULL-terminated list of super-classes.
MachineInstr * getInstructionFromIndex(SlotIndex index) const
Returns the instruction for the given index, or null if the given index has no instruction associated...
This file declares the machine register scavenger class.
unsigned const MachineRegisterInfo * MRI
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
const TargetRegisterClass * getPointerRegClass(const MachineFunction &MF, unsigned Kind=0) const override
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly...
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
LiveInterval & getInterval(Register Reg)
HexagonRegisterInfo(unsigned HwMode)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
bool shouldCoalesce(MachineInstr *MI, const TargetRegisterClass *SrcRC, unsigned SubReg, const TargetRegisterClass *DstRC, unsigned DstSubReg, const TargetRegisterClass *NewRC, LiveIntervals &LIS) const override
void setDesc(const MCInstrDesc &tid)
Replace the instruction descriptor (thus opcode) of the current instruction with a new one...
unsigned getFirstCallerSavedNonParamReg() const
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
const MachineBasicBlock * getParent() const
Representation of each machine instruction.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
bool useFPForScavengingIndex(const MachineFunction &MF) const override
Returns true if the frame pointer is valid.
void ChangeToRegister(Register 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...
unsigned getRARegister() const
const uint32_t * getCallPreservedMask(const MachineFunction &MF, CallingConv::ID) const override
SlotIndexes * getSlotIndexes() const
BitVector getReservedRegs(const MachineFunction &MF) const override
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
const HexagonInstrInfo * getInstrInfo() const override
bool hasFP(const MachineFunction &MF) const override
hasFP - Return true if the specified function should have a dedicated frame pointer register...
void RemoveOperand(unsigned OpNo)
Erase an operand from an instruction, leaving it with one fewer operand than it started with...
Register getReg() const
getReg - Returns the register number.
const MachineOperand & getOperand(unsigned i) const
SlotIndex - An opaque wrapper around machine indexes.
unsigned getHexagonSubRegIndex(const TargetRegisterClass &RC, unsigned GenIdx) const
unsigned getFrameRegister() const
const MCPhysReg * getCalleeSavedRegs(const MachineFunction *MF) const override
Code Generation virtual methods...
Wrapper class representing virtual and physical registers.