]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: faster liveness analysis in regalloc
authorDaniel Morsing <daniel.morsing@gmail.com>
Sat, 9 Aug 2025 19:30:30 +0000 (20:30 +0100)
committerGopher Robot <gobot@golang.org>
Tue, 4 Nov 2025 21:57:19 +0000 (13:57 -0800)
commit16705b962ecf35314cd6791348d7a4b00422639a
tree4dcde313a8fa04b4b7c0fc8272b0188cf6a89abe
parenta5fe6791d79347d4c28af4b475b679ce7a726a28
cmd/compile: faster liveness analysis in regalloc

Instead of iterating until dataflow stabilization, fill in values known to be
live at the beginning of loop headers. This reduces the number of passes
over the CFG from the depth of the loopnest to just 2.

In a test instrumented version of this change, run against
cmd/compile/internal/ssa, it brought the time spent in liveness analysis
down to 150.52ms from 225.49ms on my machine.

Change-Id: Ic72762eedfd1f10b1ba74c430ed62ab4ebd3ec5c
Reviewed-on: https://go-review.googlesource.com/c/go/+/695255
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/ssa/regalloc.go