[llvm] [ValueTracking] Fix a bug for signed min-max clamping (PR #121206)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 27 07:02:59 PST 2024
================
@@ -1119,7 +1119,8 @@ static void unionWithMinMaxIntrinsicClamp(const IntrinsicInst *II,
KnownBits &Known) {
const APInt *CLow, *CHigh;
if (isSignedMinMaxIntrinsicClamp(II, CLow, CHigh))
- Known = Known.unionWith(ConstantRange(*CLow, *CHigh + 1).toKnownBits());
+ if (!(CLow->isMinSignedValue() && CHigh->isMaxSignedValue()))
----------------
adam-bzowski wrote:
Right, thanks, corrected.
https://github.com/llvm/llvm-project/pull/121206
More information about the llvm-commits
mailing list