1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

[DAG] SelectionDAG::computeKnownBits - use APInt::insertBits to merge subvector knownbits. NFCI.

As noticed on D104472 we can use APInt::insertBits which will avoid a lot of temporary APInt creations
This commit is contained in:
Simon Pilgrim 2021-06-18 14:58:47 +01:00
parent d2647ecc04
commit ccd7a98f97

View File

@ -2955,8 +2955,8 @@ KnownBits SelectionDAG::computeKnownBits(SDValue Op, const APInt &DemandedElts,
Known2 = computeKnownBits(N0, SubDemandedElts.shl(i),
Depth + 1);
unsigned Shifts = IsLE ? i : SubScale - 1 - i;
Known.One |= Known2.One.zext(BitWidth).shl(SubBitWidth * Shifts);
Known.Zero |= Known2.Zero.zext(BitWidth).shl(SubBitWidth * Shifts);
Known.One.insertBits(Known2.One, SubBitWidth * Shifts);
Known.Zero.insertBits(Known2.Zero, SubBitWidth * Shifts);
}
}