27#define DEBUG_TYPE "reset-machine-function"
29STATISTIC(NumFunctionsReset,
"Number of functions reset");
30STATISTIC(NumFunctionsVisited,
"Number of functions visited");
36 bool EmitFallbackDiag;
38 bool AbortOnFailedISel;
42 ResetMachineFunction(
bool EmitFallbackDiag =
false,
43 bool AbortOnFailedISel =
false)
45 AbortOnFailedISel(AbortOnFailedISel) {}
55 ++NumFunctionsVisited;
59 auto ClearVRegTypesOnReturn =
63 MachineFunctionProperties::Property::FailedISel)) {
64 if (AbortOnFailedISel)
71 if (EmitFallbackDiag) {
74 F.getContext().diagnose(DiagFallback);
84char ResetMachineFunction::ID = 0;
86 "Reset machine function if ISel failed",
false,
false)
90 bool AbortOnFailedISel =
false) {
91 return new ResetMachineFunction(EmitFallbackDiag, AbortOnFailedISel);
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
This file defines the make_scope_exit function, which executes user-defined cleanup logic at scope ex...
This file defines the 'Statistic' class, which is designed to be an easy way to expose various metric...
#define STATISTIC(VARNAME, DESC)
Represent the analysis usage information of a pass.
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
Diagnostic information for ISel fallback path.
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.
virtual bool runOnMachineFunction(MachineFunction &MF)=0
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
bool hasProperty(Property P) const
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
void initTargetMachineFunctionInfo(const TargetSubtargetInfo &STI)
Initialize the target specific MachineFunctionInfo.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
Function & getFunction()
Return the LLVM function that this machine code represents.
const MachineFunctionProperties & getProperties() const
Get the function properties.
void reset()
Reset the instance as if it was just created.
virtual StringRef getPassName() const
getPassName - Return a nice clean name for a pass.
StringRef - Represent a constant reference to a string, i.e.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
This is an optimization pass for GlobalISel generic memory operations.
detail::scope_exit< std::decay_t< Callable > > make_scope_exit(Callable &&F)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
MachineFunctionPass * createResetMachineFunctionPass(bool EmitFallbackDiag, bool AbortOnFailedISel)
This pass resets a MachineFunction when it has the FailedISel property as if it was just created.