[llvm] [InstCombine] canonicalize sign bit checks (PR #122962)

Jacob Young via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 15 09:33:54 PST 2025


================
@@ -3133,7 +3133,9 @@ Instruction *InstCombinerImpl::foldICmpAddConstant(ICmpInst &Cmp,
 
   if (ICmpInst::isUnsigned(Pred) && Add->hasNoSignedWrap() &&
       C.isNonNegative() && (C - *C2).isNonNegative() &&
-      computeConstantRange(X, /*ForSigned=*/true).add(*C2).isAllNonNegative())
+      computeConstantRange(X, Add, /*ForSigned=*/true)
----------------
jacobly0 wrote:

Members take precedence over functions from an outer namespace, but I could use a different name for the member to be more clear.

https://github.com/llvm/llvm-project/pull/122962


More information about the llvm-commits mailing list