Reduce the size of formatted SemIR. (#4534)

- Do not include entities imported from files that we are not dumping.
- Do not include constants and import_refs that are not referenced by
something that we are including in the formatted output.

---------

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
This commit is contained in:
Richard Smith
2024-11-15 21:00:26 +00:00
committed by GitHub
co-authored by Jon Ross-Perkins Carbon Infra Bot
parent 3c18a6c477
commit 4ee65ef58a
557 changed files with 319 additions and 11200 deletions
-9
View File
@@ -20,7 +20,6 @@ var c: [(); 5] = ((), (), (), (), (),);
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
// CHECK:STDOUT: %.1: i32 = int_value 1 [template]
// CHECK:STDOUT: %.2: type = array_type %.1, i32 [template]
// CHECK:STDOUT: %.3: type = ptr_type %.2 [template]
// CHECK:STDOUT: %tuple.type.1: type = tuple_type (i32) [template]
// CHECK:STDOUT: %.4: i32 = int_value 0 [template]
// CHECK:STDOUT: %array.1: %.2 = tuple_value (%.1) [template]
@@ -29,14 +28,12 @@ var c: [(); 5] = ((), (), (), (), (),);
// CHECK:STDOUT: %Float: %Float.type = struct_value () [template]
// CHECK:STDOUT: %.6: i32 = int_value 2 [template]
// CHECK:STDOUT: %.7: type = array_type %.6, f64 [template]
// CHECK:STDOUT: %.8: type = ptr_type %.7 [template]
// CHECK:STDOUT: %.9: f64 = float_literal 11.100000000000001 [template]
// CHECK:STDOUT: %.10: f64 = float_literal 2.2000000000000002 [template]
// CHECK:STDOUT: %tuple.type.2: type = tuple_type (f64, f64) [template]
// CHECK:STDOUT: %array.2: %.7 = tuple_value (%.9, %.10) [template]
// CHECK:STDOUT: %.11: i32 = int_value 5 [template]
// CHECK:STDOUT: %.12: type = array_type %.11, %empty_tuple.type [template]
// CHECK:STDOUT: %.13: type = ptr_type %.12 [template]
// CHECK:STDOUT: %tuple.type.3: type = tuple_type (%empty_tuple.type, %empty_tuple.type, %empty_tuple.type, %empty_tuple.type, %empty_tuple.type) [template]
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [template]
// CHECK:STDOUT: %.14: i32 = int_value 3 [template]
@@ -51,8 +48,6 @@ var c: [(); 5] = ((), (), (), (), (),);
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/...
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32]
// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+60, loaded [template = constants.%Float]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -86,10 +81,6 @@ var c: [(); 5] = ((), (), (), (), (),);
// CHECK:STDOUT: %c: ref %.12 = bind_name c, %c.var
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Float(%size.param_patt: Core.IntLiteral) -> type = "float.make_type";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %.loc11_20: i32 = int_value 1 [template = constants.%.1]