Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: better escape analysis tag encoding #31504

Closed
mdempsky opened this issue Apr 16, 2019 · 1 comment
Closed

cmd/compile: better escape analysis tag encoding #31504

mdempsky opened this issue Apr 16, 2019 · 1 comment
Milestone

Comments

@mdempsky
Copy link
Member

mdempsky commented Apr 16, 2019

Currently escape.go mostly reuses esc.go's tagging scheme for simplicity, but that encoding scheme is unnecessarily lossy.

In particular, escape tags can only report that a parameter flows to the heap (EscHeap), or that it's dereferenced once before flowing to the heap (EscContentEscapes). However, there are hundreds of parameters in std cmd that are always dereferenced at least twice before flowing to the heap.

A quick experiment (tracking the shortest param path to heap and then logging when it's >=2) shows:

derefs    count
2         686
3         165
4         53
5         12
6         1
7         2

And this is probably an underestimate, since any functions that call other tagged functions will be analyzed based on the latter's lossy tags.

@mdempsky
Copy link
Member Author

Duplicate of #33981.

@golang golang locked and limited conversation to collaborators Sep 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants