unsigned MaskLoBits = 0;
if (IsRotate && isPowerOf2_64(EltSize)) {
unsigned Bits = Log2_64(EltSize);
- APInt DemandedBits = APInt::getLowBitsSet(EltSize, Bits);
+ APInt DemandedBits =
+ APInt::getLowBitsSet(Neg.getScalarValueSizeInBits(), Bits);
if (SDValue Inner =
TLI.SimplifyMultipleUseDemandedBits(Neg, DemandedBits, DAG)) {
Neg = Inner;
// affect Mask's demanded bits, just replace Pos with Pos'. These operations
// are redundant for the purpose of the equality.
if (MaskLoBits) {
- APInt DemandedBits = APInt::getLowBitsSet(EltSize, MaskLoBits);
+ APInt DemandedBits =
+ APInt::getLowBitsSet(Pos.getScalarValueSizeInBits(), MaskLoBits);
if (SDValue Inner =
TLI.SimplifyMultipleUseDemandedBits(Pos, DemandedBits, DAG)) {
Pos = Inner;