This is an archive of the discontinued LLVM Phabricator instance.

[SLP] Consider extractelements as shuffles iff they have the same type/parent etc.
Needs ReviewPublic

Authored by ABataev on Oct 9 2017, 10:24 AM.

Details

Summary

We may try to treat set of extractelements as the shuffle wrongly if
they have different parents|types, are used in real gather tree entries
etc. Patch fixes this problem.

Diff Detail

Event Timeline

ABataev created this revision.Oct 9 2017, 10:24 AM
RKSimon added inline comments.Oct 10 2017, 1:15 PM
lib/Transforms/Vectorize/SLPVectorizer.cpp
721–722

Update comment

ABataev marked an inline comment as done.Oct 11 2017, 6:14 AM
ABataev updated this revision to Diff 118600.Oct 11 2017, 6:14 AM

Address comment.

RKSimon edited edge metadata.Oct 29 2017, 5:34 AM

I must say, this patch gets incredibly confusing - TEK_EEShuffle sometimes gets treated like a gather, and other times as a vectorization - it's almost never referenced directly.

lib/Transforms/Vectorize/SLPVectorizer.cpp
759

Why don't you handle TEK_EEShuffle?

I must say, this patch gets incredibly confusing - TEK_EEShuffle sometimes gets treated like a gather, and other times as a vectorization - it's almost never referenced directly.

Because this is neither the gathering, not the vectorization, but something different. We should not gather instructions and should not vectorize them, just merge them as shuffle.

lib/Transforms/Vectorize/SLPVectorizer.cpp
759

Because for this kind of tree entry we should not do anything - neither gather the items, nor mark them as vectorized, because instead we just merge them into a shuffle

ABataev updated this revision to Diff 130455.Jan 18 2018, 10:54 AM

Rebased against D38697.

ABataev updated this revision to Diff 132033.Jan 30 2018, 1:11 PM

Added a new test where we cannot schedule the bundle, but still vectorizing it in the current implementation.
Patch does not allow to vectorize this code

ABataev updated this revision to Diff 218908.Sep 5 2019, 6:44 AM

Rebase, need to check the tests though

Herald added a project: Restricted Project. · View Herald TranscriptSep 5 2019, 6:44 AM