[TargetLowering] SimplifyDemandedBits - don't use OriginalDemanded variables in analysis.

These might have been replaced in multiple use cases.

llvm-svn: 362322
This commit is contained in:
Simon Pilgrim 2019-06-02 10:12:55 +00:00
parent 30a6caa3e7
commit 88522ce388
1 changed files with 5 additions and 5 deletions

View File

@ -676,27 +676,27 @@ bool TargetLowering::SimplifyDemandedBits(
// If index isn't constant, assume we need all vector elements AND the
// inserted element.
APInt DemandedVecElts(OriginalDemandedElts);
APInt DemandedVecElts(DemandedElts);
if (CIdx && CIdx->getAPIntValue().ult(VecVT.getVectorNumElements())) {
unsigned Idx = CIdx->getZExtValue();
DemandedVecElts.clearBit(Idx);
// Inserted element is not required.
if (!OriginalDemandedElts[Idx])
if (!DemandedElts[Idx])
return TLO.CombineTo(Op, Vec);
}
KnownBits KnownScl;
unsigned NumSclBits = Scl.getScalarValueSizeInBits();
APInt DemandedSclBits = OriginalDemandedBits.zextOrTrunc(NumSclBits);
APInt DemandedSclBits = DemandedBits.zextOrTrunc(NumSclBits);
if (SimplifyDemandedBits(Scl, DemandedSclBits, KnownScl, TLO, Depth + 1))
return true;
Known = KnownScl.zextOrTrunc(BitWidth, false);
KnownBits KnownVec;
if (SimplifyDemandedBits(Vec, OriginalDemandedBits, DemandedVecElts,
KnownVec, TLO, Depth + 1))
if (SimplifyDemandedBits(Vec, DemandedBits, DemandedVecElts, KnownVec, TLO,
Depth + 1))
return true;
if (!!DemandedVecElts) {