diff options
author | Than McIntosh <thanm@google.com> | 2023-10-31 13:21:41 -0400 |
---|---|---|
committer | Than McIntosh <thanm@google.com> | 2023-11-16 20:15:25 +0000 |
commit | 3f04f959d2d8bba0b636aa0c4ac705ae29e2c7b0 (patch) | |
tree | c6f1a783642a9717b4926ad62d085f054ec6223c /test/newinline.go | |
parent | d21afcdf00e5401cf0ffae7e346abfe3821912a9 (diff) | |
download | go-3f04f959d2d8bba0b636aa0c4ac705ae29e2c7b0.tar.gz go-3f04f959d2d8bba0b636aa0c4ac705ae29e2c7b0.zip |
cmd/compile/internal/inline: refactor AnalyzeFunc
This patch reworks how inlheur.AnalyzeFunc is called by the top level
inliner. Up until this point the strategy was to analyze a function at
the point where CanInline is invoked on it, however it simplifies
things to instead make the call outside of CanInline (for example, so
that directly recursive functions can be analyzed).
Also as part of this patch, change things so that we no longer run
some of the more compile-time intensive analysis on functions that
haven't been marked inlinable (so as to safe compile time), and add a
teardown/cleanup hook in the inlheur package to be invoked by the
inliner when we're done inlining.
Change-Id: Id0772a285d891b0bed66dd86adaffa69d973c26a
Reviewed-on: https://go-review.googlesource.com/c/go/+/539318
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'test/newinline.go')
-rw-r--r-- | test/newinline.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/newinline.go b/test/newinline.go index 272eb82f3d..69f1310ab2 100644 --- a/test/newinline.go +++ b/test/newinline.go @@ -326,9 +326,9 @@ func ii() { // ERROR "can inline ii" // Issue #42194 - make sure that functions evaluated in // go and defer statements can be inlined. func gd1(int) { - defer gd1(gd2()) // ERROR "inlining call to gd2" + defer gd1(gd2()) // ERROR "inlining call to gd2" "can inline gd1.deferwrap1" defer gd3()() // ERROR "inlining call to gd3" - go gd1(gd2()) // ERROR "inlining call to gd2" + go gd1(gd2()) // ERROR "inlining call to gd2" "can inline gd1.gowrap2" go gd3()() // ERROR "inlining call to gd3" } |