28struct PatchableFunction {
29 bool run(MachineFunction &
F);
34 PatchableFunctionLegacy() : MachineFunctionPass(ID) {}
35 bool runOnMachineFunction(MachineFunction &
F)
override {
36 return PatchableFunction().run(
F);
39 MachineFunctionProperties getRequiredProperties()
const override {
40 return MachineFunctionProperties().setNoVRegs();
43 void getAnalysisUsage(AnalysisUsage &AU)
const override {
55 if (!PatchableFunction().
run(MF))
67 TII->get(TargetOpcode::PATCHABLE_FUNCTION_ENTER));
73 assert(PatchType ==
"prologue-short-redirect" &&
"Only possibility today!");
77 TII->get(TargetOpcode::PATCHABLE_OP))
85char PatchableFunctionLegacy::ID = 0;
88 "Implement the 'patchable-function' attribute",
false,
false)
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
const HexagonInstrInfo * TII
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
Functions, function parameters, and return types can have attributes to indicate how they should be t...
LLVM_ABI StringRef getValueAsString() const
Return the attribute's value as a string.
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.
An RAII based helper class to modify MachineFunctionProperties when running pass.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
void ensureAlignment(Align A)
ensureAlignment - Make sure the function is at least A bytes aligned.
Function & getFunction()
Return the LLVM function that this machine code represents.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
LLVM_ABI PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
Represent a constant reference to a string, i.e.
TargetInstrInfo - Interface to description of machine instruction set.
virtual const TargetInstrInfo * getInstrInfo() const
DXILDebugInfoMap run(Module &M)
This is an optimization pass for GlobalISel generic memory operations.
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
LLVM_ABI char & PatchableFunctionID
This pass implements the "patchable-function" attribute.
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
LLVM_ABI PreservedAnalyses getMachineFunctionPassPreservedAnalyses()
Returns the minimum set of Analyses that all machine function passes must preserve.
This struct is a compact representation of a valid (non-zero power of two) alignment.