LLVM  5.0.0
AArch64CallLowering.cpp
Go to the documentation of this file.
1 //===--- AArch64CallLowering.cpp - Call lowering --------------------------===//
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 /// \file
11 /// This file implements the lowering of LLVM calls to machine code calls for
12 /// GlobalISel.
13 ///
14 //===----------------------------------------------------------------------===//
15 
16 #include "AArch64CallLowering.h"
17 #include "AArch64ISelLowering.h"
19 #include "AArch64Subtarget.h"
20 #include "llvm/ADT/ArrayRef.h"
21 #include "llvm/ADT/SmallVector.h"
22 #include "llvm/CodeGen/Analysis.h"
36 #include "llvm/IR/Argument.h"
37 #include "llvm/IR/Attributes.h"
38 #include "llvm/IR/Function.h"
39 #include "llvm/IR/Type.h"
40 #include "llvm/IR/Value.h"
43 #include <algorithm>
44 #include <cassert>
45 #include <cstdint>
46 #include <iterator>
47 
48 using namespace llvm;
49 
50 #ifndef LLVM_BUILD_GLOBAL_ISEL
51 #error "This shouldn't be built without GISel"
52 #endif
53 
55  : CallLowering(&TLI) {}
56 
59  CCAssignFn *AssignFn)
60  : ValueHandler(MIRBuilder, MRI, AssignFn), StackUsed(0) {}
61 
62  unsigned getStackAddress(uint64_t Size, int64_t Offset,
63  MachinePointerInfo &MPO) override {
64  auto &MFI = MIRBuilder.getMF().getFrameInfo();
65  int FI = MFI.CreateFixedObject(Size, Offset, true);
66  MPO = MachinePointerInfo::getFixedStack(MIRBuilder.getMF(), FI);
67  unsigned AddrReg = MRI.createGenericVirtualRegister(LLT::pointer(0, 64));
68  MIRBuilder.buildFrameIndex(AddrReg, FI);
69  StackUsed = std::max(StackUsed, Size + Offset);
70  return AddrReg;
71  }
72 
73  void assignValueToReg(unsigned ValVReg, unsigned PhysReg,
74  CCValAssign &VA) override {
75  markPhysRegUsed(PhysReg);
76  MIRBuilder.buildCopy(ValVReg, PhysReg);
77  // FIXME: assert extension
78  }
79 
80  void assignValueToAddress(unsigned ValVReg, unsigned Addr, uint64_t Size,
81  MachinePointerInfo &MPO, CCValAssign &VA) override {
82  auto MMO = MIRBuilder.getMF().getMachineMemOperand(
84  0);
85  MIRBuilder.buildLoad(ValVReg, Addr, *MMO);
86  }
87 
88  /// How the physical register gets marked varies between formal
89  /// parameters (it's a basic-block live-in), and a call instruction
90  /// (it's an implicit-def of the BL).
91  virtual void markPhysRegUsed(unsigned PhysReg) = 0;
92 
93  uint64_t StackUsed;
94 };
95 
98  CCAssignFn *AssignFn)
99  : IncomingArgHandler(MIRBuilder, MRI, AssignFn) {}
100 
101  void markPhysRegUsed(unsigned PhysReg) override {
102  MIRBuilder.getMBB().addLiveIn(PhysReg);
103  }
104 };
105 
108  MachineInstrBuilder MIB, CCAssignFn *AssignFn)
109  : IncomingArgHandler(MIRBuilder, MRI, AssignFn), MIB(MIB) {}
110 
111  void markPhysRegUsed(unsigned PhysReg) override {
112  MIB.addDef(PhysReg, RegState::Implicit);
113  }
114 
116 };
117 
120  MachineInstrBuilder MIB, CCAssignFn *AssignFn,
121  CCAssignFn *AssignFnVarArg)
122  : ValueHandler(MIRBuilder, MRI, AssignFn), MIB(MIB),
123  AssignFnVarArg(AssignFnVarArg), StackSize(0) {}
124 
125  unsigned getStackAddress(uint64_t Size, int64_t Offset,
126  MachinePointerInfo &MPO) override {
127  LLT p0 = LLT::pointer(0, 64);
128  LLT s64 = LLT::scalar(64);
129  unsigned SPReg = MRI.createGenericVirtualRegister(p0);
130  MIRBuilder.buildCopy(SPReg, AArch64::SP);
131 
132  unsigned OffsetReg = MRI.createGenericVirtualRegister(s64);
133  MIRBuilder.buildConstant(OffsetReg, Offset);
134 
135  unsigned AddrReg = MRI.createGenericVirtualRegister(p0);
136  MIRBuilder.buildGEP(AddrReg, SPReg, OffsetReg);
137 
138  MPO = MachinePointerInfo::getStack(MIRBuilder.getMF(), Offset);
139  return AddrReg;
140  }
141 
142  void assignValueToReg(unsigned ValVReg, unsigned PhysReg,
143  CCValAssign &VA) override {
144  MIB.addUse(PhysReg, RegState::Implicit);
145  unsigned ExtReg = extendRegister(ValVReg, VA);
146  MIRBuilder.buildCopy(PhysReg, ExtReg);
147  }
148 
149  void assignValueToAddress(unsigned ValVReg, unsigned Addr, uint64_t Size,
150  MachinePointerInfo &MPO, CCValAssign &VA) override {
151  auto MMO = MIRBuilder.getMF().getMachineMemOperand(
152  MPO, MachineMemOperand::MOStore, Size, 0);
153  MIRBuilder.buildStore(ValVReg, Addr, *MMO);
154  }
155 
156  bool assignArg(unsigned ValNo, MVT ValVT, MVT LocVT,
157  CCValAssign::LocInfo LocInfo,
158  const CallLowering::ArgInfo &Info,
159  CCState &State) override {
160  bool Res;
161  if (Info.IsFixed)
162  Res = AssignFn(ValNo, ValVT, LocVT, LocInfo, Info.Flags, State);
163  else
164  Res = AssignFnVarArg(ValNo, ValVT, LocVT, LocInfo, Info.Flags, State);
165 
166  StackSize = State.getNextStackOffset();
167  return Res;
168  }
169 
172  uint64_t StackSize;
173 };
174 
175 void AArch64CallLowering::splitToValueTypes(
176  const ArgInfo &OrigArg, SmallVectorImpl<ArgInfo> &SplitArgs,
178  const SplitArgTy &PerformArgSplit) const {
179  const AArch64TargetLowering &TLI = *getTLI<AArch64TargetLowering>();
180  LLVMContext &Ctx = OrigArg.Ty->getContext();
181 
182  SmallVector<EVT, 4> SplitVTs;
184  ComputeValueVTs(TLI, DL, OrigArg.Ty, SplitVTs, &Offsets, 0);
185 
186  if (SplitVTs.size() == 1) {
187  // No splitting to do, but we want to replace the original type (e.g. [1 x
188  // double] -> double).
189  SplitArgs.emplace_back(OrigArg.Reg, SplitVTs[0].getTypeForEVT(Ctx),
190  OrigArg.Flags, OrigArg.IsFixed);
191  return;
192  }
193 
194  unsigned FirstRegIdx = SplitArgs.size();
195  for (auto SplitVT : SplitVTs) {
196  // FIXME: set split flags if they're actually used (e.g. i128 on AAPCS).
197  Type *SplitTy = SplitVT.getTypeForEVT(Ctx);
198  SplitArgs.push_back(
199  ArgInfo{MRI.createGenericVirtualRegister(getLLTForType(*SplitTy, DL)),
200  SplitTy, OrigArg.Flags, OrigArg.IsFixed});
201  }
202 
203  for (unsigned i = 0; i < Offsets.size(); ++i)
204  PerformArgSplit(SplitArgs[FirstRegIdx + i].Reg, Offsets[i] * 8);
205 }
206 
208  const Value *Val, unsigned VReg) const {
209  MachineFunction &MF = MIRBuilder.getMF();
210  const Function &F = *MF.getFunction();
211 
212  auto MIB = MIRBuilder.buildInstrNoInsert(AArch64::RET_ReallyLR);
213  assert(((Val && VReg) || (!Val && !VReg)) && "Return value without a vreg");
214  bool Success = true;
215  if (VReg) {
216  const AArch64TargetLowering &TLI = *getTLI<AArch64TargetLowering>();
217  CCAssignFn *AssignFn = TLI.CCAssignFnForReturn(F.getCallingConv());
218  MachineRegisterInfo &MRI = MF.getRegInfo();
219  auto &DL = F.getParent()->getDataLayout();
220 
221  ArgInfo OrigArg{VReg, Val->getType()};
222  setArgFlags(OrigArg, AttributeList::ReturnIndex, DL, F);
223 
224  SmallVector<ArgInfo, 8> SplitArgs;
225  splitToValueTypes(OrigArg, SplitArgs, DL, MRI,
226  [&](unsigned Reg, uint64_t Offset) {
227  MIRBuilder.buildExtract(Reg, VReg, Offset);
228  });
229 
230  OutgoingArgHandler Handler(MIRBuilder, MRI, MIB, AssignFn, AssignFn);
231  Success = handleAssignments(MIRBuilder, SplitArgs, Handler);
232  }
233 
234  MIRBuilder.insertInstr(MIB);
235  return Success;
236 }
237 
239  const Function &F,
240  ArrayRef<unsigned> VRegs) const {
241  MachineFunction &MF = MIRBuilder.getMF();
242  MachineBasicBlock &MBB = MIRBuilder.getMBB();
243  MachineRegisterInfo &MRI = MF.getRegInfo();
244  auto &DL = F.getParent()->getDataLayout();
245 
246  SmallVector<ArgInfo, 8> SplitArgs;
247  unsigned i = 0;
248  for (auto &Arg : F.args()) {
249  ArgInfo OrigArg{VRegs[i], Arg.getType()};
250  setArgFlags(OrigArg, i + AttributeList::FirstArgIndex, DL, F);
251  bool Split = false;
252  LLT Ty = MRI.getType(VRegs[i]);
253  unsigned Dst = VRegs[i];
254 
255  splitToValueTypes(OrigArg, SplitArgs, DL, MRI,
256  [&](unsigned Reg, uint64_t Offset) {
257  if (!Split) {
258  Split = true;
259  Dst = MRI.createGenericVirtualRegister(Ty);
260  MIRBuilder.buildUndef(Dst);
261  }
262  unsigned Tmp = MRI.createGenericVirtualRegister(Ty);
263  MIRBuilder.buildInsert(Tmp, Dst, Reg, Offset);
264  Dst = Tmp;
265  });
266 
267  if (Dst != VRegs[i])
268  MIRBuilder.buildCopy(VRegs[i], Dst);
269  ++i;
270  }
271 
272  if (!MBB.empty())
273  MIRBuilder.setInstr(*MBB.begin());
274 
275  const AArch64TargetLowering &TLI = *getTLI<AArch64TargetLowering>();
276  CCAssignFn *AssignFn =
277  TLI.CCAssignFnForCall(F.getCallingConv(), /*IsVarArg=*/false);
278 
279  FormalArgHandler Handler(MIRBuilder, MRI, AssignFn);
280  if (!handleAssignments(MIRBuilder, SplitArgs, Handler))
281  return false;
282 
283  if (F.isVarArg()) {
285  // FIXME: we need to reimplement saveVarArgsRegisters from
286  // AArch64ISelLowering.
287  return false;
288  }
289 
290  // We currently pass all varargs at 8-byte alignment.
291  uint64_t StackOffset = alignTo(Handler.StackUsed, 8);
292 
293  auto &MFI = MIRBuilder.getMF().getFrameInfo();
295  FuncInfo->setVarArgsStackIndex(MFI.CreateFixedObject(4, StackOffset, true));
296  }
297 
298  // Move back to the end of the basic block.
299  MIRBuilder.setMBB(MBB);
300 
301  return true;
302 }
303 
305  CallingConv::ID CallConv,
306  const MachineOperand &Callee,
307  const ArgInfo &OrigRet,
308  ArrayRef<ArgInfo> OrigArgs) const {
309  MachineFunction &MF = MIRBuilder.getMF();
310  const Function &F = *MF.getFunction();
311  MachineRegisterInfo &MRI = MF.getRegInfo();
312  auto &DL = F.getParent()->getDataLayout();
313 
314  SmallVector<ArgInfo, 8> SplitArgs;
315  for (auto &OrigArg : OrigArgs) {
316  splitToValueTypes(OrigArg, SplitArgs, DL, MRI,
317  [&](unsigned Reg, uint64_t Offset) {
318  MIRBuilder.buildExtract(Reg, OrigArg.Reg, Offset);
319  });
320  }
321 
322  // Find out which ABI gets to decide where things go.
323  const AArch64TargetLowering &TLI = *getTLI<AArch64TargetLowering>();
324  CCAssignFn *AssignFnFixed =
325  TLI.CCAssignFnForCall(CallConv, /*IsVarArg=*/false);
326  CCAssignFn *AssignFnVarArg =
327  TLI.CCAssignFnForCall(CallConv, /*IsVarArg=*/true);
328 
329  auto CallSeqStart = MIRBuilder.buildInstr(AArch64::ADJCALLSTACKDOWN);
330 
331  // Create a temporarily-floating call instruction so we can add the implicit
332  // uses of arg registers.
333  auto MIB = MIRBuilder.buildInstrNoInsert(Callee.isReg() ? AArch64::BLR
334  : AArch64::BL);
335  MIB.add(Callee);
336 
337  // Tell the call which registers are clobbered.
338  auto TRI = MF.getSubtarget().getRegisterInfo();
339  MIB.addRegMask(TRI->getCallPreservedMask(MF, F.getCallingConv()));
340 
341  // Do the actual argument marshalling.
342  SmallVector<unsigned, 8> PhysRegs;
343  OutgoingArgHandler Handler(MIRBuilder, MRI, MIB, AssignFnFixed,
344  AssignFnVarArg);
345  if (!handleAssignments(MIRBuilder, SplitArgs, Handler))
346  return false;
347 
348  // Now we can add the actual call instruction to the correct basic block.
349  MIRBuilder.insertInstr(MIB);
350 
351  // If Callee is a reg, since it is used by a target specific
352  // instruction, it must have a register class matching the
353  // constraint of that instruction.
354  if (Callee.isReg())
356  MF, *TRI, MRI, *MF.getSubtarget().getInstrInfo(),
357  *MF.getSubtarget().getRegBankInfo(), *MIB, MIB->getDesc(),
358  Callee.getReg(), 0));
359 
360  // Finally we can copy the returned value back into its virtual-register. In
361  // symmetry with the arugments, the physical register must be an
362  // implicit-define of the call instruction.
363  CCAssignFn *RetAssignFn = TLI.CCAssignFnForReturn(F.getCallingConv());
364  if (OrigRet.Reg) {
365  SplitArgs.clear();
366 
367  SmallVector<uint64_t, 8> RegOffsets;
368  SmallVector<unsigned, 8> SplitRegs;
369  splitToValueTypes(OrigRet, SplitArgs, DL, MRI,
370  [&](unsigned Reg, uint64_t Offset) {
371  RegOffsets.push_back(Offset);
372  SplitRegs.push_back(Reg);
373  });
374 
375  CallReturnHandler Handler(MIRBuilder, MRI, MIB, RetAssignFn);
376  if (!handleAssignments(MIRBuilder, SplitArgs, Handler))
377  return false;
378 
379  if (!RegOffsets.empty())
380  MIRBuilder.buildSequence(OrigRet.Reg, SplitRegs, RegOffsets);
381  }
382 
383  CallSeqStart.addImm(Handler.StackSize).addImm(0);
384  MIRBuilder.buildInstr(AArch64::ADJCALLSTACKUP)
385  .addImm(Handler.StackSize)
386  .addImm(0);
387 
388  return true;
389 }
MachineBasicBlock & getMBB()
Getter for the basic block we currently build.
A parsed version of the target data layout string in and methods for querying it. ...
Definition: DataLayout.h:109
AArch64FunctionInfo - This class is derived from MachineFunctionInfo and contains private AArch64-spe...
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
LLT getType(unsigned VReg) const
Get the low-level type of VReg or LLT{} if VReg is not a generic (target independent) virtual registe...
CCAssignFn * CCAssignFnForReturn(CallingConv::ID CC) const
Selects the correct CCAssignFn for a given CallingConvention value.
unsigned constrainOperandRegClass(const MachineFunction &MF, const TargetRegisterInfo &TRI, MachineRegisterInfo &MRI, const TargetInstrInfo &TII, const RegisterBankInfo &RBI, MachineInstr &InsertPt, const MCInstrDesc &II, unsigned Reg, unsigned OpIdx)
Try to constrain Reg so that it is usable by argument OpIdx of the provided MCInstrDesc II...
Definition: Utils.cpp:46
CallReturnHandler(MachineIRBuilder &MIRBuilder, MachineRegisterInfo &MRI, MachineInstrBuilder MIB, CCAssignFn *AssignFn)
DataLayout DL
const MachineInstrBuilder & add(const MachineOperand &MO) const
bool CCAssignFn(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
CCAssignFn - This function assigns a location for Val, updating State to reflect the change...
Offsets
Offsets in bytes from the start of the input buffer.
Definition: SIInstrInfo.h:864
static const MCPhysReg VRegs[32]
const Function * getFunction() const
getFunction - Return the LLVM function that this machine code represents
uint64_t alignTo(uint64_t Value, uint64_t Align, uint64_t Skew=0)
Returns the next integer (mod 2**64) that is greater than or equal to Value and is a multiple of Alig...
Definition: MathExtras.h:677
unsigned createGenericVirtualRegister(LLT Ty)
Create and return a new generic virtual register with low-level type Ty.
MachineInstrBuilder buildExtract(unsigned Res, unsigned Src, uint64_t Index)
Build and insert `Res0<def>, ...
CallingConv::ID getCallingConv() const
getCallingConv()/setCallingConv(CC) - These method get and set the calling convention of this functio...
Definition: Function.h:186
void markPhysRegUsed(unsigned PhysReg) override
How the physical register gets marked varies between formal parameters (it's a basic-block live-in)...
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
bool isVarArg() const
isVarArg - Return true if this function takes a variable number of arguments.
Definition: Function.h:150
virtual const RegisterBankInfo * getRegBankInfo() const
If the information for the register banks is available, return it.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:42
bool isReg() const
isReg - Tests if this is a MO_Register operand.
Reg
All possible values of the reg field in the ModR/M byte.
This file contains the simple types necessary to represent the attributes associated with functions a...
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
LLVM_NODISCARD bool empty() const
Definition: SmallVector.h:60
#define F(x, y, z)
Definition: MD5.cpp:55
MachineInstrBuilder buildInstrNoInsert(unsigned Opcode)
Build but don't insert <empty> = Opcode <empty>.
MachineFunction & getMF()
Getter for the function we currently build.
static LLT scalar(unsigned SizeInBits)
Get a low-level scalar or aggregate "bag of bits".
bool lowerCall(MachineIRBuilder &MIRBuilder, CallingConv::ID CallConv, const MachineOperand &Callee, const ArgInfo &OrigRet, ArrayRef< ArgInfo > OrigArgs) const override
This hook must be implemented to lower the given call instruction, including argument and return valu...
void ComputeValueVTs(const TargetLowering &TLI, const DataLayout &DL, Type *Ty, SmallVectorImpl< EVT > &ValueVTs, SmallVectorImpl< uint64_t > *Offsets=nullptr, uint64_t StartingOffset=0)
ComputeValueVTs - Given an LLVM IR type, compute a sequence of EVTs that represent all the individual...
Definition: Analysis.cpp:85
static MachinePointerInfo getStack(MachineFunction &MF, int64_t Offset)
Stack pointer relative access.
IncomingArgHandler(MachineIRBuilder &MIRBuilder, MachineRegisterInfo &MRI, CCAssignFn *AssignFn)
unsigned const MachineRegisterInfo * MRI
Machine Value Type.
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:46
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:68
void assignValueToAddress(unsigned ValVReg, unsigned Addr, uint64_t Size, MachinePointerInfo &MPO, CCValAssign &VA) override
The specified value has been assigned to a stack location.
MachineInstrBuilder buildInstr(unsigned Opcode)
Build and insert <empty> = Opcode <empty>.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
const MachineOperand & getOperand(unsigned i) const
Definition: MachineInstr.h:284
Helper class to build MachineInstr.
unsigned getStackAddress(uint64_t Size, int64_t Offset, MachinePointerInfo &MPO) override
Materialize a VReg containing the address of the specified stack-based object.
void setInstr(MachineInstr &MI)
Set the insertion point to before MI.
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
MachineInstrBuilder buildInsert(unsigned Res, unsigned Src, unsigned Op, unsigned Index)
unsigned getNextStackOffset() const
getNextStackOffset - Return the next stack offset such that all stack slots satisfy their alignment r...
void markPhysRegUsed(unsigned PhysReg) override
How the physical register gets marked varies between formal parameters (it's a basic-block live-in)...
Argument handling is mostly uniform between the four places that make these decisions: function forma...
Definition: CallLowering.h:61
This class contains a discriminated union of information about pointers in memory operands...
LLT getLLTForType(Type &Ty, const DataLayout &DL)
Construct a low-level type based on an LLVM type.
The memory access writes data.
bool lowerReturn(MachineIRBuilder &MIRBuiler, const Value *Val, unsigned VReg) const override
This hook must be implemented to lower outgoing return values, described by Val, into the specified v...
MachineInstrBuilder MIB
CCState - This class holds information needed while lowering arguments and return values...
void buildSequence(unsigned Res, ArrayRef< unsigned > Ops, ArrayRef< uint64_t > Indices)
Build and insert instructions to put Ops together at the specified p Indices to form a larger registe...
bool assignArg(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, const CallLowering::ArgInfo &Info, CCState &State) override
MachineOperand class - Representation of each machine instruction operand.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Definition: SmallVector.h:861
Type * getType() const
All values are typed, get the type of this value.
Definition: Value.h:245
MachineInstrBuilder buildCopy(unsigned Res, unsigned Op)
Build and insert Res<def> = COPY Op.
CCValAssign - Represent assignment of one arg/retval to a location.
bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F, ArrayRef< unsigned > VRegs) const override
This hook must be implemented to lower the incoming (formal) arguments, described by Args...
This file declares the MachineIRBuilder class.
CCAssignFn * CCAssignFnForCall(CallingConv::ID CC, bool IsVarArg) const
Selects the correct CCAssignFn for a given CallingConvention value.
bool isTargetDarwin() const
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
The memory access reads data.
#define Success
static MachinePointerInfo getFixedStack(MachineFunction &MF, int FI, int64_t Offset=0)
Return a MachinePointerInfo record that refers to the specified FrameIndex.
const DataLayout & getDataLayout() const
Get the data layout for the module's target platform.
Definition: Module.cpp:361
MachineInstrBuilder buildUndef(unsigned Dst)
Build and insert Res = IMPLICIT_DEF.
void emplace_back(ArgTypes &&...Args)
Definition: SmallVector.h:653
bool handleAssignments(MachineIRBuilder &MIRBuilder, ArrayRef< ArgInfo > Args, ValueHandler &Callback) const
Invoke Handler::assignArg on each of the given Args and then use Callback to move them to the assigne...
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
void assignValueToAddress(unsigned ValVReg, unsigned Addr, uint64_t Size, MachinePointerInfo &MPO, CCValAssign &VA) override
The specified value has been assigned to a stack location.
void setMBB(MachineBasicBlock &MBB)
Set the insertion point to the end of MBB.
void setReg(unsigned Reg)
Change the register this operand corresponds to.
OutgoingArgHandler(MachineIRBuilder &MIRBuilder, MachineRegisterInfo &MRI, MachineInstrBuilder MIB, CCAssignFn *AssignFn, CCAssignFn *AssignFnVarArg)
LLVM_ATTRIBUTE_ALWAYS_INLINE size_type size() const
Definition: SmallVector.h:135
void setArgFlags(ArgInfo &Arg, unsigned OpNum, const DataLayout &DL, const FuncInfoTy &FuncInfo) const
The memory access always returns the same value (or traps).
void assignValueToReg(unsigned ValVReg, unsigned PhysReg, CCValAssign &VA) override
The specified value has been assigned to a physical register, handle the appropriate COPY (either to ...
This file describes how to lower LLVM calls to machine code calls.
MachineInstrBuilder MIB
unsigned getReg() const
getReg - Returns the register number.
unsigned getStackAddress(uint64_t Size, int64_t Offset, MachinePointerInfo &MPO) override
Materialize a VReg containing the address of the specified stack-based object.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
virtual const TargetInstrInfo * getInstrInfo() const
MachineInstrBuilder insertInstr(MachineInstrBuilder MIB)
Insert an existing instruction at the insertion point.
Module * getParent()
Get the module that this global value is contained inside of...
Definition: GlobalValue.h:545
LLVM Value Representation.
Definition: Value.h:73
static LLT pointer(uint16_t AddressSpace, unsigned SizeInBits)
Get a low-level pointer in the given address space (defaulting to 0).
AArch64CallLowering(const AArch64TargetLowering &TLI)
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
static void Split(std::vector< std::string > &V, StringRef S)
Splits a string of comma separated items in to a vector of strings.
FormalArgHandler(MachineIRBuilder &MIRBuilder, MachineRegisterInfo &MRI, CCAssignFn *AssignFn)
void assignValueToReg(unsigned ValVReg, unsigned PhysReg, CCValAssign &VA) override
The specified value has been assigned to a physical register, handle the appropriate COPY (either to ...
iterator_range< arg_iterator > args()
Definition: Function.h:613