]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix containsUnavoidableCall computation
authorKeith Randall <khr@golang.org>
Tue, 10 Jun 2025 21:37:47 +0000 (14:37 -0700)
committerGopher Robot <gobot@golang.org>
Fri, 25 Jul 2025 20:52:00 +0000 (13:52 -0700)
commit5045fdd8ff8769c34e837fbfb0894a72dfa73b4d
tree3f20df03788802dc841d0d7cb3ed68ad9cf3819e
parentd28b27cd8e612f3e3e6ffcfb7444a4e8829dbb48
cmd/compile: fix containsUnavoidableCall computation

The previous algorithm was incorrect, as it reused the dominatedByCall
slice without resetting it. It also used the depth fields even though
they were not yet calculated.

Also, clean up a lot of the loop detector code that we never use.

Always compute depths. It is cheap.

Update #71868

Not really sure how to test this. As it is just an advisory bit,
nothing goes really wrong when the result is incorrect.

Change-Id: Ic0ae87a4d3576554831252d88b05b058ca68af41
Reviewed-on: https://go-review.googlesource.com/c/go/+/680775
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/ssa/likelyadjust.go
src/cmd/compile/internal/ssa/regalloc.go
src/cmd/compile/internal/ssa/rewrite.go
src/cmd/compile/internal/ssa/tighten.go