summaryrefslogtreecommitdiffstats
path: root/llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h')
-rw-r--r--llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h b/llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h
index ef47fa8e684..e955673283e 100644
--- a/llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h
+++ b/llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h
@@ -31,8 +31,16 @@ class SimplifyCFGPass : public PassInfoMixin<SimplifyCFGPass> {
SimplifyCFGOptions Options;
public:
- /// Construct a pass with default options.
- SimplifyCFGPass();
+ /// The default constructor sets the pass options to create optimal IR,
+ /// rather than canonical IR. That is, by default we do transformations that
+ /// are likely to improve performance but make analysis more difficult.
+ /// FIXME: This is inverted from what most instantiations of the pass should
+ /// be.
+ SimplifyCFGPass()
+ : SimplifyCFGPass(SimplifyCFGOptions()
+ .forwardSwitchCondToPhi(true)
+ .convertSwitchToLookupTable(true)
+ .needCanonicalLoops(false)) {}
/// Construct a pass with optional optimizations.
SimplifyCFGPass(const SimplifyCFGOptions &PassOptions);
OpenPOWER on IntegriCloud