From 09bd06838eb084fc6e6090f92f661e1d0c2de9a7 Mon Sep 17 00:00:00 2001 From: Amara Emerson Date: Fri, 18 Sep 2020 10:23:35 -0700 Subject: [PATCH] [AArch64][GlobalISel] Make <8 x s8> of G_BUILD_VECTOR legal. --- .../AArch64/GISel/AArch64LegalizerInfo.cpp | 3 ++- .../AArch64/GlobalISel/legalize-build-vector.mir | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp b/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp index 1dfae8d0ba7..99a01230860 100644 --- a/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp +++ b/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp @@ -599,7 +599,8 @@ AArch64LegalizerInfo::AArch64LegalizerInfo(const AArch64Subtarget &ST) }); getActionDefinitionsBuilder(G_BUILD_VECTOR) - .legalFor({{v16s8, s8}, + .legalFor({{v8s8, s8}, + {v16s8, s8}, {v4s16, s16}, {v8s16, s16}, {v2s32, s32}, diff --git a/test/CodeGen/AArch64/GlobalISel/legalize-build-vector.mir b/test/CodeGen/AArch64/GlobalISel/legalize-build-vector.mir index bb2bc337293..b6c4ac8a6d7 100644 --- a/test/CodeGen/AArch64/GlobalISel/legalize-build-vector.mir +++ b/test/CodeGen/AArch64/GlobalISel/legalize-build-vector.mir @@ -72,3 +72,19 @@ body: | $q0 = COPY %2(<16 x s8>) RET_ReallyLR ... +--- +name: legal_v8s8 +body: | + bb.0: + ; CHECK-LABEL: name: legal_v8s8 + ; CHECK: [[DEF:%[0-9]+]]:_(s8) = G_IMPLICIT_DEF + ; CHECK: [[DEF1:%[0-9]+]]:_(s8) = G_IMPLICIT_DEF + ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<8 x s8>) = G_BUILD_VECTOR [[DEF]](s8), [[DEF1]](s8), [[DEF]](s8), [[DEF1]](s8), [[DEF]](s8), [[DEF1]](s8), [[DEF]](s8), [[DEF1]](s8) + ; CHECK: $d0 = COPY [[BUILD_VECTOR]](<8 x s8>) + ; CHECK: RET_ReallyLR + %0:_(s8) = G_IMPLICIT_DEF + %1:_(s8) = G_IMPLICIT_DEF + %2:_(<8 x s8>) = G_BUILD_VECTOR %0(s8), %1(s8), %0(s8), %1(s8), %0(s8), %1(s8), %0(s8), %1(s8) + $d0 = COPY %2(<8 x s8>) + RET_ReallyLR +...