1//===-- HexagonRegisterInfo.cpp - Hexagon Register Information ------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file contains the Hexagon implementation of the TargetRegisterInfo
10// class.
11//
12//===----------------------------------------------------------------------===//
13
14#include "HexagonRegisterInfo.h"
15#include "HexagonFrameLowering.h"
16#include "HexagonMachineFunctionInfo.h"
17#include "HexagonSubtarget.h"
18#include "llvm/ADT/BitVector.h"
19#include "llvm/ADT/STLExtras.h"
20#include "llvm/ADT/SmallSet.h"
21#include "llvm/CodeGen/LiveIntervals.h"
22#include "llvm/CodeGen/LiveRegUnits.h"
23#include "llvm/CodeGen/MachineFrameInfo.h"
24#include "llvm/CodeGen/MachineFunction.h"
25#include "llvm/CodeGen/MachineInstrBuilder.h"
26#include "llvm/CodeGen/MachineRegisterInfo.h"
27#include "llvm/CodeGen/PseudoSourceValue.h"
28#include "llvm/CodeGen/RegisterScavenging.h"
29#include "llvm/CodeGen/TargetInstrInfo.h"
30#include "llvm/IR/Function.h"
31#include "llvm/IR/Type.h"
32#include "llvm/Support/CommandLine.h"
33#include "llvm/Support/Debug.h"
34#include "llvm/Support/ErrorHandling.h"
35#include "llvm/Support/raw_ostream.h"
36#include "llvm/Target/TargetOptions.h"
37
38#define GET_REGINFO_TARGET_DESC
39#include "HexagonGenRegisterInfo.inc"
40
41using namespace llvm;
42
43static cl::opt<unsigned> FrameIndexSearchRange(
44 "hexagon-frame-index-search-range", cl::init(Val: 32), cl::Hidden,
45 cl::desc("Limit on instruction search range in frame index elimination"));
46
47static cl::opt<unsigned> FrameIndexReuseLimit(
48 "hexagon-frame-index-reuse-limit", cl::init(Val: ~0), cl::Hidden,
49 cl::desc("Limit on the number of reused registers in frame index "
50 "elimination"));
51
52HexagonRegisterInfo::HexagonRegisterInfo(unsigned HwMode)
53 : HexagonGenRegisterInfo(Hexagon::R31, 0/*DwarfFlavor*/, 0/*EHFlavor*/,
54 0/*PC*/, HwMode) {}
55
56bool HexagonRegisterInfo::isGlobalReg(MCPhysReg Reg) const {
57 switch (Reg) {
58 case Hexagon::R29:
59 case Hexagon::R30:
60 case Hexagon::R31:
61 return true;
62 }
63 return false;
64}
65
66bool HexagonRegisterInfo::isFakeReg(MCPhysReg Reg) const {
67 // VF0-VF31 are fake registers used as sub-registers in HVX vector pairs
68 if (Reg >= Hexagon::VF0 && Reg <= Hexagon::VF31)
69 return true;
70 // VFR0-VFR31 are fake registers used for reversed vector pairs
71 if (Reg >= Hexagon::VFR0 && Reg <= Hexagon::VFR31)
72 return true;
73 return false;
74}
75
76bool HexagonRegisterInfo::isEHReturnCalleeSaveReg(Register R) const {
77 return R == Hexagon::R0 || R == Hexagon::R1 || R == Hexagon::R2 ||
78 R == Hexagon::R3 || R == Hexagon::D0 || R == Hexagon::D1;
79}
80
81const MCPhysReg *
82HexagonRegisterInfo::getCallerSavedRegs(const MachineFunction *MF,
83 const TargetRegisterClass *RC) const {
84 using namespace Hexagon;
85
86 static const MCPhysReg Int32[] = {
87 R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, 0
88 };
89 static const MCPhysReg Int64[] = {
90 D0, D1, D2, D3, D4, D5, D6, D7, 0
91 };
92 static const MCPhysReg Pred[] = {
93 P0, P1, P2, P3, 0
94 };
95 static const MCPhysReg VecSgl[] = {
96 V0, V1, V2, V3, V4, V5, V6, V7, V8, V9, V10, V11, V12, V13,
97 V14, V15, V16, V17, V18, V19, V20, V21, V22, V23, V24, V25, V26, V27,
98 V28, V29, V30, V31, 0
99 };
100 static const MCPhysReg VecDbl[] = {
101 W0, W1, W2, W3, W4, W5, W6, W7, W8, W9, W10, W11, W12, W13, W14, W15, 0
102 };
103 static const MCPhysReg VecPred[] = {
104 Q0, Q1, Q2, Q3, 0
105 };
106
107 switch (RC->getID()) {
108 case IntRegsRegClassID:
109 return Int32;
110 case DoubleRegsRegClassID:
111 return Int64;
112 case PredRegsRegClassID:
113 return Pred;
114 case HvxVRRegClassID:
115 return VecSgl;
116 case HvxWRRegClassID:
117 return VecDbl;
118 case HvxQRRegClassID:
119 return VecPred;
120 default:
121 break;
122 }
123
124 static const MCPhysReg Empty[] = { 0 };
125#ifndef NDEBUG
126 dbgs() << "Register class: " << getRegClassName(RC) << "\n";
127#endif
128 llvm_unreachable("Unexpected register class");
129 return Empty;
130}
131
132// Returns true if MF takes HLX arguments or returns an HLX type.
133static bool hasHLXSignature(const MachineFunction &MF) {
134 const auto &HST = MF.getSubtarget<HexagonSubtarget>();
135 const Function &F = MF.getFunction();
136 return HST.isTypeForHLX(VecTy: F.getReturnType()) ||
137 any_of(Range: F.args(), P: [&HST](const Argument &A) {
138 return HST.isTypeForHLX(VecTy: A.getType());
139 });
140}
141
142const MCPhysReg *
143HexagonRegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
144 static const MCPhysReg CalleeSavedRegsV3[] = {
145 Hexagon::R16, Hexagon::R17, Hexagon::R18, Hexagon::R19,
146 Hexagon::R20, Hexagon::R21, Hexagon::R22, Hexagon::R23,
147 Hexagon::R24, Hexagon::R25, Hexagon::R26, Hexagon::R27, 0
148 };
149
150 // Functions that contain a call to __builtin_eh_return also save the first 4
151 // parameter registers.
152 static const MCPhysReg CalleeSavedRegsV3EHReturn[] = {
153 Hexagon::R0, Hexagon::R1, Hexagon::R2, Hexagon::R3,
154 Hexagon::R16, Hexagon::R17, Hexagon::R18, Hexagon::R19,
155 Hexagon::R20, Hexagon::R21, Hexagon::R22, Hexagon::R23,
156 Hexagon::R24, Hexagon::R25, Hexagon::R26, Hexagon::R27, 0
157 };
158
159 bool HasEHReturn = MF->getInfo<HexagonMachineFunctionInfo>()->hasEHReturn();
160
161 if (hasHLXSignature(MF: *MF))
162 return HasEHReturn ? HexagonCSR_HLX_EH_SaveList : HexagonCSR_HLX_SaveList;
163 return HasEHReturn ? CalleeSavedRegsV3EHReturn : CalleeSavedRegsV3;
164}
165
166const uint32_t *HexagonRegisterInfo::getCallPreservedMask(
167 const MachineFunction &MF, CallingConv::ID) const {
168 return HexagonCSR_RegMask;
169}
170
171const uint32_t *HexagonRegisterInfo::getHLXCallPreservedMask() const {
172 return HexagonCSR_HLX_RegMask;
173}
174
175BitVector
176HexagonRegisterInfo::getReservedRegs(const MachineFunction &MF) const {
177 BitVector Reserved = getBaseReservedRegs(MF);
178 if (Register AP = computeStackAlignBaseRegister(MF, BaseReservedRegs: Reserved)) {
179 Reserved.set(AP);
180 markSuperRegs(RegisterSet&: Reserved, Reg: AP);
181 }
182 return Reserved;
183}
184
185Register HexagonRegisterInfo::computeStackAlignBaseRegister(
186 const MachineFunction &MF) const {
187 return computeStackAlignBaseRegister(MF, BaseReservedRegs: getBaseReservedRegs(MF));
188}
189
190Register HexagonRegisterInfo::computeStackAlignBaseRegister(
191 const MachineFunction &MF, const BitVector &BaseReservedRegs) const {
192 auto &HFI = *MF.getSubtarget<HexagonSubtarget>().getFrameLowering();
193 if (!HFI.needsAligna(MF))
194 return Register();
195
196 // Reserve the first non-volatile register.
197 Register AP;
198 for (const MCPhysReg *R = getCalleeSavedRegs(MF: &MF); *R; ++R) {
199 if (BaseReservedRegs[*R])
200 continue;
201 AP = *R;
202 break;
203 }
204 assert(AP.isValid() && "Couldn't reserve stack align register");
205 return AP;
206}
207
208BitVector
209HexagonRegisterInfo::getBaseReservedRegs(const MachineFunction &MF) const {
210 BitVector Reserved(getNumRegs());
211 Reserved.set(Hexagon::R29);
212 Reserved.set(Hexagon::R30);
213 Reserved.set(Hexagon::R31);
214 Reserved.set(Hexagon::VTMP);
215
216 // Guest registers.
217 Reserved.set(Hexagon::GELR); // G0
218 Reserved.set(Hexagon::GSR); // G1
219 Reserved.set(Hexagon::GOSP); // G2
220 Reserved.set(Hexagon::G3); // G3
221
222 // Control registers.
223 Reserved.set(Hexagon::SA0); // C0
224 Reserved.set(Hexagon::LC0); // C1
225 Reserved.set(Hexagon::SA1); // C2
226 Reserved.set(Hexagon::LC1); // C3
227 Reserved.set(Hexagon::P3_0); // C4
228 Reserved.set(Hexagon::USR); // C8
229 Reserved.set(Hexagon::PC); // C9
230 Reserved.set(Hexagon::UGP); // C10
231 Reserved.set(Hexagon::GP); // C11
232 Reserved.set(Hexagon::UPCYCLELO); // C14
233 Reserved.set(Hexagon::UPCYCLEHI); // C15
234 Reserved.set(Hexagon::FRAMELIMIT); // C16
235 Reserved.set(Hexagon::FRAMEKEY); // C17
236 Reserved.set(Hexagon::PKTCOUNTLO); // C18
237 Reserved.set(Hexagon::PKTCOUNTHI); // C19
238 Reserved.set(Hexagon::VFRAMELIMIT); // C28
239 Reserved.set(Hexagon::VSP); // C29
240 Reserved.set(Hexagon::UTIMERLO); // C30
241 Reserved.set(Hexagon::UTIMERHI); // C31
242 // Out of the control registers, only C8 is explicitly defined in
243 // HexagonRegisterInfo.td. If others are defined, make sure to add
244 // them here as well.
245 Reserved.set(Hexagon::C8);
246 Reserved.set(Hexagon::USR_OVF);
247
248 // Leveraging these registers will require more work to recognize
249 // the new semantics posed, Hi/LoVec patterns, etc.
250 // Note well: if enabled, they should be restricted to only
251 // where `HST.useHVXOps() && HST.hasV67Ops()` is true.
252 for (auto Reg : Hexagon_MC::GetVectRegRev())
253 Reserved.set(Reg);
254
255 static const MCPhysReg RRegs[] = {
256 Hexagon::R6, Hexagon::R7, Hexagon::R8, Hexagon::R9, Hexagon::R10,
257 Hexagon::R11, Hexagon::R12, Hexagon::R13, Hexagon::R14, Hexagon::R15,
258 Hexagon::R16, Hexagon::R17, Hexagon::R18, Hexagon::R19, Hexagon::R20,
259 Hexagon::R21, Hexagon::R22, Hexagon::R23, Hexagon::R24, Hexagon::R25,
260 Hexagon::R26, Hexagon::R27, Hexagon::R28};
261 for (MCPhysReg Reg : RRegs)
262 if (MF.getSubtarget().isRegisterReservedByUser(R: Reg))
263 Reserved.set(Reg);
264
265 for (int x = Reserved.find_first(); x >= 0; x = Reserved.find_next(Prev: x))
266 markSuperRegs(RegisterSet&: Reserved, Reg: x);
267
268 return Reserved;
269}
270
271bool HexagonRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
272 int SPAdj, unsigned FIOp,
273 RegScavenger *RS) const {
274 static unsigned ReuseCount = 0;
275 //
276 // Hexagon_TODO: Do we need to enforce this for Hexagon?
277 assert(SPAdj == 0 && "Unexpected");
278
279 MachineInstr &MI = *II;
280 MachineBasicBlock &MB = *MI.getParent();
281 MachineFunction &MF = *MB.getParent();
282 auto &HST = MF.getSubtarget<HexagonSubtarget>();
283 auto &HII = *HST.getInstrInfo();
284 auto &HFI = *HST.getFrameLowering();
285
286 Register BP;
287 int FI = MI.getOperand(i: FIOp).getIndex();
288 // Select the base pointer (BP) and calculate the actual offset from BP
289 // to the beginning of the object at index FI.
290 int Offset = HFI.getFrameIndexReference(MF, FI, FrameReg&: BP).getFixed();
291 unsigned Opc = MI.getOpcode();
292 bool IsBaseOnlyHLX =
293 Opc == Hexagon::LX_L16b_pseudo || Opc == Hexagon::LX_S16b_pseudo;
294 // Add the offset from the instruction.
295 int RealOffset =
296 Offset + (IsBaseOnlyHLX ? 0 : MI.getOperand(i: FIOp + 1).getImm());
297
298 if (BP == Hexagon::VSP) {
299 auto &MRI = MF.getRegInfo();
300 Register VSPCopy = MRI.createVirtualRegister(RegClass: &Hexagon::IntRegsRegClass);
301 BuildMI(BB&: MB, I: II, MIMD: MI.getDebugLoc(), MCID: HII.get(Opcode: Hexagon::A2_tfrcrr), DestReg: VSPCopy)
302 .addReg(RegNo: BP);
303 BP = VSPCopy;
304
305 // HLX memory operations take a complete scalar address and do not have an
306 // immediate offset operand. Materialize the VTCM address before replacing
307 // their frame index.
308 if (IsBaseOnlyHLX) {
309 Register Addr = MRI.createVirtualRegister(RegClass: &Hexagon::IntRegsRegClass);
310 BuildMI(BB&: MB, I: II, MIMD: MI.getDebugLoc(), MCID: HII.get(Opcode: Hexagon::A2_addi), DestReg: Addr)
311 .addReg(RegNo: BP)
312 .addImm(Val: RealOffset);
313 MI.getOperand(i: FIOp).ChangeToRegister(Reg: Addr, isDef: false, isImp: false, isKill: true);
314 return false;
315 }
316 }
317
318 switch (Opc) {
319 case Hexagon::PS_fia:
320 MI.setDesc(HII.get(Opcode: Hexagon::A2_addi));
321 MI.getOperand(i: FIOp).ChangeToImmediate(ImmVal: RealOffset);
322 MI.removeOperand(OpNo: FIOp+1);
323 return false;
324 case Hexagon::PS_fi:
325 // Set up the instruction for updating below.
326 MI.setDesc(HII.get(Opcode: Hexagon::A2_addi));
327 break;
328 }
329
330 if (!HII.isValidOffset(Opcode: Opc, Offset: RealOffset)) {
331 // If the offset is not valid, calculate the address in a temporary
332 // register and use it with offset 0.
333 int InstOffset = 0;
334 // The actual base register (BP) is typically shared between many
335 // instructions where frame indices are being replaced. In scalar
336 // instructions the offset range is large, and the need for an extra
337 // add instruction is infrequent. Vector loads/stores, however, have
338 // a much smaller offset range: [-8, 7), or #s4. In those cases it
339 // makes sense to "standardize" the immediate in the "addi" instruction
340 // so that multiple loads/stores could be based on it.
341 bool IsPair = false;
342 switch (MI.getOpcode()) {
343 // All of these instructions have the same format: base+#s4.
344 case Hexagon::PS_vloadrw_ai:
345 case Hexagon::PS_vloadrw_nt_ai:
346 case Hexagon::PS_vstorerw_ai:
347 case Hexagon::PS_vstorerw_nt_ai:
348 IsPair = true;
349 [[fallthrough]];
350 case Hexagon::PS_vloadrv_ai:
351 case Hexagon::PS_vloadrv_nt_ai:
352 case Hexagon::PS_vstorerv_ai:
353 case Hexagon::PS_vstorerv_nt_ai:
354 case Hexagon::V6_vL32b_ai:
355 case Hexagon::V6_vS32b_ai: {
356 unsigned HwLen = HST.getVectorLength();
357 if (RealOffset % HwLen == 0) {
358 int VecOffset = RealOffset / HwLen;
359 // Rewrite the offset as "base + [-8, 7)".
360 VecOffset += 8;
361 // Pairs are expanded into two instructions: make sure that both
362 // can use the same base (i.e. VecOffset+1 is not a different
363 // multiple of 16 than VecOffset).
364 if (!IsPair || (VecOffset + 1) % 16 != 0) {
365 RealOffset = (VecOffset & -16) * HwLen;
366 InstOffset = (VecOffset % 16 - 8) * HwLen;
367 }
368 }
369 }
370 }
371
372 // Search backwards in the block for "Reg = A2_addi BP, RealOffset".
373 // This will give us a chance to avoid creating a new register.
374 Register ReuseBP;
375
376 if (ReuseCount < FrameIndexReuseLimit) {
377 unsigned SearchCount = 0, SearchRange = FrameIndexSearchRange;
378 SmallSet<Register,2> SeenVRegs;
379 bool PassedCall = false;
380 LiveRegUnits Defs(*this), Uses(*this);
381
382 for (auto I = std::next(x: II.getReverse()), E = MB.rend(); I != E; ++I) {
383 if (SearchCount == SearchRange)
384 break;
385 ++SearchCount;
386 const MachineInstr &BI = *I;
387 LiveRegUnits::accumulateUsedDefed(MI: BI, ModifiedRegUnits&: Defs, UsedRegUnits&: Uses, TRI: this);
388 PassedCall |= BI.isCall();
389 for (const MachineOperand &Op : BI.operands()) {
390 if (SeenVRegs.size() > 1)
391 break;
392 if (Op.isReg() && Op.getReg().isVirtual())
393 SeenVRegs.insert(V: Op.getReg());
394 }
395 if (BI.getOpcode() != Hexagon::A2_addi)
396 continue;
397 if (BI.getOperand(i: 1).getReg() != BP)
398 continue;
399 const auto &Op2 = BI.getOperand(i: 2);
400 if (!Op2.isImm() || Op2.getImm() != RealOffset)
401 continue;
402
403 Register R = BI.getOperand(i: 0).getReg();
404 if (R.isPhysical()) {
405 if (Defs.available(Reg: R))
406 ReuseBP = R;
407 } else if (R.isVirtual()) {
408 // Extending a range of a virtual register can be dangerous,
409 // since the scavenger will need to find a physical register
410 // for it. Avoid extending the range past a function call,
411 // and avoid overlapping it with another virtual register.
412 if (!PassedCall && SeenVRegs.size() <= 1)
413 ReuseBP = R;
414 }
415 break;
416 }
417 if (ReuseBP)
418 ++ReuseCount;
419 }
420
421 auto &MRI = MF.getRegInfo();
422 if (!ReuseBP) {
423 ReuseBP = MRI.createVirtualRegister(RegClass: &Hexagon::IntRegsRegClass);
424 const DebugLoc &DL = MI.getDebugLoc();
425 BuildMI(BB&: MB, I: II, MIMD: DL, MCID: HII.get(Opcode: Hexagon::A2_addi), DestReg: ReuseBP)
426 .addReg(RegNo: BP)
427 .addImm(Val: RealOffset);
428 }
429 BP = ReuseBP;
430 RealOffset = InstOffset;
431 }
432
433 MI.getOperand(i: FIOp).ChangeToRegister(Reg: BP, isDef: false, isImp: false, isKill: false);
434 MI.getOperand(i: FIOp+1).ChangeToImmediate(ImmVal: RealOffset);
435 return false;
436}
437
438
439bool HexagonRegisterInfo::shouldCoalesce(MachineInstr *MI,
440 const TargetRegisterClass *SrcRC, unsigned SubReg,
441 const TargetRegisterClass *DstRC, unsigned DstSubReg,
442 const TargetRegisterClass *NewRC, LiveIntervals &LIS) const {
443 // Coalescing will extend the live interval of the destination register.
444 // If the destination register is a vector pair, avoid introducing function
445 // calls into the interval, since it could result in a spilling of a pair
446 // instead of a single vector.
447 MachineFunction &MF = *MI->getParent()->getParent();
448 const HexagonSubtarget &HST = MF.getSubtarget<HexagonSubtarget>();
449 if (!HST.useHVXOps() || NewRC->getID() != Hexagon::HvxWRRegClass.getID())
450 return true;
451 bool SmallSrc = SrcRC->getID() == Hexagon::HvxVRRegClass.getID();
452 bool SmallDst = DstRC->getID() == Hexagon::HvxVRRegClass.getID();
453 if (!SmallSrc && !SmallDst)
454 return true;
455
456 Register DstReg = MI->getOperand(i: 0).getReg();
457 Register SrcReg = MI->getOperand(i: 1).getReg();
458 const SlotIndexes &Indexes = *LIS.getSlotIndexes();
459 auto HasCall = [&Indexes] (const LiveInterval::Segment &S) {
460 for (SlotIndex I = S.start.getBaseIndex(), E = S.end.getBaseIndex();
461 I != E; I = I.getNextIndex()) {
462 if (const MachineInstr *MI = Indexes.getInstructionFromIndex(index: I))
463 if (MI->isCall())
464 return true;
465 }
466 return false;
467 };
468
469 if (SmallSrc == SmallDst) {
470 // Both must be true, because the case for both being false was
471 // checked earlier. Both registers will be coalesced into a register
472 // of a wider class (HvxWR), and we don't want its live range to
473 // span over calls.
474 return !any_of(Range&: LIS.getInterval(Reg: DstReg), P: HasCall) &&
475 !any_of(Range&: LIS.getInterval(Reg: SrcReg), P: HasCall);
476 }
477
478 // If one register is large (HvxWR) and the other is small (HvxVR), then
479 // coalescing is ok if the large is already live across a function call,
480 // or if the small one is not.
481 Register SmallReg = SmallSrc ? SrcReg : DstReg;
482 Register LargeReg = SmallSrc ? DstReg : SrcReg;
483 return any_of(Range&: LIS.getInterval(Reg: LargeReg), P: HasCall) ||
484 !any_of(Range&: LIS.getInterval(Reg: SmallReg), P: HasCall);
485}
486
487
488Register HexagonRegisterInfo::getFrameRegister(const MachineFunction
489 &MF) const {
490 const HexagonFrameLowering *TFI = getFrameLowering(MF);
491 if (TFI->hasFP(MF))
492 return getFrameRegister();
493 return getStackRegister();
494}
495
496
497Register HexagonRegisterInfo::getFrameRegister() const {
498 return Hexagon::R30;
499}
500
501
502Register HexagonRegisterInfo::getStackRegister() const {
503 return Hexagon::R29;
504}
505
506Register HexagonRegisterInfo::getVTCMStackRegister() const {
507 return Hexagon::VSP;
508}
509
510unsigned HexagonRegisterInfo::getHexagonSubRegIndex(
511 const TargetRegisterClass &RC, unsigned GenIdx) const {
512 assert(GenIdx == Hexagon::ps_sub_lo || GenIdx == Hexagon::ps_sub_hi);
513
514 static const unsigned ISub[] = { Hexagon::isub_lo, Hexagon::isub_hi };
515 static const unsigned VSub[] = { Hexagon::vsub_lo, Hexagon::vsub_hi };
516 static const unsigned WSub[] = { Hexagon::wsub_lo, Hexagon::wsub_hi };
517
518 switch (RC.getID()) {
519 case Hexagon::CtrRegs64RegClassID:
520 case Hexagon::DoubleRegsRegClassID:
521 case Hexagon::CircRegsRegClassID:
522 return ISub[GenIdx];
523 case Hexagon::HvxWRRegClassID:
524 case Hexagon::HlxLLRRegClassID:
525 return VSub[GenIdx];
526 case Hexagon::HvxVQRRegClassID:
527 return WSub[GenIdx];
528 }
529
530 if (!RC.superclasses().empty())
531 return getHexagonSubRegIndex(RC: *getRegClass(i: *RC.superclasses().begin()),
532 GenIdx);
533
534 llvm_unreachable("Invalid register class");
535}
536
537bool HexagonRegisterInfo::useFPForScavengingIndex(const MachineFunction &MF)
538 const {
539 return MF.getSubtarget<HexagonSubtarget>().getFrameLowering()->hasFP(MF);
540}
541