summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Pop <sebpop@gmail.com>2018-09-10 15:07:59 +0000
committerSebastian Pop <sebpop@gmail.com>2018-09-10 15:07:59 +0000
commit6284b54ccd8b276cd46673d7df9fb1125c51a352 (patch)
treedd60875c72ff517e2979f2ca3f9a4a5c30a38d2d
parentea0a91298dd417df06bb90c9b107984d0b5aa28c (diff)
downloadbcm5719-llvm-6284b54ccd8b276cd46673d7df9fb1125c51a352.tar.gz
bcm5719-llvm-6284b54ccd8b276cd46673d7df9fb1125c51a352.zip
add flag instead of using a constant [NFC]
llvm-svn: 341837
-rw-r--r--llvm/lib/Transforms/Scalar/GVN.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp
index 7486d5f0df5..185b2238463 100644
--- a/llvm/lib/Transforms/Scalar/GVN.cpp
+++ b/llvm/lib/Transforms/Scalar/GVN.cpp
@@ -105,6 +105,10 @@ static cl::opt<uint32_t>
MaxRecurseDepth("gvn-max-recurse-depth", cl::Hidden, cl::init(1000), cl::ZeroOrMore,
cl::desc("Max recurse depth in GVN (default = 1000)"));
+static cl::opt<uint32_t> MaxNumDeps(
+ "gvn-max-num-deps", cl::Hidden, cl::init(100), cl::ZeroOrMore,
+ cl::desc("Max number of dependences to attempt Load PRE (default = 100)"));
+
struct llvm::GVN::Expression {
uint32_t opcode;
Type *type;
@@ -1311,7 +1315,7 @@ bool GVN::processNonLocalLoad(LoadInst *LI) {
// dependencies, this load isn't worth worrying about. Optimizing
// it will be too expensive.
unsigned NumDeps = Deps.size();
- if (NumDeps > 100)
+ if (NumDeps > MaxNumDeps)
return false;
// If we had a phi translation failure, we'll have a single entry which is a
OpenPOWER on IntegriCloud