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:
commit
dfd30d7b70
24 changed files with 149 additions and 60 deletions
|
@ -792,18 +792,6 @@ impl Session {
|
|||
!self.target.is_like_windows && !self.target.is_like_osx
|
||||
}
|
||||
|
||||
pub fn must_not_eliminate_frame_pointers(&self) -> bool {
|
||||
// "mcount" function relies on stack pointer.
|
||||
// See <https://sourceware.org/binutils/docs/gprof/Implementation.html>.
|
||||
if self.instrument_mcount() {
|
||||
true
|
||||
} else if let Some(x) = self.opts.cg.force_frame_pointers {
|
||||
x
|
||||
} else {
|
||||
!self.target.eliminate_frame_pointer
|
||||
}
|
||||
}
|
||||
|
||||
pub fn must_emit_unwind_tables(&self) -> bool {
|
||||
// This is used to control the emission of the `uwtable` attribute on
|
||||
// LLVM functions.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue