This is an archive of the discontinued LLVM Phabricator instance.

[SVE] Fix casts to <FixedVectorType> in truncateToMinimalBitwidths
ClosedPublic

Authored by kmclaughlin on Jul 16 2021, 9:28 AM.

Details

Summary

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.

Diff Detail

Event Timeline

kmclaughlin created this revision.Jul 16 2021, 9:28 AM
kmclaughlin requested review of this revision.Jul 16 2021, 9:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 16 2021, 9:28 AM
Matt added a subscriber: Matt.Jul 16 2021, 11:37 AM
david-arm accepted this revision.Jul 20 2021, 3:35 AM

LGTM! There are no tests attached here because there is currently no codepath where we can hit this for scalable vectors, but from a conceptual point of view there is no reason why it shouldn't work for scalable vectors.

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
4052–4053

nit: Before merging/committing/submitting/<insert_correct_terminology here :)> can you fix up the formatting issues?

This revision is now accepted and ready to land.Jul 20 2021, 3:35 AM
This revision was landed with ongoing or failed builds.Jul 26 2021, 5:46 AM
This revision was automatically updated to reflect the committed changes.
kmclaughlin marked an inline comment as done.