[SVE][CodeGen] Legalisation of truncate for scalable vectors
authorKerry McLaughlin <kerry.mclaughlin@arm.com>
Thu, 10 Sep 2020 08:55:54 +0000 (09:55 +0100)
committerKerry McLaughlin <kerry.mclaughlin@arm.com>
Thu, 10 Sep 2020 10:35:33 +0000 (11:35 +0100)
commitcd89f5c91b4bad90278a59865fc06a75211589a1
tree2e48f22bd9d839f6e6ad2964d123cfdcda75aed4
parentb7586afc4dcddd1abc70724585c3eb3857e27f43
[SVE][CodeGen] Legalisation of truncate for scalable vectors

Truncating from an illegal SVE type to a legal type, e.g.
`trunc <vscale x 4 x i64> %in to <vscale x 4 x i32>`
fails after PromoteIntOp_CONCAT_VECTORS attempts to
create a BUILD_VECTOR.

This patch changes the promote function to create a sequence of
INSERT_SUBVECTORs if the return type is scalable, and replaces
these with UNPK+UZP1 for AArch64.

Reviewed By: paulwalker-arm

Differential Revision: https://reviews.llvm.org/D86548
llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/test/CodeGen/AArch64/sve-split-trunc.ll [new file with mode: 0644]