|
LLVM 22.0.0git
|
This class implements a mechanism to disable passes and individual optimizations at compile time based on a command line option (-opt-bisect) in order to perform a bisecting search for optimization-related problems. More...
#include "llvm/IR/OptBisect.h"
Public Member Functions | |
| OptBisect ()=default | |
| Default constructor. | |
| ~OptBisect () override=default | |
| bool | shouldRunPass (StringRef PassName, StringRef IRDescription) const override |
| Checks the bisect intervals to determine if the specified pass should run. | |
| bool | isEnabled () const override |
| isEnabled() should return true before calling shouldRunPass(). | |
| void | setIntervals (IntegerInclusiveIntervalUtils::IntervalList Intervals) |
| Set intervals directly from an IntervalList. | |
| void | clearIntervals () |
| Clear all intervals, effectively disabling bisection. | |
| Public Member Functions inherited from llvm::OptPassGate | |
| virtual | ~OptPassGate ()=default |
This class implements a mechanism to disable passes and individual optimizations at compile time based on a command line option (-opt-bisect) in order to perform a bisecting search for optimization-related problems.
Definition at line 45 of file OptBisect.h.
|
default |
Default constructor.
Initializes the state to "disabled". The bisection will be enabled by the cl::opt call-back when the command line option is processed. Clients should not instantiate this class directly. All access should go through LLVMContext.
|
overridedefault |
References PassName, and shouldRunPass().
|
inline |
Clear all intervals, effectively disabling bisection.
Definition at line 78 of file OptBisect.h.
|
inlineoverridevirtual |
isEnabled() should return true before calling shouldRunPass().
Reimplemented from llvm::OptPassGate.
Definition at line 70 of file OptBisect.h.
Referenced by shouldRunPass().
|
inline |
Set intervals directly from an IntervalList.
Definition at line 73 of file OptBisect.h.
Checks the bisect intervals to determine if the specified pass should run.
The method prints the name of the pass, its assigned bisect number, and whether or not the pass will be executed. It returns true if the pass should run, i.e. if no intervals are specified or the current pass number falls within one of the specified intervals.
Most passes should not call this routine directly. Instead, it is called through helper routines provided by the base classes of the pass. For instance, function passes should call FunctionPass::skipFunction().
Reimplemented from llvm::OptPassGate.
Definition at line 105 of file OptBisect.cpp.
References assert(), llvm::IntegerInclusiveIntervalUtils::contains(), isEnabled(), OptBisectVerbose, PassName, and printPassMessage().
Referenced by ~OptBisect().