15 #ifndef LLVM_CODEGEN_GLOBALISEL_CALLLOWERING_H
16 #define LLVM_CODEGEN_GLOBALISEL_CALLLOWERING_H
32 class MachineIRBuilder;
34 struct MachinePointerInfo;
35 class MachineRegisterInfo;
64 : MIRBuilder(MIRBuilder), MRI(MRI), AssignFn(AssignFn) {}
105 return AssignFn(ValNo, ValVT, LocVT, LocInfo, Info.
Flags, State);
120 template <
class XXXTargetLowering>
121 const XXXTargetLowering *
getTLI()
const {
122 return static_cast<const XXXTargetLowering *
>(TLI);
125 template <
typename FuncInfoTy>
127 const FuncInfoTy &FuncInfo)
const;
134 ValueHandler &Callback)
const;
146 const Value *Val,
unsigned VReg)
const {
215 #endif // LLVM_CODEGEN_GLOBALISEL_CALLLOWERING_H
virtual bool lowerReturn(MachineIRBuilder &MIRBuilder, const Value *Val, unsigned VReg) const
This hook must be implemented to lower outgoing return values, described by Val, into the specified v...
A parsed version of the target data layout string in and methods for querying it. ...
ValueHandler(MachineIRBuilder &MIRBuilder, MachineRegisterInfo &MRI, CCAssignFn *AssignFn)
MachineRegisterInfo & MRI
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...
static const MCPhysReg VRegs[32]
ArgInfo(unsigned Reg, Type *Ty, ISD::ArgFlagsTy Flags=ISD::ArgFlagsTy{}, bool IsFixed=true)
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
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...
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
virtual ~CallLowering()=default
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 ...
const XXXTargetLowering * getTLI() const
Getter for target specific TargetLowering class.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
Helper class to build MachineInstr.
CallLowering(const TargetLowering *TLI)
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.
CCState - This class holds information needed while lowering arguments and return values...
MachineOperand class - Representation of each machine instruction operand.
CCValAssign - Represent assignment of one arg/retval to a location.
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
llvm_unreachable("Unknown RegBank!")
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
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.
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...
virtual bool lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F, ArrayRef< unsigned > VRegs) const
This hook must be implemented to lower the incoming (formal) arguments, described by Args...
Establish a view to a call site for examination.
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)
LLVM Value Representation.
print Print MemDeps of function
unsigned extendRegister(unsigned ValReg, CCValAssign &VA)
MachineIRBuilder & MIRBuilder
const TargetLowering * getTLI() const
Getter for generic TargetLowering class.
virtual ~ValueHandler()=default