Join GitHub today
cmd/compile: detect call trees that can be marked NOSPLIT #17023
CL 24814 contains a minor optimization for 386/amd64: Ignore a few common runtime functions that take no arguments when deciding whether a function is a leaf function and is thus eligible for being marked NOSPLIT and thus having no function prolog.
Keith suggested some ways during code review to make this analysis much more powerful. This issue is a reminder to investigate those suggestions.
Indeed I've been thinking about something similar at link time, where we know the full call tree (at least for internal static linking), initially motivated for reducing binary size. But I am not sure about the complexity vs. gain (indirect calls are tricky). I may do some experiment.