[llvm] 4e607ec - [SCCP] Flip range arguments for NSW region check.
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 30 10:03:55 PST 2023
Author: Florian Hahn
Date: 2023-01-30T18:03:18Z
New Revision: 4e607ec498786039f1edb8f5fb4834311402e07d
URL: https://github.com/llvm/llvm-project/commit/4e607ec498786039f1edb8f5fb4834311402e07d
DIFF: https://github.com/llvm/llvm-project/commit/4e607ec498786039f1edb8f5fb4834311402e07d.diff
LOG: [SCCP] Flip range arguments for NSW region check.
This brings the operand order in line with the NUW handling, which was
missed out in 72121a20cda4dc91d0ef5548f930.
At the moment this is NFC as we only additions, but it
should fix miscompiles with 024115ab14822a recommitted.
Added:
Modified:
llvm/lib/Transforms/Utils/SCCPSolver.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Utils/SCCPSolver.cpp b/llvm/lib/Transforms/Utils/SCCPSolver.cpp
index 310c4a73081de..80f11268ba139 100644
--- a/llvm/lib/Transforms/Utils/SCCPSolver.cpp
+++ b/llvm/lib/Transforms/Utils/SCCPSolver.cpp
@@ -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;
}
More information about the llvm-commits
mailing list