LLVM  16.0.0git
Macros | Functions
AArch64CallLowering.cpp File Reference
#include "AArch64CallLowering.h"
#include "AArch64ISelLowering.h"
#include "AArch64MachineFunctionInfo.h"
#include "AArch64Subtarget.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Analysis/ObjCARCUtil.h"
#include "llvm/CodeGen/Analysis.h"
#include "llvm/CodeGen/CallingConvLower.h"
#include "llvm/CodeGen/FunctionLoweringInfo.h"
#include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h"
#include "llvm/CodeGen/GlobalISel/Utils.h"
#include "llvm/CodeGen/LowLevelType.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineMemOperand.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/IR/Argument.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Value.h"
#include "llvm/Support/MachineValueType.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <iterator>
Include dependency graph for AArch64CallLowering.cpp:

Go to the source code of this file.


#define DEBUG_TYPE   "aarch64-call-lowering"


static void applyStackPassedSmallTypeDAGHack (EVT OrigVT, MVT &ValVT, MVT &LocVT)
static LLT getStackValueStoreTypeHack (const CCValAssign &VA)
static bool doesCalleeRestoreStack (CallingConv::ID CallConv, bool TailCallOpt)
static void handleMustTailForwardedRegisters (MachineIRBuilder &MIRBuilder, CCAssignFn *AssignFn)
 Helper function to compute forwarded registers for musttail calls. More...
static bool canGuaranteeTCO (CallingConv::ID CC, bool GuaranteeTailCalls)
 Return true if the calling convention is one that we can guarantee TCO for. More...
static bool mayTailCallThisCC (CallingConv::ID CC)
 Return true if we might ever do TCO for calls with this calling convention. More...
static std::pair< CCAssignFn *, CCAssignFn * > getAssignFnsForCC (CallingConv::ID CC, const AArch64TargetLowering &TLI)
 Returns a pair containing the fixed CCAssignFn and the vararg CCAssignFn for CC. More...
static unsigned getCallOpcode (const MachineFunction &CallerF, bool IsIndirect, bool IsTailCall)
static const uint32_tgetMaskForArgs (SmallVectorImpl< AArch64CallLowering::ArgInfo > &OutArgs, AArch64CallLowering::CallLoweringInfo &Info, const AArch64RegisterInfo &TRI, MachineFunction &MF)

Detailed Description

This file implements the lowering of LLVM calls to machine code calls for GlobalISel.

Definition in file AArch64CallLowering.cpp.

Macro Definition Documentation


#define DEBUG_TYPE   "aarch64-call-lowering"

Definition at line 49 of file AArch64CallLowering.cpp.

Function Documentation

◆ applyStackPassedSmallTypeDAGHack()

static void applyStackPassedSmallTypeDAGHack ( EVT  OrigVT,

Definition at line 56 of file AArch64CallLowering.cpp.

References llvm::MVT::i1, llvm::MVT::i16, and llvm::MVT::i8.

◆ canGuaranteeTCO()

static bool canGuaranteeTCO ( CallingConv::ID  CC,
bool  GuaranteeTailCalls 

Return true if the calling convention is one that we can guarantee TCO for.

Definition at line 673 of file AArch64CallLowering.cpp.

References CC, llvm::CallingConv::Fast, llvm::CallingConv::SwiftTail, and llvm::CallingConv::Tail.

Referenced by llvm::AArch64CallLowering::isEligibleForTailCallOptimization().

◆ doesCalleeRestoreStack()

static bool doesCalleeRestoreStack ( CallingConv::ID  CallConv,
bool  TailCallOpt 

◆ getAssignFnsForCC()

static std::pair<CCAssignFn *, CCAssignFn *> getAssignFnsForCC ( CallingConv::ID  CC,
const AArch64TargetLowering TLI 

Returns a pair containing the fixed CCAssignFn and the vararg CCAssignFn for CC.

Definition at line 696 of file AArch64CallLowering.cpp.

References CC, and llvm::AArch64TargetLowering::CCAssignFnForCall().

Referenced by llvm::AArch64CallLowering::lowerCall().

◆ getCallOpcode()

static unsigned getCallOpcode ( const MachineFunction CallerF,
bool  IsIndirect,
bool  IsTailCall 

◆ getMaskForArgs()

static const uint32_t* getMaskForArgs ( SmallVectorImpl< AArch64CallLowering::ArgInfo > &  OutArgs,
AArch64CallLowering::CallLoweringInfo &  Info,
const AArch64RegisterInfo TRI,
MachineFunction MF 

◆ getStackValueStoreTypeHack()

static LLT getStackValueStoreTypeHack ( const CCValAssign VA)

◆ handleMustTailForwardedRegisters()

static void handleMustTailForwardedRegisters ( MachineIRBuilder MIRBuilder,
CCAssignFn *  AssignFn 

◆ mayTailCallThisCC()

static bool mayTailCallThisCC ( CallingConv::ID  CC)