[llvm-commits] [llvm] r62474 - /llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp

Chris Lattner sabre at nondot.org
Sun Jan 18 15:22:09 PST 2009


Author: lattner
Date: Sun Jan 18 17:22:07 2009
New Revision: 62474

URL: http://llvm.org/viewvc/llvm-project?rev=62474&view=rev
Log:
Make this a bit more explicit about which cases need the 
check.  No functionality change.

Modified:
    llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp

Modified: llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp?rev=62474&r1=62473&r2=62474&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp Sun Jan 18 17:22:07 2009
@@ -969,14 +969,18 @@
   default: return false;  // Not safe / profitable to hoist.
   case Instruction::Add:
   case Instruction::Sub:
+    // FP arithmetic might trap. Not worth doing for vector ops.
+    if (I->getType()->isFloatingPoint() || isa<VectorType>(I->getType()))
+      return false;
+    break;
   case Instruction::And:
   case Instruction::Or:
   case Instruction::Xor:
   case Instruction::Shl:
   case Instruction::LShr:
   case Instruction::AShr:
-    if (!I->getOperand(0)->getType()->isInteger())
-      // FP arithmetic might trap. Not worth doing for vector ops.
+    // Don't mess with vector operations.
+    if (isa<VectorType>(I->getType()))
       return false;
     break;   // These are all cheap and non-trapping instructions.
   }





More information about the llvm-commits mailing list