forked from OSchip/llvm-project
When tracking demanded bits, if any bits from the sext of an SRA are demanded,
then so is the input sign bit. This fixes mediabench/g721 on X86. llvm-svn: 28166
This commit is contained in:
parent
d7a19102d1
commit
10c653744e
|
@ -467,8 +467,14 @@ bool TargetLowering::SimplifyDemandedBits(SDOperand Op, uint64_t DemandedMask,
|
||||||
HighBits <<= MVT::getSizeInBits(VT) - ShAmt;
|
HighBits <<= MVT::getSizeInBits(VT) - ShAmt;
|
||||||
uint64_t TypeMask = MVT::getIntVTBitMask(VT);
|
uint64_t TypeMask = MVT::getIntVTBitMask(VT);
|
||||||
|
|
||||||
if (SimplifyDemandedBits(Op.getOperand(0),
|
uint64_t InDemandedMask = (DemandedMask << ShAmt) & TypeMask;
|
||||||
(DemandedMask << ShAmt) & TypeMask,
|
|
||||||
|
// If any of the demanded bits are produced by the sign extension, we also
|
||||||
|
// demand the input sign bit.
|
||||||
|
if (HighBits & DemandedMask)
|
||||||
|
InDemandedMask |= MVT::getIntVTSignBit(VT);
|
||||||
|
|
||||||
|
if (SimplifyDemandedBits(Op.getOperand(0), InDemandedMask,
|
||||||
KnownZero, KnownOne, TLO, Depth+1))
|
KnownZero, KnownOne, TLO, Depth+1))
|
||||||
return true;
|
return true;
|
||||||
assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
|
assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?");
|
||||||
|
|
Loading…
Reference in New Issue