diff --git a/MODULE.bazel b/MODULE.bazel index b819f770834ed..423f635999761 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -135,8 +135,8 @@ bazel_dep(name = "zstd", version = "1.5.6", repo_name = "llvm_zstd") # We pin to specific upstream commits and try to track top-of-tree reasonably # closely rather than pinning to a specific release. -# HEAD as of 2024-06-20. -llvm_project_version = "80f881485accb020345ee7e1c4c3151ec55ce590" +# HEAD as of 2024-08-09. +llvm_project_version = "4c5ef6690040383956461828457ac27f7f912edb" # Load a repository for the raw llvm-project, pre-overlay. http_archive( @@ -147,7 +147,7 @@ http_archive( "@carbon//bazel/llvm_project:0001_Patch_for_mallinfo2_when_using_Bazel_build_system.patch", "@carbon//bazel/llvm_project:0002_Added_Bazel_build_for_compiler_rt_fuzzer.patch", ], - sha256 = "3216d56b308d420170d6284d04560175b56fd56065a7442f32b732c606e77367", + sha256 = "a30da7822f5307bc0aca8c497ffdd6369e3877186e87501e2ac1f3ec5ed1c0b7", strip_prefix = "llvm-project-{0}".format(llvm_project_version), urls = ["https://github.com/llvm/llvm-project/archive/{0}.tar.gz".format(llvm_project_version)], ) diff --git a/toolchain/lower/testdata/array/assign_return_value.carbon b/toolchain/lower/testdata/array/assign_return_value.carbon index bc66ecdd9eb26..9a21a1bf06647 100644 --- a/toolchain/lower/testdata/array/assign_return_value.carbon +++ b/toolchain/lower/testdata/array/assign_return_value.carbon @@ -21,8 +21,8 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: define void @F(ptr sret({ i32, i32 }) %return) { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc11_38.2.tuple.elem = getelementptr inbounds { i32, i32 }, ptr %return, i32 0, i32 0 -// CHECK:STDOUT: %.loc11_38.4.tuple.elem = getelementptr inbounds { i32, i32 }, ptr %return, i32 0, i32 1 +// CHECK:STDOUT: %.loc11_38.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0 +// CHECK:STDOUT: %.loc11_38.4.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %return, ptr align 4 @tuple.loc11_39, i64 8, i1 false) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -32,11 +32,11 @@ fn Run() { // CHECK:STDOUT: %t.var = alloca [2 x i32], align 4 // CHECK:STDOUT: %.loc14_22.1.temp = alloca { i32, i32 }, align 8 // CHECK:STDOUT: call void @F(ptr %.loc14_22.1.temp) -// CHECK:STDOUT: %.loc14_22.3.tuple.elem = getelementptr inbounds { i32, i32 }, ptr %.loc14_22.1.temp, i32 0, i32 0 +// CHECK:STDOUT: %.loc14_22.3.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %.loc14_22.1.temp, i32 0, i32 0 // CHECK:STDOUT: %.loc14_22.4 = load i32, ptr %.loc14_22.3.tuple.elem, align 4 // CHECK:STDOUT: %.loc14_22.6.array.index = getelementptr inbounds [2 x i32], ptr %t.var, i32 0, i32 0 // CHECK:STDOUT: store i32 %.loc14_22.4, ptr %.loc14_22.6.array.index, align 4 -// CHECK:STDOUT: %.loc14_22.8.tuple.elem = getelementptr inbounds { i32, i32 }, ptr %.loc14_22.1.temp, i32 0, i32 1 +// CHECK:STDOUT: %.loc14_22.8.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %.loc14_22.1.temp, i32 0, i32 1 // CHECK:STDOUT: %.loc14_22.9 = load i32, ptr %.loc14_22.8.tuple.elem, align 4 // CHECK:STDOUT: %.loc14_22.11.array.index = getelementptr inbounds [2 x i32], ptr %t.var, i32 0, i32 1 // CHECK:STDOUT: store i32 %.loc14_22.9, ptr %.loc14_22.11.array.index, align 4 diff --git a/toolchain/lower/testdata/array/base.carbon b/toolchain/lower/testdata/array/base.carbon index e6f86ed0e3ddd..eb5174c329ad7 100644 --- a/toolchain/lower/testdata/array/base.carbon +++ b/toolchain/lower/testdata/array/base.carbon @@ -41,20 +41,20 @@ fn Run() { // CHECK:STDOUT: %.loc14_40.15.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i32 4 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %c.var, ptr align 1 @array.3.loc14_41, i64 0, i1 false) // CHECK:STDOUT: %d.var = alloca { i32, i32, i32 }, align 8 -// CHECK:STDOUT: %.loc15_36.2.tuple.elem = getelementptr inbounds { i32, i32, i32 }, ptr %d.var, i32 0, i32 0 -// CHECK:STDOUT: %.loc15_36.4.tuple.elem = getelementptr inbounds { i32, i32, i32 }, ptr %d.var, i32 0, i32 1 -// CHECK:STDOUT: %.loc15_36.6.tuple.elem = getelementptr inbounds { i32, i32, i32 }, ptr %d.var, i32 0, i32 2 +// CHECK:STDOUT: %.loc15_36.2.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 0 +// CHECK:STDOUT: %.loc15_36.4.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 1 +// CHECK:STDOUT: %.loc15_36.6.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 2 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %d.var, ptr align 4 @tuple.2.loc15_37, i64 12, i1 false) // CHECK:STDOUT: %e.var = alloca [3 x i32], align 4 -// CHECK:STDOUT: %.loc16_21.1.tuple.elem = getelementptr inbounds { i32, i32, i32 }, ptr %d.var, i32 0, i32 0 +// CHECK:STDOUT: %.loc16_21.1.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 0 // CHECK:STDOUT: %.loc16_21.2 = load i32, ptr %.loc16_21.1.tuple.elem, align 4 // CHECK:STDOUT: %.loc16_21.4.array.index = getelementptr inbounds [3 x i32], ptr %e.var, i32 0, i32 0 // CHECK:STDOUT: store i32 %.loc16_21.2, ptr %.loc16_21.4.array.index, align 4 -// CHECK:STDOUT: %.loc16_21.6.tuple.elem = getelementptr inbounds { i32, i32, i32 }, ptr %d.var, i32 0, i32 1 +// CHECK:STDOUT: %.loc16_21.6.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 1 // CHECK:STDOUT: %.loc16_21.7 = load i32, ptr %.loc16_21.6.tuple.elem, align 4 // CHECK:STDOUT: %.loc16_21.9.array.index = getelementptr inbounds [3 x i32], ptr %e.var, i32 0, i32 1 // CHECK:STDOUT: store i32 %.loc16_21.7, ptr %.loc16_21.9.array.index, align 4 -// CHECK:STDOUT: %.loc16_21.11.tuple.elem = getelementptr inbounds { i32, i32, i32 }, ptr %d.var, i32 0, i32 2 +// CHECK:STDOUT: %.loc16_21.11.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 2 // CHECK:STDOUT: %.loc16_21.12 = load i32, ptr %.loc16_21.11.tuple.elem, align 4 // CHECK:STDOUT: %.loc16_21.14.array.index = getelementptr inbounds [3 x i32], ptr %e.var, i32 0, i32 2 // CHECK:STDOUT: store i32 %.loc16_21.12, ptr %.loc16_21.14.array.index, align 4 diff --git a/toolchain/lower/testdata/class/adapt.carbon b/toolchain/lower/testdata/class/adapt.carbon index 4504b669a8051..2bec22d6c19be 100644 --- a/toolchain/lower/testdata/class/adapt.carbon +++ b/toolchain/lower/testdata/class/adapt.carbon @@ -58,8 +58,8 @@ fn DoStuff(a: Int) -> Int { // CHECK:STDOUT: // CHECK:STDOUT: define void @Make(ptr sret({ i32, i32 }) %return) { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc9_27.2.a = getelementptr inbounds { i32, i32 }, ptr %return, i32 0, i32 0 -// CHECK:STDOUT: %.loc9_27.4.b = getelementptr inbounds { i32, i32 }, ptr %return, i32 0, i32 1 +// CHECK:STDOUT: %.loc9_27.2.a = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0 +// CHECK:STDOUT: %.loc9_27.4.b = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %return, ptr align 4 @struct.loc9_28, i64 8, i1 false) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -72,7 +72,7 @@ fn DoStuff(a: Int) -> Int { // CHECK:STDOUT: // CHECK:STDOUT: define i32 @GetB(ptr %self) { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc22_14.1.b = getelementptr inbounds { i32, i32 }, ptr %self, i32 0, i32 1 +// CHECK:STDOUT: %.loc22_14.1.b = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1 // CHECK:STDOUT: %.loc22_14.2 = load i32, ptr %.loc22_14.1.b, align 4 // CHECK:STDOUT: ret i32 %.loc22_14.2 // CHECK:STDOUT: } diff --git a/toolchain/lower/testdata/class/base.carbon b/toolchain/lower/testdata/class/base.carbon index 1fa96a4d543a0..0eebdcb503123 100644 --- a/toolchain/lower/testdata/class/base.carbon +++ b/toolchain/lower/testdata/class/base.carbon @@ -37,30 +37,30 @@ fn Convert(p: Derived*) -> Base* { // CHECK:STDOUT: // CHECK:STDOUT: define void @Make(ptr sret({ { i32 }, i32 }) %return) { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc22_35.2.base = getelementptr inbounds { { i32 }, i32 }, ptr %return, i32 0, i32 0 -// CHECK:STDOUT: %.loc22_26.2.b = getelementptr inbounds { i32 }, ptr %.loc22_35.2.base, i32 0, i32 0 -// CHECK:STDOUT: %.loc22_35.4.d = getelementptr inbounds { { i32 }, i32 }, ptr %return, i32 0, i32 1 +// CHECK:STDOUT: %.loc22_35.2.base = getelementptr inbounds nuw { { i32 }, i32 }, ptr %return, i32 0, i32 0 +// CHECK:STDOUT: %.loc22_26.2.b = getelementptr inbounds nuw { i32 }, ptr %.loc22_35.2.base, i32 0, i32 0 +// CHECK:STDOUT: %.loc22_35.4.d = getelementptr inbounds nuw { { i32 }, i32 }, ptr %return, i32 0, i32 1 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %return, ptr align 4 @struct.2.loc22_36, i64 8, i1 false) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: define void @Access(ptr sret({ i32, i32 }) %return, ptr %d) { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc26_12.1.d = getelementptr inbounds { { i32 }, i32 }, ptr %d, i32 0, i32 1 +// CHECK:STDOUT: %.loc26_12.1.d = getelementptr inbounds nuw { { i32 }, i32 }, ptr %d, i32 0, i32 1 // CHECK:STDOUT: %.loc26_12.2 = load i32, ptr %.loc26_12.1.d, align 4 -// CHECK:STDOUT: %.loc26_17.1.base = getelementptr inbounds { { i32 }, i32 }, ptr %d, i32 0, i32 0 -// CHECK:STDOUT: %.loc26_22.1.b = getelementptr inbounds { i32 }, ptr %.loc26_17.1.base, i32 0, i32 0 +// CHECK:STDOUT: %.loc26_17.1.base = getelementptr inbounds nuw { { i32 }, i32 }, ptr %d, i32 0, i32 0 +// CHECK:STDOUT: %.loc26_22.1.b = getelementptr inbounds nuw { i32 }, ptr %.loc26_17.1.base, i32 0, i32 0 // CHECK:STDOUT: %.loc26_22.2 = load i32, ptr %.loc26_22.1.b, align 4 -// CHECK:STDOUT: %.loc26_24.2.tuple.elem = getelementptr inbounds { i32, i32 }, ptr %return, i32 0, i32 0 +// CHECK:STDOUT: %.loc26_24.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0 // CHECK:STDOUT: store i32 %.loc26_12.2, ptr %.loc26_24.2.tuple.elem, align 4 -// CHECK:STDOUT: %.loc26_24.4.tuple.elem = getelementptr inbounds { i32, i32 }, ptr %return, i32 0, i32 1 +// CHECK:STDOUT: %.loc26_24.4.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1 // CHECK:STDOUT: store i32 %.loc26_22.2, ptr %.loc26_24.4.tuple.elem, align 4 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: define ptr @Convert(ptr %p) { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc30_11.2.base = getelementptr inbounds { { i32 }, i32 }, ptr %p, i32 0, i32 0 +// CHECK:STDOUT: %.loc30_11.2.base = getelementptr inbounds nuw { { i32 }, i32 }, ptr %p, i32 0, i32 0 // CHECK:STDOUT: ret ptr %.loc30_11.2.base // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/class/field.carbon b/toolchain/lower/testdata/class/field.carbon index cb7f1f62906ed..9ff92362aa3cb 100644 --- a/toolchain/lower/testdata/class/field.carbon +++ b/toolchain/lower/testdata/class/field.carbon @@ -29,9 +29,9 @@ fn Run() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: define i32 @F(ptr %c) { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc17_13.1.b = getelementptr inbounds { i32, ptr }, ptr %c, i32 0, i32 1 +// CHECK:STDOUT: %.loc17_13.1.b = getelementptr inbounds nuw { i32, ptr }, ptr %c, i32 0, i32 1 // CHECK:STDOUT: %.loc17_13.2 = load ptr, ptr %.loc17_13.1.b, align 8 -// CHECK:STDOUT: %.loc17_16.1.a = getelementptr inbounds { i32, ptr }, ptr %.loc17_13.2, i32 0, i32 0 +// CHECK:STDOUT: %.loc17_16.1.a = getelementptr inbounds nuw { i32, ptr }, ptr %.loc17_13.2, i32 0, i32 0 // CHECK:STDOUT: %.loc17_16.2 = load i32, ptr %.loc17_16.1.a, align 4 // CHECK:STDOUT: ret i32 %.loc17_16.2 // CHECK:STDOUT: } @@ -39,9 +39,9 @@ fn Run() -> i32 { // CHECK:STDOUT: define i32 @main() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %c.var = alloca { i32, ptr }, align 8 -// CHECK:STDOUT: %.loc22_4.a = getelementptr inbounds { i32, ptr }, ptr %c.var, i32 0, i32 0 +// CHECK:STDOUT: %.loc22_4.a = getelementptr inbounds nuw { i32, ptr }, ptr %c.var, i32 0, i32 0 // CHECK:STDOUT: store i32 1, ptr %.loc22_4.a, align 4 -// CHECK:STDOUT: %.loc23_4.b = getelementptr inbounds { i32, ptr }, ptr %c.var, i32 0, i32 1 +// CHECK:STDOUT: %.loc23_4.b = getelementptr inbounds nuw { i32, ptr }, ptr %c.var, i32 0, i32 1 // CHECK:STDOUT: store ptr %c.var, ptr %.loc23_4.b, align 8 // CHECK:STDOUT: %F.call = call i32 @F(ptr %c.var) // CHECK:STDOUT: ret i32 %F.call diff --git a/toolchain/lower/testdata/class/self.carbon b/toolchain/lower/testdata/class/self.carbon index 53e33bc99dea7..7b5f3746abd28 100644 --- a/toolchain/lower/testdata/class/self.carbon +++ b/toolchain/lower/testdata/class/self.carbon @@ -28,14 +28,14 @@ fn C.Set[addr self: C*]() { // CHECK:STDOUT: // CHECK:STDOUT: define i32 @Get(ptr %self) { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc19_14.1.a = getelementptr inbounds { i32 }, ptr %self, i32 0, i32 0 +// CHECK:STDOUT: %.loc19_14.1.a = getelementptr inbounds nuw { i32 }, ptr %self, i32 0, i32 0 // CHECK:STDOUT: %.loc19_14.2 = load i32, ptr %.loc19_14.1.a, align 4 // CHECK:STDOUT: ret i32 %.loc19_14.2 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: define void @Set(ptr %self) { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc23_10.a = getelementptr inbounds { i32 }, ptr %self, i32 0, i32 0 +// CHECK:STDOUT: %.loc23_10.a = getelementptr inbounds nuw { i32 }, ptr %self, i32 0, i32 0 // CHECK:STDOUT: store i32 1, ptr %.loc23_10.a, align 4 // CHECK:STDOUT: ret void // CHECK:STDOUT: } diff --git a/toolchain/lower/testdata/class/value_access.carbon b/toolchain/lower/testdata/class/value_access.carbon index d9774f6c3a311..4bf2f888da908 100644 --- a/toolchain/lower/testdata/class/value_access.carbon +++ b/toolchain/lower/testdata/class/value_access.carbon @@ -24,21 +24,21 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: define i32 @F(ptr %c) { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc19_11.1.a = getelementptr inbounds { { i32, i32, i32 } }, ptr %c, i32 0, i32 0 -// CHECK:STDOUT: %.loc19_11.2.tuple.elem = getelementptr inbounds { i32, i32, i32 }, ptr %.loc19_11.1.a, i32 0, i32 0 +// CHECK:STDOUT: %.loc19_11.1.a = getelementptr inbounds nuw { { i32, i32, i32 } }, ptr %c, i32 0, i32 0 +// CHECK:STDOUT: %.loc19_11.2.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %.loc19_11.1.a, i32 0, i32 0 // CHECK:STDOUT: %.loc19_11.3 = load i32, ptr %.loc19_11.2.tuple.elem, align 4 -// CHECK:STDOUT: %.loc19_11.4.tuple.elem = getelementptr inbounds { i32, i32, i32 }, ptr %.loc19_11.1.a, i32 0, i32 1 +// CHECK:STDOUT: %.loc19_11.4.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %.loc19_11.1.a, i32 0, i32 1 // CHECK:STDOUT: %.loc19_11.5 = load i32, ptr %.loc19_11.4.tuple.elem, align 4 -// CHECK:STDOUT: %.loc19_11.6.tuple.elem = getelementptr inbounds { i32, i32, i32 }, ptr %.loc19_11.1.a, i32 0, i32 2 +// CHECK:STDOUT: %.loc19_11.6.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %.loc19_11.1.a, i32 0, i32 2 // CHECK:STDOUT: %.loc19_11.7 = load i32, ptr %.loc19_11.6.tuple.elem, align 4 // CHECK:STDOUT: %tuple = alloca { i32, i32, i32 }, align 8 -// CHECK:STDOUT: %tuple1 = getelementptr inbounds { i32, i32, i32 }, ptr %tuple, i32 0, i32 0 +// CHECK:STDOUT: %tuple1 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %tuple, i32 0, i32 0 // CHECK:STDOUT: store i32 %.loc19_11.3, ptr %tuple1, align 4 -// CHECK:STDOUT: %tuple2 = getelementptr inbounds { i32, i32, i32 }, ptr %tuple, i32 0, i32 1 +// CHECK:STDOUT: %tuple2 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %tuple, i32 0, i32 1 // CHECK:STDOUT: store i32 %.loc19_11.5, ptr %tuple2, align 4 -// CHECK:STDOUT: %tuple3 = getelementptr inbounds { i32, i32, i32 }, ptr %tuple, i32 0, i32 2 +// CHECK:STDOUT: %tuple3 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %tuple, i32 0, i32 2 // CHECK:STDOUT: store i32 %.loc19_11.7, ptr %tuple3, align 4 -// CHECK:STDOUT: %.loc19_15.tuple.index = getelementptr inbounds { i32, i32, i32 }, ptr %tuple, i32 0, i32 1 +// CHECK:STDOUT: %.loc19_15.tuple.index = getelementptr inbounds nuw { i32, i32, i32 }, ptr %tuple, i32 0, i32 1 // CHECK:STDOUT: %.loc19_15.tuple.index.load = load i32, ptr %.loc19_15.tuple.index, align 4 // CHECK:STDOUT: ret i32 %.loc19_15.tuple.index.load // CHECK:STDOUT: } diff --git a/toolchain/lower/testdata/function/call/tuple_param_with_return_slot.carbon b/toolchain/lower/testdata/function/call/tuple_param_with_return_slot.carbon index 20ed9d875c330..51291ca1c01c6 100644 --- a/toolchain/lower/testdata/function/call/tuple_param_with_return_slot.carbon +++ b/toolchain/lower/testdata/function/call/tuple_param_with_return_slot.carbon @@ -24,15 +24,15 @@ fn Main() { // CHECK:STDOUT: define void @F(ptr sret({ i32, i32, i32 }) %return, { i32 } %b, ptr %c) { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc12_14.tuple.index = extractvalue { i32 } %b, 0 -// CHECK:STDOUT: %.loc12_20.tuple.index = getelementptr inbounds { i32, i32 }, ptr %c, i32 0, i32 0 +// CHECK:STDOUT: %.loc12_20.tuple.index = getelementptr inbounds nuw { i32, i32 }, ptr %c, i32 0, i32 0 // CHECK:STDOUT: %.loc12_20.tuple.index.load = load i32, ptr %.loc12_20.tuple.index, align 4 -// CHECK:STDOUT: %.loc12_26.tuple.index = getelementptr inbounds { i32, i32 }, ptr %c, i32 0, i32 1 +// CHECK:STDOUT: %.loc12_26.tuple.index = getelementptr inbounds nuw { i32, i32 }, ptr %c, i32 0, i32 1 // CHECK:STDOUT: %.loc12_26.tuple.index.load = load i32, ptr %.loc12_26.tuple.index, align 4 -// CHECK:STDOUT: %.loc12_27.2.tuple.elem = getelementptr inbounds { i32, i32, i32 }, ptr %return, i32 0, i32 0 +// CHECK:STDOUT: %.loc12_27.2.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 0 // CHECK:STDOUT: store i32 %.loc12_14.tuple.index, ptr %.loc12_27.2.tuple.elem, align 4 -// CHECK:STDOUT: %.loc12_27.4.tuple.elem = getelementptr inbounds { i32, i32, i32 }, ptr %return, i32 0, i32 1 +// CHECK:STDOUT: %.loc12_27.4.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 1 // CHECK:STDOUT: store i32 %.loc12_20.tuple.index.load, ptr %.loc12_27.4.tuple.elem, align 4 -// CHECK:STDOUT: %.loc12_27.6.tuple.elem = getelementptr inbounds { i32, i32, i32 }, ptr %return, i32 0, i32 2 +// CHECK:STDOUT: %.loc12_27.6.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %return, i32 0, i32 2 // CHECK:STDOUT: store i32 %.loc12_26.tuple.index.load, ptr %.loc12_27.6.tuple.elem, align 4 // CHECK:STDOUT: ret void // CHECK:STDOUT: } diff --git a/toolchain/lower/testdata/impl/assoc_fn_alias.carbon b/toolchain/lower/testdata/impl/assoc_fn_alias.carbon index 1f8d9d683be78..cc807b9da153b 100644 --- a/toolchain/lower/testdata/impl/assoc_fn_alias.carbon +++ b/toolchain/lower/testdata/impl/assoc_fn_alias.carbon @@ -32,7 +32,7 @@ fn Call(a: A) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: define i32 @F(ptr %self) { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc22_16.1.n = getelementptr inbounds { i32 }, ptr %self, i32 0, i32 0 +// CHECK:STDOUT: %.loc22_16.1.n = getelementptr inbounds nuw { i32 }, ptr %self, i32 0, i32 0 // CHECK:STDOUT: %.loc22_16.2 = load i32, ptr %.loc22_16.1.n, align 4 // CHECK:STDOUT: ret i32 %.loc22_16.2 // CHECK:STDOUT: } diff --git a/toolchain/lower/testdata/impl/impl.carbon b/toolchain/lower/testdata/impl/impl.carbon index 90c55a1d8fddb..0a1d2c72897cb 100644 --- a/toolchain/lower/testdata/impl/impl.carbon +++ b/toolchain/lower/testdata/impl/impl.carbon @@ -31,7 +31,7 @@ fn Call(a: A) -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: define i32 @F(ptr %self) { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc21_16.1.n = getelementptr inbounds { i32 }, ptr %self, i32 0, i32 0 +// CHECK:STDOUT: %.loc21_16.1.n = getelementptr inbounds nuw { i32 }, ptr %self, i32 0, i32 0 // CHECK:STDOUT: %.loc21_16.2 = load i32, ptr %.loc21_16.1.n, align 4 // CHECK:STDOUT: ret i32 %.loc21_16.2 // CHECK:STDOUT: } diff --git a/toolchain/lower/testdata/index/array_element_access.carbon b/toolchain/lower/testdata/index/array_element_access.carbon index 6148769ae494d..8c17c062a2d71 100644 --- a/toolchain/lower/testdata/index/array_element_access.carbon +++ b/toolchain/lower/testdata/index/array_element_access.carbon @@ -26,8 +26,8 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: define void @A(ptr sret({ i32, i32 }) %return) { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc10_36.2.tuple.elem = getelementptr inbounds { i32, i32 }, ptr %return, i32 0, i32 0 -// CHECK:STDOUT: %.loc10_36.4.tuple.elem = getelementptr inbounds { i32, i32 }, ptr %return, i32 0, i32 1 +// CHECK:STDOUT: %.loc10_36.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0 +// CHECK:STDOUT: %.loc10_36.4.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %return, ptr align 4 @tuple.loc10_37, i64 8, i1 false) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -45,18 +45,18 @@ fn Run() { // CHECK:STDOUT: %a.var = alloca [2 x i32], align 4 // CHECK:STDOUT: %.loc15_22.1.temp = alloca { i32, i32 }, align 8 // CHECK:STDOUT: call void @A(ptr %.loc15_22.1.temp) -// CHECK:STDOUT: %.loc15_22.3.tuple.elem = getelementptr inbounds { i32, i32 }, ptr %.loc15_22.1.temp, i32 0, i32 0 +// CHECK:STDOUT: %.loc15_22.3.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %.loc15_22.1.temp, i32 0, i32 0 // CHECK:STDOUT: %.loc15_22.4 = load i32, ptr %.loc15_22.3.tuple.elem, align 4 // CHECK:STDOUT: %.loc15_22.6.array.index = getelementptr inbounds [2 x i32], ptr %a.var, i32 0, i32 0 // CHECK:STDOUT: store i32 %.loc15_22.4, ptr %.loc15_22.6.array.index, align 4 -// CHECK:STDOUT: %.loc15_22.8.tuple.elem = getelementptr inbounds { i32, i32 }, ptr %.loc15_22.1.temp, i32 0, i32 1 +// CHECK:STDOUT: %.loc15_22.8.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %.loc15_22.1.temp, i32 0, i32 1 // CHECK:STDOUT: %.loc15_22.9 = load i32, ptr %.loc15_22.8.tuple.elem, align 4 // CHECK:STDOUT: %.loc15_22.11.array.index = getelementptr inbounds [2 x i32], ptr %a.var, i32 0, i32 1 // CHECK:STDOUT: store i32 %.loc15_22.9, ptr %.loc15_22.11.array.index, align 4 // CHECK:STDOUT: %b.var = alloca i32, align 4 // CHECK:STDOUT: %.loc16_17.1.temp = alloca { i32, i32 }, align 8 // CHECK:STDOUT: call void @A(ptr %.loc16_17.1.temp) -// CHECK:STDOUT: %.loc16_21.1.tuple.index = getelementptr inbounds { i32, i32 }, ptr %.loc16_17.1.temp, i32 0, i32 0 +// CHECK:STDOUT: %.loc16_21.1.tuple.index = getelementptr inbounds nuw { i32, i32 }, ptr %.loc16_17.1.temp, i32 0, i32 0 // CHECK:STDOUT: %.loc16_21.2 = load i32, ptr %.loc16_21.1.tuple.index, align 4 // CHECK:STDOUT: store i32 %.loc16_21.2, ptr %b.var, align 4 // CHECK:STDOUT: %c.var = alloca i32, align 4 diff --git a/toolchain/lower/testdata/index/tuple_element_access.carbon b/toolchain/lower/testdata/index/tuple_element_access.carbon index a045dba4add02..62384404cf4f0 100644 --- a/toolchain/lower/testdata/index/tuple_element_access.carbon +++ b/toolchain/lower/testdata/index/tuple_element_access.carbon @@ -23,16 +23,16 @@ fn Run() -> i32 { // CHECK:STDOUT: define i32 @main() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca { i32, i32, i32 }, align 8 -// CHECK:STDOUT: %.loc12_36.2.tuple.elem = getelementptr inbounds { i32, i32, i32 }, ptr %a.var, i32 0, i32 0 -// CHECK:STDOUT: %.loc12_36.4.tuple.elem = getelementptr inbounds { i32, i32, i32 }, ptr %a.var, i32 0, i32 1 -// CHECK:STDOUT: %.loc12_36.6.tuple.elem = getelementptr inbounds { i32, i32, i32 }, ptr %a.var, i32 0, i32 2 +// CHECK:STDOUT: %.loc12_36.2.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 0 +// CHECK:STDOUT: %.loc12_36.4.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 1 +// CHECK:STDOUT: %.loc12_36.6.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 2 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %a.var, ptr align 4 @tuple.loc12_37, i64 12, i1 false) // CHECK:STDOUT: %b.var = alloca i32, align 4 -// CHECK:STDOUT: %.loc13_19.1.tuple.index = getelementptr inbounds { i32, i32, i32 }, ptr %a.var, i32 0, i32 0 +// CHECK:STDOUT: %.loc13_19.1.tuple.index = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 0 // CHECK:STDOUT: %.loc13_19.2 = load i32, ptr %.loc13_19.1.tuple.index, align 4 // CHECK:STDOUT: store i32 %.loc13_19.2, ptr %b.var, align 4 // CHECK:STDOUT: %c.var = alloca i32, align 4 -// CHECK:STDOUT: %.loc14_19.1.tuple.index = getelementptr inbounds { i32, i32, i32 }, ptr %a.var, i32 0, i32 2 +// CHECK:STDOUT: %.loc14_19.1.tuple.index = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 2 // CHECK:STDOUT: %.loc14_19.2 = load i32, ptr %.loc14_19.1.tuple.index, align 4 // CHECK:STDOUT: store i32 %.loc14_19.2, ptr %c.var, align 4 // CHECK:STDOUT: ret i32 0 diff --git a/toolchain/lower/testdata/index/tuple_return_value_access.carbon b/toolchain/lower/testdata/index/tuple_return_value_access.carbon index 35630114dbdac..d0429818ff77d 100644 --- a/toolchain/lower/testdata/index/tuple_return_value_access.carbon +++ b/toolchain/lower/testdata/index/tuple_return_value_access.carbon @@ -21,8 +21,8 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: define void @F(ptr sret({ i32, i32 }) %return) { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc11_38.2.tuple.elem = getelementptr inbounds { i32, i32 }, ptr %return, i32 0, i32 0 -// CHECK:STDOUT: %.loc11_38.4.tuple.elem = getelementptr inbounds { i32, i32 }, ptr %return, i32 0, i32 1 +// CHECK:STDOUT: %.loc11_38.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0 +// CHECK:STDOUT: %.loc11_38.4.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %return, ptr align 4 @tuple.loc11_39, i64 8, i1 false) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -32,7 +32,7 @@ fn Run() { // CHECK:STDOUT: %t.var = alloca i32, align 4 // CHECK:STDOUT: %.loc14_17.1.temp = alloca { i32, i32 }, align 8 // CHECK:STDOUT: call void @F(ptr %.loc14_17.1.temp) -// CHECK:STDOUT: %.loc14_21.1.tuple.index = getelementptr inbounds { i32, i32 }, ptr %.loc14_17.1.temp, i32 0, i32 1 +// CHECK:STDOUT: %.loc14_21.1.tuple.index = getelementptr inbounds nuw { i32, i32 }, ptr %.loc14_17.1.temp, i32 0, i32 1 // CHECK:STDOUT: %.loc14_21.2 = load i32, ptr %.loc14_21.1.tuple.index, align 4 // CHECK:STDOUT: store i32 %.loc14_21.2, ptr %t.var, align 4 // CHECK:STDOUT: ret void diff --git a/toolchain/lower/testdata/let/tuple.carbon b/toolchain/lower/testdata/let/tuple.carbon index 3affa6586e60a..ddb7cb5a20f32 100644 --- a/toolchain/lower/testdata/let/tuple.carbon +++ b/toolchain/lower/testdata/let/tuple.carbon @@ -24,44 +24,44 @@ fn F() -> i32 { // CHECK:STDOUT: define i32 @F() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca { i32, i32, i32 }, align 8 -// CHECK:STDOUT: %.loc12_36.2.tuple.elem = getelementptr inbounds { i32, i32, i32 }, ptr %a.var, i32 0, i32 0 -// CHECK:STDOUT: %.loc12_36.4.tuple.elem = getelementptr inbounds { i32, i32, i32 }, ptr %a.var, i32 0, i32 1 -// CHECK:STDOUT: %.loc12_36.6.tuple.elem = getelementptr inbounds { i32, i32, i32 }, ptr %a.var, i32 0, i32 2 +// CHECK:STDOUT: %.loc12_36.2.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 0 +// CHECK:STDOUT: %.loc12_36.4.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 1 +// CHECK:STDOUT: %.loc12_36.6.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 2 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %a.var, ptr align 4 @tuple.1.loc12_37, i64 12, i1 false) // CHECK:STDOUT: %b.var = alloca { i32, i32 }, align 8 -// CHECK:STDOUT: %.loc13_28.2.tuple.elem = getelementptr inbounds { i32, i32 }, ptr %b.var, i32 0, i32 0 -// CHECK:STDOUT: %.loc13_28.4.tuple.elem = getelementptr inbounds { i32, i32 }, ptr %b.var, i32 0, i32 1 +// CHECK:STDOUT: %.loc13_28.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 0 +// CHECK:STDOUT: %.loc13_28.4.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 1 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %b.var, ptr align 4 @tuple.2.loc13_29, i64 8, i1 false) -// CHECK:STDOUT: %.loc14_43.1.tuple.elem = getelementptr inbounds { i32, i32, i32 }, ptr %a.var, i32 0, i32 0 +// CHECK:STDOUT: %.loc14_43.1.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 0 // CHECK:STDOUT: %.loc14_43.2 = load i32, ptr %.loc14_43.1.tuple.elem, align 4 -// CHECK:STDOUT: %.loc14_43.3.tuple.elem = getelementptr inbounds { i32, i32, i32 }, ptr %a.var, i32 0, i32 1 +// CHECK:STDOUT: %.loc14_43.3.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 1 // CHECK:STDOUT: %.loc14_43.4 = load i32, ptr %.loc14_43.3.tuple.elem, align 4 -// CHECK:STDOUT: %.loc14_43.5.tuple.elem = getelementptr inbounds { i32, i32, i32 }, ptr %a.var, i32 0, i32 2 +// CHECK:STDOUT: %.loc14_43.5.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 2 // CHECK:STDOUT: %.loc14_43.6 = load i32, ptr %.loc14_43.5.tuple.elem, align 4 // CHECK:STDOUT: %tuple.loc14_43 = alloca { i32, i32, i32 }, align 8 -// CHECK:STDOUT: %tuple.loc14_431 = getelementptr inbounds { i32, i32, i32 }, ptr %tuple.loc14_43, i32 0, i32 0 +// CHECK:STDOUT: %tuple.loc14_431 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %tuple.loc14_43, i32 0, i32 0 // CHECK:STDOUT: store i32 %.loc14_43.2, ptr %tuple.loc14_431, align 4 -// CHECK:STDOUT: %tuple.loc14_432 = getelementptr inbounds { i32, i32, i32 }, ptr %tuple.loc14_43, i32 0, i32 1 +// CHECK:STDOUT: %tuple.loc14_432 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %tuple.loc14_43, i32 0, i32 1 // CHECK:STDOUT: store i32 %.loc14_43.4, ptr %tuple.loc14_432, align 4 -// CHECK:STDOUT: %tuple.loc14_433 = getelementptr inbounds { i32, i32, i32 }, ptr %tuple.loc14_43, i32 0, i32 2 +// CHECK:STDOUT: %tuple.loc14_433 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %tuple.loc14_43, i32 0, i32 2 // CHECK:STDOUT: store i32 %.loc14_43.6, ptr %tuple.loc14_433, align 4 -// CHECK:STDOUT: %.loc14_46.1.tuple.elem = getelementptr inbounds { i32, i32 }, ptr %b.var, i32 0, i32 0 +// CHECK:STDOUT: %.loc14_46.1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 0 // CHECK:STDOUT: %.loc14_46.2 = load i32, ptr %.loc14_46.1.tuple.elem, align 4 -// CHECK:STDOUT: %.loc14_46.3.tuple.elem = getelementptr inbounds { i32, i32 }, ptr %b.var, i32 0, i32 1 +// CHECK:STDOUT: %.loc14_46.3.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 1 // CHECK:STDOUT: %.loc14_46.4 = load i32, ptr %.loc14_46.3.tuple.elem, align 4 // CHECK:STDOUT: %tuple.loc14_46 = alloca { i32, i32 }, align 8 -// CHECK:STDOUT: %tuple.loc14_464 = getelementptr inbounds { i32, i32 }, ptr %tuple.loc14_46, i32 0, i32 0 +// CHECK:STDOUT: %tuple.loc14_464 = getelementptr inbounds nuw { i32, i32 }, ptr %tuple.loc14_46, i32 0, i32 0 // CHECK:STDOUT: store i32 %.loc14_46.2, ptr %tuple.loc14_464, align 4 -// CHECK:STDOUT: %tuple.loc14_465 = getelementptr inbounds { i32, i32 }, ptr %tuple.loc14_46, i32 0, i32 1 +// CHECK:STDOUT: %tuple.loc14_465 = getelementptr inbounds nuw { i32, i32 }, ptr %tuple.loc14_46, i32 0, i32 1 // CHECK:STDOUT: store i32 %.loc14_46.4, ptr %tuple.loc14_465, align 4 // CHECK:STDOUT: %tuple.loc14_47 = alloca { ptr, ptr }, align 8 -// CHECK:STDOUT: %tuple.loc14_476 = getelementptr inbounds { ptr, ptr }, ptr %tuple.loc14_47, i32 0, i32 0 +// CHECK:STDOUT: %tuple.loc14_476 = getelementptr inbounds nuw { ptr, ptr }, ptr %tuple.loc14_47, i32 0, i32 0 // CHECK:STDOUT: store ptr %tuple.loc14_43, ptr %tuple.loc14_476, align 8 -// CHECK:STDOUT: %tuple.loc14_477 = getelementptr inbounds { ptr, ptr }, ptr %tuple.loc14_47, i32 0, i32 1 +// CHECK:STDOUT: %tuple.loc14_477 = getelementptr inbounds nuw { ptr, ptr }, ptr %tuple.loc14_47, i32 0, i32 1 // CHECK:STDOUT: store ptr %tuple.loc14_46, ptr %tuple.loc14_477, align 8 -// CHECK:STDOUT: %.loc15_13.tuple.index = getelementptr inbounds { ptr, ptr }, ptr %tuple.loc14_47, i32 0, i32 1 +// CHECK:STDOUT: %.loc15_13.tuple.index = getelementptr inbounds nuw { ptr, ptr }, ptr %tuple.loc14_47, i32 0, i32 1 // CHECK:STDOUT: %.loc15_13.tuple.index.load = load ptr, ptr %.loc15_13.tuple.index, align 8 -// CHECK:STDOUT: %.loc15_16.tuple.index = getelementptr inbounds { i32, i32 }, ptr %.loc15_13.tuple.index.load, i32 0, i32 1 +// CHECK:STDOUT: %.loc15_16.tuple.index = getelementptr inbounds nuw { i32, i32 }, ptr %.loc15_13.tuple.index.load, i32 0, i32 1 // CHECK:STDOUT: %.loc15_16.tuple.index.load = load i32, ptr %.loc15_16.tuple.index, align 4 // CHECK:STDOUT: ret i32 %.loc15_16.tuple.index.load // CHECK:STDOUT: } diff --git a/toolchain/lower/testdata/operators/assignment.carbon b/toolchain/lower/testdata/operators/assignment.carbon index 9160fbefe5bf1..74fbe01f5af46 100644 --- a/toolchain/lower/testdata/operators/assignment.carbon +++ b/toolchain/lower/testdata/operators/assignment.carbon @@ -26,8 +26,8 @@ fn Main() { // CHECK:STDOUT: store i32 12, ptr %a.var, align 4 // CHECK:STDOUT: store i32 9, ptr %a.var, align 4 // CHECK:STDOUT: %b.var = alloca { i32, i32 }, align 8 -// CHECK:STDOUT: %.loc15_12.2.tuple.elem = getelementptr inbounds { i32, i32 }, ptr %b.var, i32 0, i32 0 -// CHECK:STDOUT: %.loc15_12.4.tuple.elem = getelementptr inbounds { i32, i32 }, ptr %b.var, i32 0, i32 1 +// CHECK:STDOUT: %.loc15_12.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 0 +// CHECK:STDOUT: %.loc15_12.4.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %b.var, i32 0, i32 1 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %b.var, ptr align 4 @tuple.loc15_5, i64 8, i1 false) // CHECK:STDOUT: ret void // CHECK:STDOUT: } diff --git a/toolchain/lower/testdata/operators/overloaded.carbon b/toolchain/lower/testdata/operators/overloaded.carbon index a4847f14cfce4..835b4d599a12a 100644 --- a/toolchain/lower/testdata/operators/overloaded.carbon +++ b/toolchain/lower/testdata/operators/overloaded.carbon @@ -33,22 +33,22 @@ fn Calculate(a: Number, b: Number) -> Number { // CHECK:STDOUT: // CHECK:STDOUT: define void @Op(ptr sret({ i1 }) %return, ptr %self) { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc17_36.1.is_positive = getelementptr inbounds { i1 }, ptr %self, i32 0, i32 0 +// CHECK:STDOUT: %.loc17_36.1.is_positive = getelementptr inbounds nuw { i1 }, ptr %self, i32 0, i32 0 // CHECK:STDOUT: %.loc17_36.2 = load i1, ptr %.loc17_36.1.is_positive, align 1 // CHECK:STDOUT: %.loc17_28 = xor i1 %.loc17_36.2, true -// CHECK:STDOUT: %.loc17_48.2.is_positive = getelementptr inbounds { i1 }, ptr %return, i32 0, i32 0 +// CHECK:STDOUT: %.loc17_48.2.is_positive = getelementptr inbounds nuw { i1 }, ptr %return, i32 0, i32 0 // CHECK:STDOUT: store i1 %.loc17_28, ptr %.loc17_48.2.is_positive, align 1 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: define void @Op.1(ptr sret({ i1 }) %return, ptr %self, ptr %other) { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc22_33.1.is_positive = getelementptr inbounds { i1 }, ptr %self, i32 0, i32 0 +// CHECK:STDOUT: %.loc22_33.1.is_positive = getelementptr inbounds nuw { i1 }, ptr %self, i32 0, i32 0 // CHECK:STDOUT: %.loc22_33.2 = load i1, ptr %.loc22_33.1.is_positive, align 1 // CHECK:STDOUT: br i1 %.loc22_33.2, label %and.rhs.loc22, label %and.result.loc22 // CHECK:STDOUT: // CHECK:STDOUT: and.rhs.loc22: ; preds = %entry -// CHECK:STDOUT: %.loc22_55.1.is_positive = getelementptr inbounds { i1 }, ptr %other, i32 0, i32 0 +// CHECK:STDOUT: %.loc22_55.1.is_positive = getelementptr inbounds nuw { i1 }, ptr %other, i32 0, i32 0 // CHECK:STDOUT: %.loc22_55.2 = load i1, ptr %.loc22_55.1.is_positive, align 1 // CHECK:STDOUT: br label %and.result.loc22 // CHECK:STDOUT: @@ -58,13 +58,13 @@ fn Calculate(a: Number, b: Number) -> Number { // CHECK:STDOUT: br i1 %.loc22_69.1, label %or.rhs, label %or.result // CHECK:STDOUT: // CHECK:STDOUT: or.rhs: ; preds = %and.result.loc22 -// CHECK:STDOUT: %.loc23_38.1.is_positive = getelementptr inbounds { i1 }, ptr %self, i32 0, i32 0 +// CHECK:STDOUT: %.loc23_38.1.is_positive = getelementptr inbounds nuw { i1 }, ptr %self, i32 0, i32 0 // CHECK:STDOUT: %.loc23_38.2 = load i1, ptr %.loc23_38.1.is_positive, align 1 // CHECK:STDOUT: %.loc23_30 = xor i1 %.loc23_38.2, true // CHECK:STDOUT: br i1 %.loc23_30, label %and.rhs.loc23, label %and.result.loc23 // CHECK:STDOUT: // CHECK:STDOUT: and.rhs.loc23: ; preds = %or.rhs -// CHECK:STDOUT: %.loc23_64.1.is_positive = getelementptr inbounds { i1 }, ptr %other, i32 0, i32 0 +// CHECK:STDOUT: %.loc23_64.1.is_positive = getelementptr inbounds nuw { i1 }, ptr %other, i32 0, i32 0 // CHECK:STDOUT: %.loc23_64.2 = load i1, ptr %.loc23_64.1.is_positive, align 1 // CHECK:STDOUT: %.loc23_55 = xor i1 %.loc23_64.2, true // CHECK:STDOUT: br label %and.result.loc23 @@ -75,7 +75,7 @@ fn Calculate(a: Number, b: Number) -> Number { // CHECK:STDOUT: // CHECK:STDOUT: or.result: ; preds = %and.result.loc23, %and.result.loc22 // CHECK:STDOUT: %2 = phi i1 [ true, %and.result.loc22 ], [ %1, %and.result.loc23 ] -// CHECK:STDOUT: %.loc23_77.2.is_positive = getelementptr inbounds { i1 }, ptr %return, i32 0, i32 0 +// CHECK:STDOUT: %.loc23_77.2.is_positive = getelementptr inbounds nuw { i1 }, ptr %return, i32 0, i32 0 // CHECK:STDOUT: store i1 %2, ptr %.loc23_77.2.is_positive, align 1 // CHECK:STDOUT: ret void // CHECK:STDOUT: } diff --git a/toolchain/lower/testdata/pointer/address_of_field.carbon b/toolchain/lower/testdata/pointer/address_of_field.carbon index 6268cdc63d9e3..9db04baf6e6f5 100644 --- a/toolchain/lower/testdata/pointer/address_of_field.carbon +++ b/toolchain/lower/testdata/pointer/address_of_field.carbon @@ -25,10 +25,10 @@ fn F() { // CHECK:STDOUT: define void @F() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %s.var = alloca { i32, i32 }, align 8 -// CHECK:STDOUT: %.loc14_46.2.a = getelementptr inbounds { i32, i32 }, ptr %s.var, i32 0, i32 0 -// CHECK:STDOUT: %.loc14_46.4.b = getelementptr inbounds { i32, i32 }, ptr %s.var, i32 0, i32 1 +// CHECK:STDOUT: %.loc14_46.2.a = getelementptr inbounds nuw { i32, i32 }, ptr %s.var, i32 0, i32 0 +// CHECK:STDOUT: %.loc14_46.4.b = getelementptr inbounds nuw { i32, i32 }, ptr %s.var, i32 0, i32 1 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %s.var, ptr align 4 @struct.loc14_47, i64 8, i1 false) -// CHECK:STDOUT: %.loc15_7.b = getelementptr inbounds { i32, i32 }, ptr %s.var, i32 0, i32 1 +// CHECK:STDOUT: %.loc15_7.b = getelementptr inbounds nuw { i32, i32 }, ptr %s.var, i32 0, i32 1 // CHECK:STDOUT: call void @G(ptr %.loc15_7.b) // CHECK:STDOUT: ret void // CHECK:STDOUT: } diff --git a/toolchain/lower/testdata/return/return_var.carbon b/toolchain/lower/testdata/return/return_var.carbon index bd6aabe910943..a41c83f41d063 100644 --- a/toolchain/lower/testdata/return/return_var.carbon +++ b/toolchain/lower/testdata/return/return_var.carbon @@ -24,8 +24,8 @@ fn Make() -> C { // CHECK:STDOUT: // CHECK:STDOUT: define void @Make(ptr sret({ i32, ptr }) %return) { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc18_30.2.data = getelementptr inbounds { i32, ptr }, ptr %return, i32 0, i32 0 -// CHECK:STDOUT: %.loc18_30.4.next = getelementptr inbounds { i32, ptr }, ptr %return, i32 0, i32 1 +// CHECK:STDOUT: %.loc18_30.2.data = getelementptr inbounds nuw { i32, ptr }, ptr %return, i32 0, i32 0 +// CHECK:STDOUT: %.loc18_30.4.next = getelementptr inbounds nuw { i32, ptr }, ptr %return, i32 0, i32 1 // CHECK:STDOUT: store ptr %return, ptr %.loc18_30.4.next, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } diff --git a/toolchain/lower/testdata/struct/member_access.carbon b/toolchain/lower/testdata/struct/member_access.carbon index 6c6f40519f576..f01d2ad3fba09 100644 --- a/toolchain/lower/testdata/struct/member_access.carbon +++ b/toolchain/lower/testdata/struct/member_access.carbon @@ -23,11 +23,11 @@ fn Run() -> i32 { // CHECK:STDOUT: define i32 @main() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.var = alloca { double, i32 }, align 8 -// CHECK:STDOUT: %.loc12_48.2.a = getelementptr inbounds { double, i32 }, ptr %x.var, i32 0, i32 0 -// CHECK:STDOUT: %.loc12_48.4.b = getelementptr inbounds { double, i32 }, ptr %x.var, i32 0, i32 1 +// CHECK:STDOUT: %.loc12_48.2.a = getelementptr inbounds nuw { double, i32 }, ptr %x.var, i32 0, i32 0 +// CHECK:STDOUT: %.loc12_48.4.b = getelementptr inbounds nuw { double, i32 }, ptr %x.var, i32 0, i32 1 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %x.var, ptr align 8 @struct.loc12_49, i64 16, i1 false) // CHECK:STDOUT: %y.var = alloca i32, align 4 -// CHECK:STDOUT: %.loc13_17.1.b = getelementptr inbounds { double, i32 }, ptr %x.var, i32 0, i32 1 +// CHECK:STDOUT: %.loc13_17.1.b = getelementptr inbounds nuw { double, i32 }, ptr %x.var, i32 0, i32 1 // CHECK:STDOUT: %.loc13_17.2 = load i32, ptr %.loc13_17.1.b, align 4 // CHECK:STDOUT: store i32 %.loc13_17.2, ptr %y.var, align 4 // CHECK:STDOUT: %z.var = alloca i32, align 4 diff --git a/toolchain/lower/testdata/struct/nested_struct_in_place.carbon b/toolchain/lower/testdata/struct/nested_struct_in_place.carbon index bab2e5dc51a42..94d96d565eb31 100644 --- a/toolchain/lower/testdata/struct/nested_struct_in_place.carbon +++ b/toolchain/lower/testdata/struct/nested_struct_in_place.carbon @@ -22,9 +22,9 @@ fn G() { // CHECK:STDOUT: define void @G() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %v.var = alloca { { i32, i32, i32 }, { i32, i32, i32 } }, align 8 -// CHECK:STDOUT: %.loc14_74.1.a = getelementptr inbounds { { i32, i32, i32 }, { i32, i32, i32 } }, ptr %v.var, i32 0, i32 0 +// CHECK:STDOUT: %.loc14_74.1.a = getelementptr inbounds nuw { { i32, i32, i32 }, { i32, i32, i32 } }, ptr %v.var, i32 0, i32 0 // CHECK:STDOUT: call void @F(ptr %.loc14_74.1.a) -// CHECK:STDOUT: %.loc14_74.2.b = getelementptr inbounds { { i32, i32, i32 }, { i32, i32, i32 } }, ptr %v.var, i32 0, i32 1 +// CHECK:STDOUT: %.loc14_74.2.b = getelementptr inbounds nuw { { i32, i32, i32 }, { i32, i32, i32 } }, ptr %v.var, i32 0, i32 1 // CHECK:STDOUT: call void @F(ptr %.loc14_74.2.b) // CHECK:STDOUT: ret void // CHECK:STDOUT: } diff --git a/toolchain/lower/testdata/struct/one_entry.carbon b/toolchain/lower/testdata/struct/one_entry.carbon index 2b714c2c9e8dc..a3857e8550ad8 100644 --- a/toolchain/lower/testdata/struct/one_entry.carbon +++ b/toolchain/lower/testdata/struct/one_entry.carbon @@ -22,7 +22,7 @@ fn Run() -> i32 { // CHECK:STDOUT: %x.var = alloca { i32 }, align 8 // CHECK:STDOUT: store { i32 } { i32 4 }, ptr %x.var, align 4 // CHECK:STDOUT: %y.var = alloca { i32 }, align 8 -// CHECK:STDOUT: %.loc13_22.1.a = getelementptr inbounds { i32 }, ptr %x.var, i32 0, i32 0 +// CHECK:STDOUT: %.loc13_22.1.a = getelementptr inbounds nuw { i32 }, ptr %x.var, i32 0, i32 0 // CHECK:STDOUT: %.loc13_22.2 = load i32, ptr %.loc13_22.1.a, align 4 // CHECK:STDOUT: %.loc13_22.3.struct.init = insertvalue { i32 } poison, i32 %.loc13_22.2, 0 // CHECK:STDOUT: store { i32 } %.loc13_22.3.struct.init, ptr %y.var, align 4 diff --git a/toolchain/lower/testdata/struct/two_entries.carbon b/toolchain/lower/testdata/struct/two_entries.carbon index b18b9f18f004b..0c74c7cf9e58b 100644 --- a/toolchain/lower/testdata/struct/two_entries.carbon +++ b/toolchain/lower/testdata/struct/two_entries.carbon @@ -22,17 +22,17 @@ fn Run() -> i32 { // CHECK:STDOUT: define i32 @main() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.var = alloca { i32, i32 }, align 8 -// CHECK:STDOUT: %.loc12_46.2.a = getelementptr inbounds { i32, i32 }, ptr %x.var, i32 0, i32 0 -// CHECK:STDOUT: %.loc12_46.4.b = getelementptr inbounds { i32, i32 }, ptr %x.var, i32 0, i32 1 +// CHECK:STDOUT: %.loc12_46.2.a = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 0 +// CHECK:STDOUT: %.loc12_46.4.b = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 1 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %x.var, ptr align 4 @struct.loc12_47, i64 8, i1 false) // CHECK:STDOUT: %y.var = alloca { i32, i32 }, align 8 -// CHECK:STDOUT: %.loc13_31.1.a = getelementptr inbounds { i32, i32 }, ptr %x.var, i32 0, i32 0 +// CHECK:STDOUT: %.loc13_31.1.a = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 0 // CHECK:STDOUT: %.loc13_31.2 = load i32, ptr %.loc13_31.1.a, align 4 -// CHECK:STDOUT: %.loc13_31.3.a = getelementptr inbounds { i32, i32 }, ptr %y.var, i32 0, i32 0 +// CHECK:STDOUT: %.loc13_31.3.a = getelementptr inbounds nuw { i32, i32 }, ptr %y.var, i32 0, i32 0 // CHECK:STDOUT: store i32 %.loc13_31.2, ptr %.loc13_31.3.a, align 4 -// CHECK:STDOUT: %.loc13_31.5.b = getelementptr inbounds { i32, i32 }, ptr %x.var, i32 0, i32 1 +// CHECK:STDOUT: %.loc13_31.5.b = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 1 // CHECK:STDOUT: %.loc13_31.6 = load i32, ptr %.loc13_31.5.b, align 4 -// CHECK:STDOUT: %.loc13_31.7.b = getelementptr inbounds { i32, i32 }, ptr %y.var, i32 0, i32 1 +// CHECK:STDOUT: %.loc13_31.7.b = getelementptr inbounds nuw { i32, i32 }, ptr %y.var, i32 0, i32 1 // CHECK:STDOUT: store i32 %.loc13_31.6, ptr %.loc13_31.7.b, align 4 // CHECK:STDOUT: ret i32 0 // CHECK:STDOUT: } diff --git a/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon b/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon index 50e9b6963526e..5dc8fe1fa42fc 100644 --- a/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon +++ b/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon @@ -22,9 +22,9 @@ fn G() { // CHECK:STDOUT: define void @G() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %v.var = alloca { { i32, i32, i32 }, { i32, i32, i32 } }, align 8 -// CHECK:STDOUT: %.loc14_56.1.tuple.elem = getelementptr inbounds { { i32, i32, i32 }, { i32, i32, i32 } }, ptr %v.var, i32 0, i32 0 +// CHECK:STDOUT: %.loc14_56.1.tuple.elem = getelementptr inbounds nuw { { i32, i32, i32 }, { i32, i32, i32 } }, ptr %v.var, i32 0, i32 0 // CHECK:STDOUT: call void @F(ptr %.loc14_56.1.tuple.elem) -// CHECK:STDOUT: %.loc14_56.2.tuple.elem = getelementptr inbounds { { i32, i32, i32 }, { i32, i32, i32 } }, ptr %v.var, i32 0, i32 1 +// CHECK:STDOUT: %.loc14_56.2.tuple.elem = getelementptr inbounds nuw { { i32, i32, i32 }, { i32, i32, i32 } }, ptr %v.var, i32 0, i32 1 // CHECK:STDOUT: call void @F(ptr %.loc14_56.2.tuple.elem) // CHECK:STDOUT: ret void // CHECK:STDOUT: } diff --git a/toolchain/lower/testdata/tuple/one_entry.carbon b/toolchain/lower/testdata/tuple/one_entry.carbon index 2fcfed24143b3..83fa542655768 100644 --- a/toolchain/lower/testdata/tuple/one_entry.carbon +++ b/toolchain/lower/testdata/tuple/one_entry.carbon @@ -22,7 +22,7 @@ fn Run() -> i32 { // CHECK:STDOUT: %x.var = alloca { i32 }, align 8 // CHECK:STDOUT: store { i32 } { i32 1 }, ptr %x.var, align 4 // CHECK:STDOUT: %y.var = alloca { i32 }, align 8 -// CHECK:STDOUT: %.loc13_20.1.tuple.elem = getelementptr inbounds { i32 }, ptr %x.var, i32 0, i32 0 +// CHECK:STDOUT: %.loc13_20.1.tuple.elem = getelementptr inbounds nuw { i32 }, ptr %x.var, i32 0, i32 0 // CHECK:STDOUT: %.loc13_20.2 = load i32, ptr %.loc13_20.1.tuple.elem, align 4 // CHECK:STDOUT: %.loc13_20.3.tuple.init = insertvalue { i32 } poison, i32 %.loc13_20.2, 0 // CHECK:STDOUT: store { i32 } %.loc13_20.3.tuple.init, ptr %y.var, align 4 diff --git a/toolchain/lower/testdata/tuple/two_entries.carbon b/toolchain/lower/testdata/tuple/two_entries.carbon index f92c4e42289ff..3eb65db7a6bf2 100644 --- a/toolchain/lower/testdata/tuple/two_entries.carbon +++ b/toolchain/lower/testdata/tuple/two_entries.carbon @@ -22,17 +22,17 @@ fn Run() -> i32 { // CHECK:STDOUT: define i32 @main() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.var = alloca { i32, i32 }, align 8 -// CHECK:STDOUT: %.loc12_29.2.tuple.elem = getelementptr inbounds { i32, i32 }, ptr %x.var, i32 0, i32 0 -// CHECK:STDOUT: %.loc12_29.4.tuple.elem = getelementptr inbounds { i32, i32 }, ptr %x.var, i32 0, i32 1 +// CHECK:STDOUT: %.loc12_29.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 0 +// CHECK:STDOUT: %.loc12_29.4.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 1 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %x.var, ptr align 4 @tuple.loc12_30, i64 8, i1 false) // CHECK:STDOUT: %y.var = alloca { i32, i32 }, align 8 -// CHECK:STDOUT: %.loc13_23.1.tuple.elem = getelementptr inbounds { i32, i32 }, ptr %x.var, i32 0, i32 0 +// CHECK:STDOUT: %.loc13_23.1.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 0 // CHECK:STDOUT: %.loc13_23.2 = load i32, ptr %.loc13_23.1.tuple.elem, align 4 -// CHECK:STDOUT: %.loc13_23.3.tuple.elem = getelementptr inbounds { i32, i32 }, ptr %y.var, i32 0, i32 0 +// CHECK:STDOUT: %.loc13_23.3.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %y.var, i32 0, i32 0 // CHECK:STDOUT: store i32 %.loc13_23.2, ptr %.loc13_23.3.tuple.elem, align 4 -// CHECK:STDOUT: %.loc13_23.5.tuple.elem = getelementptr inbounds { i32, i32 }, ptr %x.var, i32 0, i32 1 +// CHECK:STDOUT: %.loc13_23.5.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 1 // CHECK:STDOUT: %.loc13_23.6 = load i32, ptr %.loc13_23.5.tuple.elem, align 4 -// CHECK:STDOUT: %.loc13_23.7.tuple.elem = getelementptr inbounds { i32, i32 }, ptr %y.var, i32 0, i32 1 +// CHECK:STDOUT: %.loc13_23.7.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %y.var, i32 0, i32 1 // CHECK:STDOUT: store i32 %.loc13_23.6, ptr %.loc13_23.7.tuple.elem, align 4 // CHECK:STDOUT: ret i32 0 // CHECK:STDOUT: } diff --git a/toolchain/lower/testdata/tuple/value_formation.carbon b/toolchain/lower/testdata/tuple/value_formation.carbon index 249b4a3ec5b8f..94138a454f7c1 100644 --- a/toolchain/lower/testdata/tuple/value_formation.carbon +++ b/toolchain/lower/testdata/tuple/value_formation.carbon @@ -25,36 +25,36 @@ fn F() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca { i32, i32, i32 }, align 8 // CHECK:STDOUT: %b.var = alloca { i32, i32, i32 }, align 8 -// CHECK:STDOUT: %.loc16_6.1.tuple.elem = getelementptr inbounds { i32, i32, i32 }, ptr %a.var, i32 0, i32 0 +// CHECK:STDOUT: %.loc16_6.1.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 0 // CHECK:STDOUT: %.loc16_6.2 = load i32, ptr %.loc16_6.1.tuple.elem, align 4 -// CHECK:STDOUT: %.loc16_6.3.tuple.elem = getelementptr inbounds { i32, i32, i32 }, ptr %a.var, i32 0, i32 1 +// CHECK:STDOUT: %.loc16_6.3.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 1 // CHECK:STDOUT: %.loc16_6.4 = load i32, ptr %.loc16_6.3.tuple.elem, align 4 -// CHECK:STDOUT: %.loc16_6.5.tuple.elem = getelementptr inbounds { i32, i32, i32 }, ptr %a.var, i32 0, i32 2 +// CHECK:STDOUT: %.loc16_6.5.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 2 // CHECK:STDOUT: %.loc16_6.6 = load i32, ptr %.loc16_6.5.tuple.elem, align 4 // CHECK:STDOUT: %tuple.loc16_6 = alloca { i32, i32, i32 }, align 8 -// CHECK:STDOUT: %tuple.loc16_61 = getelementptr inbounds { i32, i32, i32 }, ptr %tuple.loc16_6, i32 0, i32 0 +// CHECK:STDOUT: %tuple.loc16_61 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %tuple.loc16_6, i32 0, i32 0 // CHECK:STDOUT: store i32 %.loc16_6.2, ptr %tuple.loc16_61, align 4 -// CHECK:STDOUT: %tuple.loc16_62 = getelementptr inbounds { i32, i32, i32 }, ptr %tuple.loc16_6, i32 0, i32 1 +// CHECK:STDOUT: %tuple.loc16_62 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %tuple.loc16_6, i32 0, i32 1 // CHECK:STDOUT: store i32 %.loc16_6.4, ptr %tuple.loc16_62, align 4 -// CHECK:STDOUT: %tuple.loc16_63 = getelementptr inbounds { i32, i32, i32 }, ptr %tuple.loc16_6, i32 0, i32 2 +// CHECK:STDOUT: %tuple.loc16_63 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %tuple.loc16_6, i32 0, i32 2 // CHECK:STDOUT: store i32 %.loc16_6.6, ptr %tuple.loc16_63, align 4 -// CHECK:STDOUT: %.loc16_9.1.tuple.elem = getelementptr inbounds { i32, i32, i32 }, ptr %b.var, i32 0, i32 0 +// CHECK:STDOUT: %.loc16_9.1.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %b.var, i32 0, i32 0 // CHECK:STDOUT: %.loc16_9.2 = load i32, ptr %.loc16_9.1.tuple.elem, align 4 -// CHECK:STDOUT: %.loc16_9.3.tuple.elem = getelementptr inbounds { i32, i32, i32 }, ptr %b.var, i32 0, i32 1 +// CHECK:STDOUT: %.loc16_9.3.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %b.var, i32 0, i32 1 // CHECK:STDOUT: %.loc16_9.4 = load i32, ptr %.loc16_9.3.tuple.elem, align 4 -// CHECK:STDOUT: %.loc16_9.5.tuple.elem = getelementptr inbounds { i32, i32, i32 }, ptr %b.var, i32 0, i32 2 +// CHECK:STDOUT: %.loc16_9.5.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %b.var, i32 0, i32 2 // CHECK:STDOUT: %.loc16_9.6 = load i32, ptr %.loc16_9.5.tuple.elem, align 4 // CHECK:STDOUT: %tuple.loc16_9 = alloca { i32, i32, i32 }, align 8 -// CHECK:STDOUT: %tuple.loc16_94 = getelementptr inbounds { i32, i32, i32 }, ptr %tuple.loc16_9, i32 0, i32 0 +// CHECK:STDOUT: %tuple.loc16_94 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %tuple.loc16_9, i32 0, i32 0 // CHECK:STDOUT: store i32 %.loc16_9.2, ptr %tuple.loc16_94, align 4 -// CHECK:STDOUT: %tuple.loc16_95 = getelementptr inbounds { i32, i32, i32 }, ptr %tuple.loc16_9, i32 0, i32 1 +// CHECK:STDOUT: %tuple.loc16_95 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %tuple.loc16_9, i32 0, i32 1 // CHECK:STDOUT: store i32 %.loc16_9.4, ptr %tuple.loc16_95, align 4 -// CHECK:STDOUT: %tuple.loc16_96 = getelementptr inbounds { i32, i32, i32 }, ptr %tuple.loc16_9, i32 0, i32 2 +// CHECK:STDOUT: %tuple.loc16_96 = getelementptr inbounds nuw { i32, i32, i32 }, ptr %tuple.loc16_9, i32 0, i32 2 // CHECK:STDOUT: store i32 %.loc16_9.6, ptr %tuple.loc16_96, align 4 // CHECK:STDOUT: %tuple.loc16_10 = alloca { ptr, ptr }, align 8 -// CHECK:STDOUT: %tuple.loc16_107 = getelementptr inbounds { ptr, ptr }, ptr %tuple.loc16_10, i32 0, i32 0 +// CHECK:STDOUT: %tuple.loc16_107 = getelementptr inbounds nuw { ptr, ptr }, ptr %tuple.loc16_10, i32 0, i32 0 // CHECK:STDOUT: store ptr %tuple.loc16_6, ptr %tuple.loc16_107, align 8 -// CHECK:STDOUT: %tuple.loc16_108 = getelementptr inbounds { ptr, ptr }, ptr %tuple.loc16_10, i32 0, i32 1 +// CHECK:STDOUT: %tuple.loc16_108 = getelementptr inbounds nuw { ptr, ptr }, ptr %tuple.loc16_10, i32 0, i32 1 // CHECK:STDOUT: store ptr %tuple.loc16_9, ptr %tuple.loc16_108, align 8 // CHECK:STDOUT: call void @G(ptr %tuple.loc16_10) // CHECK:STDOUT: ret void diff --git a/toolchain/lower/testdata/tuple/value_forwarding.carbon b/toolchain/lower/testdata/tuple/value_forwarding.carbon index 8868f92ad09a8..15dba88e41719 100644 --- a/toolchain/lower/testdata/tuple/value_forwarding.carbon +++ b/toolchain/lower/testdata/tuple/value_forwarding.carbon @@ -22,9 +22,9 @@ fn F(a: (i32, i32, i32), b: (i32, i32, i32)) { // CHECK:STDOUT: define void @F(ptr %a, ptr %b) { // CHECK:STDOUT: entry: // CHECK:STDOUT: %tuple = alloca { ptr, ptr }, align 8 -// CHECK:STDOUT: %tuple1 = getelementptr inbounds { ptr, ptr }, ptr %tuple, i32 0, i32 0 +// CHECK:STDOUT: %tuple1 = getelementptr inbounds nuw { ptr, ptr }, ptr %tuple, i32 0, i32 0 // CHECK:STDOUT: store ptr %a, ptr %tuple1, align 8 -// CHECK:STDOUT: %tuple2 = getelementptr inbounds { ptr, ptr }, ptr %tuple, i32 0, i32 1 +// CHECK:STDOUT: %tuple2 = getelementptr inbounds nuw { ptr, ptr }, ptr %tuple, i32 0, i32 1 // CHECK:STDOUT: store ptr %b, ptr %tuple2, align 8 // CHECK:STDOUT: call void @G(ptr %tuple) // CHECK:STDOUT: ret void