]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: make the cached sdom always return the reverse PO
authorDaniel Morsing <daniel.morsing@gmail.com>
Thu, 5 Feb 2026 12:44:32 +0000 (12:44 +0000)
committerGopher Robot <gobot@golang.org>
Thu, 12 Feb 2026 17:31:24 +0000 (09:31 -0800)
commita6c48f2ca9efdf6c45d434767a30b9d25824497d
tree2721485f76312ad664c2284751bd89050cfb68d3
parent31a03fe20c5361924622fd4cc92edcd08ba07072
cmd/compile: make the cached sdom always return the reverse PO

The sdom tree has a feature where the ordering of child nodes could be
customized, but in actuality, we only ever used one ordering: reverse
postorder. This order has a nice property that walking the tree will
always visit the source block of any non-retreating edge before the
destination block.

Make this ordering the default and document it. This allows passes that
use it to use the cached sdom tree instead of calculating it from
scratch each time.

Change-Id: I907b8ff7cc722e94bf364c183f26ead66a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/742340
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
src/cmd/compile/internal/ssa/loopreschedchecks.go
src/cmd/compile/internal/ssa/sparsetree.go