aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/InstCombine/InstructionCombining.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2012-02-06 21:56:39 +0000
committerChris Lattner <sabre@nondot.org>2012-02-06 21:56:39 +0000
commit7302d80490feabfc8a01bee0fa698aab55169544 (patch)
treea2e302de0cd9bbed2d37ef67132f6f43ba8587e0 /lib/Transforms/InstCombine/InstructionCombining.cpp
parent705f4813afb13ed850386cbb4b56688abb6412ab (diff)
Remove some dead code and tidy things up now that vectors use ConstantDataVector
instead of always using ConstantVector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149912 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine/InstructionCombining.cpp')
-rw-r--r--lib/Transforms/InstCombine/InstructionCombining.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/Transforms/InstCombine/InstructionCombining.cpp b/lib/Transforms/InstCombine/InstructionCombining.cpp
index 0294d2a5ac..318256a9b7 100644
--- a/lib/Transforms/InstCombine/InstructionCombining.cpp
+++ b/lib/Transforms/InstCombine/InstructionCombining.cpp
@@ -495,10 +495,8 @@ Value *InstCombiner::dyn_castNegVal(Value *V) const {
if (ConstantInt *C = dyn_cast<ConstantInt>(V))
return ConstantExpr::getNeg(C);
- if (Constant *C = dyn_cast<Constant>(V))
- // FIXME: Remove ConstantVector
- if ((isa<ConstantVector>(C) || isa<ConstantDataVector>(C)) &&
- C->getType()->getVectorElementType()->isIntegerTy())
+ if (ConstantDataVector *C = dyn_cast<ConstantDataVector>(V))
+ if (C->getType()->getElementType()->isIntegerTy())
return ConstantExpr::getNeg(C);
return 0;
@@ -516,10 +514,8 @@ Value *InstCombiner::dyn_castFNegVal(Value *V) const {
if (ConstantFP *C = dyn_cast<ConstantFP>(V))
return ConstantExpr::getFNeg(C);
- if (Constant *C = dyn_cast<Constant>(V))
- // FIXME: Remove ConstantVector
- if ((isa<ConstantVector>(C) || isa<ConstantDataVector>(C)) &&
- C->getType()->getVectorElementType()->isFloatingPointTy())
+ if (ConstantDataVector *C = dyn_cast<ConstantDataVector>(V))
+ if (C->getType()->getElementType()->isFloatingPointTy())
return ConstantExpr::getFNeg(C);
return 0;