Preserving frame pointers -- even inside leaf functions -- makes it easy to capture the stack of a running program, without requiring any side tables or metadata (like `.eh_frame` sections). Many sampling profilers and similar tools walk frame pointers to capture stacks. Enabling this option will play nice with those tools.
21 lines
358 B
Plaintext
21 lines
358 B
Plaintext
;; Test compilation of leaf functions without preserving frame pointers.
|
|
|
|
test compile precise-output
|
|
set unwind_info=false
|
|
set preserve_frame_pointers=false
|
|
target x86_64
|
|
|
|
function %leaf(i64) -> i64 {
|
|
block0(v0: i64):
|
|
return v0
|
|
}
|
|
|
|
; pushq %rbp
|
|
; movq %rsp, %rbp
|
|
; block0:
|
|
; movq %rdi, %rax
|
|
; movq %rbp, %rsp
|
|
; popq %rbp
|
|
; ret
|
|
|