1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple=arm64-unknown-unknown -global-isel -run-pass=legalizer -global-isel-abort=1 %s -o - | FileCheck %s
6 tracksRegLiveness: true
11 ; CHECK-LABEL: name: test_v8s8
13 ; CHECK: [[COPY:%[0-9]+]]:_(<8 x s8>) = COPY $d0
14 ; CHECK: [[CTLZ:%[0-9]+]]:_(<8 x s8>) = G_CTLZ [[COPY]](<8 x s8>)
15 ; CHECK: $d0 = COPY [[CTLZ]](<8 x s8>)
16 ; CHECK: RET_ReallyLR implicit $d0
17 %0:_(<8 x s8>) = COPY $d0
18 %1:_(<8 x s8>) = G_CTLZ %0(<8 x s8>)
19 $d0 = COPY %1(<8 x s8>)
20 RET_ReallyLR implicit $d0
26 tracksRegLiveness: true
31 ; CHECK-LABEL: name: test_v4s16
33 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $d0
34 ; CHECK: [[CTLZ:%[0-9]+]]:_(<4 x s16>) = G_CTLZ [[COPY]](<4 x s16>)
35 ; CHECK: $d0 = COPY [[CTLZ]](<4 x s16>)
36 ; CHECK: RET_ReallyLR implicit $d0
37 %0:_(<4 x s16>) = COPY $d0
38 %1:_(<4 x s16>) = G_CTLZ %0(<4 x s16>)
39 $d0 = COPY %1(<4 x s16>)
40 RET_ReallyLR implicit $d0
46 tracksRegLiveness: true
51 ; CHECK-LABEL: name: test_v2s32
53 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $d0
54 ; CHECK: [[CTLZ:%[0-9]+]]:_(<2 x s32>) = G_CTLZ [[COPY]](<2 x s32>)
55 ; CHECK: $d0 = COPY [[CTLZ]](<2 x s32>)
56 ; CHECK: RET_ReallyLR implicit $d0
57 %0:_(<2 x s32>) = COPY $d0
58 %1:_(<2 x s32>) = G_CTLZ %0(<2 x s32>)
59 $d0 = COPY %1(<2 x s32>)
60 RET_ReallyLR implicit $d0
66 tracksRegLiveness: true
71 ; CHECK-LABEL: name: test_s64
73 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $d0
74 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY [[COPY]](s64)
75 ; CHECK: [[CTLZ:%[0-9]+]]:_(s64) = G_CTLZ [[COPY1]](s64)
76 ; CHECK: $d0 = COPY [[CTLZ]](s64)
77 ; CHECK: RET_ReallyLR implicit $d0
79 %2:_(s64) = COPY %0(s64)
80 %1:_(s64) = G_CTLZ %2(s64)
82 RET_ReallyLR implicit $d0
88 tracksRegLiveness: true
92 ; CHECK-LABEL: name: test_s32
94 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
95 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
96 ; CHECK: [[CTLZ:%[0-9]+]]:_(s32) = G_CTLZ [[COPY1]](s32)
97 ; CHECK: $s0 = COPY [[CTLZ]](s32)
98 ; CHECK: RET_ReallyLR implicit $s0
100 %2:_(s32) = COPY %0(s32)
101 %1:_(s32) = G_CTLZ %2(s32)
103 RET_ReallyLR implicit $s0
109 tracksRegLiveness: true
114 ; CHECK-LABEL: name: test_v16s8
115 ; CHECK: liveins: $q0
116 ; CHECK: [[COPY:%[0-9]+]]:_(<16 x s8>) = COPY $q0
117 ; CHECK: [[CTLZ:%[0-9]+]]:_(<16 x s8>) = G_CTLZ [[COPY]](<16 x s8>)
118 ; CHECK: $q0 = COPY [[CTLZ]](<16 x s8>)
119 ; CHECK: RET_ReallyLR implicit $q0
120 %0:_(<16 x s8>) = COPY $q0
121 %1:_(<16 x s8>) = G_CTLZ %0(<16 x s8>)
122 $q0 = COPY %1(<16 x s8>)
123 RET_ReallyLR implicit $q0
129 tracksRegLiveness: true
134 ; CHECK-LABEL: name: test_v8s16
135 ; CHECK: liveins: $q0
136 ; CHECK: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0
137 ; CHECK: [[CTLZ:%[0-9]+]]:_(<8 x s16>) = G_CTLZ [[COPY]](<8 x s16>)
138 ; CHECK: $q0 = COPY [[CTLZ]](<8 x s16>)
139 ; CHECK: RET_ReallyLR implicit $q0
140 %0:_(<8 x s16>) = COPY $q0
141 %1:_(<8 x s16>) = G_CTLZ %0(<8 x s16>)
142 $q0 = COPY %1(<8 x s16>)
143 RET_ReallyLR implicit $q0
149 tracksRegLiveness: true
154 ; CHECK-LABEL: name: test_v4s32
155 ; CHECK: liveins: $q0
156 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
157 ; CHECK: [[CTLZ:%[0-9]+]]:_(<4 x s32>) = G_CTLZ [[COPY]](<4 x s32>)
158 ; CHECK: $q0 = COPY [[CTLZ]](<4 x s32>)
159 ; CHECK: RET_ReallyLR implicit $q0
160 %0:_(<4 x s32>) = COPY $q0
161 %1:_(<4 x s32>) = G_CTLZ %0(<4 x s32>)
162 $q0 = COPY %1(<4 x s32>)
163 RET_ReallyLR implicit $q0
167 # The ZERO_UNDEF variants just lower into the vanilla ones.
169 name: test_s32_zeroundef
171 tracksRegLiveness: true
175 ; CHECK-LABEL: name: test_s32_zeroundef
176 ; CHECK: liveins: $s0
177 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
178 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
179 ; CHECK: [[CTLZ:%[0-9]+]]:_(s32) = G_CTLZ [[COPY1]](s32)
180 ; CHECK: $s0 = COPY [[CTLZ]](s32)
181 ; CHECK: RET_ReallyLR implicit $s0
183 %2:_(s32) = COPY %0(s32)
184 %1:_(s32) = G_CTLZ_ZERO_UNDEF %2(s32)
186 RET_ReallyLR implicit $s0
190 name: test_s64_zeroundef
192 tracksRegLiveness: true
197 ; CHECK-LABEL: name: test_s64_zeroundef
198 ; CHECK: liveins: $d0
199 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $d0
200 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY [[COPY]](s64)
201 ; CHECK: [[CTLZ:%[0-9]+]]:_(s64) = G_CTLZ [[COPY1]](s64)
202 ; CHECK: $d0 = COPY [[CTLZ]](s64)
203 ; CHECK: RET_ReallyLR implicit $d0
205 %2:_(s64) = COPY %0(s64)
206 %1:_(s64) = G_CTLZ_ZERO_UNDEF %2(s64)
208 RET_ReallyLR implicit $d0