[SCCP] Flip range arguments for NSW region check.
This brings the operand order in line with the NUW handling, which was missed out in72121a20cd. At the moment this is NFC as we only additions, but it should fix miscompiles with024115ab14recommitted.
This commit is contained in:
@@ -153,8 +153,8 @@ static bool refineInstruction(SCCPSolver &Solver,
|
||||
}
|
||||
if (!Inst.hasNoSignedWrap()) {
|
||||
auto NSWRange = ConstantRange::makeGuaranteedNoWrapRegion(
|
||||
Instruction::Add, RangeA, OverflowingBinaryOperator::NoSignedWrap);
|
||||
if (NSWRange.contains(RangeB)) {
|
||||
Instruction::Add, RangeB, OverflowingBinaryOperator::NoSignedWrap);
|
||||
if (NSWRange.contains(RangeA)) {
|
||||
Inst.setHasNoSignedWrap();
|
||||
Changed = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user