[llvm] [DA] Check for overflow in strong SIV test (PR #164704)

Alireza Torabian via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 28 14:11:36 PDT 2025


================
@@ -512,3 +668,53 @@ for.body:                                         ; preds = %entry, %for.body
 for.end:                                          ; preds = %for.body
   ret void
 }
+
+;;  for (long unsigned i = 0; i < 9223372036854775806; i++) {
+;;    for (long unsigned j = 0; j < 2147483640; j++) {
+;;      A[i] = 0;
+;;      A[j] = 0;
+;;    }
+;;  }
+
+define dso_local void @strong11(ptr %A) local_unnamed_addr #0 {
+; CHECK-LABEL: 'strong11'
+; CHECK-NEXT:  Src: store i32 0, ptr %arrayidx, align 4 --> Dst: store i32 0, ptr %arrayidx, align 4
+; CHECK-NEXT:    da analyze - none!
+; CHECK-NEXT:  Src: store i32 0, ptr %arrayidx, align 4 --> Dst: store i32 0, ptr %arrayidx4, align 4
+; CHECK-NEXT:    da analyze - none!
+; CHECK-NEXT:  Src: store i32 0, ptr %arrayidx4, align 4 --> Dst: store i32 0, ptr %arrayidx4, align 4
+; CHECK-NEXT:    da analyze - consistent output [S 0]!
+;
+; CHECK-STRONG-SIV-LABEL: 'strong11'
+; CHECK-STRONG-SIV-NEXT:  Src: store i32 0, ptr %arrayidx, align 4 --> Dst: store i32 0, ptr %arrayidx, align 4
+; CHECK-STRONG-SIV-NEXT:    da analyze - consistent output [0 S]!
+; CHECK-STRONG-SIV-NEXT:  Src: store i32 0, ptr %arrayidx, align 4 --> Dst: store i32 0, ptr %arrayidx4, align 4
+; CHECK-STRONG-SIV-NEXT:    da analyze - consistent output [* *|<]!
+; CHECK-STRONG-SIV-NEXT:  Src: store i32 0, ptr %arrayidx4, align 4 --> Dst: store i32 0, ptr %arrayidx4, align 4
+; CHECK-STRONG-SIV-NEXT:    da analyze - consistent output [S 0]!
+;
+entry:
+  br label %for.cond1.preheader
+
+for.cond1.preheader:                              ; preds = %entry, %for.inc5
+  %i.014 = phi i64 [ 0, %entry ], [ %inc6, %for.inc5 ]
+  %arrayidx = getelementptr inbounds nuw i32, ptr %A, i64 %i.014
----------------
1997alireza wrote:

Test case is modified now.

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


More information about the llvm-commits mailing list