This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] Add support for widening the result of EXTRACT_SUBVECTOR
ClosedPublic

Authored by david-arm on May 17 2021, 3:24 AM.

Details

Summary

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.

Diff Detail

Event Timeline

david-arm created this revision.May 17 2021, 3:24 AM
david-arm requested review of this revision.May 17 2021, 3:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 17 2021, 3:24 AM
sdesmalen added inline comments.May 17 2021, 1:36 PM
llvm/test/CodeGen/AArch64/sve-extract-vector.ll
115

Can you add a test where the index is not 0?

david-arm added inline comments.May 18 2021, 12:45 AM
llvm/test/CodeGen/AArch64/sve-extract-vector.ll
115

I don't think so because the compiler will crash. We only support the '0' case for scalable vectors at the moment.

Matt added a subscriber: Matt.May 18 2021, 7:28 AM
peterwaller-arm accepted this revision.May 18 2021, 7:48 AM
This revision is now accepted and ready to land.May 18 2021, 7:48 AM
This revision was landed with ongoing or failed builds.May 20 2021, 4:27 AM
This revision was automatically updated to reflect the committed changes.