1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4
2 # RUN: llc -mtriple=arm64-apple-macosx -mcpu=apple-m1 -verify-regalloc -run-pass=greedy -o - %s | FileCheck %s
5 tracksRegLiveness: true
10 liveins: $x0, $x1, $x2, $x3, $x4, $x5, $x6
12 ; CHECK-LABEL: name: func
13 ; CHECK: liveins: $x0, $x1, $x2, $x3, $x4, $x5, $x6
15 ; CHECK-NEXT: [[DEF:%[0-9]+]]:gpr64sp = IMPLICIT_DEF
16 ; CHECK-NEXT: dead [[DEF1:%[0-9]+]]:gpr32 = IMPLICIT_DEF
17 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64common = COPY $x0
18 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
19 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr64 = COPY $x2
20 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:gpr64 = COPY $x3
21 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:gpr64 = COPY $x4
22 ; CHECK-NEXT: [[COPY5:%[0-9]+]]:gpr64 = COPY $x5
23 ; CHECK-NEXT: [[COPY6:%[0-9]+]]:gpr64 = COPY $x6
24 ; CHECK-NEXT: undef [[MOVi32imm:%[0-9]+]].sub_32:gpr64 = MOVi32imm 4, implicit-def [[MOVi32imm]]
25 ; CHECK-NEXT: ADJCALLSTACKDOWN 8, 0, implicit-def dead $sp, implicit $sp
26 ; CHECK-NEXT: BL 0, csr_darwin_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp
27 ; CHECK-NEXT: ADJCALLSTACKUP 8, 0, implicit-def dead $sp, implicit $sp
28 ; CHECK-NEXT: ADJCALLSTACKDOWN 24, 0, implicit-def dead $sp, implicit $sp
29 ; CHECK-NEXT: ADJCALLSTACKUP 24, 0, implicit-def dead $sp, implicit $sp
30 ; CHECK-NEXT: ADJCALLSTACKDOWN 16, 0, implicit-def dead $sp, implicit $sp
31 ; CHECK-NEXT: ADJCALLSTACKUP 16, 0, implicit-def dead $sp, implicit $sp
32 ; CHECK-NEXT: ADJCALLSTACKDOWN 8, 0, implicit-def dead $sp, implicit $sp
33 ; CHECK-NEXT: [[DEF2:%[0-9]+]]:gpr64 = IMPLICIT_DEF
34 ; CHECK-NEXT: ADJCALLSTACKUP 8, 0, implicit-def dead $sp, implicit $sp
35 ; CHECK-NEXT: ADJCALLSTACKDOWN 16, 0, implicit-def dead $sp, implicit $sp
36 ; CHECK-NEXT: undef [[DEF3:%[0-9]+]].sub_32:gpr64 = IMPLICIT_DEF implicit-def [[DEF3]]
37 ; CHECK-NEXT: STRXui [[DEF3]], [[DEF]], 1 :: (store (s64) into stack + 8)
38 ; CHECK-NEXT: BL 0, csr_darwin_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp
39 ; CHECK-NEXT: ADJCALLSTACKUP 16, 0, implicit-def dead $sp, implicit $sp
40 ; CHECK-NEXT: ADJCALLSTACKDOWN 8, 0, implicit-def dead $sp, implicit $sp
41 ; CHECK-NEXT: STRXui [[MOVi32imm]], [[DEF]], 0 :: (store (s64) into stack)
42 ; CHECK-NEXT: ADJCALLSTACKUP 8, 0, implicit-def dead $sp, implicit $sp
43 ; CHECK-NEXT: STRWui undef [[MOVi32imm]].sub_32, [[COPY]], 0 :: (store (s32))
44 ; CHECK-NEXT: ADJCALLSTACKDOWN 8, 0, implicit-def dead $sp, implicit $sp
45 ; CHECK-NEXT: STRXui [[DEF2]], undef [[DEF]], 0 :: (store (s64) into stack)
46 ; CHECK-NEXT: $x0 = COPY [[COPY6]]
47 ; CHECK-NEXT: ADJCALLSTACKUP 8, 0, implicit-def dead $sp, implicit $sp
48 ; CHECK-NEXT: ADJCALLSTACKDOWN 8, 0, implicit-def dead $sp, implicit $sp
49 ; CHECK-NEXT: $x0 = COPY [[COPY5]]
50 ; CHECK-NEXT: ADJCALLSTACKUP 8, 0, implicit-def dead $sp, implicit $sp
51 ; CHECK-NEXT: ADJCALLSTACKDOWN 8, 0, implicit-def dead $sp, implicit $sp
52 ; CHECK-NEXT: $x0 = COPY [[COPY4]]
53 ; CHECK-NEXT: ADJCALLSTACKUP 8, 0, implicit-def dead $sp, implicit $sp
54 ; CHECK-NEXT: ADJCALLSTACKDOWN 8, 0, implicit-def dead $sp, implicit $sp
55 ; CHECK-NEXT: $x0 = COPY [[COPY3]]
56 ; CHECK-NEXT: ADJCALLSTACKUP 8, 0, implicit-def dead $sp, implicit $sp
57 ; CHECK-NEXT: ADJCALLSTACKDOWN 8, 0, implicit-def dead $sp, implicit $sp
58 ; CHECK-NEXT: $x0 = COPY [[COPY2]]
59 ; CHECK-NEXT: ADJCALLSTACKUP 8, 0, implicit-def dead $sp, implicit $sp
60 ; CHECK-NEXT: ADJCALLSTACKDOWN 8, 0, implicit-def dead $sp, implicit $sp
61 ; CHECK-NEXT: $x0 = COPY [[COPY1]]
62 ; CHECK-NEXT: ADJCALLSTACKUP 8, 0, implicit-def dead $sp, implicit $sp
63 ; CHECK-NEXT: ADJCALLSTACKDOWN 24, 0, implicit-def dead $sp, implicit $sp
64 ; CHECK-NEXT: undef [[DEF4:%[0-9]+]].sub_32:gpr64 = IMPLICIT_DEF implicit-def [[DEF4]]
65 ; CHECK-NEXT: STRXui [[DEF4]], undef [[DEF]], 1 :: (store (s64) into stack + 8)
66 ; CHECK-NEXT: ADJCALLSTACKUP 24, 0, implicit-def dead $sp, implicit $sp
67 ; CHECK-NEXT: RET_ReallyLR
68 %0:gpr64sp = IMPLICIT_DEF
69 undef %13.sub_32:gpr64 = IMPLICIT_DEF implicit-def %13
70 dead %2:gpr32 = IMPLICIT_DEF
71 %3:gpr64common = COPY $x0
78 undef %11.sub_32:gpr64 = MOVi32imm 4, implicit-def %11
79 ADJCALLSTACKDOWN 8, 0, implicit-def dead $sp, implicit $sp
80 BL 0, csr_darwin_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp
81 ADJCALLSTACKUP 8, 0, implicit-def dead $sp, implicit $sp
82 ADJCALLSTACKDOWN 24, 0, implicit-def dead $sp, implicit $sp
83 ADJCALLSTACKUP 24, 0, implicit-def dead $sp, implicit $sp
84 ADJCALLSTACKDOWN 16, 0, implicit-def dead $sp, implicit $sp
85 ADJCALLSTACKUP 16, 0, implicit-def dead $sp, implicit $sp
86 ADJCALLSTACKDOWN 8, 0, implicit-def dead $sp, implicit $sp
87 %12:gpr64 = IMPLICIT_DEF
88 ADJCALLSTACKUP 8, 0, implicit-def dead $sp, implicit $sp
89 ADJCALLSTACKDOWN 16, 0, implicit-def dead $sp, implicit $sp
90 STRXui %13, %0, 1 :: (store (s64) into stack + 8)
91 BL 0, csr_darwin_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp
92 ADJCALLSTACKUP 16, 0, implicit-def dead $sp, implicit $sp
93 ADJCALLSTACKDOWN 8, 0, implicit-def dead $sp, implicit $sp
94 STRXui %11, %0, 0 :: (store (s64) into stack)
95 ADJCALLSTACKUP 8, 0, implicit-def dead $sp, implicit $sp
96 STRWui undef %11.sub_32, %3, 0 :: (store (s32))
97 ADJCALLSTACKDOWN 8, 0, implicit-def dead $sp, implicit $sp
98 STRXui %12, undef %0, 0 :: (store (s64) into stack)
100 ADJCALLSTACKUP 8, 0, implicit-def dead $sp, implicit $sp
101 ADJCALLSTACKDOWN 8, 0, implicit-def dead $sp, implicit $sp
103 ADJCALLSTACKUP 8, 0, implicit-def dead $sp, implicit $sp
104 ADJCALLSTACKDOWN 8, 0, implicit-def dead $sp, implicit $sp
106 ADJCALLSTACKUP 8, 0, implicit-def dead $sp, implicit $sp
107 ADJCALLSTACKDOWN 8, 0, implicit-def dead $sp, implicit $sp
109 ADJCALLSTACKUP 8, 0, implicit-def dead $sp, implicit $sp
110 ADJCALLSTACKDOWN 8, 0, implicit-def dead $sp, implicit $sp
112 ADJCALLSTACKUP 8, 0, implicit-def dead $sp, implicit $sp
113 ADJCALLSTACKDOWN 8, 0, implicit-def dead $sp, implicit $sp
115 ADJCALLSTACKUP 8, 0, implicit-def dead $sp, implicit $sp
116 ADJCALLSTACKDOWN 24, 0, implicit-def dead $sp, implicit $sp
117 STRXui %13, undef %0, 1 :: (store (s64) into stack + 8)
118 ADJCALLSTACKUP 24, 0, implicit-def dead $sp, implicit $sp