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) {
28 declare i8* @attachedcall()
32 # CHECK-LABEL: : test_1_callsite_info
34 # CHECK-NEXT: liveins:
36 # 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 {
37 # 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
38 # CHECK-NEXT: ORRXrs $xzr, $fp, 0
39 # CHECK-NEXT: BL @attachedcall, implicit-def $lr, implicit internal $sp
41 # CHECK-NEXT: RET undef $lr, implicit killed $w0
43 name: test_1_callsite_info
45 - {bb: 0, offset: 0, fwdArgRegs:
46 - { arg: 0, reg: '$x0' } }
51 BLR_RVMARKER @attachedcall, $x0, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $x0
52 RET_ReallyLR implicit killed $w0
55 # CHECK-LABEL: : test_bl_pass_x0_arg
57 # CHECK-NEXT: liveins:
59 # 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 {
60 # 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
61 # CHECK-NEXT: $fp = ORRXrs $xzr, $fp, 0
62 # CHECK-NEXT: BL @attachedcall, implicit-def $lr, implicit internal $sp
64 # CHECK-NEXT: RET undef $lr, implicit killed $w0
66 name: test_bl_pass_x0_arg
71 BLR_RVMARKER @attachedcall, @foo, $x0, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $x0
72 RET_ReallyLR implicit killed $w0
75 # CHECK-LABEL: : test_bl_pass_x0_x1_x2_args
77 # CHECK-NEXT: liveins:
79 # 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 {
80 # 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
81 # CHECK-NEXT: $fp = ORRXrs $xzr, $fp, 0
82 # CHECK-NEXT: BL @attachedcall, implicit-def $lr, implicit internal $sp
84 # CHECK-NEXT: RET undef $lr
86 name: test_bl_pass_x0_x1_x2_args
89 liveins: $lr, $x0, $x1, $x2
91 BLR_RVMARKER @attachedcall, @foo, $x0, $x1, $x2, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def $x0
95 # CHECK-LABEL: : test_bl_pass_w0_w1_args
97 # CHECK-NEXT: liveins:
99 # 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 {
100 # 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
101 # CHECK-NEXT: $fp = ORRXrs $xzr, $fp, 0
102 # CHECK-NEXT: BL @attachedcall, implicit-def $lr, implicit internal $sp
104 # CHECK-NEXT: RET undef $lr, implicit killed $w0
106 name: test_bl_pass_w0_w1_args
109 liveins: $lr, $w0, $w1
111 BLR_RVMARKER @attachedcall, @foo, $w0, $w1, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $x0
112 RET_ReallyLR implicit killed $w0
116 # CHECK-LABEL: : test_blr_pass_w0_w1_args
118 # CHECK-NEXT: liveins:
120 # 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 {
121 # 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
122 # CHECK-NEXT: $fp = ORRXrs $xzr, $fp, 0
123 # CHECK-NEXT: BL @attachedcall, implicit-def $lr, implicit internal $sp
125 # CHECK-NEXT: RET undef $lr, implicit killed $w0
127 name: test_blr_pass_w0_w1_args
130 liveins: $lr, $x8, $w0, $w1
132 BLR_RVMARKER @attachedcall, $x8, $w0, $w1, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $x0
133 RET_ReallyLR implicit killed $w0