summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorMax Kazantsev <max.kazantsev@azul.com>2018-11-23 09:14:53 +0000
committerMax Kazantsev <max.kazantsev@azul.com>2018-11-23 09:14:53 +0000
commite1c2dc27d381f8a0bfb8b567dc80b9db55eeaf8d (patch)
tree2c051f1896066092b1a88c4000e0b847b8b026d6 /llvm/lib
parent5f8fc76b4e53b5f05bd4db6a6e1ab06da34e5e0c (diff)
downloadbcm5719-llvm-e1c2dc27d381f8a0bfb8b567dc80b9db55eeaf8d.tar.gz
bcm5719-llvm-e1c2dc27d381f8a0bfb8b567dc80b9db55eeaf8d.zip
Disable LoopSimplifyCFG terminator folding by default
llvm-svn: 347486
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp b/llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp
index 7edba7c60c5..5ca412f1a20 100644
--- a/llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp
@@ -41,6 +41,9 @@ using namespace llvm;
#define DEBUG_TYPE "loop-simplifycfg"
+static cl::opt<bool> EnableTermFolding("enable-loop-simplifycfg-term-folding",
+ cl::init(false));
+
STATISTIC(NumTerminatorsFolded,
"Number of terminators folded to unconditional branches");
@@ -352,6 +355,9 @@ public:
/// Turn branches and switches with known constant conditions into unconditional
/// branches.
static bool constantFoldTerminators(Loop &L, DominatorTree &DT, LoopInfo &LI) {
+ if (!EnableTermFolding)
+ return false;
+
// To keep things simple, only process loops with single latch. We
// canonicalize most loops to this form. We can support multi-latch if needed.
if (!L.getLoopLatch())
OpenPOWER on IntegriCloud