This is an archive of the discontinued LLVM Phabricator instance.

[SLP]Merge reorder and reuse shuffles.
ClosedPublic

Authored by ABataev on Jan 19 2021, 12:21 PM.

Details

Summary

It is possible to merge reuse and reorder shuffles and reduce the total
cost of the vectorization tree/number of final instructions.

Diff Detail

Event Timeline

ABataev created this revision.Jan 19 2021, 12:21 PM
ABataev requested review of this revision.Jan 19 2021, 12:21 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 19 2021, 12:21 PM

Looks good for me after Index/Pos fix for "shrink shuffles". Any objections now?

dtemirbulatov accepted this revision.Jan 27 2021, 9:11 AM

Looks good to me.

This revision is now accepted and ready to land.Jan 27 2021, 9:11 AM
echristo added inline comments.Jan 27 2021, 9:26 AM
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
3516

Let's describe dead cost here.

4354

I seem to recall we have other classes that do this as well?

4407

"Shuffle construction must be finalized"

ABataev added inline comments.Feb 10 2021, 2:07 PM
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
4354

I did not find any. Could you point me where should I look for something similar?

ABataev updated this revision to Diff 322828.Feb 10 2021, 2:28 PM

Update, rebase

LG after addressing all comments.

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
3516

May be just something like "CommonCost"? The "dead" part of cost is used at the end only.

4299

This phrase "Before this patch..." looks misplaced here, inside comment. May be move it to summary?

4354

Didn't find them as well...

ABataev added inline comments.Feb 26 2021, 6:40 AM
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
3516

Done. Also, forgot to add a comment.

4299

Yes, will fix this part of the comment, thanks.

ABataev updated this revision to Diff 326682.Feb 26 2021, 6:40 AM

Updates and fixes

anton-afanasyev accepted this revision.Feb 26 2021, 2:29 PM

LGTM

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
4407

Please address this comment.

This revision was automatically updated to reflect the committed changes.