mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 08:44:41 +01:00
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:
co-authored by
Jon Ross-Perkins
Carbon Infra Bot
parent
3c18a6c477
commit
4ee65ef58a
@@ -16,7 +16,6 @@ var arr: [i32; Add(1, 2)];
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
|
||||
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %Add.type: type = fn_type @Add [template]
|
||||
// CHECK:STDOUT: %Add: %Add.type = struct_value () [template]
|
||||
@@ -24,7 +23,6 @@ var arr: [i32; Add(1, 2)];
|
||||
// CHECK:STDOUT: %.2: i32 = int_value 2 [template]
|
||||
// CHECK:STDOUT: %.3: i32 = int_value 3 [template]
|
||||
// CHECK:STDOUT: %.4: type = array_type %.3, i32 [template]
|
||||
// CHECK:STDOUT: %.5: type = ptr_type %.4 [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -33,7 +31,6 @@ var arr: [i32; Add(1, 2)];
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -79,7 +76,5 @@ var arr: [i32; Add(1, 2)];
|
||||
// CHECK:STDOUT: %arr: ref %.4 = bind_name arr, %arr.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Add(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd";
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -14,7 +14,6 @@ fn Add(a: i32, b: i32) -> i32 = "int.sadd";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
|
||||
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %Add.type: type = fn_type @Add [template]
|
||||
// CHECK:STDOUT: %Add: %Add.type = struct_value () [template]
|
||||
@@ -26,7 +25,6 @@ fn Add(a: i32, b: i32) -> i32 = "int.sadd";
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -61,7 +59,5 @@ fn Add(a: i32, b: i32) -> i32 = "int.sadd";
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Add(%a.param_patt: i32, %b.param_patt: i32) -> i32 = "int.sadd";
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -41,7 +41,6 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
|
||||
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %A.type: type = fn_type @A [template]
|
||||
// CHECK:STDOUT: %A: %A.type = struct_value () [template]
|
||||
@@ -57,7 +56,6 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd";
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -214,8 +212,6 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd";
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @A(%n.param_patt: i32, %m.param_patt: i32) -> i32 = "int.sadd" {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %n.ref: i32 = name_ref n, %n.loc19
|
||||
|
||||
@@ -17,7 +17,6 @@ fn UnknownBuiltin() = "unknown.builtin.name";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %UnknownBuiltin.type: type = fn_type @UnknownBuiltin [template]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
|
||||
// CHECK:STDOUT: %UnknownBuiltin: %UnknownBuiltin.type = struct_value () [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -24,7 +24,6 @@ var arr: [i32; 1.(I.F)(2)];
|
||||
// CHECK:STDOUT: %I.type: type = facet_type <@I> [template]
|
||||
// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
|
||||
// CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
|
||||
// CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template]
|
||||
// CHECK:STDOUT: %.1: type = assoc_entity_type %I.type, %F.type.1 [template]
|
||||
// CHECK:STDOUT: %.2: %.1 = assoc_entity element0, @I.%F.decl [template]
|
||||
@@ -38,7 +37,6 @@ var arr: [i32; 1.(I.F)(2)];
|
||||
// CHECK:STDOUT: %.6: i32 = int_value 2 [template]
|
||||
// CHECK:STDOUT: %.7: i32 = int_value 3 [template]
|
||||
// CHECK:STDOUT: %.8: type = array_type %.7, i32 [template]
|
||||
// CHECK:STDOUT: %.9: type = ptr_type %.8 [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -47,7 +45,6 @@ var arr: [i32; 1.(I.F)(2)];
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+15, loaded [template = constants.%Int32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -151,8 +148,6 @@ var arr: [i32; 1.(I.F)(2)];
|
||||
// CHECK:STDOUT: fn[%self.param_patt: @F.1.%Self (%Self)](%other.param_patt: @F.1.%Self (%Self)) -> @F.1.%Self (%Self);
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F.2[%self.param_patt: i32](%other.param_patt: i32) -> i32 = "int.sadd";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F.1(constants.%Self) {
|
||||
|
||||
-5
@@ -34,7 +34,6 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
|
||||
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %Add.type: type = facet_type <@Add> [template]
|
||||
// CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic]
|
||||
@@ -109,7 +108,6 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
|
||||
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %Add.type: type = facet_type <@Add> [template]
|
||||
// CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic]
|
||||
@@ -125,7 +123,6 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
|
||||
// CHECK:STDOUT: %.6: <bound method> = bound_method %.2, %Op.1 [template]
|
||||
// CHECK:STDOUT: %.7: i32 = int_value 3 [template]
|
||||
// CHECK:STDOUT: %.8: type = array_type %.7, i32 [template]
|
||||
// CHECK:STDOUT: %.9: type = ptr_type %.8 [template]
|
||||
// CHECK:STDOUT: %.10: i32 = int_value 4 [template]
|
||||
// CHECK:STDOUT: %.11: <bound method> = bound_method %.7, %Op.1 [template]
|
||||
// CHECK:STDOUT: %.12: i32 = int_value 7 [template]
|
||||
@@ -140,12 +137,10 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
|
||||
// CHECK:STDOUT: .Add = %import_ref.2
|
||||
// CHECK:STDOUT: import Core//default
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//default, inst+5, loaded [template = constants.%Int32]
|
||||
// CHECK:STDOUT: %import_ref.2: type = import_ref Core//default, inst+9, loaded [template = constants.%Add.type]
|
||||
// CHECK:STDOUT: %import_ref.3 = import_ref Core//default, inst+11, unloaded
|
||||
// CHECK:STDOUT: %import_ref.4: %.4 = import_ref Core//default, inst+39, loaded [template = constants.%.5]
|
||||
// CHECK:STDOUT: %import_ref.5: %Op.type.2 = import_ref Core//default, inst+34, loaded [template = constants.%Op.2]
|
||||
// CHECK:STDOUT: %import_ref.6 = import_ref Core//default, inst+34, unloaded
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
|
||||
@@ -25,7 +25,6 @@ var arr: [i32; Core.TestAdd(1, 2)] = (1, 2, 3);
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
|
||||
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %TestAdd.type: type = fn_type @TestAdd [template]
|
||||
// CHECK:STDOUT: %TestAdd: %TestAdd.type = struct_value () [template]
|
||||
@@ -77,7 +76,6 @@ var arr: [i32; Core.TestAdd(1, 2)] = (1, 2, 3);
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
|
||||
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %TestAdd.type: type = fn_type @TestAdd [template]
|
||||
// CHECK:STDOUT: %TestAdd: %TestAdd.type = struct_value () [template]
|
||||
@@ -85,7 +83,6 @@ var arr: [i32; Core.TestAdd(1, 2)] = (1, 2, 3);
|
||||
// CHECK:STDOUT: %.2: i32 = int_value 2 [template]
|
||||
// CHECK:STDOUT: %.3: i32 = int_value 3 [template]
|
||||
// CHECK:STDOUT: %.4: type = array_type %.3, i32 [template]
|
||||
// CHECK:STDOUT: %.5: type = ptr_type %.4 [template]
|
||||
// CHECK:STDOUT: %tuple.type: type = tuple_type (i32, i32, i32) [template]
|
||||
// CHECK:STDOUT: %.6: i32 = int_value 0 [template]
|
||||
// CHECK:STDOUT: %array: %.4 = tuple_value (%.1, %.2, %.3) [template]
|
||||
@@ -97,7 +94,6 @@ var arr: [i32; Core.TestAdd(1, 2)] = (1, 2, 3);
|
||||
// CHECK:STDOUT: .TestAdd = %import_ref.2
|
||||
// CHECK:STDOUT: import Core//core
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//core, inst+5, loaded [template = constants.%Int32]
|
||||
// CHECK:STDOUT: %import_ref.2: %TestAdd.type = import_ref Core//core, inst+30, loaded [template = constants.%TestAdd]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
Reference in New Issue
Block a user