]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: update README for unified IR
authorKeith Randall <khr@golang.org>
Wed, 26 Jul 2023 18:01:29 +0000 (11:01 -0700)
committerKeith Randall <khr@google.com>
Wed, 26 Jul 2023 19:27:07 +0000 (19:27 +0000)
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>

src/cmd/compile/README.md

index 9c4eeeb51ead3e47da0255dea070a40f66d0633b..5cac4076bdca6fb8a1d89e044c280720494c887a 100644 (file)
@@ -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