From: Keith Randall Date: Wed, 26 Jul 2023 18:01:29 +0000 (-0700) Subject: cmd/compile: update README for unified IR X-Git-Tag: go1.22rc1~1521 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e4fdb437f659a47b3bc124a480eff7f40c0e34f8;p=gostls13.git cmd/compile: update README for unified IR Change-Id: Ie84e88db4b84f04f2c6f7750a2a413ecad6d817a Reviewed-on: https://go-review.googlesource.com/c/go/+/513436 Reviewed-by: Matthew Dempsky Reviewed-by: Keith Randall TryBot-Bypass: Keith Randall --- diff --git a/src/cmd/compile/README.md b/src/cmd/compile/README.md index 9c4eeeb51e..5cac4076bd 100644 --- a/src/cmd/compile/README.md +++ b/src/cmd/compile/README.md @@ -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 @@ -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