[llvm] r341837 - add flag instead of using a constant [NFC]

Sebastian Pop via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 10 08:08:00 PDT 2018


Author: spop
Date: Mon Sep 10 08:07:59 2018
New Revision: 341837

URL: http://llvm.org/viewvc/llvm-project?rev=341837&view=rev
Log:
add flag instead of using a constant [NFC]

Modified:
    llvm/trunk/lib/Transforms/Scalar/GVN.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=341837&r1=341836&r2=341837&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Mon Sep 10 08:07:59 2018
@@ -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 *
   // 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




More information about the llvm-commits mailing list