summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@codeaurora.org>2017-08-10 14:12:57 +0000
committerChad Rosier <mcrosier@codeaurora.org>2017-08-10 14:12:57 +0000
commita5508e3119ad88fc90691638f7e0c1ed356fc21e (patch)
tree1161bb4174d61e74a30bf0c5080004f23971243e /llvm/lib
parent136b54374551ff71a68772c89b180752914ea83e (diff)
downloadbcm5719-llvm-a5508e3119ad88fc90691638f7e0c1ed356fc21e.tar.gz
bcm5719-llvm-a5508e3119ad88fc90691638f7e0c1ed356fc21e.zip
[NewGVN] Add CL option to control the generation of phi-of-ops (disable by default).
Differential Revision: https://reviews.llvm.org/D36478539 llvm-svn: 310594
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/NewGVN.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/NewGVN.cpp b/llvm/lib/Transforms/Scalar/NewGVN.cpp
index e620ae9c557..ceb53502f98 100644
--- a/llvm/lib/Transforms/Scalar/NewGVN.cpp
+++ b/llvm/lib/Transforms/Scalar/NewGVN.cpp
@@ -127,6 +127,10 @@ DEBUG_COUNTER(PHIOfOpsCounter, "newgvn-phi",
static cl::opt<bool> EnableStoreRefinement("enable-store-refinement",
cl::init(false), cl::Hidden);
+/// Currently, the generation "phi of ops" can result in correctness issues.
+static cl::opt<bool> EnablePhiOfOps("enable-phi-of-ops", cl::init(false),
+ cl::Hidden);
+
//===----------------------------------------------------------------------===//
// GVN Pass
//===----------------------------------------------------------------------===//
@@ -2442,6 +2446,8 @@ void NewGVN::addPhiOfOps(PHINode *Op, BasicBlock *BB,
}
static bool okayForPHIOfOps(const Instruction *I) {
+ if (!EnablePhiOfOps)
+ return false;
return isa<BinaryOperator>(I) || isa<SelectInst>(I) || isa<CmpInst>(I) ||
isa<LoadInst>(I);
}
OpenPOWER on IntegriCloud