[TargetLowering] use APInt::getLowBitsSet instead of APInt::getAllOnes+zext. (#188384)

This commit is contained in:
Craig Topper 2026-03-25 09:09:04 -07:00 committed by GitHub
parent 18250fd47b
commit d362bd7b9d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7428,7 +7428,7 @@ TargetLowering::prepareSREMEqFold(EVT SETCCVT, SDValue REMNode,
// A = 2^(W-1)
A = APInt::getSignedMinValue(W);
// - Q = 2^(W-K) - 1
Q = APInt::getAllOnes(W - K).zext(W);
Q = APInt::getLowBitsSet(W, W - K);
}
// If the divisor is 1 the result can be constant-folded. Likewise, we