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
@@ -8,6 +8,10 @@ fn F();
fn G() { F(); }
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %.loc9: type = tuple_type ()
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file "simple.carbon" {
// CHECK:STDOUT: %F: <function> = fn_decl @F
// CHECK:STDOUT: %G: <function> = fn_decl @G
@@ -18,7 +22,6 @@ fn G() { F(); }
// CHECK:STDOUT: fn @G() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: <function> = name_reference "F", file.%F
// CHECK:STDOUT: %.loc9_11.1: type = tuple_type ()
// CHECK:STDOUT: %.loc9_11.2: init () = call %F.ref()
// CHECK:STDOUT: %.loc9: init () = call %F.ref()
// CHECK:STDOUT: return
// CHECK:STDOUT: }