[llvm] [KnownBits] Fix minimum denominator bounds for sdiv (PR #227264)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 04:10:54 PDT 2026


================
@@ -1255,7 +1255,11 @@ KnownBits KnownBits::sdiv(const KnownBits &LHS, const KnownBits &RHS,
     if (Exact || (-LHS.getSignedMaxValue()).uge(RHS.getSignedMaxValue())) {
       APInt Denom = RHS.getSignedMinValue();
       APInt Num = LHS.getSignedMinValue();
-      Res = Denom.isZero() ? Num : Num.sdiv(Denom);
+      // fix to set the lowest unknown bit to get the minimum non-zero
+      // denominator
----------------
arsenm wrote:

Comment can be improved and needs capitalization. This isn't really a "fix", it's an improvement?

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


More information about the llvm-commits mailing list