summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/Transforms/Scalar.h2
-rw-r--r--llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h3
-rw-r--r--llvm/include/llvm/Transforms/Utils/Local.h10
3 files changed, 12 insertions, 3 deletions
diff --git a/llvm/include/llvm/Transforms/Scalar.h b/llvm/include/llvm/Transforms/Scalar.h
index 07d3d7fc8f6..6fe35b441b5 100644
--- a/llvm/include/llvm/Transforms/Scalar.h
+++ b/llvm/include/llvm/Transforms/Scalar.h
@@ -267,7 +267,7 @@ FunctionPass *createJumpThreadingPass(int Threshold = -1);
//
FunctionPass *createCFGSimplificationPass(
unsigned Threshold = 1, bool ForwardSwitchCond = false,
- bool ConvertSwitch = false, bool KeepLoops = true,
+ bool ConvertSwitch = false, bool KeepLoops = true, bool SinkCommon = false,
std::function<bool(const Function &)> Ftor = nullptr);
//===----------------------------------------------------------------------===//
diff --git a/llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h b/llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h
index ed6b1b1853b..1afb9c7f954 100644
--- a/llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h
+++ b/llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h
@@ -39,7 +39,8 @@ public:
: SimplifyCFGPass(SimplifyCFGOptions()
.forwardSwitchCondToPhi(false)
.convertSwitchToLookupTable(false)
- .needCanonicalLoops(true)) {}
+ .needCanonicalLoops(true)
+ .sinkCommonInsts(false)) {}
/// Construct a pass with optional optimizations.
diff --git a/llvm/include/llvm/Transforms/Utils/Local.h b/llvm/include/llvm/Transforms/Utils/Local.h
index 6d8d8591fa1..7dd21dfc1a8 100644
--- a/llvm/include/llvm/Transforms/Utils/Local.h
+++ b/llvm/include/llvm/Transforms/Utils/Local.h
@@ -63,16 +63,20 @@ struct SimplifyCFGOptions {
bool ForwardSwitchCondToPhi;
bool ConvertSwitchToLookupTable;
bool NeedCanonicalLoop;
+ bool SinkCommonInsts;
AssumptionCache *AC;
SimplifyCFGOptions(unsigned BonusThreshold = 1,
bool ForwardSwitchCond = false,
bool SwitchToLookup = false, bool CanonicalLoops = true,
+ bool SinkCommon = false,
AssumptionCache *AssumpCache = nullptr)
: BonusInstThreshold(BonusThreshold),
ForwardSwitchCondToPhi(ForwardSwitchCond),
ConvertSwitchToLookupTable(SwitchToLookup),
- NeedCanonicalLoop(CanonicalLoops), AC(AssumpCache) {}
+ NeedCanonicalLoop(CanonicalLoops),
+ SinkCommonInsts(SinkCommon),
+ AC(AssumpCache) {}
// Support 'builder' pattern to set members by name at construction time.
SimplifyCFGOptions &bonusInstThreshold(int I) {
@@ -91,6 +95,10 @@ struct SimplifyCFGOptions {
NeedCanonicalLoop = B;
return *this;
}
+ SimplifyCFGOptions &sinkCommonInsts(bool B) {
+ SinkCommonInsts = B;
+ return *this;
+ }
SimplifyCFGOptions &setAssumptionCache(AssumptionCache *Cache) {
AC = Cache;
return *this;
OpenPOWER on IntegriCloud