This is an archive of the discontinued LLVM Phabricator instance.

[Driver] Default to -momit-leaf-frame-pointer for AArch64
ClosedPublic

Authored by MaskRay on Dec 7 2019, 11:09 AM.

Details

Summary

This matches https://gcc.gnu.org/onlinedocs/gcc/AArch64-Options.html

-momit-leaf-frame-pointer
-mno-omit-leaf-frame-pointer

Omit or keep the frame pointer in leaf functions. The former behavior is the default.

-mno-omit-leaf-frame-pointer is currently a no-op because
TargetOptions::DisableFramePointerElim is only considered for non-leaf
functions.

Diff Detail

Event Timeline

MaskRay created this revision.Dec 7 2019, 11:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 7 2019, 11:10 AM

The patch looks structurally fine, but I'm missing the argumentation for changing the default and related, the history of why the default is to not omit the frame pointer on leaf functions.
Can you provide some insight here?

This comment was removed by MaskRay.
MaskRay added a comment.EditedDec 13 2019, 1:36 PM

(I got confused over the last weekend.)

@sdesmalen @efriedma We still need this driver change, otherwise D71168 will cause a functional difference when neither -m(no-)omit-leaf-frame-pointer is specified.

https://godbolt.org/z/653p3q

If I'm understanding correctly, this does nothing without D71168? And together with D71168, the net change for clang is that "-mno-omit-leaf-frame-pointer" works correctly, but everything else stays the same?

If I'm understanding correctly, this does nothing without D71168? And together with D71168, the net change for clang is that "-mno-omit-leaf-frame-pointer" works correctly, but everything else stays the same?

Yes.

efriedma accepted this revision.Dec 13 2019, 5:47 PM

Okay, LGTM

This revision is now accepted and ready to land.Dec 13 2019, 5:47 PM
This revision was automatically updated to reflect the committed changes.