Skip to content

cmd/compile: display AST IR in ssa.html #26662

@ysmolski

Description

@ysmolski

To finish work on ssa.html, it would be great to display AST IR as a second column in ssa.html.

But for that I would like to gather requirements, what exactly should be displayed there. Just copy the stuff GOSSAFUNC spews into stdout as AST IR? Or should we refine it to contain some subset of fields?

Please state your opinions and "use-cases" for this AST IR. How do you use it and what is the most important to you?

/CC @randall77 @josharian

I am talking about this:

generating SSA for f
buildssa-enter
buildssa-body
.   DCL l(9)
.   .   NAME-inline.i a(true) l(13) x(0) class(PAUTO) tc(1) assigned used uint16

.   DCL l(9)
.   .   NAME-inline.~r1 a(true) l(13) x(0) class(PAUTO) tc(1) assigned used uint16

.   BLOCK l(9)
.   BLOCK-list
.   .   AS l(9) tc(1)
.   .   .   NAME-inline.i a(true) l(13) x(0) class(PAUTO) tc(1) assigned used uint16
.   .   .   NAME-inline.x a(true) l(5) x(0) class(PEXTERN) tc(1) assigned used uint16

.   AS l(9) tc(1)
.   .   NAME-inline.~r1 a(true) l(13) x(0) class(PAUTO) tc(1) assigned used uint16

.   BLOCK-init
.   .   AS l(9) tc(1)
.   .   .   NAME-inline..autotmp_5 a(true) l(9) x(0) class(PAUTO) esc(N) tc(1) assigned used uint16
.   .   .   ADD l(14) tc(1) uint16
.   .   .   .   NAME-inline.i a(true) l(13) x(0) class(PAUTO) tc(1) assigned used uint16
.   .   .   .   MUL l(14) tc(1) uint16
.   .   .   .   .   LITERAL-2 l(14) tc(1) uint16
.   .   .   .   .   NAME-inline.i a(true) l(13) x(0) class(PAUTO) tc(1) assigned used uint16
.   BLOCK l(9) hascall
.   BLOCK-list
.   .   AS l(9) tc(1)
.   .   .   NAME-inline.~r1 a(true) l(13) x(0) class(PAUTO) tc(1) assigned used uint16
.   .   .   NAME-inline..autotmp_5 a(true) l(9) x(0) class(PAUTO) esc(N) tc(1) assigned used uint16

.   GOTO l(9) tc(1)
.   .   NAME-inline..i0 a(true) l(9) x(0)

.   LABEL l(9) tc(1)
.   .   NAME-inline..i0 a(true) l(9) x(0)

.   AS l(9) tc(1)
.   .   NAME-inline.x a(true) l(5) x(0) class(PEXTERN) tc(1) assigned used uint16
.   .   ADD l(9) tc(1) uint16
.   .   .   CONVNOP l(9) tc(1) uint16
.   .   .   .   NAME-inline.~r1 a(true) l(13) x(0) class(PAUTO) tc(1) assigned used uint16
.   .   .   LITERAL-123 l(9) tc(1) uint16

.   DCL l(10)
.   .   NAME-binary.b a(true) l(104) x(0) class(PAUTO) tc(1) assigned used SLICE-[]byte

.   DCL l(10)
.   .   NAME-binary.v a(true) l(104) x(0) class(PAUTO) tc(1) assigned used uint16

.   AS l(10) tc(1)
.   .   NAME-_ a(true) x(0) tc(1) assigned blank
.   .   NAME-binary.BigEndian a(true) l(47) x(0) class(PEXTERN) tc(1) used binary.bigEndian

.   AS l(10) tc(1) hascall
.   .   NAME-inline..autotmp_4 a(true) l(10) x(0) class(PAUTO) esc(N) tc(1) assigned used SLICE-[]byte
.   .   SLICEARR l(10) tc(1) hascall SLICE-[]byte
.   .   .   ADDR l(10) esc(no) tc(1) implicit(true) PTR64-*[2]byte
.   .   .   .   NAME-inline.b a(true) l(6) x(0) class(PEXTERN) tc(1) addrtaken used ARRAY-[2]byte

.   BLOCK l(10)
.   BLOCK-list
.   .   AS l(10) tc(1)
.   .   .   NAME-inline..autotmp_6 a(true) l(10) x(0) class(PAUTO) esc(N) tc(1) assigned used uint16
.   .   .   NAME-inline.x a(true) l(5) x(0) class(PEXTERN) tc(1) assigned used uint16

.   .   AS l(10) tc(1)
.   .   .   NAME-binary.b a(true) l(104) x(0) class(PAUTO) tc(1) assigned used SLICE-[]byte
.   .   .   NAME-inline..autotmp_4 a(true) l(10) x(0) class(PAUTO) esc(N) tc(1) assigned used SLICE-[]byte

.   .   AS l(10) tc(1)
.   .   .   NAME-binary.v a(true) l(104) x(0) class(PAUTO) tc(1) assigned used uint16
.   .   .   NAME-inline..autotmp_6 a(true) l(10) x(0) class(PAUTO) esc(N) tc(1) assigned used uint16

.   VARKILL l(10) tc(1)
.   .   NAME-inline..autotmp_4 a(true) l(10) x(0) class(PAUTO) esc(N) tc(1) assigned used SLICE-[]byte

.   AS l(105) tc(1) hascall
.   .   NAME-_ a(true) x(0) tc(1) assigned blank
.   .   INDEX l(105) tc(1) hascall byte
.   .   .   NAME-binary.b a(true) l(104) x(0) class(PAUTO) tc(1) assigned used SLICE-[]byte
.   .   .   LITERAL-1 l(105) tc(1) int

.   AS l(106) tc(1) hascall
.   .   INDEX l(106) tc(1) assigned hascall byte
.   .   .   NAME-binary.b a(true) l(104) x(0) class(PAUTO) tc(1) assigned used SLICE-[]byte
.   .   .   LITERAL-0 l(106) tc(1) int
.   .   CONV l(106) tc(1) byte
.   .   .   RSH l(106) tc(1) bounded uint16
.   .   .   .   NAME-binary.v a(true) l(104) x(0) class(PAUTO) tc(1) assigned used uint16
.   .   .   .   LITERAL-8 l(106) tc(1) uint

.   AS l(107) tc(1) hascall
.   .   INDEX l(107) tc(1) assigned hascall byte
.   .   .   NAME-binary.b a(true) l(104) x(0) class(PAUTO) tc(1) assigned used SLICE-[]byte
.   .   .   LITERAL-1 l(107) tc(1) int
.   .   CONV l(107) tc(1) byte
.   .   .   NAME-binary.v a(true) l(104) x(0) class(PAUTO) tc(1) assigned used uint16

.   LABEL l(10) tc(1)
.   .   NAME-inline..i1 a(true) l(10) x(0)
buildssa-exit

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions