Add option to createGVNPass to disable PRE.
authorEvan Cheng <evan.cheng@apple.com>
Fri, 30 Oct 2009 20:12:24 +0000 (20:12 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Fri, 30 Oct 2009 20:12:24 +0000 (20:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85609 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Transforms/Scalar.h
lib/Transforms/Scalar/GVN.cpp

index f019d3512d59275bb2c2e7af86c8a1eeb2e1353d..e01b5dd746d89fb2406ff89e7ce13b133998de92 100644 (file)
@@ -271,7 +271,7 @@ extern const PassInfo *const LCSSAID;
 // GVN - This pass performs global value numbering and redundant load 
 // elimination cotemporaneously.
 //
-FunctionPass *createGVNPass();
+FunctionPass *createGVNPass(bool NoPRE = false);
 
 //===----------------------------------------------------------------------===//
 //
index dd8859b5e845f7c6d18151e9fedd3272bed21990..33ad4e1059d120252983b557490b4a2a7da1ce0d 100644 (file)
@@ -669,9 +669,10 @@ namespace {
     bool runOnFunction(Function &F);
   public:
     static char ID; // Pass identification, replacement for typeid
-    GVN() : FunctionPass(&ID) { }
+    GVN(bool nopre = false) : FunctionPass(&ID), NoPRE(nopre) { }
 
   private:
+    bool NoPRE;
     MemoryDependenceAnalysis *MD;
     DominatorTree *DT;
 
@@ -710,7 +711,7 @@ namespace {
 }
 
 // createGVNPass - The public interface to this file...
-FunctionPass *llvm::createGVNPass() { return new GVN(); }
+FunctionPass *llvm::createGVNPass(bool NoPRE) { return new GVN(NoPRE); }
 
 static RegisterPass<GVN> X("gvn",
                            "Global Value Numbering");