From aa0b63422a2170c82e89215bcb7c5c383df62989 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Thu, 19 Jun 2008 19:57:25 +0000 Subject: [PATCH] Add a hidden -disable-pre flag for testing purposes. This should be removed once benchmarking is completed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52506 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/GVN.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp index cbc24eda56f..88377d51ce7 100644 --- a/lib/Transforms/Scalar/GVN.cpp +++ b/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 DisablePRE("disable-pre", + cl::init(false), cl::Hidden); + //===----------------------------------------------------------------------===// // ValueTable Class //===----------------------------------------------------------------------===// @@ -1285,7 +1289,9 @@ bool GVN::iterateOnFunction(Function &F) { for (df_iterator 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; } -- 2.34.1