Move instruction names for struct and tuple values from lower to InstNamer. (#3918)

Change the names for emitted globals for constants with storage to
include both the name of the constant and the name of the use.

This causes the instructions to also be named in SemIR and in LLVM IR
constants.
This commit is contained in:
Richard Smith
2024-04-26 23:47:08 +00:00
committed by GitHub
parent 79c0b65288
commit 008d41d7f3
148 changed files with 1297 additions and 1271 deletions
+2 -2
View File
@@ -15,7 +15,7 @@ fn G() -> i32 {
// CHECK:STDOUT: ; ModuleID = 'function_param.carbon'
// CHECK:STDOUT: source_filename = "function_param.carbon"
// CHECK:STDOUT:
// CHECK:STDOUT: @const.loc12_11.1 = internal constant [3 x i32] [i32 1, i32 2, i32 3]
// CHECK:STDOUT: @array.loc12_11.1 = internal constant [3 x i32] [i32 1, i32 2, i32 3]
// CHECK:STDOUT:
// CHECK:STDOUT: define i32 @F(ptr %arr, i32 %i) {
// CHECK:STDOUT: entry:
@@ -30,7 +30,7 @@ fn G() -> i32 {
// CHECK:STDOUT: %.loc12_20.4.array.index = getelementptr inbounds [3 x i32], ptr %.loc12_20.2.temp, i32 0, i32 0
// CHECK:STDOUT: %.loc12_20.7.array.index = getelementptr inbounds [3 x i32], ptr %.loc12_20.2.temp, i32 0, i32 1
// CHECK:STDOUT: %.loc12_20.10.array.index = getelementptr inbounds [3 x i32], ptr %.loc12_20.2.temp, i32 0, i32 2
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %.loc12_20.2.temp, ptr align 4 @const.loc12_11.1, i64 12, i1 false)
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %.loc12_20.2.temp, ptr align 4 @array.loc12_11.1, i64 12, i1 false)
// CHECK:STDOUT: %F.call = call i32 @F(ptr %.loc12_20.2.temp, i32 1)
// CHECK:STDOUT: ret i32 %F.call
// CHECK:STDOUT: }