[AArch64][GlobalISel] Fix an assertion during G_UNMERGE selection for s128 types.

llvm-svn: 369172
This commit is contained in:
Amara Emerson 2019-08-16 23:23:40 +00:00
parent 8e2837e549
commit 57ec292ab8
2 changed files with 20 additions and 1 deletions

View File

@ -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!");

View File

@ -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
...