From 57ec292ab80002b8dbc3e9b201be5d4e22917449 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. llvm-svn: 369172 --- llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp | 4 +++- llvm/test/CodeGen/AArch64/GlobalISel/select-unmerge.mir | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp b/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp index 0c808bc..bab15dd 100644 --- a/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp +++ b/llvm/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/llvm/test/CodeGen/AArch64/GlobalISel/select-unmerge.mir b/llvm/test/CodeGen/AArch64/GlobalISel/select-unmerge.mir index fdc5f12..5162fa2 100644 --- a/llvm/test/CodeGen/AArch64/GlobalISel/select-unmerge.mir +++ b/llvm/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.7.4