aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-03-24 23:56:43 +0000
committerChris Lattner <sabre@nondot.org>2007-03-24 23:56:43 +0000
commit42593e69e2fb74364c85ae5155cd2105faafa203 (patch)
tree6b711b8dd56c5150cd19363bd0d4238874658ed9
parent758d1bc919f3f0856df102f6db64ef9b894d4c23 (diff)
fix a regression on vector or instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35314 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index b189503c2a..461b0a01fb 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -3636,9 +3636,8 @@ Instruction *InstCombiner::visitOr(BinaryOperator &I) {
bool Changed = SimplifyCommutative(I);
Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
- if (isa<UndefValue>(Op1))
- return ReplaceInstUsesWith(I, // X | undef -> -1
- ConstantInt::getAllOnesValue(I.getType()));
+ if (isa<UndefValue>(Op1)) // X | undef -> -1
+ return ReplaceInstUsesWith(I, ConstantInt::getAllOnesValue(I.getType()));
// or X, X = X
if (Op0 == Op1)
@@ -3646,12 +3645,13 @@ Instruction *InstCombiner::visitOr(BinaryOperator &I) {
// See if we can simplify any instructions used by the instruction whose sole
// purpose is to compute bits we don't care about.
- uint32_t BitWidth = cast<IntegerType>(I.getType())->getBitWidth();
- APInt KnownZero(BitWidth, 0), KnownOne(BitWidth, 0);
- if (!isa<VectorType>(I.getType()) &&
- SimplifyDemandedBits(&I, APInt::getAllOnesValue(BitWidth),
- KnownZero, KnownOne))
- return &I;
+ if (!isa<VectorType>(I.getType())) {
+ uint32_t BitWidth = cast<IntegerType>(I.getType())->getBitWidth();
+ APInt KnownZero(BitWidth, 0), KnownOne(BitWidth, 0);
+ if (SimplifyDemandedBits(&I, APInt::getAllOnesValue(BitWidth),
+ KnownZero, KnownOne))
+ return &I;
+ }
// or X, -1 == -1
if (ConstantInt *RHS = dyn_cast<ConstantInt>(Op1)) {