aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-12-02 00:13:08 +0000
committerChris Lattner <sabre@nondot.org>2006-12-02 00:13:08 +0000
commit9919e3df178fdb9f9b9b9147f6701294e363fa77 (patch)
tree4c0601ce3d5d4916dd7630b437d7d74fa32de590
parent832e1489ccd782e87b1b380223ea7f7f0ed2977d (diff)
downloadexternal_llvm-9919e3df178fdb9f9b9b9147f6701294e363fa77.tar.gz
external_llvm-9919e3df178fdb9f9b9b9147f6701294e363fa77.tar.bz2
external_llvm-9919e3df178fdb9f9b9b9147f6701294e363fa77.zip
disable transformations that are invalid for fp vectors. This fixes
Transforms/InstCombine/2006-12-01-BadFPVectorXform.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32112 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index c8f69959b6..adcd339f27 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -1715,7 +1715,7 @@ Instruction *InstCombiner::visitAdd(BinaryOperator &I) {
return ReplaceInstUsesWith(I, RHS);
// X + 0 --> X
- if (!I.getType()->isFloatingPoint()) { // NOTE: -0 + +0 = +0.
+ if (!I.getType()->isFPOrFPVector()) { // NOTE: -0 + +0 = +0.
if (RHSC->isNullValue())
return ReplaceInstUsesWith(I, LHS);
} else if (ConstantFP *CFP = dyn_cast<ConstantFP>(RHSC)) {
@@ -1991,7 +1991,7 @@ Instruction *InstCombiner::visitSub(BinaryOperator &I) {
if (BinaryOperator *Op1I = dyn_cast<BinaryOperator>(Op1)) {
if (Op1I->getOpcode() == Instruction::Add &&
- !Op0->getType()->isFloatingPoint()) {
+ !Op0->getType()->isFPOrFPVector()) {
if (Op1I->getOperand(0) == Op0) // X-(X+Y) == -Y
return BinaryOperator::createNeg(Op1I->getOperand(1), I.getName());
else if (Op1I->getOperand(1) == Op0) // X-(Y+X) == -Y
@@ -2009,7 +2009,7 @@ Instruction *InstCombiner::visitSub(BinaryOperator &I) {
// is not used by anyone else...
//
if (Op1I->getOpcode() == Instruction::Sub &&
- !Op1I->getType()->isFloatingPoint()) {
+ !Op1I->getType()->isFPOrFPVector()) {
// Swap the two operands of the subexpr...
Value *IIOp0 = Op1I->getOperand(0), *IIOp1 = Op1I->getOperand(1);
Op1I->setOperand(0, IIOp1);
@@ -2048,7 +2048,7 @@ Instruction *InstCombiner::visitSub(BinaryOperator &I) {
}
}
- if (!Op0->getType()->isFloatingPoint())
+ if (!Op0->getType()->isFPOrFPVector())
if (BinaryOperator *Op0I = dyn_cast<BinaryOperator>(Op0))
if (Op0I->getOpcode() == Instruction::Add) {
if (Op0I->getOperand(0) == Op1) // (Y+X)-Y == X