brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.3 KiB · 30cb7b7 Raw
140 lines · plain
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py2# RUN: llc -mtriple aarch64-apple-ios  -run-pass=aarch64-prelegalizer-combiner %s -o - | FileCheck %s3 4# Check that we canonicalize concat_vectors(build_vector, build_vector)5# into build_vector.6---7name: concat_to_build_vector8tracksRegLiveness: true9body:             |10  bb.1:11    liveins: $x0, $x1, $x2, $x312 13    ; CHECK-LABEL: name: concat_to_build_vector14    ; CHECK: liveins: $x0, $x1, $x2, $x315    ; CHECK-NEXT: {{  $}}16    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x017    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x118    ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x219    ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s64) = COPY $x320    ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s64>) = G_BUILD_VECTOR [[COPY]](s64), [[COPY1]](s64), [[COPY2]](s64), [[COPY3]](s64)21    ; CHECK-NEXT: RET_ReallyLR implicit [[BUILD_VECTOR]](<4 x s64>)22    %0:_(s64) = COPY $x023    %1:_(s64) = COPY $x124    %2:_(s64) = COPY $x225    %3:_(s64) = COPY $x326    %4:_(<2 x s64>) = G_BUILD_VECTOR %0(s64), %127    %5:_(<2 x s64>) = G_BUILD_VECTOR %2(s64), %328    %6:_(<4 x s64>) = G_CONCAT_VECTORS %4(<2 x s64>), %529    RET_ReallyLR implicit %630...31# Same test as concat_to_build_vector but with pointer types.32---33name: concat_to_build_vector_ptr34tracksRegLiveness: true35body:             |36  bb.1:37    liveins: $x0, $x1, $x2, $x338 39    ; CHECK-LABEL: name: concat_to_build_vector_ptr40    ; CHECK: liveins: $x0, $x1, $x2, $x341    ; CHECK-NEXT: {{  $}}42    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x043    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x144    ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(p0) = COPY $x245    ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(p0) = COPY $x346    ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x p0>) = G_BUILD_VECTOR [[COPY]](p0), [[COPY1]](p0), [[COPY2]](p0), [[COPY3]](p0)47    ; CHECK-NEXT: RET_ReallyLR implicit [[BUILD_VECTOR]](<4 x p0>)48    %0:_(p0) = COPY $x049    %1:_(p0) = COPY $x150    %2:_(p0) = COPY $x251    %3:_(p0) = COPY $x352    %4:_(<2 x p0>) = G_BUILD_VECTOR %0(p0), %153    %5:_(<2 x p0>) = G_BUILD_VECTOR %2(p0), %354    %6:_(<4 x p0>) = G_CONCAT_VECTORS %4(<2 x p0>), %555    RET_ReallyLR implicit %656...57# Check that we canonicalize concat_vectors(undef, undef) into undef.58---59name: concat_to_undef60tracksRegLiveness: true61body:             |62  bb.1:63    ; CHECK-LABEL: name: concat_to_undef64    ; CHECK: [[DEF:%[0-9]+]]:_(<4 x s64>) = G_IMPLICIT_DEF65    ; CHECK-NEXT: RET_ReallyLR implicit [[DEF]](<4 x s64>)66    %4:_(<2 x s64>) = G_IMPLICIT_DEF67    %5:_(<2 x s64>) = G_IMPLICIT_DEF68    %6:_(<4 x s64>) = G_CONCAT_VECTORS %4(<2 x s64>), %569    RET_ReallyLR implicit %670...71# Check that when combining concat_vectors(build_vector, undef) into72# build_vector, we correctly break the undef vector into a sequence73# of undef scalar.74---75name: concat_to_build_vector_with_undef76tracksRegLiveness: true77body:             |78  bb.1:79    liveins: $x0, $x180 81    ; CHECK-LABEL: name: concat_to_build_vector_with_undef82    ; CHECK: liveins: $x0, $x183    ; CHECK-NEXT: {{  $}}84    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x085    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x186    ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF87    ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s64>) = G_BUILD_VECTOR [[COPY]](s64), [[COPY1]](s64), [[DEF]](s64), [[DEF]](s64)88    ; CHECK-NEXT: RET_ReallyLR implicit [[BUILD_VECTOR]](<4 x s64>)89    %0:_(s64) = COPY $x090    %1:_(s64) = COPY $x191    %4:_(<2 x s64>) = G_BUILD_VECTOR %0(s64), %192    %5:_(<2 x s64>) = G_IMPLICIT_DEF93    %6:_(<4 x s64>) = G_CONCAT_VECTORS %4(<2 x s64>), %594    RET_ReallyLR implicit %695...96# Same as concat_to_build_vector_with_undef but with pointer types.97---98name: concat_to_build_vector_with_undef_ptr99tracksRegLiveness: true100body:             |101  bb.1:102    liveins: $x0, $x1103 104    ; CHECK-LABEL: name: concat_to_build_vector_with_undef_ptr105    ; CHECK: liveins: $x0, $x1106    ; CHECK-NEXT: {{  $}}107    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x0108    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1109    ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(p0) = G_IMPLICIT_DEF110    ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x p0>) = G_BUILD_VECTOR [[COPY]](p0), [[COPY1]](p0), [[DEF]](p0), [[DEF]](p0)111    ; CHECK-NEXT: RET_ReallyLR implicit [[BUILD_VECTOR]](<4 x p0>)112    %0:_(p0) = COPY $x0113    %1:_(p0) = COPY $x1114    %4:_(<2 x p0>) = G_BUILD_VECTOR %0(p0), %1115    %5:_(<2 x p0>) = G_IMPLICIT_DEF116    %6:_(<4 x p0>) = G_CONCAT_VECTORS %4(<2 x p0>), %5117    RET_ReallyLR implicit %6118...119# Check that we keep a concat_vectors as soon as one of the operand is120# not undef or build_vector. I.e., we cannot flatten the concat_vectors.121---122name: concat_to_build_vector_negative_test123tracksRegLiveness: true124body:             |125  bb.1:126    liveins: $q0127 128    ; CHECK-LABEL: name: concat_to_build_vector_negative_test129    ; CHECK: liveins: $q0130    ; CHECK-NEXT: {{  $}}131    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0132    ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(<2 x s64>) = G_IMPLICIT_DEF133    ; CHECK-NEXT: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x s64>) = G_CONCAT_VECTORS [[COPY]](<2 x s64>), [[DEF]](<2 x s64>)134    ; CHECK-NEXT: RET_ReallyLR implicit [[CONCAT_VECTORS]](<4 x s64>)135    %4:_(<2 x s64>) = COPY $q0136    %5:_(<2 x s64>) = G_IMPLICIT_DEF137    %6:_(<4 x s64>) = G_CONCAT_VECTORS %4(<2 x s64>), %5138    RET_ReallyLR implicit %6139...140