[llvm] 615695d - [AArch64][GlobalISel] Make <8 x s8> of G_BUILD_VECTOR legal.
Amara Emerson via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 18 10:32:40 PDT 2020
Author: Amara Emerson
Date: 2020-09-18T10:32:33-07:00
New Revision: 615695de27e417d6b444cd983e6f636373afc8c9
URL: https://github.com/llvm/llvm-project/commit/615695de27e417d6b444cd983e6f636373afc8c9
DIFF: https://github.com/llvm/llvm-project/commit/615695de27e417d6b444cd983e6f636373afc8c9.diff
LOG: [AArch64][GlobalISel] Make <8 x s8> of G_BUILD_VECTOR legal.
Added:
Modified:
llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
llvm/test/CodeGen/AArch64/GlobalISel/legalize-build-vector.mir
Removed:
################################################################################
diff --git a/llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp b/llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
index 1dfae8d0ba7c..99a012308606 100644
--- a/llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
+++ b/llvm/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/llvm/test/CodeGen/AArch64/GlobalISel/legalize-build-vector.mir b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-build-vector.mir
index bb2bc3372936..b6c4ac8a6d7c 100644
--- a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-build-vector.mir
+++ b/llvm/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
+...
More information about the llvm-commits
mailing list