Skip to content

Commit ef7ed19

Browse files
committed
vector test
1 parent e03cc26 commit ef7ed19

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

llvm/test/CodeGen/AArch64/GlobalISel/combine-logic-of-compare.mir

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,3 +212,49 @@ body: |
212212
%zext:_(s64) = G_ZEXT %and(s1)
213213
$x0 = COPY %zext
214214
...
215+
---
216+
# icmp (x, v1) && icmp (x, v2)) -> x
217+
name: test_icmp_and_icmp_with_vectors
218+
body: |
219+
bb.1:
220+
liveins: $x0, $x1
221+
; CHECK-LABEL: name: test_icmp_and_icmp_with_vectors
222+
; CHECK: liveins: $x0, $x1
223+
; CHECK-NEXT: {{ $}}
224+
; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
225+
; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
226+
; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x2
227+
; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s64) = COPY $x3
228+
; CHECK-NEXT: [[COPY4:%[0-9]+]]:_(s64) = COPY $x4
229+
; CHECK-NEXT: [[COPY5:%[0-9]+]]:_(s64) = COPY $x5
230+
; CHECK-NEXT: [[COPY6:%[0-9]+]]:_(s64) = COPY $x6
231+
; CHECK-NEXT: [[COPY7:%[0-9]+]]:_(s64) = COPY $x7
232+
; CHECK-NEXT: %v1:_(<2 x s64>) = G_BUILD_VECTOR [[COPY]](s64), [[COPY1]](s64)
233+
; CHECK-NEXT: %v2:_(<2 x s64>) = G_BUILD_VECTOR [[COPY2]](s64), [[COPY3]](s64)
234+
; CHECK-NEXT: %v3:_(<2 x s64>) = G_BUILD_VECTOR [[COPY4]](s64), [[COPY5]](s64)
235+
; CHECK-NEXT: %v4:_(<2 x s64>) = G_BUILD_VECTOR [[COPY6]](s64), [[COPY7]](s64)
236+
; CHECK-NEXT: %cmp1:_(<2 x s1>) = G_ICMP intpred(ne), %v1(<2 x s64>), %v2
237+
; CHECK-NEXT: %cmp2:_(<2 x s1>) = G_ICMP intpred(eq), %v3(<2 x s64>), %v4
238+
; CHECK-NEXT: %and:_(<2 x s1>) = G_AND %cmp1, %cmp2
239+
; CHECK-NEXT: %zext:_(<2 x s64>) = G_ZEXT %and(<2 x s1>)
240+
; CHECK-NEXT: $q0 = COPY %zext(<2 x s64>)
241+
%0:_(s64) = COPY $x0
242+
%1:_(s64) = COPY $x1
243+
%2:_(s64) = COPY $x2
244+
%3:_(s64) = COPY $x3
245+
%4:_(s64) = COPY $x4
246+
%5:_(s64) = COPY $x5
247+
%6:_(s64) = COPY $x6
248+
%7:_(s64) = COPY $x7
249+
%nine:_(s64) = G_CONSTANT i64 9
250+
%two:_(s64) = G_CONSTANT i64 2
251+
%v1:_(<2 x s64>) = G_BUILD_VECTOR %0(s64), %1(s64)
252+
%v2:_(<2 x s64>) = G_BUILD_VECTOR %2(s64), %3(s64)
253+
%v3:_(<2 x s64>) = G_BUILD_VECTOR %4(s64), %5(s64)
254+
%v4:_(<2 x s64>) = G_BUILD_VECTOR %6(s64), %7(s64)
255+
%cmp1:_(<2 x s1>) = G_ICMP intpred(ne), %v1(<2 x s64>), %v2
256+
%cmp2:_(<2 x s1>) = G_ICMP intpred(eq), %v3(<2 x s64>), %v4
257+
%and:_(<2 x s1>) = G_AND %cmp1, %cmp2
258+
%zext:_(<2 x s64>) = G_ZEXT %and(<2 x s1>)
259+
$q0 = COPY %zext
260+
...

0 commit comments

Comments
 (0)