[llvm-commits] [llvm] r96614 - /llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp

Dan Gohman gohman at apple.com
Thu Feb 18 13:34:02 PST 2010


Author: djg
Date: Thu Feb 18 15:34:02 2010
New Revision: 96614

URL: http://llvm.org/viewvc/llvm-project?rev=96614&view=rev
Log:
Hoist this loop-invariant logic out of the loop.

Modified:
    llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp?rev=96614&r1=96613&r2=96614&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp Thu Feb 18 15:34:02 2010
@@ -241,15 +241,17 @@
     while ((PN = dyn_cast<PHINode>(BBI++))) {
       if (PN->use_empty())
         continue; // dead use, don't replace it
+
+      // SCEV only supports integer expressions for now.
+      if (!PN->getType()->isIntegerTy() && !PN->getType()->isPointerTy())
+        continue;
+
       // Iterate over all of the values in all the PHI nodes.
       for (unsigned i = 0; i != NumPreds; ++i) {
         // If the value being merged in is not integer or is not defined
         // in the loop, skip it.
         Value *InVal = PN->getIncomingValue(i);
-        if (!isa<Instruction>(InVal) ||
-            // SCEV only supports integer expressions for now.
-            (!InVal->getType()->isIntegerTy() &&
-             !InVal->getType()->isPointerTy()))
+        if (!isa<Instruction>(InVal))
           continue;
 
         // If this pred is for a subloop, not L itself, skip it.





More information about the llvm-commits mailing list