[llvm] [ConstraintElim] Answer unsigned queries using the signed system. (PR #213744)

Antonio Frighetto via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 4 02:00:36 PDT 2026


================
@@ -825,8 +829,8 @@ ConstraintTy ConstraintInfo::getConstraintForSolving(CmpInst::Predicate Pred,
   // unsigned ones. This increases the reasoning effectiveness in combination
   // with the signed <-> unsigned transfer logic.
   if (CmpInst::isSigned(Pred) &&
-      isKnownNonNegative(Op0, DL, /*Depth=*/MaxAnalysisRecursionDepth - 1) &&
-      isKnownNonNegative(Op1, DL, /*Depth=*/MaxAnalysisRecursionDepth - 1))
+      ::isKnownNonNegative(Op0, DL, /*Depth=*/MaxAnalysisRecursionDepth - 1) &&
+      ::isKnownNonNegative(Op1, DL, /*Depth=*/MaxAnalysisRecursionDepth - 1))
----------------
antoniofrighetto wrote:

Shadowing the ValueTracking routine is not super ideal, and one encountering this may reasonably wonder why the member isn't used there instead (and would need to go through the chain of calls to find it would lead to recursively calling the member). I think the name is self-explanatory though, not sure I have better suggestions here.

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


More information about the llvm-commits mailing list