]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile/internal/inline: no-return flag analysis for inline heuristics
authorThan McIntosh <thanm@google.com>
Fri, 30 Jun 2023 16:17:06 +0000 (12:17 -0400)
committerThan McIntosh <thanm@google.com>
Wed, 6 Sep 2023 17:43:02 +0000 (17:43 +0000)
commite844d72421fb34b57eddf2653b33ed5ebf146b64
tree26be3756fe5da9d8076a211f00c60fe37ccbd917
parent5cdb132228b90732d57215893a9910ded694c585
cmd/compile/internal/inline: no-return flag analysis for inline heuristics

Add code to compute whether a given function appears to
unconditionally call panic or exit, as a means of driving inlining
decisions. Note that this determination is based on
heuristics/guesses, as opposed to strict safety analysis; in some
cases we may miss a function that does indeed always panic, or mark a
function as always invoking panic when it doesn't; the intent is get
the right answer in "most" cases.

Updates #61502.

Change-Id: Ibba3e60c06c2e54cf29b3ffa0f816518aaacb9a3
Reviewed-on: https://go-review.googlesource.com/c/go/+/511558
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/compile/internal/inline/inlheur/analyze.go
src/cmd/compile/internal/inline/inlheur/analyze_func_flags.go [new file with mode: 0644]
src/cmd/compile/internal/inline/inlheur/funcprops_test.go
src/cmd/compile/internal/inline/inlheur/pstate_string.go [new file with mode: 0644]
src/cmd/compile/internal/inline/inlheur/testdata/props/funcflags.go [new file with mode: 0644]
src/cmd/compile/internal/inline/inlheur/testdata/props/stub.go [deleted file]