Make this a bit more explicit about which cases need the
authorChris Lattner <sabre@nondot.org>
Sun, 18 Jan 2009 23:22:07 +0000 (23:22 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 18 Jan 2009 23:22:07 +0000 (23:22 +0000)
check.  No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62474 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/SimplifyCFG.cpp

index 366021e6480ef8c673558264867b25c9315f45df..1a0b0b4b66d15d2400a5141379e8546cbf8fee0e 100644 (file)
@@ -969,14 +969,18 @@ static bool SpeculativelyExecuteBB(BranchInst *BI, BasicBlock *BB1) {
   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.
   }