@@ -40,14 +40,14 @@ void vla_type_with_element_type_int() {
4040// CIR: cir.store {{.*}} %[[CONST_10]], %[[N_ADDR]] : !u64i, !cir.ptr<!u64i>
4141// CIR: %3 = cir.load {{.*}} %[[N_ADDR]] : !cir.ptr<!u64i>, !u64i
4242// CIR: %[[CONST_4:.*]] = cir.const #cir.int<4> : !u64i
43- // CIR: %[[SIZE:.*]] = cir.binop(mul, %[[CONST_4]], %3) : !u64i
43+ // CIR: %[[SIZE:.*]] = cir.binop(mul, %[[CONST_4]], %3) nuw : !u64i
4444// CIR: cir.store {{.*}} %[[SIZE]], %[[SIZE_ADDR]] : !u64i, !cir.ptr<!u64i>
4545
4646// LLVM: %[[N_ADDR:.*]] = alloca i64, i64 1, align 8
4747// LLVM: %[[SIZE_ADDR:.*]] = alloca i64, i64 1, align 8
4848// LLVM: store i64 10, ptr %[[N_ADDR]], align 8
4949// LLVM: %[[TMP_N:.*]] = load i64, ptr %[[N_ADDR]], align 8
50- // LLVM: %[[SIZE:.*]] = mul i64 4, %[[TMP_N]]
50+ // LLVM: %[[SIZE:.*]] = mul nuw i64 4, %[[TMP_N]]
5151// LLVM: store i64 %[[SIZE]], ptr %[[SIZE_ADDR]], align 8
5252
5353// OGCG: %[[N_ADDR:.*]] = alloca i64, align 8
@@ -120,7 +120,7 @@ void vla_expr_element_type_int() {
120120// CIR: %[[ARR_ADDR:.*]] = cir.alloca !s32i, !cir.ptr<!s32i>, %[[TMP_N]] : !u64i, ["arr"]
121121// CIR: %[[SIZE_ADDR:.*]] = cir.alloca !u64i, !cir.ptr<!u64i>, ["size", init]
122122// CIR: %[[CONST_4:.*]] = cir.const #cir.int<4> : !u64i
123- // CIR: %[[SIZE:.*]] = cir.binop(mul, %[[CONST_4]], %[[TMP_N]]) : !u64i
123+ // CIR: %[[SIZE:.*]] = cir.binop(mul, %[[CONST_4]], %[[TMP_N]]) nuw : !u64i
124124// CIR: cir.store {{.*}} %[[SIZE]], %[[SIZE_ADDR]] : !u64i, !cir.ptr<!u64i>
125125// CIR: %[[TMP_SAVED_STACK:.*]] = cir.load {{.*}} %[[SAVED_STACK_ADDR]] : !cir.ptr<!cir.ptr<!u8i>>, !cir.ptr<!u8i>
126126// CIR: cir.stackrestore %[[TMP_SAVED_STACK]] : !cir.ptr<!u8i>
@@ -133,7 +133,7 @@ void vla_expr_element_type_int() {
133133// LLVM: store ptr %[[STACK_SAVE]], ptr %[[SAVED_STACK_ADDR]], align 8
134134// LLVM: %[[ARR_ADDR:.*]] = alloca i32, i64 %[[TMP_N]], align 16
135135// LLVM: %[[SIZE_ADDR:.*]] = alloca i64, i64 1, align 8
136- // LLVM: %[[SIZE:.*]] = mul i64 4, %[[TMP_N]]
136+ // LLVM: %[[SIZE:.*]] = mul nuw i64 4, %[[TMP_N]]
137137// LLVM: store i64 %[[SIZE]], ptr %[[SIZE_ADDR]], align 8
138138// LLVM: %[[TMP_SAVED_STACK:.*]] = load ptr, ptr %[[SAVED_STACK_ADDR]], align 8
139139// LLVM: call void @llvm.stackrestore.p0(ptr %[[TMP_SAVED_STACK]])
0 commit comments