forked from OSchip/llvm-project
Fix a problem in my patch yesterday, causing a miscompilation of 176.gcc
llvm-svn: 26045
This commit is contained in:
parent
adeb8fb5a2
commit
ddba3289b5
|
@ -464,7 +464,7 @@ static uint64_t ComputeMaskedNonZeroBits(Value *V, uint64_t Mask,
|
||||||
// (shl X, C1) & C2 == 0 iff (X & C2 >>u C1) == 0
|
// (shl X, C1) & C2 == 0 iff (X & C2 >>u C1) == 0
|
||||||
if (ConstantUInt *SA = dyn_cast<ConstantUInt>(I->getOperand(1)))
|
if (ConstantUInt *SA = dyn_cast<ConstantUInt>(I->getOperand(1)))
|
||||||
return ComputeMaskedNonZeroBits(I->getOperand(0),Mask >> SA->getValue(),
|
return ComputeMaskedNonZeroBits(I->getOperand(0),Mask >> SA->getValue(),
|
||||||
Depth+1);
|
Depth+1) << SA->getValue();
|
||||||
break;
|
break;
|
||||||
case Instruction::Shr:
|
case Instruction::Shr:
|
||||||
// (ushr X, C1) & C2 == 0 iff (-1 >> C1) & C2 == 0
|
// (ushr X, C1) & C2 == 0 iff (-1 >> C1) & C2 == 0
|
||||||
|
@ -472,7 +472,8 @@ static uint64_t ComputeMaskedNonZeroBits(Value *V, uint64_t Mask,
|
||||||
if (I->getType()->isUnsigned()) {
|
if (I->getType()->isUnsigned()) {
|
||||||
Mask <<= SA->getValue();
|
Mask <<= SA->getValue();
|
||||||
Mask &= I->getType()->getIntegralTypeMask();
|
Mask &= I->getType()->getIntegralTypeMask();
|
||||||
return ComputeMaskedNonZeroBits(I->getOperand(0), Mask, Depth+1);
|
return ComputeMaskedNonZeroBits(I->getOperand(0), Mask, Depth+1)
|
||||||
|
>> SA->getValue();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue