#include "RISCVCallLowering.h"
#include "RISCVCallingConv.h"
#include "RISCVISelLowering.h"
#include "RISCVMachineFunctionInfo.h"
#include "RISCVSubtarget.h"
#include "llvm/CodeGen/Analysis.h"
#include "llvm/CodeGen/FunctionLoweringInfo.h"
#include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
usingnamespacellvm;
namespace {
struct RISCVOutgoingValueAssigner : public CallLowering::OutgoingValueAssigner { … };
struct RISCVOutgoingValueHandler : public CallLowering::OutgoingValueHandler { … };
struct RISCVIncomingValueAssigner : public CallLowering::IncomingValueAssigner { … };
struct RISCVIncomingValueHandler : public CallLowering::IncomingValueHandler { … };
struct RISCVFormalArgHandler : public RISCVIncomingValueHandler { … };
struct RISCVCallReturnHandler : public RISCVIncomingValueHandler { … };
}
RISCVCallLowering::RISCVCallLowering(const RISCVTargetLowering &TLI)
: … { … }
static bool isLegalElementTypeForRVV(Type *EltTy,
const RISCVSubtarget &Subtarget) { … }
static bool isSupportedArgumentType(Type *T, const RISCVSubtarget &Subtarget,
bool IsLowerArgs = false) { … }
static bool isSupportedReturnType(Type *T, const RISCVSubtarget &Subtarget,
bool IsLowerRetVal = false) { … }
bool RISCVCallLowering::lowerReturn(MachineIRBuilder &MIRBuilder,
const Value *Val, ArrayRef<Register> VRegs,
FunctionLoweringInfo &FLI) const { … }
bool RISCVCallLowering::canLowerReturn(MachineFunction &MF,
CallingConv::ID CallConv,
SmallVectorImpl<BaseArgInfo> &Outs,
bool IsVarArg) const { … }
void RISCVCallLowering::saveVarArgRegisters(
MachineIRBuilder &MIRBuilder, CallLowering::IncomingValueHandler &Handler,
IncomingValueAssigner &Assigner, CCState &CCInfo) const { … }
bool RISCVCallLowering::lowerFormalArguments(MachineIRBuilder &MIRBuilder,
const Function &F,
ArrayRef<ArrayRef<Register>> VRegs,
FunctionLoweringInfo &FLI) const { … }
bool RISCVCallLowering::lowerCall(MachineIRBuilder &MIRBuilder,
CallLoweringInfo &Info) const { … }