1 # NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 # RUN: llc %s -mtriple=m68k -start-after=prologepilog -O0 -filetype=asm -o - \
5 #------------------------------------------------------------------------------
6 # CollapseMOVEM pass finds sequences of MOVEM instructions and collapse them
7 # into a single instruciton with merged masks. This only works with stack data
8 #------------------------------------------------------------------------------
10 --- # CollapseMOVEM_RM
12 # CHECK-LABEL: CollapseMOVEM_RM
13 # CHECK: movem.l (0,%sp), %d0-%d2/%d7/%a1-%a3/%a5
14 name: CollapseMOVEM_RM
22 MOVM32mp 1024, 20, $sp
23 MOVM32mp 2048, 24, $sp
24 MOVM32mp 8192, 28, $sp
28 # CHECK-LABEL: CollapseMOVEM_RM_Reversed
29 # CHECK: movem.l (0,%sp), %d0-%d2/%d7/%a1-%a3/%a5
30 name: CollapseMOVEM_RM_Reversed
33 MOVM32mp 8192, 28, $sp
34 MOVM32mp 2048, 24, $sp
35 MOVM32mp 1024, 20, $sp
43 # This async reg/mem order is impossible to store with MOVEM
44 # CHECK-LABEL: CollapseMOVEM_RM_ReversedStoreOrder
45 # CHECK: movem.l (0,%sp), %a5
46 # CHECK: movem.l (4,%sp), %a3
47 # CHECK: movem.l (8,%sp), %a2
48 # CHECK: movem.l (12,%sp), %a1
49 # CHECK: movem.l (16,%sp), %d7
50 # CHECK: movem.l (20,%sp), %d2
51 # CHECK: movem.l (24,%sp), %d1
52 # CHECK: movem.l (28,%sp), %d0
53 name: CollapseMOVEM_RM_ReversedStoreOrder
66 --- # CollapseMOVEM_MR
68 # CHECK-LABEL: CollapseMOVEM_MR
69 # CHECK: movem.l %d0-%d2/%d7/%a1-%a3/%a5, (0,%sp)
70 name: CollapseMOVEM_MR
78 MOVM32pm 20, $sp, 1024
79 MOVM32pm 24, $sp, 2048
80 MOVM32pm 28, $sp, 8192
83 --- # CollapseMOVEM_Mixed
85 # CHECK-LABEL: CollapseMOVEM_Mixed
86 # CHECK: movem.l %d0-%d1, (0,%sp)
87 # CHECK: movem.l (8,%sp), %d2/%d7
88 # CHECK: movem.l %a1-%a2, (16,%sp)
89 # CHECK: movem.l (24,%sp), %a3
90 # CHECK: movem.l %a5, (28,%sp)
91 name: CollapseMOVEM_Mixed
99 MOVM32pm 20, $sp, 1024
100 MOVM32mp 2048, 24, $sp
101 MOVM32pm 28, $sp, 8192
104 --- # CollapseMOVEM_Zero
106 # CHECK-LABEL: CollapseMOVEM_Zero
107 # CHECK: movem.l %d0-%d4, (-8,%sp)
108 name: CollapseMOVEM_Zero
119 # CHECK-LABEL: CollapseMOVEM_Zero_Mixed
120 # CHECK: movem.l %d3, (4,%sp)
121 # CHECK: movem.l %d0-%d2, (-8,%sp)
122 # CHECK: movem.l %d4, (8,%sp)
123 name: CollapseMOVEM_Zero_Mixed
133 --- # CollapseMOVEM_Zero_Reversed
135 # CHECK-LABEL: CollapseMOVEM_Zero_Reversed
136 # CHECK: movem.l %d0-%d4, (-8,%sp)
137 name: CollapseMOVEM_Zero_Reversed
148 # CHECK-LABEL: CollapseMOVEM_Zero_ReversedStoreOrder
149 # CHECK: movem.l %d0, (8,%sp)
150 # CHECK: movem.l %d1, (4,%sp)
151 # CHECK: movem.l %d2, (0,%sp)
152 # CHECK: movem.l %d3, (-4,%sp)
153 # CHECK: movem.l %d4, (-8,%sp)
154 name: CollapseMOVEM_Zero_ReversedStoreOrder