This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Allow forcing frame pointers in leaf functions
AbandonedPublic

Authored by olista01 on Aug 15 2016, 9:10 AM.

Details

Summary

This allows the -fno-omit-frame-pointer option (and the
no-frame-pointer-elim function attribute) to work on leaf functions
(those which do not contain any calls).

This still does not emit frame pointers for leaf functions which do not
otherwise need a stack frame, due to the early return in emitPrologue.
This is OK, because a function without a stack frame cannot clobber the
previous value of the frame pointer, so the callee's frame pointer chain
will remain valid.

Diff Detail

Event Timeline

olista01 updated this revision to Diff 68045.Aug 15 2016, 9:10 AM
olista01 retitled this revision from to [ARM] Allow forcing frame pointers in leaf functions.
olista01 updated this object.
olista01 added reviewers: rengolin, t.p.northover.
olista01 set the repository for this revision to rL LLVM.
olista01 added a subscriber: llvm-commits.
rengolin edited edge metadata.Aug 15 2016, 12:26 PM

I vaguely remember the frame pointer being used by SjLj unwinding, but I don't know enough about SjLj and can't remember what the problem was to say with any accuracy.

Indeed, SjLj EH does use the frame pointer, but doesn't force it to be emitted, and assumes it is always r7! I've raised https://llvm.org/bugs/show_bug.cgi?id=28995 for this.

olista01 abandoned this revision.Aug 22 2016, 10:05 AM

Now part of D23516 (this patch is required to maintain correctness on iOS/WatchOS with D23516)