1 # RUN: llc -run-pass=aarch64-expand-pseudo -mtriple=arm64-apple-ios -o - -emit-call-site-info %s | FileCheck %s
4 define void @test_1_callsite_info() {
8 define void @test_bl_pass_x0_arg() {
12 define void @test_bl_pass_x0_x1_x2_args() {
16 define void @test_bl_pass_w0_w1_args() {
20 define void @test_blr_pass_w0_w1_args() {
24 define void @foo(i32 %a) {
31 # CHECK-LABEL: : test_1_callsite_info
33 # CHECK-NEXT: BUNDLE implicit-def $lr, implicit-def $w30, implicit-def $sp, implicit-def $wsp, implicit-def dead $x0, implicit-def $fp, implicit-def $w29, implicit $x0, implicit $sp, implicit $xzr, implicit $fp {
34 # CHECK-NEXT: BLR $x0, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $x0
35 # CHECK-NEXT: ORRXrs $xzr, $fp, 0
37 # CHECK-NEXT: RET undef $lr, implicit killed $w0
39 name: test_1_callsite_info
41 - {bb: 0, offset: 0, fwdArgRegs:
42 - { arg: 0, reg: '$x0' } }
47 BLR_RVMARKER $x0, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $x0
48 RET_ReallyLR implicit killed $w0
51 # CHECK-LABEL: : test_bl_pass_x0_arg
53 # CHECK-NEXT: BUNDLE implicit-def $lr, implicit-def $w30, implicit-def $sp, implicit-def $wsp, implicit-def dead $x0, implicit-def $fp, implicit-def $w29, implicit $sp, implicit $x0, implicit $xzr, implicit $fp {
54 # CHECK-NEXT: BL @foo, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $x0
55 # CHECK-NEXT: $fp = ORRXrs $xzr, $fp, 0
57 # CHECK-NEXT: RET undef $lr, implicit killed $w0
59 name: test_bl_pass_x0_arg
64 BLR_RVMARKER @foo, $x0, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $x0
65 RET_ReallyLR implicit killed $w0
68 # CHECK-LABEL: : test_bl_pass_x0_x1_x2_args
70 # CHECK-NEXT: BUNDLE implicit-def $lr, implicit-def $w30, implicit-def $sp, implicit-def $wsp, implicit-def $x0, implicit-def $w0, implicit-def $fp, implicit-def $w29, implicit $sp, implicit $x0, implicit $x1, implicit $x2, implicit $xzr, implicit $fp {
71 # CHECK-NEXT: BL @foo, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0, implicit $x1, implicit $x2, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def $x0
72 # CHECK-NEXT: $fp = ORRXrs $xzr, $fp, 0
74 # CHECK-NEXT: RET undef $lr
76 name: test_bl_pass_x0_x1_x2_args
79 liveins: $lr, $x0, $x1, $x2
81 BLR_RVMARKER @foo, $x0, $x1, $x2, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def $x0
85 # CHECK-LABEL: : test_bl_pass_w0_w1_args
87 # CHECK-NEXT: BUNDLE implicit-def $lr, implicit-def $w30, implicit-def $sp, implicit-def $wsp, implicit-def dead $x0, implicit-def $fp, implicit-def $w29, implicit $sp, implicit $w0, implicit $w1, implicit $xzr, implicit $fp {
88 # CHECK-NEXT: BL @foo, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $w0, implicit $w1, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $x0
89 # CHECK-NEXT: $fp = ORRXrs $xzr, $fp, 0
91 # CHECK-NEXT: RET undef $lr, implicit killed $w0
93 name: test_bl_pass_w0_w1_args
96 liveins: $lr, $w0, $w1
98 BLR_RVMARKER @foo, $w0, $w1, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $x0
99 RET_ReallyLR implicit killed $w0
103 # CHECK-LABEL: : test_blr_pass_w0_w1_args
105 # CHECK-NEXT: BUNDLE implicit-def $lr, implicit-def $w30, implicit-def $sp, implicit-def $wsp, implicit-def dead $x0, implicit-def $fp, implicit-def $w29, implicit $x8, implicit $sp, implicit $w0, implicit $w1, implicit $xzr, implicit $fp {
106 # CHECK-NEXT: BLR $x8, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $w0, implicit $w1, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $x0
107 # CHECK-NEXT: $fp = ORRXrs $xzr, $fp, 0
109 # CHECK-NEXT: RET undef $lr, implicit killed $w0
111 name: test_blr_pass_w0_w1_args
114 liveins: $lr, $x8, $w0, $w1
116 BLR_RVMARKER $x8, $w0, $w1, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $x0
117 RET_ReallyLR implicit killed $w0