Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/compile: improve escape analysis fidelity #33981
Currently, when compiling the test case below, escape analysis decides that both
The reason for this is that the escape analysis tags use a single-bit flag
Contrast with how
Moreover, while we currently track these values in a
A little disappointing, but it looks like this only really helps cmd/compile/internal/gc.substArgTypes; in particular, the ... argument no longer escapes to the heap. So the ~30 call sites all benefit.
This is because the improved fidelity for cmd/compile/internal/types.SubstAny (used by gc.substArgTypes) can now report that for the
It also allows a few maps to be stack allocated in pprof:
Building all of Kubernetes (go build k8s.io/kubernetes/...) yields slightly better results; 145 improvements in total.
145 escape analysis improvements