This is an archive of the discontinued LLVM Phabricator instance.

[SLP]Change the order of the reduction/binops args pair vectorization attempts.
ClosedPublic

Authored by ABataev on Oct 21 2021, 8:03 AM.

Details

Summary

Need to change the order of the reduction/binops args pair vectorization
attempts. Need to try to find the reduction at first and postpone
vectorization of binops args. This may help to find more reduction
patterns and vectorize them.
Part of D111574.

Diff Detail

Event Timeline

ABataev created this revision.Oct 21 2021, 8:03 AM
ABataev requested review of this revision.Oct 21 2021, 8:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 21 2021, 8:03 AM
RKSimon added inline comments.Oct 22 2021, 6:00 AM
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
8842–8843

Why did you need to change this?

ABataev added inline comments.Oct 22 2021, 6:04 AM
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
8842–8843

This order is also important, it helps to detect longer reduction chains. Better to start analysis from the deeper operands, that's why SmallVector is not the best option here.

RKSimon accepted this revision.Oct 22 2021, 6:36 AM

OK, LGTM cheers

This revision is now accepted and ready to land.Oct 22 2021, 6:36 AM