As pointed out in #55342, given non-canonical IR with multiple constants, we check the second operand in isSafeWrap, but can promote both with sext. Fix that as suggested by @craig.topper by ensuring we only extend the second constant if multiple are present.
Fixes #55342