mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
f7ea499702
Part of the effort to refactoring frame pointer code generation. We used to use two function attributes "no-frame-pointer-elim" and "no-frame-pointer-elim-non-leaf" to represent three kinds of frame pointer usage: (all) frames use frame pointer, (non-leaf) frames use frame pointer, (none) frame use frame pointer. This CL makes the idea explicit by using only one enum function attribute "frame-pointer" Option "-frame-pointer=" replaces "-disable-fp-elim" for tools such as llc. "no-frame-pointer-elim" and "no-frame-pointer-elim-non-leaf" are still supported for easy migration to "frame-pointer". tests are mostly updated with // replace command line args ‘-disable-fp-elim=false’ with ‘-frame-pointer=none’ grep -iIrnl '\-disable-fp-elim=false' * | xargs sed -i '' -e "s/-disable-fp-elim=false/-frame-pointer=none/g" // replace command line args ‘-disable-fp-elim’ with ‘-frame-pointer=all’ grep -iIrnl '\-disable-fp-elim' * | xargs sed -i '' -e "s/-disable-fp-elim/-frame-pointer=all/g" Patch by Yuanfang Chen (tabloid.adroit)! Differential Revision: https://reviews.llvm.org/D56351 llvm-svn: 351049
36 lines
1.1 KiB
LLVM
36 lines
1.1 KiB
LLVM
; RUN: llc < %s -mtriple=arm64-apple-ios7.0 -disable-post-ra -frame-pointer=all | FileCheck %s
|
|
; RUN: llc < %s -mtriple=arm64-linux-gnu -disable-post-ra | FileCheck %s --check-prefix=CHECK-LINUX
|
|
|
|
; CHECK-LABEL: main:
|
|
; CHECK: sub sp, sp, #32
|
|
; CHECK-NEXT: stp x29, x30, [sp, #16]
|
|
; CHECK-NEXT: add x29, sp, #16
|
|
; CHECK-NEXT: stur wzr, [x29, #-4]
|
|
; CHECK: adrp x0, l_.str@PAGE
|
|
; CHECK: add x0, x0, l_.str@PAGEOFF
|
|
; CHECK-NEXT: bl _puts
|
|
; CHECK-NEXT: ldp x29, x30, [sp, #16]
|
|
; CHECK-NEXT: add sp, sp, #32
|
|
; CHECK-NEXT: ret
|
|
|
|
; CHECK-LINUX-LABEL: main:
|
|
; CHECK-LINUX: str x30, [sp, #-16]!
|
|
; CHECK-LINUX-NEXT: str wzr, [sp, #12]
|
|
; CHECK-LINUX: adrp x0, .L.str
|
|
; CHECK-LINUX: add x0, x0, :lo12:.L.str
|
|
; CHECK-LINUX-NEXT: bl puts
|
|
; CHECK-LINUX-NEXT: ldr x30, [sp], #16
|
|
; CHECK-LINUX-NEXT: ret
|
|
|
|
@.str = private unnamed_addr constant [7 x i8] c"hello\0A\00"
|
|
|
|
define i32 @main() nounwind ssp {
|
|
entry:
|
|
%retval = alloca i32, align 4
|
|
store i32 0, i32* %retval
|
|
%call = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0))
|
|
ret i32 %call
|
|
}
|
|
|
|
declare i32 @puts(i8*)
|