
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.
42 lines
1.2 KiB
LLVM
42 lines
1.2 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
|
|
; RUN: llc < %s -mtriple csky | 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: lrw a0, [.LCPI0_0]
|
|
; CHECK-NEXT: jsr16 a0
|
|
; CHECK-NEXT: .p2align 1
|
|
; CHECK-NEXT: # %bb.1:
|
|
; CHECK-NEXT: .p2align 2, 0x0
|
|
; CHECK-NEXT: .LCPI0_0:
|
|
; CHECK-NEXT: .long main
|
|
call void @main()
|
|
unreachable
|
|
}
|
|
|
|
define dso_local void @normal() "frame-pointer"="all" {
|
|
; CHECK-LABEL: normal:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: subi16 sp, sp, 8
|
|
; CHECK-NEXT: .cfi_def_cfa_offset 8
|
|
; CHECK-NEXT: st32.w lr, (sp, 4) # 4-byte Folded Spill
|
|
; CHECK-NEXT: st32.w l4, (sp, 0) # 4-byte Folded Spill
|
|
; CHECK-NEXT: .cfi_offset lr, -4
|
|
; CHECK-NEXT: .cfi_offset l4, -8
|
|
; CHECK-NEXT: mov16 l4, sp
|
|
; CHECK-NEXT: .cfi_def_cfa_register l4
|
|
; CHECK-NEXT: subi16 sp, sp, 4
|
|
; CHECK-NEXT: lrw a0, [.LCPI1_0]
|
|
; CHECK-NEXT: jsr16 a0
|
|
; CHECK-NEXT: .p2align 1
|
|
; CHECK-NEXT: # %bb.1:
|
|
; CHECK-NEXT: .p2align 2, 0x0
|
|
; CHECK-NEXT: .LCPI1_0:
|
|
; CHECK-NEXT: .long main
|
|
call void @main()
|
|
unreachable
|
|
}
|