20 : VarArgsFrameIndex(MFI.getVarArgsFrameIndex()),
21 VarArgsSaveSize(MFI.getVarArgsSaveSize()) {}
37 if (
F.hasFnAttribute(
"stack-probe-size"))
38 ProbeSize =
F.getFnAttributeAsParsedInteger(
"stack-probe-size");
39 else if (
const auto *PS = mdconst::extract_or_null<ConstantInt>(
40 F.getParent()->getModuleFlag(
"stack-probe-size")))
41 ProbeSize = PS->getZExtValue();
42 assert(int64_t(ProbeSize) > 0 &&
"Invalid stack probe size");
47 ProbeSize = std::max(StackAlign,
alignDown(ProbeSize, StackAlign));
49 if (
F.hasFnAttribute(
"probe-stack"))
50 ProbeKind =
F.getFnAttribute(
"probe-stack").getValueAsString();
51 else if (
const auto *PS = dyn_cast_or_null<MDString>(
52 F.getParent()->getModuleFlag(
"probe-stack")))
53 ProbeKind = PS->getString();
54 if (ProbeKind.
size()) {
55 StackProbeSize = ProbeSize;
63 return InterruptStackKind::None;
66 "Interrupt functions should not having incoming varargs");
73 .
Case(
"qci-nest", InterruptStackKind::QCINest)
74 .
Case(
"qci-nonest", InterruptStackKind::QCINoNest)
75 .
Case(
"SiFive-CLIC-preemptible",
76 InterruptStackKind::SiFiveCLICPreemptible)
77 .
Case(
"SiFive-CLIC-stack-swap", InterruptStackKind::SiFiveCLICStackSwap)
78 .
Case(
"SiFive-CLIC-preemptible-stack-swap",
79 InterruptStackKind::SiFiveCLICPreemptibleStackSwap)
80 .
Default(InterruptStackKind::None);
93 return PushPopKind::None;
96 if (useSiFiveInterrupt(MF))
97 return PushPopKind::None;
102 return PushPopKind::StdExtZcmp;
107 return PushPopKind::VendorXqccmp;
109 return PushPopKind::None;
114 switch (getInterruptStackKind(MF)) {
115 case InterruptStackKind::QCINest:
116 case InterruptStackKind::QCINoNest:
123 switch (getPushPopKind(MF)) {
124 case PushPopKind::VendorXqccmp:
142 SExt32Registers.push_back(Reg);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Module.h This file contains the declarations for the Module class.
LLVM_ABI StringRef getValueAsString() const
Return the attribute's value as a string.
Allocate memory in an ever growing pool, as if by bump-pointer.
Attribute getFnAttribute(Attribute::AttrKind Kind) const
Return the attribute for the given attribute kind.
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
Function & getFunction()
Return the LLVM function that this machine code represents.
Ty * cloneInfo(const Ty &Old)
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
RISCVMachineFunctionInfo - This class is derived from MachineFunctionInfo and contains private RISCV-...
bool hasImplicitFPUpdates(const MachineFunction &MF) const
void initializeBaseYamlFields(const yaml::RISCVMachineFunctionInfo &YamlMFI)
InterruptStackKind getInterruptStackKind(const MachineFunction &MF) const
bool isSExt32Register(Register Reg) const
MachineFunctionInfo * clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF, const DenseMap< MachineBasicBlock *, MachineBasicBlock * > &Src2DstMBB) const override
Make a functionally equivalent copy of this MachineFunctionInfo in MF.
PushPopKind getPushPopKind(const MachineFunction &MF) const
void addSExt32Register(Register Reg)
const RISCVFrameLowering * getFrameLowering() const override
Wrapper class representing virtual and physical registers.
StringRef - Represent a constant reference to a string, i.e.
constexpr size_t size() const
size - Get the string size.
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
Align getTransientStackAlign() const
getTransientStackAlignment - This method returns the number of bytes to which the stack pointer must ...
LLVM_ABI bool DisableFramePointerElim(const MachineFunction &MF) const
DisableFramePointerElim - This returns true if frame pointer elimination optimization should be disab...
This is an optimization pass for GlobalISel generic memory operations.
constexpr T alignDown(U Value, V Align, W Skew=0)
Returns the largest unsigned integer less than or equal to Value and is Skew mod Align.
bool is_contained(R &&Range, const E &Element)
Returns true if Element is found in Range.
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...
void mappingImpl(yaml::IO &YamlIO) override
RISCVMachineFunctionInfo()=default