From ead85efff9571e9d9ac393cc6c08c3f75641e354 Mon Sep 17 00:00:00 2001 From: Amara Emerson Date: Fri, 16 Aug 2019 23:23:40 +0000 Subject: [PATCH] [AArch64][GlobalISel] Fix an assertion during G_UNMERGE selection for s128 types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369172 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../AArch64/AArch64InstructionSelector.cpp | 4 +++- .../AArch64/GlobalISel/select-unmerge.mir | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/lib/Target/AArch64/AArch64InstructionSelector.cpp b/lib/Target/AArch64/AArch64InstructionSelector.cpp index 0c808bcb0a1..bab15dd8e75 100644 --- a/lib/Target/AArch64/AArch64InstructionSelector.cpp +++ b/lib/Target/AArch64/AArch64InstructionSelector.cpp @@ -2963,7 +2963,9 @@ bool AArch64InstructionSelector::selectUnmergeValues( const LLT NarrowTy = MRI.getType(I.getOperand(0).getReg()); const LLT WideTy = MRI.getType(SrcReg); (void)WideTy; - assert(WideTy.isVector() && "can only unmerge from vector types!"); + assert(WideTy.isVector() || + WideTy.getSizeInBits() == 128 && + "can only unmerge from vector or s128 types!"); assert(WideTy.getSizeInBits() > NarrowTy.getSizeInBits() && "source register size too small!"); diff --git a/test/CodeGen/AArch64/GlobalISel/select-unmerge.mir b/test/CodeGen/AArch64/GlobalISel/select-unmerge.mir index fdc5f12912b..5162fa2a543 100644 --- a/test/CodeGen/AArch64/GlobalISel/select-unmerge.mir +++ b/test/CodeGen/AArch64/GlobalISel/select-unmerge.mir @@ -27,6 +27,8 @@ ret <2 x half> undef } + define void @test_s128(i128 %p) { ret void } + ... --- name: test_v2s64_unmerge @@ -208,3 +210,18 @@ body: | $s1 = COPY %2(<2 x s16>) RET_ReallyLR implicit $s0 ... +--- +name: test_s128 +alignment: 2 +legalized: true +regBankSelected: true +tracksRegLiveness: true +body: | + bb.1: + liveins: $q0 + %0:fpr(s128) = COPY $q0 + %1:fpr(s64), %2:fpr(s64) = G_UNMERGE_VALUES %0(s128) + $d0 = COPY %1(s64) + $d1 = COPY %2(s64) + RET_ReallyLR implicit $d0, implicit $d1 +... -- 2.40.0