37 for (
auto &Arg : CS.
args()) {
52 if (!OrigRet.Ty->isVoidTy())
58 template <
typename FuncInfoTy>
61 const FuncInfoTy &FuncInfo)
const {
81 Type *ElementTy = cast<PointerType>(Arg.
Ty)->getElementType();
86 if (FuncInfo.getParamAlignment(OpIdx - 2))
87 FrameAlign = FuncInfo.getParamAlignment(OpIdx - 2);
117 unsigned NumArgs = Args.
size();
118 for (
unsigned i = 0; i != NumArgs; ++i) {
124 for (
unsigned i = 0, e = Args.
size(), j = 0; i != e; ++i, ++j) {
125 assert(j < ArgLocs.size() &&
"Skipped too many arg locs");
128 assert(VA.getValNo() == i &&
"Location doesn't correspond to current arg");
130 if (VA.needsCustom()) {
137 else if (VA.isMemLoc()) {
140 :
alignTo(VA.getValVT().getSizeInBits(), 8) / 8;
141 unsigned Offset = VA.getLocMemOffset();
void setByValAlign(unsigned A)
void push_back(const T &Elt)
A parsed version of the target data layout string in and methods for querying it. ...
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function. ...
LocInfo getLocInfo() const
unsigned getNumParams() const
Return the number of fixed parameters this function type requires.
MachineRegisterInfo & MRI
MachineInstrBuilder buildZExt(unsigned Res, unsigned Op)
Build and insert Res<def> = G_ZEXT Op.
BBTy * getParent() const
Get the basic block containing the call site.
This class represents a function call, abstracting a target machine's calling convention.
const Function * getParent() const
Return the enclosing method, or null if none.
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...
unsigned createGenericVirtualRegister(LLT Ty)
Create and return a new generic virtual register with low-level type Ty.
CallingConv::ID getCallingConv() const
getCallingConv()/setCallingConv(CC) - These method get and set the calling convention of this functio...
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
static MachineOperand CreateReg(unsigned Reg, bool isDef, bool isImp=false, bool isKill=false, bool isDead=false, bool isUndef=false, bool isEarlyClobber=false, unsigned SubReg=0, bool isDebug=false, bool isInternalRead=false)
bool isVarArg() const
isVarArg - Return true if this function takes a variable number of arguments.
Reg
All possible values of the reg field in the ModR/M byte.
void setByValSize(unsigned S)
virtual bool lowerCall(MachineIRBuilder &MIRBuilder, CallingConv::ID CallConv, const MachineOperand &Callee, const ArgInfo &OrigRet, ArrayRef< ArgInfo > OrigArgs) const
This hook must be implemented to lower the given call instruction, including argument and return valu...
CallingConv::ID getCallingConv() const
Get the calling convention of the call.
MachineFunction & getMF()
Getter for the function we currently build.
void setOrigAlign(unsigned A)
size_t size() const
size - Get the array size.
constexpr char Attrs[]
Key for Kernel::Metadata::mAttrs.
bool hasAttribute(unsigned Index, Attribute::AttrKind Kind) const
Return true if the attribute exists at the given index.
iterator_range< IterTy > args() const
FunctionType * getFunctionType() const
The instances of the Type class are immutable: once they are created, they are never changed...
virtual void assignValueToReg(unsigned ValVReg, unsigned PhysReg, CCValAssign &VA)=0
The specified value has been assigned to a physical register, handle the appropriate COPY (either to ...
bool isVector() const
Return true if this is a vector value type.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
Helper class to build MachineInstr.
static MachineOperand CreateGA(const GlobalValue *GV, int64_t Offset, unsigned char TargetFlags=0)
static MVT getVT(Type *Ty, bool HandleUnknown=false)
Return the value type corresponding to the specified type.
static unsigned NumFixedArgs
Type * getType() const
Return the type of the instruction that generated this call site.
virtual unsigned getByValTypeAlignment(Type *Ty, const DataLayout &DL) const
Return the desired alignment for ByVal or InAlloca aggregate function arguments in the caller paramet...
Argument handling is mostly uniform between the four places that make these decisions: function forma...
This class contains a discriminated union of information about pointers in memory operands...
virtual unsigned assignCustomValue(const ArgInfo &Arg, ArrayRef< CCValAssign > VAs)
Handle custom values, which may be passed into one or more of VAs.
unsigned getABITypeAlignment(Type *Ty) const
Returns the minimum ABI-required alignment for the specified type.
CCState - This class holds information needed while lowering arguments and return values...
uint64_t getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
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...
Module.h This file contains the declarations for the Module class.
CCValAssign - Represent assignment of one arg/retval to a location.
This file declares the MachineIRBuilder class.
MachineInstrBuilder buildSExt(unsigned Res, unsigned Op)
Build and insert Res<def> = G_SEXT Op.
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
llvm_unreachable("Unknown RegBank!")
virtual unsigned getStackAddress(uint64_t Size, int64_t Offset, MachinePointerInfo &MPO)=0
Materialize a VReg containing the address of the specified stack-based object.
virtual void assignValueToAddress(unsigned ValVReg, unsigned Addr, uint64_t Size, MachinePointerInfo &MPO, CCValAssign &VA)=0
The specified value has been assigned to a stack location.
const DataLayout & getDataLayout() const
Get the data layout for the module's target platform.
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...
Establish a view to a call site for examination.
static MachineOperand CreateImm(int64_t Val)
void setArgFlags(ArgInfo &Arg, unsigned OpNum, const DataLayout &DL, const FuncInfoTy &FuncInfo) const
virtual bool assignArg(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, const ArgInfo &Info, CCState &State)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
FunTy * getCalledFunction() const
Return the function being called if this is a direct call, otherwise return null (if it's an indirect...
Module * getParent()
Get the module that this global value is contained inside of...
This file describes how to lower LLVM calls to machine code calls.
print Print MemDeps of function
unsigned extendRegister(unsigned ValReg, CCValAssign &VA)
unsigned getPointerSize(unsigned AS=0) const
Layout pointer size FIXME: The defaults need to be removed once all of the backends/clients are updat...
const TargetLowering * getTLI() const
Getter for generic TargetLowering class.
This file describes how to lower LLVM code to machine code.