summaryrefslogtreecommitdiff
path: root/lib/Analysis/InstructionSimplify.cpp
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2012-03-26 18:07:14 +0000
committerChad Rosier <mcrosier@apple.com>2012-03-26 18:07:14 +0000
commitcde6650bd05a745e78920e1cd508c3899ebbd644 (patch)
tree9bd3e043b46c1f4be3d582d46d901dc50f3d5770 /lib/Analysis/InstructionSimplify.cpp
parent81748bc32092c75c61bb7cb34bfb5a616924e535 (diff)
downloadllvm-cde6650bd05a745e78920e1cd508c3899ebbd644.tar.gz
llvm-cde6650bd05a745e78920e1cd508c3899ebbd644.tar.bz2
llvm-cde6650bd05a745e78920e1cd508c3899ebbd644.tar.xz
Revert r153423 as this is causing failures on our internal nightly testers.
Original commit message: Use the new range metadata in computeMaskedBits and add a new optimization to instruction simplify that lets us remove an and when loading a boolean value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153452 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/InstructionSimplify.cpp')
-rw-r--r--lib/Analysis/InstructionSimplify.cpp15
1 files changed, 0 insertions, 15 deletions
diff --git a/lib/Analysis/InstructionSimplify.cpp b/lib/Analysis/InstructionSimplify.cpp
index 28400b08b1..16e7a72659 100644
--- a/lib/Analysis/InstructionSimplify.cpp
+++ b/lib/Analysis/InstructionSimplify.cpp
@@ -1370,21 +1370,6 @@ static Value *SimplifyAndInst(Value *Op0, Value *Op1, const Query &Q,
return Op1;
}
- unsigned Bitwidth = Op1->getType()->getScalarSizeInBits();
- APInt DemandedMask = APInt::getAllOnesValue(Bitwidth);
- APInt KnownZero0 = APInt::getNullValue(Bitwidth);
- APInt KnownOne0 = APInt::getNullValue(Bitwidth);
- ComputeMaskedBits(Op0, DemandedMask, KnownZero0, KnownOne0);
- APInt KnownZero1 = APInt::getNullValue(Bitwidth);
- APInt KnownOne1 = APInt::getNullValue(Bitwidth);
- ComputeMaskedBits(Op1, DemandedMask, KnownZero1, KnownOne1);
-
- if ((KnownZero0 | KnownOne1).isAllOnesValue())
- return Op0;
-
- if ((KnownZero1 | KnownOne0).isAllOnesValue())
- return Op1;
-
// Try some generic simplifications for associative operations.
if (Value *V = SimplifyAssociativeBinOp(Instruction::And, Op0, Op1, Q,
MaxRecurse))