Rollup merge of #86652 - nagisa:nagisa/non-leaf-fp, r=petrochenkov

Add support for leaf function frame pointer elimination

This PR adds ability for the target specifications to specify frame
pointer emission type that's not just “always” or “whatever cg decides”.

In particular there's a new mode that allows omission of the frame
pointer for leaf functions (those that don't call any other functions).

We then set this new mode for Aarch64-based Apple targets.

Fixes #86196
This commit is contained in:
Guillaume Gomez 2021-07-01 11:15:41 +02:00 committed by GitHub
commit dfd30d7b70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 149 additions and 60 deletions

View file

@ -406,7 +406,7 @@ pub fn maybe_create_entry_wrapper<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
};
// `main` should respect same config for frame pointer elimination as rest of code
cx.set_frame_pointer_elimination(llfn);
cx.set_frame_pointer_type(llfn);
cx.apply_target_cpu_attr(llfn);
let llbb = Bx::append_block(&cx, llfn, "top");