mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-08 13:26:19 +00:00
Fix InstCombine/2007-01-18-VectorInfLoop.ll, a case where instcombine
infinitely loops. llvm-svn: 33343
This commit is contained in:
parent
f457b999c7
commit
ef4715a124
@ -3062,10 +3062,16 @@ Instruction *InstCombiner::visitAnd(BinaryOperator &I) {
|
|||||||
// See if we can simplify any instructions used by the instruction whose sole
|
// See if we can simplify any instructions used by the instruction whose sole
|
||||||
// purpose is to compute bits we don't care about.
|
// purpose is to compute bits we don't care about.
|
||||||
uint64_t KnownZero, KnownOne;
|
uint64_t KnownZero, KnownOne;
|
||||||
if (!isa<PackedType>(I.getType()) &&
|
if (!isa<PackedType>(I.getType())) {
|
||||||
SimplifyDemandedBits(&I, I.getType()->getIntegerTypeMask(),
|
if (SimplifyDemandedBits(&I, I.getType()->getIntegerTypeMask(),
|
||||||
KnownZero, KnownOne))
|
KnownZero, KnownOne))
|
||||||
return &I;
|
return &I;
|
||||||
|
} else {
|
||||||
|
if (ConstantPacked *CP = dyn_cast<ConstantPacked>(Op1)) {
|
||||||
|
if (CP->isAllOnesValue())
|
||||||
|
return ReplaceInstUsesWith(I, I.getOperand(0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (ConstantInt *AndRHS = dyn_cast<ConstantInt>(Op1)) {
|
if (ConstantInt *AndRHS = dyn_cast<ConstantInt>(Op1)) {
|
||||||
uint64_t AndRHSMask = AndRHS->getZExtValue();
|
uint64_t AndRHSMask = AndRHS->getZExtValue();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user