]> Cypherpunks repositories - gostls13.git/commit
[dev.typeparams] cmd/compile: set Func.ClosureCalled in escape analysis
authorMatthew Dempsky <mdempsky@google.com>
Sat, 3 Jul 2021 18:22:26 +0000 (11:22 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Sun, 4 Jul 2021 00:19:26 +0000 (00:19 +0000)
commit899b158ee9e99642bdbea2008d7cc70382db6545
tree3fb700ff85fa9232bef96591c32adad77b6181e6
parentea5369bac041e7a78e198f4412350cfd923215aa
[dev.typeparams] cmd/compile: set Func.ClosureCalled in escape analysis

The Func.ClosureCalled flag is an optimization used by escape analysis
to detect closures that were directly called, so we know we have
visibility of the result flows. It's not needed by any other phases of
the compiler, so we might as well calculate it within escape analysis
too.

This saves some trouble during IR construction and trying to maintain
the ClosureCalled flag through inlining and copying.

Passes toolstash -cmp.

Change-Id: Ic53cecb7ac439745c0dfba2cd202b9cc40f1e47c
Reviewed-on: https://go-review.googlesource.com/c/go/+/332691
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Trust: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
src/cmd/compile/internal/escape/call.go
src/cmd/compile/internal/inline/inl.go
src/cmd/compile/internal/ir/func.go
src/cmd/compile/internal/noder/helpers.go
src/cmd/compile/internal/noder/reader.go
src/cmd/compile/internal/noder/stencil.go
src/cmd/compile/internal/typecheck/func.go