]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/escape: stop disabling literal allocation optimizations when...
authorthepudds <thepudds1460@gmail.com>
Fri, 27 Jun 2025 22:46:27 +0000 (18:46 -0400)
committert hepudds <thepudds1460@gmail.com>
Mon, 30 Jun 2025 20:58:47 +0000 (13:58 -0700)
commit479b51ee1f78a884a45b517c1e993d91c9774e29
treef563c8fc77ed1b0bbf833aeea375bd55af81d65c
parent8002d283e8dc3d02f087a3885894c2c29fac93fa
cmd/compile/internal/escape: stop disabling literal allocation optimizations when coverage is enabled

CL 649079 and CL 649035 updated escape analysis to rewrite certain
expressions in OMAKE and OCONVIFACE nodes as optimizations to
reduce user allocations.

Part of the change in CL 649079 disabled those optimzations when
coverage instrumentation was enabled under an incorrect possible theory
of how those optimizations might be "expected" to change coverage
results -- in particular, the cover_build_pkg_select.txt testscript
failed with different coverage results. I now realize that the proper
explanation is that my fix in CL 684116 was needed.

Now that CL 684116 is merged, we should no longer disable these
optimizations when coverage is enabled, which is what this CL does.

This has not been reported as a problem to my knowledge, but without
this CL, one could imagine for example a test using testing.AllocsPerRun
might start failing when coverage was enabled if the result relied on
these optimizations.

As expected, if we place this CL just before the necessary fix in
CL 684116, the cover_build_pkg_select.txt testscript fails with a
changed coverage result. If we place this CL just after CL 684116,
the test passes, also as expected.

Updates #71359

Change-Id: Ib5ff00c267acd85dd423c238d177e91a4d881f9e
Reviewed-on: https://go-review.googlesource.com/c/go/+/684777
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/cmd/compile/internal/escape/escape.go