LLVM  5.0.0
AArch64RegisterInfo.cpp
Go to the documentation of this file.
1 //===- AArch64RegisterInfo.cpp - AArch64 Register Information -------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the AArch64 implementation of the TargetRegisterInfo
11 // class.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #include "AArch64RegisterInfo.h"
16 #include "AArch64FrameLowering.h"
17 #include "AArch64InstrInfo.h"
19 #include "AArch64Subtarget.h"
21 #include "llvm/ADT/BitVector.h"
22 #include "llvm/ADT/Triple.h"
27 #include "llvm/IR/Function.h"
31 
32 using namespace llvm;
33 
34 #define GET_REGINFO_TARGET_DESC
35 #include "AArch64GenRegisterInfo.inc"
36 
38  : AArch64GenRegisterInfo(AArch64::LR), TT(TT) {}
39 
40 const MCPhysReg *
42  assert(MF && "Invalid MachineFunction pointer.");
44  // GHC set of callee saved regs is empty as all those regs are
45  // used for passing STG regs around
46  return CSR_AArch64_NoRegs_SaveList;
48  return CSR_AArch64_AllRegs_SaveList;
50  return MF->getInfo<AArch64FunctionInfo>()->isSplitCSR() ?
51  CSR_AArch64_CXX_TLS_Darwin_PE_SaveList :
52  CSR_AArch64_CXX_TLS_Darwin_SaveList;
54  ->supportSwiftError() &&
56  Attribute::SwiftError))
57  return CSR_AArch64_AAPCS_SwiftError_SaveList;
59  return CSR_AArch64_RT_MostRegs_SaveList;
60  else
61  return CSR_AArch64_AAPCS_SaveList;
62 }
63 
65  const MachineFunction *MF) const {
66  assert(MF && "Invalid MachineFunction pointer.");
68  MF->getInfo<AArch64FunctionInfo>()->isSplitCSR())
69  return CSR_AArch64_CXX_TLS_Darwin_ViaCopy_SaveList;
70  return nullptr;
71 }
72 
73 const uint32_t *
75  CallingConv::ID CC) const {
76  if (CC == CallingConv::GHC)
77  // This is academic because all GHC calls are (supposed to be) tail calls
78  return CSR_AArch64_NoRegs_RegMask;
79  if (CC == CallingConv::AnyReg)
80  return CSR_AArch64_AllRegs_RegMask;
81  if (CC == CallingConv::CXX_FAST_TLS)
82  return CSR_AArch64_CXX_TLS_Darwin_RegMask;
84  ->supportSwiftError() &&
85  MF.getFunction()->getAttributes().hasAttrSomewhere(Attribute::SwiftError))
86  return CSR_AArch64_AAPCS_SwiftError_RegMask;
87  if (CC == CallingConv::PreserveMost)
88  return CSR_AArch64_RT_MostRegs_RegMask;
89  else
90  return CSR_AArch64_AAPCS_RegMask;
91 }
92 
94  if (TT.isOSDarwin())
95  return CSR_AArch64_TLS_Darwin_RegMask;
96 
97  assert(TT.isOSBinFormatELF() && "Invalid target");
98  return CSR_AArch64_TLS_ELF_RegMask;
99 }
100 
101 const uint32_t *
103  CallingConv::ID CC) const {
104  // This should return a register mask that is the same as that returned by
105  // getCallPreservedMask but that additionally preserves the register used for
106  // the first i64 argument (which must also be the register used to return a
107  // single i64 return value)
108  //
109  // In case that the calling convention does not use the same register for
110  // both, the function should return NULL (does not currently apply)
111  assert(CC != CallingConv::GHC && "should not be GHC calling convention.");
112  return CSR_AArch64_AAPCS_ThisReturn_RegMask;
113 }
114 
115 BitVector
117  const AArch64FrameLowering *TFI = getFrameLowering(MF);
118 
119  // FIXME: avoid re-calculating this every time.
120  BitVector Reserved(getNumRegs());
121  markSuperRegs(Reserved, AArch64::WSP);
122  markSuperRegs(Reserved, AArch64::WZR);
123 
124  if (TFI->hasFP(MF) || TT.isOSDarwin())
125  markSuperRegs(Reserved, AArch64::W29);
126 
128  markSuperRegs(Reserved, AArch64::W18); // Platform register
129 
130  if (hasBasePointer(MF))
131  markSuperRegs(Reserved, AArch64::W19);
132 
133  assert(checkAllSuperRegsMarked(Reserved));
134  return Reserved;
135 }
136 
138  unsigned Reg) const {
139  const AArch64FrameLowering *TFI = getFrameLowering(MF);
140 
141  switch (Reg) {
142  default:
143  break;
144  case AArch64::SP:
145  case AArch64::XZR:
146  case AArch64::WSP:
147  case AArch64::WZR:
148  return true;
149  case AArch64::X18:
150  case AArch64::W18:
151  return MF.getSubtarget<AArch64Subtarget>().isX18Reserved();
152  case AArch64::FP:
153  case AArch64::W29:
154  return TFI->hasFP(MF) || TT.isOSDarwin();
155  case AArch64::W19:
156  case AArch64::X19:
157  return hasBasePointer(MF);
158  }
159 
160  return false;
161 }
162 
163 bool AArch64RegisterInfo::isConstantPhysReg(unsigned PhysReg) const {
164  return PhysReg == AArch64::WZR || PhysReg == AArch64::XZR;
165 }
166 
167 const TargetRegisterClass *
169  unsigned Kind) const {
170  return &AArch64::GPR64spRegClass;
171 }
172 
173 const TargetRegisterClass *
175  if (RC == &AArch64::CCRRegClass)
176  return &AArch64::GPR64RegClass; // Only MSR & MRS copy NZCV.
177  return RC;
178 }
179 
180 unsigned AArch64RegisterInfo::getBaseRegister() const { return AArch64::X19; }
181 
183  const MachineFrameInfo &MFI = MF.getFrameInfo();
184 
185  // In the presence of variable sized objects, if the fixed stack size is
186  // large enough that referencing from the FP won't result in things being
187  // in range relatively often, we can use a base pointer to allow access
188  // from the other direction like the SP normally works.
189  // Furthermore, if both variable sized objects are present, and the
190  // stack needs to be dynamically re-aligned, the base pointer is the only
191  // reliable way to reference the locals.
192  if (MFI.hasVarSizedObjects()) {
193  if (needsStackRealignment(MF))
194  return true;
195  // Conservatively estimate whether the negative offset from the frame
196  // pointer will be sufficient to reach. If a function has a smallish
197  // frame, it's less likely to have lots of spills and callee saved
198  // space, so it's all more likely to be within range of the frame pointer.
199  // If it's wrong, we'll materialize the constant and still get to the
200  // object; it's just suboptimal. Negative offsets use the unscaled
201  // load/store instructions, which have a 9-bit signed immediate.
202  return MFI.getLocalFrameSize() >= 256;
203  }
204 
205  return false;
206 }
207 
208 unsigned
210  const AArch64FrameLowering *TFI = getFrameLowering(MF);
211  return TFI->hasFP(MF) ? AArch64::FP : AArch64::SP;
212 }
213 
215  const MachineFunction &MF) const {
216  return true;
217 }
218 
220  const MachineFunction &MF) const {
221  return true;
222 }
223 
224 bool
226  const MachineFrameInfo &MFI = MF.getFrameInfo();
227  // AArch64FrameLowering::resolveFrameIndexReference() can always fall back
228  // to the stack pointer, so only put the emergency spill slot next to the
229  // FP when there's no better way to access it (SP or base pointer).
230  return MFI.hasVarSizedObjects() && !hasBasePointer(MF);
231 }
232 
234  const MachineFunction &MF) const {
235  return true;
236 }
237 
238 bool
240  const MachineFrameInfo &MFI = MF.getFrameInfo();
242  return true;
243  return MFI.hasVarSizedObjects() || MFI.isFrameAddressTaken();
244 }
245 
246 /// needsFrameBaseReg - Returns true if the instruction's frame index
247 /// reference would be better served by a base register other than FP
248 /// or SP. Used by LocalStackFrameAllocation to determine which frame index
249 /// references it should create new base registers for.
251  int64_t Offset) const {
252  for (unsigned i = 0; !MI->getOperand(i).isFI(); ++i)
253  assert(i < MI->getNumOperands() &&
254  "Instr doesn't have FrameIndex operand!");
255 
256  // It's the load/store FI references that cause issues, as it can be difficult
257  // to materialize the offset if it won't fit in the literal field. Estimate
258  // based on the size of the local frame and some conservative assumptions
259  // about the rest of the stack frame (note, this is pre-regalloc, so
260  // we don't know everything for certain yet) whether this offset is likely
261  // to be out of range of the immediate. Return true if so.
262 
263  // We only generate virtual base registers for loads and stores, so
264  // return false for everything else.
265  if (!MI->mayLoad() && !MI->mayStore())
266  return false;
267 
268  // Without a virtual base register, if the function has variable sized
269  // objects, all fixed-size local references will be via the frame pointer,
270  // Approximate the offset and see if it's legal for the instruction.
271  // Note that the incoming offset is based on the SP value at function entry,
272  // so it'll be negative.
273  MachineFunction &MF = *MI->getParent()->getParent();
274  const AArch64FrameLowering *TFI = getFrameLowering(MF);
275  MachineFrameInfo &MFI = MF.getFrameInfo();
276 
277  // Estimate an offset from the frame pointer.
278  // Conservatively assume all GPR callee-saved registers get pushed.
279  // FP, LR, X19-X28, D8-D15. 64-bits each.
280  int64_t FPOffset = Offset - 16 * 20;
281  // Estimate an offset from the stack pointer.
282  // The incoming offset is relating to the SP at the start of the function,
283  // but when we access the local it'll be relative to the SP after local
284  // allocation, so adjust our SP-relative offset by that allocation size.
285  Offset += MFI.getLocalFrameSize();
286  // Assume that we'll have at least some spill slots allocated.
287  // FIXME: This is a total SWAG number. We should run some statistics
288  // and pick a real one.
289  Offset += 128; // 128 bytes of spill slots
290 
291  // If there is a frame pointer, try using it.
292  // The FP is only available if there is no dynamic realignment. We
293  // don't know for sure yet whether we'll need that, so we guess based
294  // on whether there are any local variables that would trigger it.
295  if (TFI->hasFP(MF) && isFrameOffsetLegal(MI, AArch64::FP, FPOffset))
296  return false;
297 
298  // If we can reference via the stack pointer or base pointer, try that.
299  // FIXME: This (and the code that resolves the references) can be improved
300  // to only disallow SP relative references in the live range of
301  // the VLA(s). In practice, it's unclear how much difference that
302  // would make, but it may be worth doing.
303  if (isFrameOffsetLegal(MI, AArch64::SP, Offset))
304  return false;
305 
306  // The offset likely isn't legal; we want to allocate a virtual base register.
307  return true;
308 }
309 
311  unsigned BaseReg,
312  int64_t Offset) const {
313  assert(Offset <= INT_MAX && "Offset too big to fit in int.");
314  assert(MI && "Unable to get the legal offset for nil instruction.");
315  int SaveOffset = Offset;
316  return isAArch64FrameOffsetLegal(*MI, SaveOffset) & AArch64FrameOffsetIsLegal;
317 }
318 
319 /// Insert defining instruction(s) for BaseReg to be a pointer to FrameIdx
320 /// at the beginning of the basic block.
322  unsigned BaseReg,
323  int FrameIdx,
324  int64_t Offset) const {
326  DebugLoc DL; // Defaults to "unknown"
327  if (Ins != MBB->end())
328  DL = Ins->getDebugLoc();
329  const MachineFunction &MF = *MBB->getParent();
330  const AArch64InstrInfo *TII =
331  MF.getSubtarget<AArch64Subtarget>().getInstrInfo();
332  const MCInstrDesc &MCID = TII->get(AArch64::ADDXri);
334  MRI.constrainRegClass(BaseReg, TII->getRegClass(MCID, 0, this, MF));
335  unsigned Shifter = AArch64_AM::getShifterImm(AArch64_AM::LSL, 0);
336 
337  BuildMI(*MBB, Ins, DL, MCID, BaseReg)
338  .addFrameIndex(FrameIdx)
339  .addImm(Offset)
340  .addImm(Shifter);
341 }
342 
344  int64_t Offset) const {
345  int Off = Offset; // ARM doesn't need the general 64-bit offsets
346  unsigned i = 0;
347 
348  while (!MI.getOperand(i).isFI()) {
349  ++i;
350  assert(i < MI.getNumOperands() && "Instr doesn't have FrameIndex operand!");
351  }
352  const MachineFunction *MF = MI.getParent()->getParent();
353  const AArch64InstrInfo *TII =
354  MF->getSubtarget<AArch64Subtarget>().getInstrInfo();
355  bool Done = rewriteAArch64FrameIndex(MI, i, BaseReg, Off, TII);
356  assert(Done && "Unable to resolve frame index!");
357  (void)Done;
358 }
359 
361  int SPAdj, unsigned FIOperandNum,
362  RegScavenger *RS) const {
363  assert(SPAdj == 0 && "Unexpected");
364 
365  MachineInstr &MI = *II;
366  MachineBasicBlock &MBB = *MI.getParent();
367  MachineFunction &MF = *MBB.getParent();
368  const AArch64InstrInfo *TII =
369  MF.getSubtarget<AArch64Subtarget>().getInstrInfo();
370  const AArch64FrameLowering *TFI = getFrameLowering(MF);
371 
372  int FrameIndex = MI.getOperand(FIOperandNum).getIndex();
373  unsigned FrameReg;
374  int Offset;
375 
376  // Special handling of dbg_value, stackmap and patchpoint instructions.
377  if (MI.isDebugValue() || MI.getOpcode() == TargetOpcode::STACKMAP ||
378  MI.getOpcode() == TargetOpcode::PATCHPOINT) {
379  Offset = TFI->resolveFrameIndexReference(MF, FrameIndex, FrameReg,
380  /*PreferFP=*/true);
381  Offset += MI.getOperand(FIOperandNum + 1).getImm();
382  MI.getOperand(FIOperandNum).ChangeToRegister(FrameReg, false /*isDef*/);
383  MI.getOperand(FIOperandNum + 1).ChangeToImmediate(Offset);
384  return;
385  }
386 
387  // Modify MI as necessary to handle as much of 'Offset' as possible
388  Offset = TFI->resolveFrameIndexReference(MF, FrameIndex, FrameReg);
389  if (rewriteAArch64FrameIndex(MI, FIOperandNum, FrameReg, Offset, TII))
390  return;
391 
392  assert((!RS || !RS->isScavengingFrameIndex(FrameIndex)) &&
393  "Emergency spill slot is out of reach");
394 
395  // If we get here, the immediate doesn't fit into the instruction. We folded
396  // as much as possible above. Handle the rest, providing a register that is
397  // SP+LargeImm.
398  unsigned ScratchReg =
399  MF.getRegInfo().createVirtualRegister(&AArch64::GPR64RegClass);
400  emitFrameOffset(MBB, II, MI.getDebugLoc(), ScratchReg, FrameReg, Offset, TII);
401  MI.getOperand(FIOperandNum).ChangeToRegister(ScratchReg, false, false, true);
402 }
403 
405  MachineFunction &MF) const {
406  const AArch64FrameLowering *TFI = getFrameLowering(MF);
407 
408  switch (RC->getID()) {
409  default:
410  return 0;
411  case AArch64::GPR32RegClassID:
412  case AArch64::GPR32spRegClassID:
413  case AArch64::GPR32allRegClassID:
414  case AArch64::GPR64spRegClassID:
415  case AArch64::GPR64allRegClassID:
416  case AArch64::GPR64RegClassID:
417  case AArch64::GPR32commonRegClassID:
418  case AArch64::GPR64commonRegClassID:
419  return 32 - 1 // XZR/SP
420  - (TFI->hasFP(MF) || TT.isOSDarwin()) // FP
422  .isX18Reserved() // X18 reserved as platform register
423  - hasBasePointer(MF); // X19
424  case AArch64::FPR8RegClassID:
425  case AArch64::FPR16RegClassID:
426  case AArch64::FPR32RegClassID:
427  case AArch64::FPR64RegClassID:
428  case AArch64::FPR128RegClassID:
429  return 32;
430 
431  case AArch64::DDRegClassID:
432  case AArch64::DDDRegClassID:
433  case AArch64::DDDDRegClassID:
434  case AArch64::QQRegClassID:
435  case AArch64::QQQRegClassID:
436  case AArch64::QQQQRegClassID:
437  return 32;
438 
439  case AArch64::FPR128_loRegClassID:
440  return 16;
441  }
442 }
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
AArch64FunctionInfo - This class is derived from MachineFunctionInfo and contains private AArch64-spe...
bool cannotEliminateFrame(const MachineFunction &MF) const
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...
unsigned createVirtualRegister(const TargetRegisterClass *RegClass)
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
const uint32_t * getTLSCallPreservedMask() const
int resolveFrameIndexReference(const MachineFunction &MF, int FI, unsigned &FrameReg, bool PreferFP=false) const
Describe properties that are true of each instruction in the target description file.
Definition: MCInstrDesc.h:163
bool mayStore(QueryType Type=AnyInBundle) const
Return true if this instruction could possibly modify memory.
Definition: MachineInstr.h:613
DataLayout DL
bool adjustsStack() const
Return true if this function adjusts the stack – e.g., when calling another function.
unsigned getID() const
Return the register class ID number.
bool isFrameOffsetLegal(const MachineInstr *MI, unsigned BaseReg, int64_t Offset) const override
A debug info location.
Definition: DebugLoc.h:34
const Function * getFunction() const
getFunction - Return the LLVM function that this machine code represents
CallingConv::ID getCallingConv() const
getCallingConv()/setCallingConv(CC) - These method get and set the calling convention of this functio...
Definition: Function.h:186
bool supportSwiftError() const override
Return true if the target supports swifterror attribute.
AttributeList getAttributes() const
Return the attribute list for this Function.
Definition: Function.h:197
unsigned getFrameRegister(const MachineFunction &MF) const override
int64_t getLocalFrameSize() const
Get the size of the local object blob.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
const HexagonInstrInfo * TII
bool DisableFramePointerElim(const MachineFunction &MF) const
DisableFramePointerElim - This returns true if frame pointer elimination optimization should be disab...
bool requiresFrameIndexScavenging(const MachineFunction &MF) const override
bool mayLoad(QueryType Type=AnyInBundle) const
Return true if this instruction could possibly read memory.
Definition: MachineInstr.h:600
Reg
All possible values of the reg field in the ModR/M byte.
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
bool isFrameAddressTaken() const
This method may be called any time after instruction selection is complete to determine if there is a...
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
unsigned getNumOperands() const
Access to explicit operands of the instruction.
Definition: MachineInstr.h:282
int isAArch64FrameOffsetLegal(const MachineInstr &MI, int &Offset, bool *OutUseUnscaledOp=nullptr, unsigned *OutUnscaledOp=nullptr, int *EmittableOffset=nullptr)
Check if the Offset is a valid frame offset for MI.
bool isFI() const
isFI - Tests if this is a MO_FrameIndex operand.
AArch64RegisterInfo(const Triple &TT)
int64_t getImm() const
const TargetRegisterClass * constrainRegClass(unsigned Reg, const TargetRegisterClass *RC, unsigned MinNumRegs=0)
constrainRegClass - Constrain the register class of the specified virtual register to be a common sub...
const uint32_t * getCallPreservedMask(const MachineFunction &MF, CallingConv::ID) const override
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
Definition: MachineInstr.h:279
static unsigned getShifterImm(AArch64_AM::ShiftExtendType ST, unsigned Imm)
getShifterImm - Encode the shift type and amount: imm: 6-bit shift amount shifter: 000 ==> lsl 001 ==...
void emitFrameOffset(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, int Offset, const TargetInstrInfo *TII, MachineInstr::MIFlag=MachineInstr::NoFlags, bool SetNZCV=false)
emitFrameOffset - Emit instructions as needed to set DestReg to SrcReg plus Offset.
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...
const MachineBasicBlock * getParent() const
Definition: MachineInstr.h:139
bool isDebugValue() const
Definition: MachineInstr.h:785
void materializeFrameBaseRegister(MachineBasicBlock *MBB, unsigned BaseReg, int FrameIdx, int64_t Offset) const override
Insert defining instruction(s) for BaseReg to be a pointer to FrameIdx at the beginning of the basic ...
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
const AArch64TargetLowering * getTargetLowering() const override
const TargetRegisterClass * getPointerRegClass(const MachineFunction &MF, unsigned Kind=0) const override
This file declares the machine register scavenger class.
unsigned const MachineRegisterInfo * MRI
bool isReservedReg(const MachineFunction &MF, unsigned Reg) const
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
const MachineOperand & getOperand(unsigned i) const
Definition: MachineInstr.h:284
void eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj, unsigned FIOperandNum, RegScavenger *RS=nullptr) const override
bool rewriteAArch64FrameIndex(MachineInstr &MI, unsigned FrameRegIdx, unsigned FrameReg, int &Offset, const AArch64InstrInfo *TII)
rewriteAArch64FrameIndex - Rewrite MI to access 'Offset' bytes from the FP.
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
const MCPhysReg * getCalleeSavedRegs(const MachineFunction *MF) const override
Code Generation virtual methods...
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
bool isScavengingFrameIndex(int FI) const
Query whether a frame index is a scavenging frame index.
bool isOSDarwin() const
isOSDarwin - Is this a "Darwin" OS (OS X, iOS, or watchOS).
Definition: Triple.h:466
const uint32_t * getThisReturnPreservedMask(const MachineFunction &MF, CallingConv::ID) const
getThisReturnPreservedMask - Returns a call preserved mask specific to the case that 'returned' is on...
void resolveFrameIndex(MachineInstr &MI, unsigned BaseReg, int64_t Offset) const override
const MachineInstrBuilder & addFrameIndex(int Idx) const
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
Definition: MachineInstr.h:257
bool hasFP(const MachineFunction &MF) const override
hasFP - Return true if the specified function should have a dedicated frame pointer register...
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
Representation of each machine instruction.
Definition: MachineInstr.h:59
BitVector getReservedRegs(const MachineFunction &MF) const override
bool requiresVirtualBaseRegisters(const MachineFunction &MF) const override
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
Definition: Triple.h:577
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
const MCPhysReg * getCalleeSavedRegsViaCopy(const MachineFunction *MF) const
TargetOptions Options
Definition: TargetMachine.h:95
bool useFPForScavengingIndex(const MachineFunction &MF) const override
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
bool requiresRegisterScavenging(const MachineFunction &MF) const override
bool hasVarSizedObjects() const
This method may be called any time after instruction selection is complete to determine if the stack ...
unsigned getRegPressureLimit(const TargetRegisterClass *RC, MachineFunction &MF) const override
const unsigned Kind
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool isConstantPhysReg(unsigned PhysReg) const override
IRTranslator LLVM IR MI
const TargetRegisterClass * getCrossCopyRegClass(const TargetRegisterClass *RC) const override
bool needsFrameBaseReg(MachineInstr *MI, int64_t Offset) const override
needsFrameBaseReg - Returns true if the instruction's frame index reference would be better served by...
bool hasAttrSomewhere(Attribute::AttrKind Kind, unsigned *Index=nullptr) const
Return true if the specified attribute is set for at least one parameter or for the return value...
bool hasBasePointer(const MachineFunction &MF) const