mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 19:52:54 +01:00
ifdef out some dead code.
Fix PR1244 and Transforms/InstCombine/2007-03-13-CompareMerge.ll llvm-svn: 35082
This commit is contained in:
parent
0f75a6cc7f
commit
efc2339bd7
@ -992,6 +992,7 @@ static bool MaskedValueIsZero(Value *V, uint64_t Mask, unsigned Depth = 0) {
|
|||||||
return (KnownZero & Mask) == Mask;
|
return (KnownZero & Mask) == Mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
/// MaskedValueIsZero - Return true if 'V & Mask' is known to be zero. We use
|
/// 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
|
/// this predicate to simplify operations downstream. Mask is known to be zero
|
||||||
/// for bits that V cannot have.
|
/// 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?");
|
assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
|
||||||
return (KnownZero & Mask) == Mask;
|
return (KnownZero & Mask) == Mask;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/// ShrinkDemandedConstant - Check to see if the specified operand of the
|
/// ShrinkDemandedConstant - Check to see if the specified operand of the
|
||||||
/// specified instruction is a constant integer. If so, check to see if there
|
/// 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
|
ICI->swapOperands(); // Swap the LHS and RHS of the ICmp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ICmpInst *RHSICI = cast<ICmpInst>(Log.getOperand(1));
|
||||||
unsigned LHSCode = getICmpCode(ICI);
|
unsigned LHSCode = getICmpCode(ICI);
|
||||||
unsigned RHSCode = getICmpCode(cast<ICmpInst>(Log.getOperand(1)));
|
unsigned RHSCode = getICmpCode(RHSICI);
|
||||||
unsigned Code;
|
unsigned Code;
|
||||||
switch (Log.getOpcode()) {
|
switch (Log.getOpcode()) {
|
||||||
case Instruction::And: Code = LHSCode & RHSCode; break;
|
case Instruction::And: Code = LHSCode & RHSCode; break;
|
||||||
@ -3618,7 +3621,10 @@ struct FoldICmpLogical {
|
|||||||
default: assert(0 && "Illegal logical opcode!"); return 0;
|
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))
|
if (Instruction *I = dyn_cast<Instruction>(RV))
|
||||||
return I;
|
return I;
|
||||||
// Otherwise, it's a constant boolean value...
|
// Otherwise, it's a constant boolean value...
|
||||||
|
Loading…
Reference in New Issue
Block a user