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) {}
73 virtual unsigned getStackAddress(uint64_t
Size, int64_t
Offset,
79 virtual void assignValueToReg(
unsigned ValVReg,
unsigned PhysReg,
85 virtual void assignValueToAddress(
unsigned ValVReg,
unsigned Addr,
100 unsigned extendRegister(
unsigned ValReg,
CCValAssign &VA);
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;
146 const Value *Val,
unsigned VReg)
const {
215 #endif // LLVM_CODEGEN_GLOBALISEL_CALLLOWERING_H A parsed version of the target data layout string in and methods for querying it. ...
ValueHandler(MachineIRBuilder &MIRBuilder, MachineRegisterInfo &MRI, CCAssignFn *AssignFn)
Compute iterated dominance frontiers using a linear time algorithm.
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)
bool handleAssignments(MachineIRBuilder &MIRBuilder, ArrayRef< ArgInfo > Args, ValueHandler &Handler) const
Invoke Handler::assignArg on each of the given Args and then use Callback to move them to the assigne...
const TargetLowering * getTLI() const
Getter for generic TargetLowering class.
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...
const XXXTargetLowering * getTLI() const
Getter for target specific TargetLowering class.
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
amdgpu Simplify well known AMD library false Value * Callee
virtual ~CallLowering()=default
unsigned const MachineRegisterInfo * MRI
The instances of the Type class are immutable: once they are created, they are never changed...
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...
void setArgFlags(ArgInfo &Arg, unsigned OpIdx, const DataLayout &DL, const FuncInfoTy &FuncInfo) const
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...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
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.
amdgpu Simplify well known AMD library false Value Value * Arg
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
Establish a view to a call site for examination.
virtual bool assignArg(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, const ArgInfo &Info, CCState &State)
LLVM Value Representation.
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
print Print MemDeps of function
MachineIRBuilder & MIRBuilder
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...
constexpr char Args[]
Key for Kernel::Metadata::mArgs.