]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: optimize liveness in stackalloc
authorDaniel Morsing <daniel.morsing@gmail.com>
Wed, 5 Nov 2025 18:33:44 +0000 (18:33 +0000)
committerGopher Robot <gobot@golang.org>
Wed, 12 Nov 2025 18:02:27 +0000 (10:02 -0800)
commit4e761b9a181a090ca9ec52916c4aef93c4cbc090
treedd5d07d686a34ddb18ee2b5a79c2ba72e5580d40
parent956909ff84eecbae48b1e0c55570e0d910a993d4
cmd/compile: optimize liveness in stackalloc

The stackalloc code needs to run a liveness pass to build the
interference graph between stack slots. Because the values that we need
liveness over is so sparse, we can optimize the analysis by using a path
exploration algorithm rather than a iterative dataflow one

In local testing, this cuts 74.05 ms of CPU time off a build of cmd/compile.

Change-Id: I765ace87d5e8aae177e65eb63da482e3d698bea7
Reviewed-on: https://go-review.googlesource.com/c/go/+/718540
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
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/stackalloc.go