From e27081d34838309c3ea398c6a1a496d65316bf6c Mon Sep 17 00:00:00 2001 From: Chad Rosier Date: Wed, 28 Mar 2012 18:42:50 +0000 Subject: Revert r153521 as it's causing large regressions on the nightly testers. Original commit message for r153521 (aka r153423): Use the new range metadata in computeMaskedBits and add a new optimization to instruction simplify that lets us remove an and when loding a boolean value. llvm-svn: 153587 --- llvm/lib/Analysis/InstructionSimplify.cpp | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'llvm/lib/Analysis/InstructionSimplify.cpp') diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp index 28400b08b1c..16e7a726595 100644 --- a/llvm/lib/Analysis/InstructionSimplify.cpp +++ b/llvm/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)) -- cgit v1.2.3