[llvm-commits] CVS: llvm/lib/Transforms/Scalar/GVNPRE.cpp

Owen Anderson resistor at mac.com
Wed Jun 20 18:59:27 PDT 2007



Changes in directory llvm/lib/Transforms/Scalar:

GVNPRE.cpp updated: 1.47 -> 1.48
---
Log message:

Eliminate a redundant check.  This speeds up optimization of 253.perlbmk from 13.5 seconds to 10.9 seconds.


---
Diffs of the changes:  (+3 -7)

 GVNPRE.cpp |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)


Index: llvm/lib/Transforms/Scalar/GVNPRE.cpp
diff -u llvm/lib/Transforms/Scalar/GVNPRE.cpp:1.47 llvm/lib/Transforms/Scalar/GVNPRE.cpp:1.48
--- llvm/lib/Transforms/Scalar/GVNPRE.cpp:1.47	Wed Jun 20 19:19:05 2007
+++ llvm/lib/Transforms/Scalar/GVNPRE.cpp	Wed Jun 20 20:59:05 2007
@@ -887,13 +887,9 @@
     // However, for opaques, such as constants within PHI nodes, it is
     // possible that they have not yet received a number.  Make sure they do
     // so now.
-    uint32_t valNum = 0;
-    if (isa<BinaryOperator>(*I) || isa<CmpInst>(*I))
-      valNum = VN.lookup(*I);
-    else
-      valNum = VN.lookup_or_add(*I);
-    if (find_leader(anticIn, valNum) == 0)
-      val_insert(anticIn, *I);
+    if (!isa<BinaryOperator>(*I) && !isa<CmpInst>(*I))
+      VN.lookup_or_add(*I);
+    val_insert(anticIn, *I);
   }
       
   clean(anticIn);






More information about the llvm-commits mailing list