This is an archive of the discontinued LLVM Phabricator instance.

[SLP]Improve isGatherShuffledEntry to handles shuffles between different length vectors.
AbandonedPublic

Authored by ABataev on Dec 27 2021, 7:43 AM.

Details

Summary

Originally isGatherShuffledEntry supports shuffles between 2 input
vectors of the same size. Actually, we can support the shuffles between
vectors of 2 different sizes. One of them (or both, for variable length
vector) just must be resized to match the sizes. Improves cost and the
vectorization itself.

Diff Detail

Event Timeline

ABataev created this revision.Dec 27 2021, 7:43 AM
ABataev requested review of this revision.Dec 27 2021, 7:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 27 2021, 7:43 AM
RKSimon added inline comments.May 1 2022, 7:54 AM
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
7377–7379

min index? Aren't you finding the max_element here?

7408

Duplicate code - worth pulling this out as a helper?

7914

We do this often enough - I'm wondering if we just add a helper to IRBuilder that creates an identity shuffle that pads/extracts a source Value to requested #elements size?

7946

Worth putting all of this inside ShuffleInstructionBuilder ?

Herald added a project: Restricted Project. · View Herald TranscriptMay 1 2022, 7:54 AM
Herald added a subscriber: vporpo. · View Herald Transcript
ABataev added inline comments.May 17 2022, 11:04 AM
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
7946

Currently it does not support shuffles between 2 input vectors. There are some other patches, where the lambda is added

ABataev abandoned this revision.Mon, Dec 18, 5:50 AM

All changes were committed already in separate patches