This is an archive of the discontinued LLVM Phabricator instance.

[X86] for split stack, not save/restore nested arg if unused
ClosedPublic

Authored by cherry on Jul 12 2019, 3:19 PM.

Details

Summary

For split-stack, if the nested argument (i.e. R10) is not used, no need to save/restore it in the prologue.

Diff Detail

Repository
rL LLVM

Event Timeline

cherry created this revision.Jul 12 2019, 3:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 12 2019, 3:19 PM
thanm added a comment.Jul 16 2019, 6:53 AM

Good cleanup -- LGTM.

We can obviously test this with Go -- do we know of any other easily usable testcases/applications that use the nested argument?

Thanks for the review.

We can obviously test this with Go -- do we know of any other easily usable testcases/applications that use the nested argument?

Closures do. The save/restore R10 code path is used when a closure call splits the stack. For example, a recursive closure like https://play.golang.org/p/6t1xV8ThJuN .

thanm accepted this revision.Jul 17 2019, 8:01 AM

SGTM

This revision is now accepted and ready to land.Jul 17 2019, 8:01 AM
This revision was automatically updated to reflect the committed changes.