[llvm] [SCEV] Rework wrap-flag-inference for sext-addrec (PR #217362)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 21 23:45:33 PDT 2026


================
@@ -60,12 +60,12 @@ define void @f_sadd_overflow(ptr %a) {
 ; CHECK-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], %[[CONT:.*]] ], [ 2147483645, %[[ENTRY]] ]
 ; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds i8, ptr [[A]], i64 [[INDVARS_IV]]
 ; CHECK-NEXT:    store i8 0, ptr [[ARRAYIDX]], align 1
-; CHECK-NEXT:    br i1 true, label %[[TRAP:.*]], label %[[CONT]], !nosanitize [[META0]]
+; CHECK-NEXT:    [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
+; CHECK-NEXT:    br i1 false, label %[[TRAP:.*]], label %[[CONT]], !nosanitize [[META0]]
----------------
lukel97 wrote:

This doesn't look correct. We're no longer branching to the trap block?

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


More information about the llvm-commits mailing list