
Some targets (e.g. PPC and Hexagon) already did this. I think it's best to do this consistently so that frontend authors don't run into inconsistent results when they emit `naked` functions. For example, in Zig, we had to change our emit code to also set `frame-pointer=none` to get reliable results across targets. Note: I don't have commit access.
32 lines
1001 B
LLVM
32 lines
1001 B
LLVM
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
|
|
; RUN: llc < %s -march xtensa | FileCheck %s -check-prefixes=CHECK
|
|
|
|
declare dso_local void @main()
|
|
|
|
define dso_local void @naked() naked "frame-pointer"="all" {
|
|
; CHECK-LABEL: naked:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: l32r a8, {{\.?LCPI[0-9]+_[0-9]+}}
|
|
; CHECK-NEXT: callx0 a8
|
|
call void @main()
|
|
unreachable
|
|
}
|
|
|
|
define dso_local void @normal() "frame-pointer"="all" {
|
|
; CHECK-LABEL: normal:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: addi a8, a1, -16
|
|
; CHECK-NEXT: or a1, a8, a8
|
|
; CHECK-NEXT: .cfi_def_cfa_offset 16
|
|
; CHECK-NEXT: s32i a0, a1, 4 # 4-byte Folded Spill
|
|
; CHECK-NEXT: s32i a15, a1, 0 # 4-byte Folded Spill
|
|
; CHECK-NEXT: .cfi_offset a0, -4
|
|
; CHECK-NEXT: .cfi_offset a15, -8
|
|
; CHECK-NEXT: or a15, a1, a1
|
|
; CHECK-NEXT: .cfi_def_cfa_register a15
|
|
; CHECK-NEXT: l32r a8, {{\.?LCPI[0-9]+_[0-9]+}}
|
|
; CHECK-NEXT: callx0 a8
|
|
call void @main()
|
|
unreachable
|
|
}
|