[AArch64][GlobalISel] Fix bug in fewVectorElts action while legalizing oversize G_FPT...
authorAmara Emerson <amara@apple.com>
Wed, 16 Sep 2020 19:14:40 +0000 (12:14 -0700)
committerAmara Emerson <amara@apple.com>
Thu, 17 Sep 2020 15:56:26 +0000 (08:56 -0700)
commit79b21fc187643416dbd21db10abe46a91b4c3f09
treecd3d3958e31b4f9bfd2d17e5b75dd352787898ce
parentf16abe5f84eee8db18d5eb5a21ab543146626ea6
[AArch64][GlobalISel] Fix bug in fewVectorElts action while legalizing oversize G_FPTRUNC vectors.

For <8 x s32> = fptrunc <8 x s64> the fewerElementsVector action tries to break
down the source vector into the final source vectors of <2 x s64> using unmerge.
This fixes a crash due to using the wrong number of elements for the breakdown
type.

Also add some legalizer tests for explicitly G_FPTRUNC which we didn't have.

Differential Revision: https://reviews.llvm.org/D87814
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
llvm/test/CodeGen/AArch64/GlobalISel/legalize-fptrunc.mir [new file with mode: 0644]
llvm/test/CodeGen/AArch64/arm64-vcvt.ll