Add a separate store for computed constant values. (#3362)

This moves the instructions generated for type values out of the block
in which they happen to first be referenced, and into shared storage.
This commit is contained in:
Richard Smith
2023-11-04 23:48:13 +00:00
committed by GitHub
parent a0bacbb26b
commit 184eafd521
130 changed files with 1075 additions and 625 deletions
+5 -2
View File
@@ -10,6 +10,10 @@ fn Main() {
Foo();
}
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.loc10: type = tuple_type ()
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file "params_zero.carbon" {
// CHECK:STDOUT: %Foo: <function> = fn_decl @Foo
// CHECK:STDOUT: %Main: <function> = fn_decl @Main
@@ -23,7 +27,6 @@ fn Main() {
// CHECK:STDOUT: fn @Main() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Foo.ref: <function> = name_reference "Foo", file.%Foo
// CHECK:STDOUT: %.loc10_6.1: type = tuple_type ()
// CHECK:STDOUT: %.loc10_6.2: init () = call %Foo.ref()
// CHECK:STDOUT: %.loc10: init () = call %Foo.ref()
// CHECK:STDOUT: return
// CHECK:STDOUT: }