[CodeGen] Add support for widening the result of EXTRACT_SUBVECTOR
authorDavid Sherwood <david.sherwood@arm.com>
Fri, 14 May 2021 09:50:08 +0000 (10:50 +0100)
committerDavid Sherwood <david.sherwood@arm.com>
Thu, 20 May 2021 11:27:08 +0000 (12:27 +0100)
commita21bff0673a1d593588c69e2ed2f557af40faa2d
treeae5f5548a119d49d54e8654780a7a267d6116148
parenta28fe17d7315f72b802b4ac4b4bc1603ffe7a23b
[CodeGen] Add support for widening the result of EXTRACT_SUBVECTOR

When trying to return a type such as <vscale x 1 x i32> from a
function we crash in DAGTypeLegalizer::WidenVecRes_EXTRACT_SUBVECTOR
when attempting to get the fixed number of elements in the vector.

For the simple case we are dealing with, i.e. extracting
<vscale x 1 x i32> from index 0 of input vector <vscale x 4 x i32>
we can simply rely upon existing code that just returns the input.

Differential Revision: https://reviews.llvm.org/D102605
llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
llvm/test/CodeGen/AArch64/sve-extract-vector.ll
llvm/test/CodeGen/AArch64/sve-int-arith.ll