diff options
author | Chris Lattner <sabre@nondot.org> | 2007-03-13 14:27:42 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-03-13 14:27:42 +0000 |
commit | bc1dbfce62d1c54bb73cb0ee3e6cb13fc8297306 (patch) | |
tree | 9a3385b384f91c8f5a1740b89bfe3a411dd3414c /lib/Transforms | |
parent | 7e9e9c6121b4085b110ef5008424e508a74f19d0 (diff) |
ifdef out some dead code.
Fix PR1244 and Transforms/InstCombine/2007-03-13-CompareMerge.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35082 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index bd88fccc22..93dde275b6 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -992,6 +992,7 @@ static bool MaskedValueIsZero(Value *V, uint64_t Mask, unsigned Depth = 0) { return (KnownZero & Mask) == Mask; } +#if 0 /// MaskedValueIsZero - Return true if 'V & Mask' is known to be zero. We use /// this predicate to simplify operations downstream. Mask is known to be zero /// for bits that V cannot have. @@ -1001,6 +1002,7 @@ static bool MaskedValueIsZero(Value *V, const APInt& Mask, unsigned Depth = 0) { assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?"); return (KnownZero & Mask) == Mask; } +#endif /// ShrinkDemandedConstant - Check to see if the specified operand of the /// specified instruction is a constant integer. If so, check to see if there @@ -3608,8 +3610,9 @@ struct FoldICmpLogical { ICI->swapOperands(); // Swap the LHS and RHS of the ICmp } + ICmpInst *RHSICI = cast<ICmpInst>(Log.getOperand(1)); unsigned LHSCode = getICmpCode(ICI); - unsigned RHSCode = getICmpCode(cast<ICmpInst>(Log.getOperand(1))); + unsigned RHSCode = getICmpCode(RHSICI); unsigned Code; switch (Log.getOpcode()) { case Instruction::And: Code = LHSCode & RHSCode; break; @@ -3618,7 +3621,10 @@ struct FoldICmpLogical { default: assert(0 && "Illegal logical opcode!"); return 0; } - Value *RV = getICmpValue(ICmpInst::isSignedPredicate(pred), Code, LHS, RHS); + bool isSigned = ICmpInst::isSignedPredicate(RHSICI->getPredicate()) || + ICmpInst::isSignedPredicate(ICI->getPredicate()); + + Value *RV = getICmpValue(isSigned, Code, LHS, RHS); if (Instruction *I = dyn_cast<Instruction>(RV)) return I; // Otherwise, it's a constant boolean value... |