[llvm-commits] [llvm] r115337 - in /llvm/trunk: lib/Transforms/Scalar/GVN.cpp test/Transforms/GVN/2010-03-31-RedundantPHIs.ll

Owen Anderson resistor at mac.com
Fri Oct 1 13:02:55 PDT 2010


Author: resistor
Date: Fri Oct  1 15:02:55 2010
New Revision: 115337

URL: http://llvm.org/viewvc/llvm-project?rev=115337&view=rev
Log:
Now that the profitable bits of EnableFullLoadPRE have been enabled by default, rip out the remainder.
Anyone interested in more general PRE would be better served by implementing it separately, to get real
anticipation calculation, etc.

Modified:
    llvm/trunk/lib/Transforms/Scalar/GVN.cpp
    llvm/trunk/test/Transforms/GVN/2010-03-31-RedundantPHIs.ll

Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=115337&r1=115336&r2=115337&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Fri Oct  1 15:02:55 2010
@@ -61,7 +61,6 @@
 static cl::opt<bool> EnablePRE("enable-pre",
                                cl::init(true), cl::Hidden);
 static cl::opt<bool> EnableLoadPRE("enable-load-pre", cl::init(true));
-static cl::opt<bool> EnableFullLoadPRE("enable-full-load-pre", cl::init(false));
 
 //===----------------------------------------------------------------------===//
 //                         ValueTable Class
@@ -1604,14 +1603,13 @@
   unsigned NumUnavailablePreds = PredLoads.size();
   assert(NumUnavailablePreds != 0 &&
          "Fully available value should be eliminated above!");
-  if (!EnableFullLoadPRE) {
-    // If this load is unavailable in multiple predecessors, reject it.
-    // FIXME: If we could restructure the CFG, we could make a common pred with
-    // all the preds that don't have an available LI and insert a new load into
-    // that one block.
-    if (NumUnavailablePreds != 1)
+  
+  // If this load is unavailable in multiple predecessors, reject it.
+  // FIXME: If we could restructure the CFG, we could make a common pred with
+  // all the preds that don't have an available LI and insert a new load into
+  // that one block.
+  if (NumUnavailablePreds != 1)
       return false;
-  }
 
   // Check if the load can safely be moved to all the unavailable predecessors.
   bool CanDoPRE = true;

Modified: llvm/trunk/test/Transforms/GVN/2010-03-31-RedundantPHIs.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/2010-03-31-RedundantPHIs.ll?rev=115337&r1=115336&r2=115337&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/GVN/2010-03-31-RedundantPHIs.ll (original)
+++ llvm/trunk/test/Transforms/GVN/2010-03-31-RedundantPHIs.ll Fri Oct  1 15:02:55 2010
@@ -1,4 +1,4 @@
-; RUN: opt < %s -gvn -enable-full-load-pre -S | FileCheck %s
+; RUN: opt < %s -gvn -S | FileCheck %s
 
 define i8* @cat(i8* %s1, ...) nounwind {
 entry:





More information about the llvm-commits mailing list