26static std::optional<uint64_t>
31 return (MFI.*GetStackSize)();
42 ?
std::optional<
bool>(MFI.hasStackFrame())
61 if (
F.hasFnAttribute(
"ptrauth-returns"))
66 if (!
F.hasFnAttribute(
"sign-return-address"))
67 return {
false,
false};
69 StringRef Scope =
F.getFnAttribute(
"sign-return-address").getValueAsString();
71 return {
false,
false};
76 assert(Scope ==
"non-leaf");
81 if (
F.hasFnAttribute(
"ptrauth-returns"))
83 if (!
F.hasFnAttribute(
"sign-return-address-key")) {
90 F.getFnAttribute(
"sign-return-address-key").getValueAsString();
92 return Key ==
"b_key";
99 const Module *M =
F.getParent();
101 M->getModuleFlag(
"ptrauth-elf-got"));
102 if (Flag && Flag->getZExtValue() == 1)
111 if (
F.hasFnAttribute(Attribute::NoRedZone))
117 IsMTETagged =
F.hasFnAttribute(Attribute::SanitizeMemTag);
120 BranchTargetEnforcement =
F.hasFnAttribute(
"branch-target-enforcement");
121 BranchProtectionPAuthLR =
F.hasFnAttribute(
"branch-protection-pauth-lr");
130 if (
F.hasFnAttribute(
"stack-probe-size"))
131 ProbeSize =
F.getFnAttributeAsParsedInteger(
"stack-probe-size");
133 F.getParent()->getModuleFlag(
"stack-probe-size")))
134 ProbeSize = PS->getZExtValue();
135 assert(int64_t(ProbeSize) > 0 &&
"Invalid stack probe size");
138 if (!
F.hasFnAttribute(
"no-stack-arg-probe"))
139 StackProbeSize = ProbeSize;
144 ProbeSize = std::max(StackAlign, ProbeSize & ~(StackAlign - 1U));
146 if (
F.hasFnAttribute(
"probe-stack"))
147 ProbeKind =
F.getFnAttribute(
"probe-stack").getValueAsString();
149 F.getParent()->getModuleFlag(
"probe-stack")))
150 ProbeKind = PS->getString();
151 if (ProbeKind.
size()) {
152 if (ProbeKind !=
"inline-asm")
154 StackProbeSize = ProbeSize;
167 if (!SignReturnAddress)
169 if (SignReturnAddressAll)
177 [](
const auto &
Info) { return Info.getReg() == AArch64::LR; });
199 if (!NeedsDwarfUnwindInfo)
203 return *NeedsDwarfUnwindInfo;
208 if (!NeedsAsyncDwarfUnwindInfo) {
214 NeedsAsyncDwarfUnwindInfo =
219 return *NeedsAsyncDwarfUnwindInfo;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static std::pair< bool, bool > GetSignReturnAddress(const Function &F)
static std::optional< uint64_t > getSVEStackSize(const AArch64FunctionInfo &MFI, uint64_t(AArch64FunctionInfo::*GetStackSize)() const)
static bool ShouldSignWithBKey(const Function &F, const AArch64Subtarget &STI)
static bool hasELFSignedGOTHelper(const Function &F, const AArch64Subtarget *STI)
static bool isLRSpilled(const MachineFunction &MF)
Analysis containing CSE Info
This file contains the declarations for the subclasses of Constant, which represent the different fla...
Module.h This file contains the declarations for the Module class.
AArch64FunctionInfo - This class is derived from MachineFunctionInfo and contains private AArch64-spe...
bool needsShadowCallStackPrologueEpilogue(MachineFunction &MF) const
void setHasStackFrame(bool s)
bool hasStreamingModeChanges() const
bool shouldSignReturnAddress(const MachineFunction &MF) const
void setStackSizeSVE(uint64_t ZPR, uint64_t PPR)
AArch64FunctionInfo(const Function &F, const AArch64Subtarget *STI)
bool needsDwarfUnwindInfo(const MachineFunction &MF) const
bool hasCalculatedStackSizeSVE() const
void initializeBaseYamlFields(const yaml::AArch64FunctionInfo &YamlMFI)
bool needsAsyncDwarfUnwindInfo(const MachineFunction &MF) const
MachineFunctionInfo * clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF, const DenseMap< MachineBasicBlock *, MachineBasicBlock * > &Src2DstMBB) const override
Make a functionally equivalent copy of this MachineFunctionInfo in MF.
bool isTargetWindows() const
const Triple & getTargetTriple() const
bool isXRegisterReserved(size_t i) const
const AArch64FrameLowering * getFrameLowering() const override
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
bool usesWindowsCFI() const
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
bool needsFrameMoves() const
True if this function needs frame moves for debug or exceptions.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
Function & getFunction()
Return the LLVM function that this machine code represents.
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
Ty * cloneInfo(const Ty &Old)
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
A Module instance is used to store all the information related to an LLVM module.
SMEAttrs is a utility class to parse the SME ACLE attributes on functions.
StringRef - Represent a constant reference to a string, i.e.
constexpr size_t size() const
size - Get the string size.
Align getTransientStackAlign() const
getTransientStackAlignment - This method returns the number of bytes to which the stack pointer must ...
const MCAsmInfo * getMCAsmInfo() const
Return target specific asm information.
bool isOSWindows() const
Tests whether the OS is Windows.
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
std::enable_if_t< detail::IsValidPointer< X, Y >::value, X * > extract_or_null(Y &&MD)
Extract a Value from Metadata, allowing null.
This is an optimization pass for GlobalISel generic memory operations.
auto dyn_cast_or_null(const Y &Val)
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
@ Async
"Asynchronous" unwind tables (instr precise)
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)
BumpPtrAllocatorImpl BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
LLVM_ATTRIBUTE_VISIBILITY_DEFAULT AnalysisKey InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key
Implement std::hash so that hash_code can be used in STL containers.
constexpr uint64_t value() const
This is a hole in the type system and should not be abused.
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
std::optional< bool > HasRedZone
std::optional< uint64_t > StackSizePPR
AArch64FunctionInfo()=default
std::optional< bool > HasStackFrame
std::optional< uint64_t > StackSizeZPR
void mappingImpl(yaml::IO &YamlIO) override
This class should be specialized by any type that needs to be converted to/from a YAML mapping.