summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2008-06-19 19:57:25 +0000
committerOwen Anderson <resistor@mac.com>2008-06-19 19:57:25 +0000
commite780d66657df0cc4047e8e21f7d477d80a47eab6 (patch)
treeb9ad3adb2e5bc1927cbe092473b65d1241d3ce3c /llvm/lib
parentfdf9f168b53406dff92a2cddea70ad2d1ca0967f (diff)
downloadbcm5719-llvm-e780d66657df0cc4047e8e21f7d477d80a47eab6.tar.gz
bcm5719-llvm-e780d66657df0cc4047e8e21f7d477d80a47eab6.zip
Add a hidden -disable-pre flag for testing purposes. This should be removed
once benchmarking is completed. llvm-svn: 52506
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/GVN.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp
index cbc24eda56f..88377d51ce7 100644
--- a/llvm/lib/Transforms/Scalar/GVN.cpp
+++ b/llvm/lib/Transforms/Scalar/GVN.cpp
@@ -32,6 +32,7 @@
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/MemoryDependenceAnalysis.h"
#include "llvm/Support/CFG.h"
+#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
@@ -41,6 +42,9 @@ STATISTIC(NumGVNInstr, "Number of instructions deleted");
STATISTIC(NumGVNLoad, "Number of loads deleted");
STATISTIC(NumGVNPRE, "Number of instructions PRE'd");
+static cl::opt<bool> DisablePRE("disable-pre",
+ cl::init(false), cl::Hidden);
+
//===----------------------------------------------------------------------===//
// ValueTable Class
//===----------------------------------------------------------------------===//
@@ -1285,7 +1289,9 @@ bool GVN::iterateOnFunction(Function &F) {
for (df_iterator<DomTreeNode*> DI = df_begin(DT.getRootNode()),
DE = df_end(DT.getRootNode()); DI != DE; ++DI)
changed |= processBlock(*DI);
-
- changed |= performPRE(F);
+
+ if (!DisablePRE)
+ changed |= performPRE(F);
+
return changed;
}
OpenPOWER on IntegriCloud