Changes in directory llvm/lib/Transforms/Scalar:

GVNPRE.cpp updated: 1.34 -> 1.35
---
Log message:

Don't perform an expensive check if it's not necessary.


---
Diffs of the changes:  (+12 -2)

 GVNPRE.cpp |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)


Index: llvm/lib/Transforms/Scalar/GVNPRE.cpp
diff -u llvm/lib/Transforms/Scalar/GVNPRE.cpp:1.34 
llvm/lib/Transforms/Scalar/GVNPRE.cpp:1.35
--- llvm/lib/Transforms/Scalar/GVNPRE.cpp:1.34  Fri Jun 15 19:26:54 2007
+++ llvm/lib/Transforms/Scalar/GVNPRE.cpp       Sun Jun 17 23:30:44 2007
@@ -329,7 +329,12 @@
             lhsValid = true;
             break;
           }
-      lhsValid &= !dependsOnInvoke(BO->getOperand(0));
+          
+      // Check for dependency on invoke insts
+      // NOTE: This check is expensive, so don't do it if we
+      // don't have to
+      if (lhsValid)
+        lhsValid = !dependsOnInvoke(BO->getOperand(0));
     
       bool rhsValid = !isa<Instruction>(BO->getOperand(1));
       if (!rhsValid)
@@ -339,7 +344,12 @@
           rhsValid = true;
           break;
         }
-      rhsValid &= !dependsOnInvoke(BO->getOperand(1));
+      
+      // Check for dependency on invoke insts
+      // NOTE: This check is expensive, so don't do it if we
+      // don't have to
+      if (rhsValid)
+        rhsValid = !dependsOnInvoke(BO->getOperand(1));
       
       if (!lhsValid || !rhsValid)
         set.erase(BO);



_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to