LLVM 20.0.0git
|
This file implements the lowering of LLVM calls to machine code calls for GlobalISel. More...
#include "AArch64CallLowering.h"
#include "AArch64GlobalISelUtils.h"
#include "AArch64ISelLowering.h"
#include "AArch64MachineFunctionInfo.h"
#include "AArch64RegisterInfo.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/LowLevelTypeUtils.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/CodeGenTypes/MachineValueType.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 <algorithm>
#include <cassert>
#include <cstdint>
#include <iterator>
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "aarch64-call-lowering" |
Functions | |
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. | |
static bool | canGuaranteeTCO (CallingConv::ID CC, bool GuaranteeTailCalls) |
Return true if the calling convention is one that we can guarantee TCO for. | |
static bool | mayTailCallThisCC (CallingConv::ID CC) |
Return true if we might ever do TCO for calls with this calling convention. | |
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. | |
static unsigned | getCallOpcode (const MachineFunction &CallerF, bool IsIndirect, bool IsTailCall, std::optional< CallLowering::PtrAuthInfo > &PAI, MachineRegisterInfo &MRI) |
static const uint32_t * | getMaskForArgs (SmallVectorImpl< AArch64CallLowering::ArgInfo > &OutArgs, AArch64CallLowering::CallLoweringInfo &Info, const AArch64RegisterInfo &TRI, MachineFunction &MF) |
Variables | |
cl::opt< bool > | EnableSVEGISel |
This file implements the lowering of LLVM calls to machine code calls for GlobalISel.
Definition in file AArch64CallLowering.cpp.
#define DEBUG_TYPE "aarch64-call-lowering" |
Definition at line 51 of file AArch64CallLowering.cpp.
Definition at line 61 of file AArch64CallLowering.cpp.
|
static |
Return true if the calling convention is one that we can guarantee TCO for.
Definition at line 781 of file AArch64CallLowering.cpp.
References CC, llvm::CallingConv::Fast, llvm::CallingConv::SwiftTail, and llvm::CallingConv::Tail.
|
static |
Definition at line 352 of file AArch64CallLowering.cpp.
References llvm::CallingConv::Fast, llvm::CallingConv::SwiftTail, and llvm::CallingConv::Tail.
Referenced by llvm::AArch64CallLowering::lowerCall(), and llvm::AArch64CallLowering::lowerFormalArguments().
|
static |
Returns a pair containing the fixed CCAssignFn and the vararg CCAssignFn for CC.
Definition at line 806 of file AArch64CallLowering.cpp.
References CC, and llvm::AArch64TargetLowering::CCAssignFnForCall().
Referenced by llvm::AMDGPUCallLowering::areCalleeOutgoingArgsTailCallable(), llvm::AMDGPUCallLowering::doCallerAndCalleePassArgsTheSameWay(), llvm::AArch64CallLowering::lowerCall(), llvm::AMDGPUCallLowering::lowerCall(), and llvm::AMDGPUCallLowering::lowerTailCall().
|
static |
Definition at line 1022 of file AArch64CallLowering.cpp.
References assert(), llvm::AArch64FunctionInfo::branchProtectionPAuthLR(), llvm::AArch64FunctionInfo::branchTargetEnforcement(), llvm::getBLRCallOpcode(), llvm::MachineFunction::getInfo(), llvm::AArch64PACKey::IA, and llvm::AArch64PACKey::IB.
Referenced by llvm::AArch64CallLowering::lowerCall(), llvm::AMDGPUCallLowering::lowerCall(), llvm::ARMCallLowering::lowerCall(), and llvm::AMDGPUCallLowering::lowerTailCall().
|
static |
Definition at line 1064 of file AArch64CallLowering.cpp.
References llvm::SmallVectorBase< Size_T >::empty(), Info, and TRI.
Referenced by llvm::AArch64CallLowering::lowerCall().
|
static |
Definition at line 76 of file AArch64CallLowering.cpp.
References llvm::CCValAssign::getLocVT(), and llvm::CCValAssign::getValVT().
|
static |
Helper function to compute forwarded registers for musttail calls.
Computes the forwarded registers, sets MBB liveness, and emits COPY instructions that can be used to save + restore registers later.
Definition at line 489 of file AArch64CallLowering.cpp.
References llvm::MachineBasicBlock::addLiveIn(), llvm::MachineFunction::addLiveIn(), llvm::CCState::analyzeMustTailForwardedRegisters(), assert(), llvm::MachineIRBuilder::buildCopy(), F, llvm::AArch64FunctionInfo::getForwardedMustTailRegParms(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getInfo(), llvm::MachineIRBuilder::getMBB(), llvm::MachineIRBuilder::getMF(), llvm::MachineFrameInfo::hasMustTailInVarArgFunc(), llvm::CCState::isAllocated(), MBB, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by llvm::AArch64CallLowering::lowerFormalArguments().
|
static |
Return true if we might ever do TCO for calls with this calling convention.
Definition at line 787 of file AArch64CallLowering.cpp.
References llvm::CallingConv::C, CC, llvm::CallingConv::Fast, llvm::CallingConv::PreserveAll, llvm::CallingConv::PreserveMost, llvm::CallingConv::PreserveNone, llvm::CallingConv::Swift, llvm::CallingConv::SwiftTail, and llvm::CallingConv::Tail.