LLVM 20.0.0git
|
A pass to simplify and canonicalize the CFG of a function. More...
#include "llvm/Transforms/Scalar/SimplifyCFG.h"
Public Member Functions | |
SimplifyCFGPass () | |
The default constructor sets the pass options to create canonical IR, rather than optimal IR. | |
SimplifyCFGPass (const SimplifyCFGOptions &PassOptions) | |
Construct a pass with optional optimizations. | |
PreservedAnalyses | run (Function &F, FunctionAnalysisManager &AM) |
Run the pass over the function. | |
void | printPipeline (raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName) |
Public Member Functions inherited from llvm::PassInfoMixin< SimplifyCFGPass > | |
void | printPipeline (raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName) |
Additional Inherited Members | |
Static Public Member Functions inherited from llvm::PassInfoMixin< SimplifyCFGPass > | |
static StringRef | name () |
Gets the name of the pass we are mixed into. | |
A pass to simplify and canonicalize the CFG of a function.
This pass iteratively simplifies the entire CFG of a function. It may change or remove control flow to put the CFG into a canonical form expected by other passes of the mid-level optimizer. Depending on the specified options, it may further optimize control-flow to create non-canonical forms.
Definition at line 29 of file SimplifyCFG.h.
SimplifyCFGPass::SimplifyCFGPass | ( | ) |
The default constructor sets the pass options to create canonical IR, rather than optimal IR.
That is, by default we bypass transformations that are likely to improve performance but make analysis for other passes more difficult.
Definition at line 335 of file SimplifyCFGPass.cpp.
References applyCommandLineOverridesToOptions().
SimplifyCFGPass::SimplifyCFGPass | ( | const SimplifyCFGOptions & | PassOptions | ) |
Construct a pass with optional optimizations.
Definition at line 339 of file SimplifyCFGPass.cpp.
References applyCommandLineOverridesToOptions().
void SimplifyCFGPass::printPipeline | ( | raw_ostream & | OS, |
function_ref< StringRef(StringRef)> | MapClassName2PassName | ||
) |
Definition at line 344 of file SimplifyCFGPass.cpp.
References llvm::SimplifyCFGOptions::BonusInstThreshold, llvm::SimplifyCFGOptions::ConvertSwitchRangeToICmp, llvm::SimplifyCFGOptions::ConvertSwitchToLookupTable, llvm::SimplifyCFGOptions::ForwardSwitchCondToPhi, llvm::SimplifyCFGOptions::HoistCommonInsts, llvm::SimplifyCFGOptions::NeedCanonicalLoop, OS, printPipeline(), llvm::SimplifyCFGOptions::SimplifyCondBranch, llvm::SimplifyCFGOptions::SinkCommonInsts, llvm::SimplifyCFGOptions::SpeculateBlocks, and llvm::SimplifyCFGOptions::SpeculateUnpredictables.
Referenced by printPipeline().
PreservedAnalyses SimplifyCFGPass::run | ( | Function & | F, |
FunctionAnalysisManager & | AM | ||
) |
Run the pass over the function.
Definition at line 365 of file SimplifyCFGPass.cpp.
References llvm::SimplifyCFGOptions::AC, llvm::PreservedAnalyses::all(), F, llvm::AnalysisManager< IRUnitT, ExtraArgTs >::getResult(), llvm::PreservedAnalyses::preserve(), llvm::RequireAndPreserveDomTree, and simplifyFunctionCFG().