]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile/internal/inline: extend flag calculation via export data
authorThan McIntosh <thanm@google.com>
Tue, 11 Jul 2023 16:42:12 +0000 (12:42 -0400)
committerThan McIntosh <thanm@google.com>
Fri, 8 Sep 2023 23:02:38 +0000 (23:02 +0000)
commitd2024a091d545909e53a04ce40c1dbf9513819e6
treead131ae1bbed5e49268c1c7a181a631f508f4372
parent323cf730912bc4ad975766118ba2da88a6e80a6b
cmd/compile/internal/inline: extend flag calculation via export data

Extend the code that computes various properties and parameter flags
to incorporate information from export data in addition to things we
can get from the current package. Specifically:

 - when deciding whether the current function always calls panic/exit,
   check to see whether it has an unconditional call to some other
   function that has that flag.

 - when computing "parameter feeds" properties, look not just for
   cases where a parameter feeds an interesting construct (if/switch,
   indirect/interface call, etc) but where it feeds a call whose
   corresponding param has that flag.

 - when computing return properties, if a given return is always the
   results of a call to X, then set the return properties to those
   of X.

Updates #61502.

Change-Id: I6472fe98759cccad05b8eed58e4fc568201d88ad
Reviewed-on: https://go-review.googlesource.com/c/go/+/511563
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
src/cmd/compile/internal/inline/inlheur/analyze_func_params.go
src/cmd/compile/internal/inline/inlheur/analyze_func_returns.go
src/cmd/compile/internal/inline/inlheur/funcprops_test.go
src/cmd/compile/internal/inline/inlheur/testdata/props/acrosscall.go [new file with mode: 0644]
src/cmd/compile/internal/inline/inlheur/testdata/props/funcflags.go