]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: improve scheduling pass
authorKeith Randall <khr@golang.org>
Tue, 17 Nov 2020 23:32:45 +0000 (15:32 -0800)
committerKeith Randall <khr@google.com>
Fri, 20 Jan 2023 04:54:01 +0000 (04:54 +0000)
commit12befc3ce3f44d500174d2b4a0aa524feb74e16b
tree963b76086cfc1fba96becb01e0266cbcaaed64df
parentb419db6c15519a29ff3d7d2e56d8f115204f8c5d
cmd/compile: improve scheduling pass

Convert the scheduling pass from scheduling backwards to scheduling forwards.

Forward scheduling makes it easier to prioritize scheduling values as
soon as they are ready, which is important for things like nil checks,
select ops, etc.

Forward scheduling is also quite a bit clearer. It was originally
backwards because computing uses is tricky, but I found a way to do it
simply and with n lg n complexity. The new scheme also makes it easy
to add new scheduling edges if needed.

Fixes #42673
Update #56568

Change-Id: Ibbb38c52d191f50ce7a94f8c1cbd3cd9b614ea8b
Reviewed-on: https://go-review.googlesource.com/c/go/+/270940
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/ssa/_gen/RISCV64Ops.go
src/cmd/compile/internal/ssa/_gen/S390XOps.go
src/cmd/compile/internal/ssa/debug_lines_test.go
src/cmd/compile/internal/ssa/opGen.go
src/cmd/compile/internal/ssa/schedule.go
src/cmd/compile/internal/ssagen/ssa.go
test/nilptr3.go