40 #define GET_REGINFO_TARGET_DESC 41 #include "HexagonGenRegisterInfo.inc" 51 return R == Hexagon::R0 || R == Hexagon::R1 || R ==
Hexagon::R2 ||
52 R == Hexagon::R3 || R == Hexagon::D0 || R == Hexagon::D1;
58 using namespace Hexagon;
61 R0, R1,
R2, R3,
R4, R5,
R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, 0
64 D0, D1, D2, D3, D4, D5, D6, D7, 0
70 V0, V1,
V2, V3,
V4, V5, V6, V7, V8, V9, V10, V11, V12, V13,
71 V14, V15, V16, V17, V18, V19, V20, V21, V22, V23, V24, V25, V26, V27,
75 W0, W1, W2, W3, W4, W5, W6, W7, W8, W9, W10, W11, W12, W13, W14, W15, 0
78 switch (RC->
getID()) {
79 case IntRegsRegClassID:
81 case DoubleRegsRegClassID:
83 case PredRegsRegClassID:
95 dbgs() <<
"Register class: " << getRegClassName(RC) <<
"\n";
104 static const MCPhysReg CalleeSavedRegsV3[] = {
105 Hexagon::R16, Hexagon::R17, Hexagon::R18, Hexagon::R19,
106 Hexagon::R20, Hexagon::R21, Hexagon::R22, Hexagon::R23,
107 Hexagon::R24, Hexagon::R25, Hexagon::R26, Hexagon::R27, 0
112 static const MCPhysReg CalleeSavedRegsV3EHReturn[] = {
113 Hexagon::R0, Hexagon::R1,
Hexagon::R2, Hexagon::R3,
114 Hexagon::R16, Hexagon::R17, Hexagon::R18, Hexagon::R19,
115 Hexagon::R20, Hexagon::R21, Hexagon::R22, Hexagon::R23,
116 Hexagon::R24, Hexagon::R25, Hexagon::R26, Hexagon::R27, 0
121 return HasEHReturn ? CalleeSavedRegsV3EHReturn : CalleeSavedRegsV3;
127 return HexagonCSR_RegMask;
134 Reserved.
set(Hexagon::R29);
135 Reserved.
set(Hexagon::R30);
136 Reserved.
set(Hexagon::R31);
137 Reserved.
set(Hexagon::VTMP);
140 Reserved.
set(Hexagon::GELR);
141 Reserved.
set(Hexagon::GSR);
142 Reserved.
set(Hexagon::GOSP);
143 Reserved.
set(Hexagon::G3);
146 Reserved.
set(Hexagon::SA0);
147 Reserved.
set(Hexagon::LC0);
148 Reserved.
set(Hexagon::SA1);
149 Reserved.
set(Hexagon::LC1);
150 Reserved.
set(Hexagon::P3_0);
151 Reserved.
set(Hexagon::USR);
152 Reserved.
set(Hexagon::PC);
153 Reserved.
set(Hexagon::UGP);
154 Reserved.
set(Hexagon::GP);
155 Reserved.
set(Hexagon::CS0);
156 Reserved.
set(Hexagon::CS1);
157 Reserved.
set(Hexagon::UPCYCLELO);
158 Reserved.
set(Hexagon::UPCYCLEHI);
159 Reserved.
set(Hexagon::FRAMELIMIT);
160 Reserved.
set(Hexagon::FRAMEKEY);
161 Reserved.
set(Hexagon::PKTCOUNTLO);
162 Reserved.
set(Hexagon::PKTCOUNTHI);
163 Reserved.
set(Hexagon::UTIMERLO);
164 Reserved.
set(Hexagon::UTIMERHI);
168 Reserved.
set(Hexagon::C8);
169 Reserved.
set(Hexagon::USR_OVF);
172 Reserved.
set(Hexagon::R19);
175 markSuperRegs(Reserved, x);
182 int SPAdj,
unsigned FIOp,
186 assert(SPAdj == 0 &&
"Unexpected");
193 auto &HFI = *HST.getFrameLowering();
199 int Offset = HFI.getFrameIndexReference(MF, FI, BP);
206 case Hexagon::PS_fia:
207 MI.
setDesc(HII.get(Hexagon::A2_addi));
213 MI.
setDesc(HII.get(Hexagon::A2_addi));
217 if (!HII.isValidOffset(Opc, RealOffset,
this)) {
221 unsigned TmpR =
MRI.createVirtualRegister(&Hexagon::IntRegsRegClass);
223 BuildMI(MB, II, DL, HII.get(Hexagon::A2_addi), TmpR)
246 if (!HST.
useHVXOps() || NewRC->
getID() != Hexagon::HvxWRRegClass.getID())
248 bool SmallSrc = SrcRC->
getID() == Hexagon::HvxVRRegClass.getID();
249 bool SmallDst = DstRC->
getID() == Hexagon::HvxVRRegClass.getID();
250 if (!SmallSrc && !SmallDst)
257 for (
SlotIndex I = S.start.getBaseIndex(),
E = S.end.getBaseIndex();
258 I !=
E;
I =
I.getNextIndex()) {
266 if (SmallSrc == SmallDst) {
278 unsigned SmallReg = SmallSrc ? SrcReg : DstReg;
279 unsigned LargeReg = SmallSrc ? DstReg : SrcReg;
313 static const unsigned ISub[] = { Hexagon::isub_lo, Hexagon::isub_hi };
314 static const unsigned VSub[] = { Hexagon::vsub_lo, Hexagon::vsub_hi };
315 static const unsigned WSub[] = { Hexagon::wsub_lo, Hexagon::wsub_hi };
317 switch (RC.
getID()) {
318 case Hexagon::CtrRegs64RegClassID:
319 case Hexagon::DoubleRegsRegClassID:
321 case Hexagon::HvxWRRegClassID:
323 case Hexagon::HvxVQRRegClassID:
340 unsigned Kind)
const {
341 return &Hexagon::IntRegsRegClass;
bool isCall(QueryType Type=AnyInBundle) const
This class represents lattice values for constants.
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...
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
unsigned getReg() const
getReg - Returns the register number.
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
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
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...
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
LiveInterval & getInterval(unsigned Reg)
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.
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...
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...