While demanded bits constant shrinking appears to prevent this in
practice right now, it is principally possible for C2 to have
set bits that are known not-needed (zeroable). See: D140858
`+` will overflow here, `|` will get the right logic.
Differential Revision: https://reviews.llvm.org/D141089
APInt NewC2 = *C2;
KnownBits Know = computeKnownBits(And->getOperand(0), 0, And);
// Set high zeros of C2 to allow matching negated power-of-2.
- NewC2 = *C2 + APInt::getHighBitsSet(C2->getBitWidth(),
+ NewC2 = *C2 | APInt::getHighBitsSet(C2->getBitWidth(),
Know.countMinLeadingZeros());
// Restrict this fold only for single-use 'and' (PR10267).