]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: improve the ssa documentation.
authorsunnymilk <shaojunyang@google.com>
Tue, 17 Sep 2024 00:10:51 +0000 (17:10 -0700)
committerJunyang Shao <shaojunyang@google.com>
Tue, 17 Sep 2024 17:43:29 +0000 (17:43 +0000)
The auxiliary field could be better documented as it appears in a lot of the operands.
This CL documents and points the user to the code for further information.

Change-Id: I34a73af488358c9799e286f3b5ee4b08639ce608
Reviewed-on: https://go-review.googlesource.com/c/go/+/613615
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
src/cmd/compile/internal/ssa/README.md

index 5dc4fbee6fe3ccb72e744d4a40501c80fc9be724..2c602f160c556794b50348add9e8016006974dc5 100644 (file)
@@ -46,7 +46,21 @@ above has a `uint8` type, and a constant boolean value will have a `bool` type.
 However, certain types don't come from Go and are special; below we will cover
 `memory`, the most common of them.
 
-See [value.go](value.go) for more information.
+Some operators contain an auxiliary field. The aux fields are usually printed as
+enclosed in `[]` or `{}`, and could be the constant op argument, argument type,
+etc.
+for example:
+
+       v13 (?) = Const64 <int> [1]
+
+Here the aux field is the constant op argument, the op is creating a `Const64`
+value of 1. One more example:
+
+       v17 (361) = Store <mem> {int} v16 v14 v8
+
+Here the aux field is the type of the value being `Store`ed, which is int.
+
+See [value.go](value.go) and `_gen/*Ops.go` for more information.
 
 #### Memory types