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
+8 -8
View File
@@ -20,10 +20,10 @@ fn G() {
// CHECK:STDOUT: %.5: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.6: type = tuple_type (i32, i32, i32) [template]
// CHECK:STDOUT: %.7: i32 = int_literal 0 [template]
// CHECK:STDOUT: %.8: [i32; 3] = tuple_value (%.4, %.5, %.1) [template]
// CHECK:STDOUT: %.9: type = tuple_type (type, type, type) [template]
// CHECK:STDOUT: %.10: type = ptr_type (i32, i32, i32) [template]
// CHECK:STDOUT: %.11: (i32, i32, i32) = tuple_value (%.4, %.5, %.1) [template]
// CHECK:STDOUT: %array: [i32; 3] = tuple_value (%.4, %.5, %.1) [template]
// CHECK:STDOUT: %.8: type = tuple_type (type, type, type) [template]
// CHECK:STDOUT: %.9: type = ptr_type (i32, i32, i32) [template]
// CHECK:STDOUT: %tuple: (i32, i32, i32) = tuple_value (%.4, %.5, %.1) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -54,8 +54,8 @@ fn G() {
// CHECK:STDOUT: %.loc9_29.8: i32 = int_literal 2 [template = constants.%.5]
// CHECK:STDOUT: %.loc9_29.9: ref i32 = array_index %a.var, %.loc9_29.8
// CHECK:STDOUT: %.loc9_29.10: init i32 = initialize_from %.loc9_28 to %.loc9_29.9 [template = constants.%.1]
// CHECK:STDOUT: %.loc9_29.11: init [i32; 3] = array_init (%.loc9_29.4, %.loc9_29.7, %.loc9_29.10) to %a.var [template = constants.%.8]
// CHECK:STDOUT: %.loc9_30: init [i32; 3] = converted %.loc9_29.1, %.loc9_29.11 [template = constants.%.8]
// CHECK:STDOUT: %.loc9_29.11: init [i32; 3] = array_init (%.loc9_29.4, %.loc9_29.7, %.loc9_29.10) to %a.var [template = constants.%array]
// CHECK:STDOUT: %.loc9_30: init [i32; 3] = converted %.loc9_29.1, %.loc9_29.11 [template = constants.%array]
// CHECK:STDOUT: assign %a.var, %.loc9_30
// CHECK:STDOUT: %.loc10_24.1: (type, type, type) = tuple_literal (i32, i32, i32)
// CHECK:STDOUT: %.loc10_24.2: type = converted %.loc10_24.1, constants.%.6 [template = constants.%.6]
@@ -71,8 +71,8 @@ fn G() {
// CHECK:STDOUT: %.loc10_36.5: init i32 = initialize_from %.loc10_32 to %.loc10_36.4 [template = constants.%.5]
// CHECK:STDOUT: %.loc10_36.6: ref i32 = tuple_access %b.var, element2
// CHECK:STDOUT: %.loc10_36.7: init i32 = initialize_from %.loc10_35 to %.loc10_36.6 [template = constants.%.1]
// CHECK:STDOUT: %.loc10_36.8: init (i32, i32, i32) = tuple_init (%.loc10_36.3, %.loc10_36.5, %.loc10_36.7) to %b.var [template = constants.%.11]
// CHECK:STDOUT: %.loc10_37: init (i32, i32, i32) = converted %.loc10_36.1, %.loc10_36.8 [template = constants.%.11]
// CHECK:STDOUT: %.loc10_36.8: init (i32, i32, i32) = tuple_init (%.loc10_36.3, %.loc10_36.5, %.loc10_36.7) to %b.var [template = constants.%tuple]
// CHECK:STDOUT: %.loc10_37: init (i32, i32, i32) = converted %.loc10_36.1, %.loc10_36.8 [template = constants.%tuple]
// CHECK:STDOUT: assign %b.var, %.loc10_37
// CHECK:STDOUT: return
// CHECK:STDOUT: }
+9 -9
View File
@@ -16,10 +16,10 @@ fn Run() {
// CHECK:STDOUT: %.1: type = tuple_type (type) [template]
// CHECK:STDOUT: %.2: type = tuple_type (i32) [template]
// CHECK:STDOUT: %.3: i32 = int_literal 0 [template]
// CHECK:STDOUT: %.4: (i32,) = tuple_value (%.3) [template]
// CHECK:STDOUT: %.5: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.6: type = array_type %.5, i32 [template]
// CHECK:STDOUT: %.7: type = ptr_type [i32; 1] [template]
// CHECK:STDOUT: %tuple: (i32,) = tuple_value (%.3) [template]
// CHECK:STDOUT: %.4: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.5: type = array_type %.4, i32 [template]
// CHECK:STDOUT: %.6: type = ptr_type [i32; 1] [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -40,16 +40,16 @@ fn Run() {
// CHECK:STDOUT: fn @F() -> (i32,) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc7_28: i32 = int_literal 0 [template = constants.%.3]
// CHECK:STDOUT: %.loc7_30.1: (i32,) = tuple_literal (%.loc7_28)
// CHECK:STDOUT: %.loc7_30.2: (i32,) = tuple_value (%.loc7_28) [template = constants.%.4]
// CHECK:STDOUT: %.loc7_31: (i32,) = converted %.loc7_30.1, %.loc7_30.2 [template = constants.%.4]
// CHECK:STDOUT: %.loc7_30: (i32,) = tuple_literal (%.loc7_28)
// CHECK:STDOUT: %tuple: (i32,) = tuple_value (%.loc7_28) [template = constants.%tuple]
// CHECK:STDOUT: %.loc7_31: (i32,) = converted %.loc7_30, %tuple [template = constants.%tuple]
// CHECK:STDOUT: return %.loc7_31
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Run() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc10_16: i32 = int_literal 1 [template = constants.%.5]
// CHECK:STDOUT: %.loc10_17: type = array_type %.loc10_16, i32 [template = constants.%.6]
// CHECK:STDOUT: %.loc10_16: i32 = int_literal 1 [template = constants.%.4]
// CHECK:STDOUT: %.loc10_17: type = array_type %.loc10_16, i32 [template = constants.%.5]
// CHECK:STDOUT: %t.var: ref [i32; 1] = var t
// CHECK:STDOUT: %t: ref [i32; 1] = bind_name t, %t.var
// CHECK:STDOUT: %F.ref: <function> = name_ref F, file.%F [template = file.%F]
+8 -8
View File
@@ -16,10 +16,10 @@ var b: [i32; 3] = a;
// CHECK:STDOUT: %.4: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.5: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.6: i32 = int_literal 3 [template]
// CHECK:STDOUT: %.7: (i32, i32, i32) = tuple_value (%.4, %.5, %.6) [template]
// CHECK:STDOUT: %.8: type = array_type %.6, i32 [template]
// CHECK:STDOUT: %.9: type = ptr_type [i32; 3] [template]
// CHECK:STDOUT: %.10: i32 = int_literal 0 [template]
// CHECK:STDOUT: %tuple: (i32, i32, i32) = tuple_value (%.4, %.5, %.6) [template]
// CHECK:STDOUT: %.7: type = array_type %.6, i32 [template]
// CHECK:STDOUT: %.8: type = ptr_type [i32; 3] [template]
// CHECK:STDOUT: %.9: i32 = int_literal 0 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -34,7 +34,7 @@ var b: [i32; 3] = a;
// CHECK:STDOUT: %a.var: ref (i32, i32, i32) = var a
// CHECK:STDOUT: %a: ref (i32, i32, i32) = bind_name a, %a.var
// CHECK:STDOUT: %.loc8_14: i32 = int_literal 3 [template = constants.%.6]
// CHECK:STDOUT: %.loc8_15: type = array_type %.loc8_14, i32 [template = constants.%.8]
// CHECK:STDOUT: %.loc8_15: type = array_type %.loc8_14, i32 [template = constants.%.7]
// CHECK:STDOUT: %b.var: ref [i32; 3] = var b
// CHECK:STDOUT: %b: ref [i32; 3] = bind_name b, %b.var
// CHECK:STDOUT: }
@@ -51,13 +51,13 @@ var b: [i32; 3] = a;
// CHECK:STDOUT: %.loc7_34.5: init i32 = initialize_from %.loc7_30 to %.loc7_34.4 [template = constants.%.5]
// CHECK:STDOUT: %.loc7_34.6: ref i32 = tuple_access file.%a.var, element2
// CHECK:STDOUT: %.loc7_34.7: init i32 = initialize_from %.loc7_33 to %.loc7_34.6 [template = constants.%.6]
// CHECK:STDOUT: %.loc7_34.8: init (i32, i32, i32) = tuple_init (%.loc7_34.3, %.loc7_34.5, %.loc7_34.7) to file.%a.var [template = constants.%.7]
// CHECK:STDOUT: %.loc7_35: init (i32, i32, i32) = converted %.loc7_34.1, %.loc7_34.8 [template = constants.%.7]
// CHECK:STDOUT: %.loc7_34.8: init (i32, i32, i32) = tuple_init (%.loc7_34.3, %.loc7_34.5, %.loc7_34.7) to file.%a.var [template = constants.%tuple]
// CHECK:STDOUT: %.loc7_35: init (i32, i32, i32) = converted %.loc7_34.1, %.loc7_34.8 [template = constants.%tuple]
// CHECK:STDOUT: assign file.%a.var, %.loc7_35
// CHECK:STDOUT: %a.ref: ref (i32, i32, i32) = name_ref a, file.%a
// CHECK:STDOUT: %.loc8_19.1: ref i32 = tuple_access %a.ref, element0
// CHECK:STDOUT: %.loc8_19.2: i32 = bind_value %.loc8_19.1
// CHECK:STDOUT: %.loc8_19.3: i32 = int_literal 0 [template = constants.%.10]
// CHECK:STDOUT: %.loc8_19.3: i32 = int_literal 0 [template = constants.%.9]
// CHECK:STDOUT: %.loc8_19.4: ref i32 = array_index file.%b.var, %.loc8_19.3
// CHECK:STDOUT: %.loc8_19.5: init i32 = initialize_from %.loc8_19.2 to %.loc8_19.4
// CHECK:STDOUT: %.loc8_19.6: ref i32 = tuple_access %a.ref, element1
+45 -45
View File
@@ -16,23 +16,23 @@ var c: [(); 5] = ((), (), (), (), (),);
// CHECK:STDOUT: %.3: type = ptr_type [i32; 1] [template]
// CHECK:STDOUT: %.4: type = tuple_type (i32) [template]
// CHECK:STDOUT: %.5: i32 = int_literal 0 [template]
// CHECK:STDOUT: %.6: [i32; 1] = tuple_value (%.1) [template]
// CHECK:STDOUT: %.7: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.8: type = array_type %.7, f64 [template]
// CHECK:STDOUT: %.9: type = ptr_type [f64; 2] [template]
// CHECK:STDOUT: %.10: f64 = float_literal 11.100000000000001 [template]
// CHECK:STDOUT: %.11: f64 = float_literal 2.2000000000000002 [template]
// CHECK:STDOUT: %.12: type = tuple_type (f64, f64) [template]
// CHECK:STDOUT: %.13: [f64; 2] = tuple_value (%.10, %.11) [template]
// CHECK:STDOUT: %.14: type = tuple_type () [template]
// CHECK:STDOUT: %.15: i32 = int_literal 5 [template]
// CHECK:STDOUT: %.16: type = array_type %.15, () [template]
// CHECK:STDOUT: %.17: type = ptr_type [(); 5] [template]
// CHECK:STDOUT: %.18: type = tuple_type ((), (), (), (), ()) [template]
// CHECK:STDOUT: %.19: () = tuple_value () [template]
// CHECK:STDOUT: %.20: i32 = int_literal 3 [template]
// CHECK:STDOUT: %.21: i32 = int_literal 4 [template]
// CHECK:STDOUT: %.22: [(); 5] = tuple_value (%.19, %.19, %.19, %.19, %.19) [template]
// CHECK:STDOUT: %array.1: [i32; 1] = tuple_value (%.1) [template]
// CHECK:STDOUT: %.6: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.7: type = array_type %.6, f64 [template]
// CHECK:STDOUT: %.8: type = ptr_type [f64; 2] [template]
// CHECK:STDOUT: %.9: f64 = float_literal 11.100000000000001 [template]
// CHECK:STDOUT: %.10: f64 = float_literal 2.2000000000000002 [template]
// CHECK:STDOUT: %.11: type = tuple_type (f64, f64) [template]
// CHECK:STDOUT: %array.2: [f64; 2] = tuple_value (%.9, %.10) [template]
// CHECK:STDOUT: %.12: type = tuple_type () [template]
// CHECK:STDOUT: %.13: i32 = int_literal 5 [template]
// CHECK:STDOUT: %.14: type = array_type %.13, () [template]
// CHECK:STDOUT: %.15: type = ptr_type [(); 5] [template]
// CHECK:STDOUT: %.16: type = tuple_type ((), (), (), (), ()) [template]
// CHECK:STDOUT: %tuple: () = tuple_value () [template]
// CHECK:STDOUT: %.17: i32 = int_literal 3 [template]
// CHECK:STDOUT: %.18: i32 = int_literal 4 [template]
// CHECK:STDOUT: %array.3: [(); 5] = tuple_value (%tuple, %tuple, %tuple, %tuple, %tuple) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -47,14 +47,14 @@ var c: [(); 5] = ((), (), (), (), (),);
// CHECK:STDOUT: %.loc7_15: type = array_type %.loc7_14, i32 [template = constants.%.2]
// CHECK:STDOUT: %a.var: ref [i32; 1] = var a
// CHECK:STDOUT: %a: ref [i32; 1] = bind_name a, %a.var
// CHECK:STDOUT: %.loc8_14: i32 = int_literal 2 [template = constants.%.7]
// CHECK:STDOUT: %.loc8_15: type = array_type %.loc8_14, f64 [template = constants.%.8]
// CHECK:STDOUT: %.loc8_14: i32 = int_literal 2 [template = constants.%.6]
// CHECK:STDOUT: %.loc8_15: type = array_type %.loc8_14, f64 [template = constants.%.7]
// CHECK:STDOUT: %b.var: ref [f64; 2] = var b
// CHECK:STDOUT: %b: ref [f64; 2] = bind_name b, %b.var
// CHECK:STDOUT: %.loc9_10.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc9_13: i32 = int_literal 5 [template = constants.%.15]
// CHECK:STDOUT: %.loc9_10.2: type = converted %.loc9_10.1, constants.%.14 [template = constants.%.14]
// CHECK:STDOUT: %.loc9_14: type = array_type %.loc9_13, () [template = constants.%.16]
// CHECK:STDOUT: %.loc9_13: i32 = int_literal 5 [template = constants.%.13]
// CHECK:STDOUT: %.loc9_10.2: type = converted %.loc9_10.1, constants.%.12 [template = constants.%.12]
// CHECK:STDOUT: %.loc9_14: type = array_type %.loc9_13, () [template = constants.%.14]
// CHECK:STDOUT: %c.var: ref [(); 5] = var c
// CHECK:STDOUT: %c: ref [(); 5] = bind_name c, %c.var
// CHECK:STDOUT: }
@@ -66,20 +66,20 @@ var c: [(); 5] = ((), (), (), (), (),);
// CHECK:STDOUT: %.loc7_22.2: i32 = int_literal 0 [template = constants.%.5]
// CHECK:STDOUT: %.loc7_22.3: ref i32 = array_index file.%a.var, %.loc7_22.2
// CHECK:STDOUT: %.loc7_22.4: init i32 = initialize_from %.loc7_20 to %.loc7_22.3 [template = constants.%.1]
// CHECK:STDOUT: %.loc7_22.5: init [i32; 1] = array_init (%.loc7_22.4) to file.%a.var [template = constants.%.6]
// CHECK:STDOUT: %.loc7_23: init [i32; 1] = converted %.loc7_22.1, %.loc7_22.5 [template = constants.%.6]
// CHECK:STDOUT: %.loc7_22.5: init [i32; 1] = array_init (%.loc7_22.4) to file.%a.var [template = constants.%array.1]
// CHECK:STDOUT: %.loc7_23: init [i32; 1] = converted %.loc7_22.1, %.loc7_22.5 [template = constants.%array.1]
// CHECK:STDOUT: assign file.%a.var, %.loc7_23
// CHECK:STDOUT: %.loc8_20: f64 = float_literal 11.100000000000001 [template = constants.%.10]
// CHECK:STDOUT: %.loc8_26: f64 = float_literal 2.2000000000000002 [template = constants.%.11]
// CHECK:STDOUT: %.loc8_20: f64 = float_literal 11.100000000000001 [template = constants.%.9]
// CHECK:STDOUT: %.loc8_26: f64 = float_literal 2.2000000000000002 [template = constants.%.10]
// CHECK:STDOUT: %.loc8_30.1: (f64, f64) = tuple_literal (%.loc8_20, %.loc8_26)
// CHECK:STDOUT: %.loc8_30.2: i32 = int_literal 0 [template = constants.%.5]
// CHECK:STDOUT: %.loc8_30.3: ref f64 = array_index file.%b.var, %.loc8_30.2
// CHECK:STDOUT: %.loc8_30.4: init f64 = initialize_from %.loc8_20 to %.loc8_30.3 [template = constants.%.10]
// CHECK:STDOUT: %.loc8_30.4: init f64 = initialize_from %.loc8_20 to %.loc8_30.3 [template = constants.%.9]
// CHECK:STDOUT: %.loc8_30.5: i32 = int_literal 1 [template = constants.%.1]
// CHECK:STDOUT: %.loc8_30.6: ref f64 = array_index file.%b.var, %.loc8_30.5
// CHECK:STDOUT: %.loc8_30.7: init f64 = initialize_from %.loc8_26 to %.loc8_30.6 [template = constants.%.11]
// CHECK:STDOUT: %.loc8_30.8: init [f64; 2] = array_init (%.loc8_30.4, %.loc8_30.7) to file.%b.var [template = constants.%.13]
// CHECK:STDOUT: %.loc8_31: init [f64; 2] = converted %.loc8_30.1, %.loc8_30.8 [template = constants.%.13]
// CHECK:STDOUT: %.loc8_30.7: init f64 = initialize_from %.loc8_26 to %.loc8_30.6 [template = constants.%.10]
// CHECK:STDOUT: %.loc8_30.8: init [f64; 2] = array_init (%.loc8_30.4, %.loc8_30.7) to file.%b.var [template = constants.%array.2]
// CHECK:STDOUT: %.loc8_31: init [f64; 2] = converted %.loc8_30.1, %.loc8_30.8 [template = constants.%array.2]
// CHECK:STDOUT: assign file.%b.var, %.loc8_31
// CHECK:STDOUT: %.loc9_20.1: () = tuple_literal ()
// CHECK:STDOUT: %.loc9_24.1: () = tuple_literal ()
@@ -89,26 +89,26 @@ var c: [(); 5] = ((), (), (), (), (),);
// CHECK:STDOUT: %.loc9_38.1: ((), (), (), (), ()) = tuple_literal (%.loc9_20.1, %.loc9_24.1, %.loc9_28.1, %.loc9_32.1, %.loc9_36.1)
// CHECK:STDOUT: %.loc9_38.2: i32 = int_literal 0 [template = constants.%.5]
// CHECK:STDOUT: %.loc9_38.3: ref () = array_index file.%c.var, %.loc9_38.2
// CHECK:STDOUT: %.loc9_20.2: init () = tuple_init () to %.loc9_38.3 [template = constants.%.19]
// CHECK:STDOUT: %.loc9_38.4: init () = converted %.loc9_20.1, %.loc9_20.2 [template = constants.%.19]
// CHECK:STDOUT: %.loc9_20.2: init () = tuple_init () to %.loc9_38.3 [template = constants.%tuple]
// CHECK:STDOUT: %.loc9_38.4: init () = converted %.loc9_20.1, %.loc9_20.2 [template = constants.%tuple]
// CHECK:STDOUT: %.loc9_38.5: i32 = int_literal 1 [template = constants.%.1]
// CHECK:STDOUT: %.loc9_38.6: ref () = array_index file.%c.var, %.loc9_38.5
// CHECK:STDOUT: %.loc9_24.2: init () = tuple_init () to %.loc9_38.6 [template = constants.%.19]
// CHECK:STDOUT: %.loc9_38.7: init () = converted %.loc9_24.1, %.loc9_24.2 [template = constants.%.19]
// CHECK:STDOUT: %.loc9_38.8: i32 = int_literal 2 [template = constants.%.7]
// CHECK:STDOUT: %.loc9_24.2: init () = tuple_init () to %.loc9_38.6 [template = constants.%tuple]
// CHECK:STDOUT: %.loc9_38.7: init () = converted %.loc9_24.1, %.loc9_24.2 [template = constants.%tuple]
// CHECK:STDOUT: %.loc9_38.8: i32 = int_literal 2 [template = constants.%.6]
// CHECK:STDOUT: %.loc9_38.9: ref () = array_index file.%c.var, %.loc9_38.8
// CHECK:STDOUT: %.loc9_28.2: init () = tuple_init () to %.loc9_38.9 [template = constants.%.19]
// CHECK:STDOUT: %.loc9_38.10: init () = converted %.loc9_28.1, %.loc9_28.2 [template = constants.%.19]
// CHECK:STDOUT: %.loc9_38.11: i32 = int_literal 3 [template = constants.%.20]
// CHECK:STDOUT: %.loc9_28.2: init () = tuple_init () to %.loc9_38.9 [template = constants.%tuple]
// CHECK:STDOUT: %.loc9_38.10: init () = converted %.loc9_28.1, %.loc9_28.2 [template = constants.%tuple]
// CHECK:STDOUT: %.loc9_38.11: i32 = int_literal 3 [template = constants.%.17]
// CHECK:STDOUT: %.loc9_38.12: ref () = array_index file.%c.var, %.loc9_38.11
// CHECK:STDOUT: %.loc9_32.2: init () = tuple_init () to %.loc9_38.12 [template = constants.%.19]
// CHECK:STDOUT: %.loc9_38.13: init () = converted %.loc9_32.1, %.loc9_32.2 [template = constants.%.19]
// CHECK:STDOUT: %.loc9_38.14: i32 = int_literal 4 [template = constants.%.21]
// CHECK:STDOUT: %.loc9_32.2: init () = tuple_init () to %.loc9_38.12 [template = constants.%tuple]
// CHECK:STDOUT: %.loc9_38.13: init () = converted %.loc9_32.1, %.loc9_32.2 [template = constants.%tuple]
// CHECK:STDOUT: %.loc9_38.14: i32 = int_literal 4 [template = constants.%.18]
// CHECK:STDOUT: %.loc9_38.15: ref () = array_index file.%c.var, %.loc9_38.14
// CHECK:STDOUT: %.loc9_36.2: init () = tuple_init () to %.loc9_38.15 [template = constants.%.19]
// CHECK:STDOUT: %.loc9_38.16: init () = converted %.loc9_36.1, %.loc9_36.2 [template = constants.%.19]
// CHECK:STDOUT: %.loc9_38.17: init [(); 5] = array_init (%.loc9_38.4, %.loc9_38.7, %.loc9_38.10, %.loc9_38.13, %.loc9_38.16) to file.%c.var [template = constants.%.22]
// CHECK:STDOUT: %.loc9_39: init [(); 5] = converted %.loc9_38.1, %.loc9_38.17 [template = constants.%.22]
// CHECK:STDOUT: %.loc9_36.2: init () = tuple_init () to %.loc9_38.15 [template = constants.%tuple]
// CHECK:STDOUT: %.loc9_38.16: init () = converted %.loc9_36.1, %.loc9_36.2 [template = constants.%tuple]
// CHECK:STDOUT: %.loc9_38.17: init [(); 5] = array_init (%.loc9_38.4, %.loc9_38.7, %.loc9_38.10, %.loc9_38.13, %.loc9_38.16) to file.%c.var [template = constants.%array.3]
// CHECK:STDOUT: %.loc9_39: init [(); 5] = converted %.loc9_38.1, %.loc9_38.17 [template = constants.%array.3]
// CHECK:STDOUT: assign file.%c.var, %.loc9_39
// CHECK:STDOUT: return
// CHECK:STDOUT: }
+3 -3
View File
@@ -19,7 +19,7 @@ let b: [i32; 3]* = &a;
// CHECK:STDOUT: %.5: type = ptr_type [i32; 3] [template]
// CHECK:STDOUT: %.6: type = tuple_type (i32, i32, i32) [template]
// CHECK:STDOUT: %.7: i32 = int_literal 0 [template]
// CHECK:STDOUT: %.8: [i32; 3] = tuple_value (%.1, %.2, %.3) [template]
// CHECK:STDOUT: %array: [i32; 3] = tuple_value (%.1, %.2, %.3) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -68,8 +68,8 @@ let b: [i32; 3]* = &a;
// CHECK:STDOUT: %.loc9_35.8: i32 = int_literal 2 [template = constants.%.2]
// CHECK:STDOUT: %.loc9_35.9: ref i32 = array_index file.%a.var, %.loc9_35.8
// CHECK:STDOUT: %.loc9_35.10: init i32 = initialize_from %.loc9_34 to %.loc9_35.9 [template = constants.%.3]
// CHECK:STDOUT: %.loc9_35.11: init [i32; 3] = array_init (%.loc9_35.4, %.loc9_35.7, %.loc9_35.10) to file.%a.var [template = constants.%.8]
// CHECK:STDOUT: %.loc9_36: init [i32; 3] = converted %.loc9_35.1, %.loc9_35.11 [template = constants.%.8]
// CHECK:STDOUT: %.loc9_35.11: init [i32; 3] = array_init (%.loc9_35.4, %.loc9_35.7, %.loc9_35.10) to file.%a.var [template = constants.%array]
// CHECK:STDOUT: %.loc9_36: init [i32; 3] = converted %.loc9_35.1, %.loc9_35.11 [template = constants.%array]
// CHECK:STDOUT: assign file.%a.var, %.loc9_36
// CHECK:STDOUT: return
// CHECK:STDOUT: }
@@ -20,9 +20,9 @@ var b: i32 = a[{.index = 3}.index];
// CHECK:STDOUT: %.5: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.6: type = tuple_type (i32, i32, i32) [template]
// CHECK:STDOUT: %.7: i32 = int_literal 0 [template]
// CHECK:STDOUT: %.8: [i32; 3] = tuple_value (%.4, %.5, %.1) [template]
// CHECK:STDOUT: %.9: type = struct_type {.index: i32} [template]
// CHECK:STDOUT: %.10: {.index: i32} = struct_value (%.1) [template]
// CHECK:STDOUT: %array: [i32; 3] = tuple_value (%.4, %.5, %.1) [template]
// CHECK:STDOUT: %.8: type = struct_type {.index: i32} [template]
// CHECK:STDOUT: %struct: {.index: i32} = struct_value (%.1) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -55,15 +55,15 @@ var b: i32 = a[{.index = 3}.index];
// CHECK:STDOUT: %.loc7_27.8: i32 = int_literal 2 [template = constants.%.5]
// CHECK:STDOUT: %.loc7_27.9: ref i32 = array_index file.%a.var, %.loc7_27.8
// CHECK:STDOUT: %.loc7_27.10: init i32 = initialize_from %.loc7_26 to %.loc7_27.9 [template = constants.%.1]
// CHECK:STDOUT: %.loc7_27.11: init [i32; 3] = array_init (%.loc7_27.4, %.loc7_27.7, %.loc7_27.10) to file.%a.var [template = constants.%.8]
// CHECK:STDOUT: %.loc7_28: init [i32; 3] = converted %.loc7_27.1, %.loc7_27.11 [template = constants.%.8]
// CHECK:STDOUT: %.loc7_27.11: init [i32; 3] = array_init (%.loc7_27.4, %.loc7_27.7, %.loc7_27.10) to file.%a.var [template = constants.%array]
// CHECK:STDOUT: %.loc7_28: init [i32; 3] = converted %.loc7_27.1, %.loc7_27.11 [template = constants.%array]
// CHECK:STDOUT: assign file.%a.var, %.loc7_28
// CHECK:STDOUT: %a.ref: ref [i32; 3] = name_ref a, file.%a
// CHECK:STDOUT: %.loc11_26: i32 = int_literal 3 [template = constants.%.1]
// CHECK:STDOUT: %.loc11_27.1: {.index: i32} = struct_literal (%.loc11_26)
// CHECK:STDOUT: %.loc11_27.2: {.index: i32} = struct_value (%.loc11_26) [template = constants.%.10]
// CHECK:STDOUT: %.loc11_27.3: {.index: i32} = converted %.loc11_27.1, %.loc11_27.2 [template = constants.%.10]
// CHECK:STDOUT: %.loc11_28: i32 = struct_access %.loc11_27.3, element0 [template = constants.%.1]
// CHECK:STDOUT: %struct: {.index: i32} = struct_value (%.loc11_26) [template = constants.%struct]
// CHECK:STDOUT: %.loc11_27.2: {.index: i32} = converted %.loc11_27.1, %struct [template = constants.%struct]
// CHECK:STDOUT: %.loc11_28: i32 = struct_access %.loc11_27.2, element0 [template = constants.%.1]
// CHECK:STDOUT: %.loc11_34.1: ref i32 = array_index %a.ref, %.loc11_28 [template = <error>]
// CHECK:STDOUT: %.loc11_34.2: i32 = bind_value %.loc11_34.1
// CHECK:STDOUT: assign file.%b.var, %.loc11_34.2
+3 -3
View File
@@ -22,7 +22,7 @@ fn G() -> i32 {
// CHECK:STDOUT: %.5: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.6: type = tuple_type (i32, i32, i32) [template]
// CHECK:STDOUT: %.7: i32 = int_literal 0 [template]
// CHECK:STDOUT: %.8: [i32; 3] = tuple_value (%.4, %.5, %.1) [template]
// CHECK:STDOUT: %array: [i32; 3] = tuple_value (%.4, %.5, %.1) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -74,8 +74,8 @@ fn G() -> i32 {
// CHECK:STDOUT: %.loc12_20.9: i32 = int_literal 2 [template = constants.%.5]
// CHECK:STDOUT: %.loc12_20.10: ref i32 = array_index %.loc12_20.2, %.loc12_20.9
// CHECK:STDOUT: %.loc12_20.11: init i32 = initialize_from %.loc12_19 to %.loc12_20.10 [template = constants.%.1]
// CHECK:STDOUT: %.loc12_20.12: init [i32; 3] = array_init (%.loc12_20.5, %.loc12_20.8, %.loc12_20.11) to %.loc12_20.2 [template = constants.%.8]
// CHECK:STDOUT: %.loc12_11.1: init [i32; 3] = converted %.loc12_20.1, %.loc12_20.12 [template = constants.%.8]
// CHECK:STDOUT: %.loc12_20.12: init [i32; 3] = array_init (%.loc12_20.5, %.loc12_20.8, %.loc12_20.11) to %.loc12_20.2 [template = constants.%array]
// CHECK:STDOUT: %.loc12_11.1: init [i32; 3] = converted %.loc12_20.1, %.loc12_20.12 [template = constants.%array]
// CHECK:STDOUT: %.loc12_11.2: ref [i32; 3] = temporary %.loc12_20.2, %.loc12_11.1
// CHECK:STDOUT: %.loc12_11.3: [i32; 3] = bind_value %.loc12_11.2
// CHECK:STDOUT: %F.call: init i32 = call %F.ref(%.loc12_11.3, %.loc12_23)
+8 -8
View File
@@ -17,9 +17,9 @@ var b: i32 = a[{.index = 2}.index];
// CHECK:STDOUT: %.5: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.6: type = tuple_type (i32, i32, i32) [template]
// CHECK:STDOUT: %.7: i32 = int_literal 0 [template]
// CHECK:STDOUT: %.8: [i32; 3] = tuple_value (%.4, %.5, %.1) [template]
// CHECK:STDOUT: %.9: type = struct_type {.index: i32} [template]
// CHECK:STDOUT: %.10: {.index: i32} = struct_value (%.5) [template]
// CHECK:STDOUT: %array: [i32; 3] = tuple_value (%.4, %.5, %.1) [template]
// CHECK:STDOUT: %.8: type = struct_type {.index: i32} [template]
// CHECK:STDOUT: %struct: {.index: i32} = struct_value (%.5) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -52,15 +52,15 @@ var b: i32 = a[{.index = 2}.index];
// CHECK:STDOUT: %.loc7_27.8: i32 = int_literal 2 [template = constants.%.5]
// CHECK:STDOUT: %.loc7_27.9: ref i32 = array_index file.%a.var, %.loc7_27.8
// CHECK:STDOUT: %.loc7_27.10: init i32 = initialize_from %.loc7_26 to %.loc7_27.9 [template = constants.%.1]
// CHECK:STDOUT: %.loc7_27.11: init [i32; 3] = array_init (%.loc7_27.4, %.loc7_27.7, %.loc7_27.10) to file.%a.var [template = constants.%.8]
// CHECK:STDOUT: %.loc7_28: init [i32; 3] = converted %.loc7_27.1, %.loc7_27.11 [template = constants.%.8]
// CHECK:STDOUT: %.loc7_27.11: init [i32; 3] = array_init (%.loc7_27.4, %.loc7_27.7, %.loc7_27.10) to file.%a.var [template = constants.%array]
// CHECK:STDOUT: %.loc7_28: init [i32; 3] = converted %.loc7_27.1, %.loc7_27.11 [template = constants.%array]
// CHECK:STDOUT: assign file.%a.var, %.loc7_28
// CHECK:STDOUT: %a.ref: ref [i32; 3] = name_ref a, file.%a
// CHECK:STDOUT: %.loc8_26: i32 = int_literal 2 [template = constants.%.5]
// CHECK:STDOUT: %.loc8_27.1: {.index: i32} = struct_literal (%.loc8_26)
// CHECK:STDOUT: %.loc8_27.2: {.index: i32} = struct_value (%.loc8_26) [template = constants.%.10]
// CHECK:STDOUT: %.loc8_27.3: {.index: i32} = converted %.loc8_27.1, %.loc8_27.2 [template = constants.%.10]
// CHECK:STDOUT: %.loc8_28: i32 = struct_access %.loc8_27.3, element0 [template = constants.%.5]
// CHECK:STDOUT: %struct: {.index: i32} = struct_value (%.loc8_26) [template = constants.%struct]
// CHECK:STDOUT: %.loc8_27.2: {.index: i32} = converted %.loc8_27.1, %struct [template = constants.%struct]
// CHECK:STDOUT: %.loc8_28: i32 = struct_access %.loc8_27.2, element0 [template = constants.%.5]
// CHECK:STDOUT: %.loc8_34.1: ref i32 = array_index %a.ref, %.loc8_28
// CHECK:STDOUT: %.loc8_34.2: i32 = bind_value %.loc8_34.1
// CHECK:STDOUT: assign file.%b.var, %.loc8_34.2
+3 -3
View File
@@ -22,7 +22,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9);
// CHECK:STDOUT: %.11: i32 = int_literal 8 [template]
// CHECK:STDOUT: %.12: type = tuple_type (i32, i32, i32, i32, i32, i32, i32, i32, i32) [template]
// CHECK:STDOUT: %.13: i32 = int_literal 0 [template]
// CHECK:STDOUT: %.14: [i32; 9] = tuple_value (%.4, %.5, %.6, %.7, %.8, %.9, %.10, %.11, %.1) [template]
// CHECK:STDOUT: %array: [i32; 9] = tuple_value (%.4, %.5, %.6, %.7, %.8, %.9, %.10, %.11, %.1) [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -76,8 +76,8 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9);
// CHECK:STDOUT: %.loc7_45.26: i32 = int_literal 8 [template = constants.%.11]
// CHECK:STDOUT: %.loc7_45.27: ref i32 = array_index file.%a.var, %.loc7_45.26
// CHECK:STDOUT: %.loc7_45.28: init i32 = initialize_from %.loc7_44 to %.loc7_45.27 [template = constants.%.1]
// CHECK:STDOUT: %.loc7_45.29: init [i32; 9] = array_init (%.loc7_45.4, %.loc7_45.7, %.loc7_45.10, %.loc7_45.13, %.loc7_45.16, %.loc7_45.19, %.loc7_45.22, %.loc7_45.25, %.loc7_45.28) to file.%a.var [template = constants.%.14]
// CHECK:STDOUT: %.loc7_46: init [i32; 9] = converted %.loc7_45.1, %.loc7_45.29 [template = constants.%.14]
// CHECK:STDOUT: %.loc7_45.29: init [i32; 9] = array_init (%.loc7_45.4, %.loc7_45.7, %.loc7_45.10, %.loc7_45.13, %.loc7_45.16, %.loc7_45.19, %.loc7_45.22, %.loc7_45.25, %.loc7_45.28) to file.%a.var [template = constants.%array]
// CHECK:STDOUT: %.loc7_46: init [i32; 9] = converted %.loc7_45.1, %.loc7_45.29 [template = constants.%array]
// CHECK:STDOUT: assign file.%a.var, %.loc7_46
// CHECK:STDOUT: return
// CHECK:STDOUT: }