Skip to content

Commit

Permalink
cmd/compile: update README for unified IR
Browse files Browse the repository at this point in the history
Change-Id: Ie84e88db4b84f04f2c6f7750a2a413ecad6d817a
Reviewed-on: https://go-review.googlesource.com/c/go/+/513436
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Keith Randall <khr@google.com>
TryBot-Bypass: Keith Randall <khr@google.com>
  • Loading branch information
randall77 committed Jul 26, 2023
1 parent 67983c0 commit e4fdb43
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions src/cmd/compile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ AST instead of `go/ast`.

* `cmd/compile/internal/types` (compiler types)
* `cmd/compile/internal/ir` (compiler AST)
* `cmd/compile/internal/typecheck` (AST transformations)
* `cmd/compile/internal/noder` (create compiler AST)

The compiler middle end uses its own AST definition and representation of Go
Expand All @@ -58,19 +57,9 @@ terms of these, so the next step after type checking is to convert the syntax
and types2 representations to ir and types. This process is referred to as
"noding."

There are currently two noding implementations:

1. irgen (aka "-G=3" or sometimes "noder2") is the implementation used starting
with Go 1.18, and

2. Unified IR is another, in-development implementation (enabled with
`GOEXPERIMENT=unified`), which also implements import/export and inlining.

Up through Go 1.18, there was a third noding implementation (just
"noder" or "-G=0"), which directly converted the pre-type-checked
syntax representation into IR and then invoked package typecheck's
type checker. This implementation was removed after Go 1.18, so now
package typecheck is only used for IR transformations.
Noding using a process called Unified IR, which builds a node representation
using a serialized version of the typechecked code from step 2.
Unified IR is also involved in import/export of packages and inlining.

### 4. Middle end

Expand Down

0 comments on commit e4fdb43

Please sign in to comment.