[llvm] [polly] [SCEV] Introduce SDiv expressions (PR #216862)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 06:32:40 PDT 2026


================
@@ -181,10 +181,10 @@ define void @implied3_samesign(i32 %n) {
 ; Prove that (n > -2) ===> (n / 2 s>= 0).
 ; CHECK-LABEL: 'implied3_samesign'
 ; CHECK-NEXT:  Determining loop execution counts for: @implied3_samesign
-; CHECK-NEXT:  Loop %header: backedge-taken count is (1 + %n.div.2)<nsw>
-; CHECK-NEXT:  Loop %header: constant max backedge-taken count is i32 1
-; CHECK-NEXT:  Loop %header: symbolic max backedge-taken count is (1 + %n.div.2)<nsw>
-; CHECK-NEXT:  Loop %header: Trip multiple is 1
+; CHECK-NEXT:  Loop %header: backedge-taken count is (1 + (%n /s 2))<nsw>
+; CHECK-NEXT:  Loop %header: constant max backedge-taken count is i32 1073741824
----------------
artagnon wrote:

We were relying on computeNumSignBits and the assumption cache to get the previous result with SCEVUnknown -- I think it is unfortunately going to require very extensive changes to make getRangeRef assumption-aware to fix this?

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


More information about the llvm-commits mailing list