]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: schedule induction variable increments late
authorKeith Randall <khr@golang.org>
Wed, 14 May 2025 22:57:58 +0000 (15:57 -0700)
committerKeith Randall <khr@golang.org>
Thu, 15 May 2025 21:06:41 +0000 (14:06 -0700)
commit19f05770b05ef2a12692f522056ffb3bc23583ea
tree4ab751618f2760a972afade30b136e66f4cafb93
parent11fa0de475f9446870bc086bfb42cb67bac40634
cmd/compile: schedule induction variable increments late

for ..; ..; i++ {
 ...
}

We want to schedule the i++ late in the block, so that all other
uses of i in the block are scheduled first. That way, i++ can
happen in place in a register instead of requiring a temporary register.

Change-Id: Id777407c7e67a5ddbd8e58251099b0488138c0df
Reviewed-on: https://go-review.googlesource.com/c/go/+/672998
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@google.com>
src/cmd/compile/internal/ssa/schedule.go
test/codegen/schedule.go [new file with mode: 0644]