mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +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
@@ -34,7 +34,6 @@ fn While() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
|
||||
// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %A.type: type = fn_type @A [template]
|
||||
// CHECK:STDOUT: %A: %A.type = struct_value () [template]
|
||||
@@ -62,7 +61,6 @@ fn While() {
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Core//prelude/types/bool, inst+5, loaded [template = constants.%Bool]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -162,8 +160,6 @@ fn While() {
|
||||
// CHECK:STDOUT: %While.decl: %While.type = fn_decl @While [template = constants.%While] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Bool() -> type = "bool.make_type";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @A() -> bool;
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @B() -> bool;
|
||||
|
||||
@@ -22,27 +22,8 @@ fn While() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %While.type: type = fn_type @While [template]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
|
||||
// CHECK:STDOUT: %While: %While.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %.1: type = ptr_type String [template]
|
||||
// CHECK:STDOUT: %.2: String = string_literal "Hello" [template]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template]
|
||||
// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template]
|
||||
// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic]
|
||||
// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic]
|
||||
// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic]
|
||||
// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic]
|
||||
// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %.3: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic]
|
||||
// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, imports.%import_ref.5 [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(bool)> [template]
|
||||
// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert, @ImplicitAs(bool) [template]
|
||||
// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template]
|
||||
// CHECK:STDOUT: %.5: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template]
|
||||
// CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.5 [template]
|
||||
// CHECK:STDOUT: %.7: %.3 = assoc_entity element0, imports.%import_ref.6 [symbolic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -51,12 +32,6 @@ fn While() {
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+48, loaded [template = constants.%ImplicitAs]
|
||||
// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+54, unloaded
|
||||
// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.3) = import_ref Core//prelude/operators/as, inst+76, loaded [symbolic = @ImplicitAs.%.2 (constants.%.7)]
|
||||
// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+69, unloaded
|
||||
// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+69, unloaded
|
||||
// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+69, unloaded
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -68,26 +43,6 @@ fn While() {
|
||||
// CHECK:STDOUT: %While.decl: %While.type = fn_decl @While [template = constants.%While] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) {
|
||||
// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
|
||||
// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)]
|
||||
// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)]
|
||||
// CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)]
|
||||
// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)]
|
||||
// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.3)]
|
||||
// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.3) = assoc_entity element0, imports.%import_ref.5 [symbolic = %.2 (constants.%.4)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface {
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = imports.%import_ref.2
|
||||
// CHECK:STDOUT: .Convert = imports.%import_ref.3
|
||||
// CHECK:STDOUT: witness = (imports.%import_ref.4)
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @While() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: br !while.cond
|
||||
@@ -104,45 +59,3 @@ fn While() {
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) {
|
||||
// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
|
||||
// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)]
|
||||
// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest);
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) {
|
||||
// CHECK:STDOUT: %Dest => constants.%Dest
|
||||
// CHECK:STDOUT: %Dest.patt => constants.%Dest
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) {
|
||||
// CHECK:STDOUT: %Dest => constants.%Dest
|
||||
// CHECK:STDOUT: %Dest.patt => constants.%Dest
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) {
|
||||
// CHECK:STDOUT: %Dest => constants.%Dest
|
||||
// CHECK:STDOUT: %Dest.patt => constants.%Dest
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) {
|
||||
// CHECK:STDOUT: %Dest => constants.%Dest
|
||||
// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2
|
||||
// CHECK:STDOUT: %Self => constants.%Self.1
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @ImplicitAs(bool) {
|
||||
// CHECK:STDOUT: %Dest => bool
|
||||
// CHECK:STDOUT: %Dest.patt => bool
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3
|
||||
// CHECK:STDOUT: %Self => constants.%Self.2
|
||||
// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2
|
||||
// CHECK:STDOUT: %Convert => constants.%Convert.2
|
||||
// CHECK:STDOUT: %.1 => constants.%.5
|
||||
// CHECK:STDOUT: %.2 => constants.%.6
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -38,9 +38,7 @@ fn While() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %While.type: type = fn_type @While [template]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
|
||||
// CHECK:STDOUT: %While: %While.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %.1: bool = bool_literal false [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
|
||||
@@ -47,7 +47,6 @@ fn While() {
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Core//prelude/types/bool, inst+5, loaded [template = constants.%Bool]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -76,8 +75,6 @@ fn While() {
|
||||
// CHECK:STDOUT: %While.decl: %While.type = fn_decl @While [template = constants.%While] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Bool() -> type = "bool.make_type";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Cond() -> bool;
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F();
|
||||
|
||||
-3
@@ -46,7 +46,6 @@ fn While() {
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Core//prelude/types/bool, inst+5, loaded [template = constants.%Bool]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -75,8 +74,6 @@ fn While() {
|
||||
// CHECK:STDOUT: %While.decl: %While.type = fn_decl @While [template = constants.%While] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Bool() -> type = "bool.make_type";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Cond() -> bool;
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F();
|
||||
|
||||
Reference in New Issue
Block a user