aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/SimplifyCFG.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-18 23:22:07 +0000
committerChris Lattner <sabre@nondot.org>2009-01-18 23:22:07 +0000
commit9dd3b610dcb17f88ed52ae03022179bf21e0e132 (patch)
tree3b673bb3599bffd0e01aa86dd154462e6b1d9de4 /lib/Transforms/Utils/SimplifyCFG.cpp
parentd62284a8040024afeb8777b514c34912e939b801 (diff)
Make this a bit more explicit about which cases need the
check. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62474 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r--lib/Transforms/Utils/SimplifyCFG.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp
index 366021e648..1a0b0b4b66 100644
--- a/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -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.
}