1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64 -run-pass=legalizer %s -o - | FileCheck %s
4 name: test_ptr_add_vec_p0
7 ; CHECK-LABEL: name: test_ptr_add_vec_p0
8 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x p0>) = COPY $q0
9 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<2 x s64>) = COPY $q1
10 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(<2 x p0>) = G_PTR_ADD [[COPY]], [[COPY1]](<2 x s64>)
11 ; CHECK-NEXT: $q0 = COPY [[PTR_ADD]](<2 x p0>)
12 %0:_(<2 x p0>) = COPY $q0
13 %1:_(<2 x s64>) = COPY $q1
14 %3:_(<2 x p0>) = G_PTR_ADD %0, %1(<2 x s64>)
15 $q0 = COPY %3(<2 x p0>)
19 name: test_ptr_add_vec_4xp0
22 ; CHECK-LABEL: name: test_ptr_add_vec_4xp0
23 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
24 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
25 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(p0) = COPY $x2
26 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(p0) = COPY $x3
27 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:_(s64) = COPY $x4
28 ; CHECK-NEXT: [[COPY5:%[0-9]+]]:_(s64) = COPY $x5
29 ; CHECK-NEXT: [[COPY6:%[0-9]+]]:_(s64) = COPY $x6
30 ; CHECK-NEXT: [[COPY7:%[0-9]+]]:_(s64) = COPY $x7
31 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x p0>) = G_BUILD_VECTOR [[COPY]](p0), [[COPY1]](p0)
32 ; CHECK-NEXT: [[BUILD_VECTOR1:%[0-9]+]]:_(<2 x p0>) = G_BUILD_VECTOR [[COPY2]](p0), [[COPY3]](p0)
33 ; CHECK-NEXT: [[BUILD_VECTOR2:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[COPY4]](s64), [[COPY5]](s64)
34 ; CHECK-NEXT: [[BUILD_VECTOR3:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[COPY6]](s64), [[COPY7]](s64)
35 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(<2 x p0>) = G_PTR_ADD [[BUILD_VECTOR]], [[BUILD_VECTOR2]](<2 x s64>)
36 ; CHECK-NEXT: [[PTR_ADD1:%[0-9]+]]:_(<2 x p0>) = G_PTR_ADD [[BUILD_VECTOR1]], [[BUILD_VECTOR3]](<2 x s64>)
37 ; CHECK-NEXT: %zero:_(s64) = G_CONSTANT i64 0
38 ; CHECK-NEXT: %one:_(s64) = G_CONSTANT i64 1
39 ; CHECK-NEXT: %extract0:_(p0) = G_EXTRACT_VECTOR_ELT [[PTR_ADD]](<2 x p0>), %zero(s64)
40 ; CHECK-NEXT: %extract1:_(p0) = G_EXTRACT_VECTOR_ELT [[PTR_ADD]](<2 x p0>), %one(s64)
41 ; CHECK-NEXT: %extract2:_(p0) = G_EXTRACT_VECTOR_ELT [[PTR_ADD1]](<2 x p0>), %zero(s64)
42 ; CHECK-NEXT: %extract3:_(p0) = G_EXTRACT_VECTOR_ELT [[PTR_ADD1]](<2 x p0>), %one(s64)
43 ; CHECK-NEXT: $x0 = COPY %extract0(p0)
44 ; CHECK-NEXT: $x1 = COPY %extract1(p0)
45 ; CHECK-NEXT: $x2 = COPY %extract2(p0)
46 ; CHECK-NEXT: $x3 = COPY %extract3(p0)
55 %ptr:_(<4 x p0>) = G_BUILD_VECTOR %0(p0), %1(p0), %2(p0), %3(p0)
56 %add:_(<4 x s64>) = G_BUILD_VECTOR %4(s64), %5(s64), %6(s64), %7(s64)
57 %res:_(<4 x p0>) = G_PTR_ADD %ptr, %add(<4 x s64>)
58 %zero:_(s64) = G_CONSTANT i64 0
59 %one:_(s64) = G_CONSTANT i64 1
60 %two:_(s64) = G_CONSTANT i64 2
61 %three:_(s64) = G_CONSTANT i64 3
62 %extract0:_(p0) = G_EXTRACT_VECTOR_ELT %res(<4 x p0>), %zero(s64)
63 %extract1:_(p0) = G_EXTRACT_VECTOR_ELT %res(<4 x p0>), %one(s64)
64 %extract2:_(p0) = G_EXTRACT_VECTOR_ELT %res(<4 x p0>), %two(s64)
65 %extract3:_(p0) = G_EXTRACT_VECTOR_ELT %res(<4 x p0>), %three(s64)
66 $x0 = COPY %extract0(p0)
67 $x1 = COPY %extract1(p0)
68 $x2 = COPY %extract2(p0)
69 $x3 = COPY %extract3(p0)