]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix loopreschedchecks for regabi
authorAustin Clements <austin@google.com>
Mon, 2 May 2022 18:54:22 +0000 (14:54 -0400)
committerAustin Clements <austin@google.com>
Mon, 2 May 2022 19:53:56 +0000 (19:53 +0000)
commit3b01a80319860c3d24a07859e4e9b1173800b786
tree707780fd17d60abe08f0a8d1106df767b28612b8
parentd4bfc87218335cb48c9d1d1a308d720f9195cae7
cmd/compile: fix loopreschedchecks for regabi

The loopreschedchecks pass (GOEXPERIMENT=preemptibleloops) had
bit-rotted in two ways because of the regabi experiment:

1. The call to goschedguarded was generating a pre-regabi StaticCall.
   This CL updates it to construct a new-style StaticCall.

2. The mem finder did not account for tuples or results containing a
   mem. This caused it to construct phis that were supposed to thread
   the mem into the added blocks, but they could instead thread a
   tuple or results containing a mem, causing things to go wrong
   later. This CL updates the mem finder to add an op to select out
   the mem if it finds the last live mem in a block is a tuple or
   results. This isn't ideal since we'll deadcode out most of these,
   but it's the easiest thing to do and this is just an experiment.

Tested by running the runtime tests. Ideally we'd have a real test for
this, but I don't think it's worth the effort for code that clearly
hasn't been enabled by anyone for at least a year.

Change-Id: I8ed01207637c454b68a551d38986c947e17d520b
Reviewed-on: https://go-review.googlesource.com/c/go/+/403475
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/ssa/loopreschedchecks.go