LLVM
15.0.0git
|
#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>
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. 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_t * | getMaskForArgs (SmallVectorImpl< AArch64CallLowering::ArgInfo > &OutArgs, AArch64CallLowering::CallLoweringInfo &Info, const AArch64RegisterInfo &TRI, MachineFunction &MF) |
This file implements the lowering of LLVM calls to machine code calls for GlobalISel.
Definition in file AArch64CallLowering.cpp.
Definition at line 49 of file AArch64CallLowering.cpp.
Definition at line 56 of file AArch64CallLowering.cpp.
References llvm::MVT::i1, llvm::MVT::i16, and llvm::MVT::i8.
|
static |
Return true if the calling convention is one that we can guarantee TCO for.
Definition at line 664 of file AArch64CallLowering.cpp.
References llvm::CallingConv::Fast, llvm::CallingConv::SwiftTail, and llvm::CallingConv::Tail.
Referenced by llvm::AArch64CallLowering::isEligibleForTailCallOptimization().
|
static |
Definition at line 343 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 687 of file AArch64CallLowering.cpp.
References llvm::AArch64TargetLowering::CCAssignFnForCall().
Referenced by llvm::AArch64CallLowering::lowerCall().
|
static |
Definition at line 900 of file AArch64CallLowering.cpp.
References llvm::ARCISD::BL, llvm::AArch64FunctionInfo::branchTargetEnforcement(), llvm::getBLRCallOpcode(), and llvm::MachineFunction::getInfo().
Referenced by llvm::ARMCallLowering::lowerCall(), and llvm::AArch64CallLowering::lowerCall().
|
static |
Definition at line 917 of file AArch64CallLowering.cpp.
References llvm::TargetRegisterInfo::getCallPreservedMask(), Info, llvm::BitmaskEnumDetail::Mask(), and TRI.
Referenced by llvm::AArch64CallLowering::lowerCall().
|
static |
Definition at line 71 of file AArch64CallLowering.cpp.
References llvm::CCValAssign::getLocVT(), llvm::CCValAssign::getValVT(), llvm::MVT::i16, and llvm::MVT::i8.
|
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 485 of file AArch64CallLowering.cpp.
References llvm::MachineBasicBlock::addLiveIn(), llvm::MachineFunction::addLiveIn(), llvm::CCState::analyzeMustTailForwardedRegisters(), assert(), llvm::MachineIRBuilder::buildCopy(), F, llvm::MVT::f128, llvm::AArch64FunctionInfo::getForwardedMustTailRegParms(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getInfo(), llvm::MachineIRBuilder::getMBB(), llvm::MachineIRBuilder::getMF(), llvm::MachineFrameInfo::hasMustTailInVarArgFunc(), llvm::MVT::i64, llvm::CCState::isAllocated(), and MBB.
Referenced by llvm::AArch64CallLowering::lowerFormalArguments().
|
static |
Return true if we might ever do TCO for calls with this calling convention.
Definition at line 670 of file AArch64CallLowering.cpp.
References llvm::CallingConv::C, llvm::CallingConv::Fast, llvm::CallingConv::PreserveMost, llvm::CallingConv::Swift, llvm::CallingConv::SwiftTail, and llvm::CallingConv::Tail.
Referenced by llvm::AArch64CallLowering::isEligibleForTailCallOptimization().