[SVE] Fix casts to <FixedVectorType> in truncateToMinimalBitwidths
authorKerry McLaughlin <kerry.mclaughlin@arm.com>
Mon, 26 Jul 2021 09:55:15 +0000 (10:55 +0100)
committerKerry McLaughlin <kerry.mclaughlin@arm.com>
Mon, 26 Jul 2021 12:44:51 +0000 (13:44 +0100)
commite484e1ae03325823c469684d7d1532f2aadbe98d
treebaee18db210d5c93c4a1e082462ee0248fb72425
parentd7cb2a07967791867c245a6e2e8e4214d69140f7
[SVE] Fix casts to <FixedVectorType> in truncateToMinimalBitwidths

Fixes more casts to `<FixedVectorType>` for the cases where the
instruction is a Insert/ExtractElementInst.

For fixed-width, this part of truncateToMinimalBitWidths is tested by
AArch64/type-shrinkage-insertelt.ll. I attempted to write a test case for this part
of truncateToMinimalBitWidths which uses scalable vectors, but was unable to add
one. The tests in type-shrinkage-insertelt.ll rely on scalarization to create extract
element instructions for instance, which is not possible for scalable vectors.

Reviewed By: david-arm

Differential Revision: https://reviews.llvm.org/D106163
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp