Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to a recent LLVM version and the changes to LLVM IR. #4212

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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)],
)
Expand Down
8 changes: 4 additions & 4 deletions toolchain/lower/testdata/array/assign_return_value.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -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: }
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions toolchain/lower/testdata/array/base.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions toolchain/lower/testdata/class/adapt.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -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: }
Expand All @@ -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: }
Expand Down
18 changes: 9 additions & 9 deletions toolchain/lower/testdata/class/base.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions toolchain/lower/testdata/class/field.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ 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: }
// CHECK:STDOUT:
// 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
Expand Down
4 changes: 2 additions & 2 deletions toolchain/lower/testdata/class/self.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -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: }
16 changes: 8 additions & 8 deletions toolchain/lower/testdata/class/value_access.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -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: }
Original file line number Diff line number Diff line change
Expand Up @@ -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: }
Expand Down
2 changes: 1 addition & 1 deletion toolchain/lower/testdata/impl/assoc_fn_alias.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -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: }
Expand Down
2 changes: 1 addition & 1 deletion toolchain/lower/testdata/impl/impl.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -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: }
Expand Down
10 changes: 5 additions & 5 deletions toolchain/lower/testdata/index/array_element_access.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -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: }
Expand All @@ -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
Expand Down
Loading
Loading