1 ;RUN: llc -march=sparc < %s | FileCheck %s -check-prefix=V8 2 ;RUN: llc -march=sparc -mattr=v9 < %s | FileCheck %s -check-prefix=V9 3 ;RUN: llc -march=sparc -regalloc=basic < %s | FileCheck %s -check-prefix=V8 4 ;RUN: llc -march=sparc -regalloc=basic -mattr=v9 < %s | FileCheck %s -check-prefix=V9 5 6 7 define i8* @frameaddr() nounwind readnone { 8 entry: 9 ;V8-LABEL: frameaddr: 10 ;V8: save %sp, -96, %sp 11 ;V8: jmp %i7+8 12 ;V8: restore %g0, %fp, %o0 13 14 ;V9-LABEL: frameaddr: 15 ;V9: save %sp, -96, %sp 16 ;V9: jmp %i7+8 17 ;V9: restore %g0, %fp, %o0 18 %0 = tail call i8* @llvm.frameaddress(i32 0) 19 ret i8* %0 20 } 21 22 define i8* @frameaddr2() nounwind readnone { 23 entry: 24 ;V8-LABEL: frameaddr2: 25 ;V8: ta 3 26 ;V8: ld [%fp+56], {{.+}} 27 ;V8: ld [{{.+}}+56], {{.+}} 28 ;V8: ld [{{.+}}+56], {{.+}} 29 30 ;V9-LABEL: frameaddr2: 31 ;V9: flushw 32 ;V9: ld [%fp+56], {{.+}} 33 ;V9: ld [{{.+}}+56], {{.+}} 34 ;V9: ld [{{.+}}+56], {{.+}} 35 %0 = tail call i8* @llvm.frameaddress(i32 3) 36 ret i8* %0 37 } 38 39 declare i8* @llvm.frameaddress(i32) nounwind readnone 40 41 42 43 define i8* @retaddr() nounwind readnone { 44 entry: 45 ;V8-LABEL: retaddr: 46 ;V8: or %g0, %o7, {{.+}} 47 48 ;V9-LABEL: retaddr: 49 ;V9: or %g0, %o7, {{.+}} 50 51 %0 = tail call i8* @llvm.returnaddress(i32 0) 52 ret i8* %0 53 } 54 55 define i8* @retaddr2() nounwind readnone { 56 entry: 57 ;V8-LABEL: retaddr2: 58 ;V8: ta 3 59 ;V8: ld [%fp+56], {{.+}} 60 ;V8: ld [{{.+}}+56], {{.+}} 61 ;V8: ld [{{.+}}+60], {{.+}} 62 63 ;V9-LABEL: retaddr2: 64 ;V9: flushw 65 ;V9: ld [%fp+56], {{.+}} 66 ;V9: ld [{{.+}}+56], {{.+}} 67 ;V9: ld [{{.+}}+60], {{.+}} 68 69 ;V8LEAF-LABEL: retaddr2: 70 ;V8LEAF: ta 3 71 ;V8LEAF: ld [%fp+56], %[[R:[goli][0-7]]] 72 ;V8LEAF: ld [%[[R]]+56], %[[R1:[goli][0-7]]] 73 ;V8LEAF: ld [%[[R1]]+60], {{.+}} 74 75 ;V9LEAF-LABEL: retaddr2: 76 ;V9LEAF: flushw 77 ;V9LEAF: ld [%fp+56], %[[R:[goli][0-7]]] 78 ;V9LEAF: ld [%[[R]]+56], %[[R1:[goli][0-7]]] 79 ;V9LEAF: ld [%[[R1]]+60], {{.+}} 80 81 %0 = tail call i8* @llvm.returnaddress(i32 3) 82 ret i8* %0 83 } 84 85 declare i8* @llvm.returnaddress(i32) nounwind readnone 86