This is an archive of the discontinued LLVM Phabricator instance.

[SLP] Fix PR23510: Try to find best possible vectorizable stores.
ClosedPublic

Authored by ABataev on Nov 3 2017, 10:25 AM.

Details

Summary

The analysis of the store sequence goes in straight order - from the
first store to the last. Bu the best opportunity for vectorization will
happen if we're going to use reverse order - from last store to the
first. It may be best because usually users have some initialization
part + further processing and this first initialization may confuse
SLP vectorizer.

Diff Detail

Repository
rL LLVM

Event Timeline

ABataev created this revision.Nov 3 2017, 10:25 AM
RKSimon added inline comments.Nov 4 2017, 10:47 AM
test/Transforms/SLPVectorizer/X86/stores_vectorize.ll
34 ↗(On Diff #121511)

TMP2 and TMP5 are the same?

ABataev added inline comments.Nov 6 2017, 6:09 AM
test/Transforms/SLPVectorizer/X86/stores_vectorize.ll
34 ↗(On Diff #121511)

Yes, but they are used for different purpose.

RKSimon accepted this revision.Nov 7 2017, 5:18 AM

LGTM with a couple of minors

lib/Transforms/Vectorize/SLPVectorizer.cpp
4318 ↗(On Diff #121511)

Space between > and Tails

4334 ↗(On Diff #121511)

Idx-1, Idx+1, Idx-2, Idx+2, ...

Idx+2 ? Fix this sequence

This revision is now accepted and ready to land.Nov 7 2017, 5:18 AM
ABataev added inline comments.Nov 7 2017, 6:06 AM
lib/Transforms/Vectorize/SLPVectorizer.cpp
4334 ↗(On Diff #121511)

I don't understand, what's wrong with the sequence?

This revision was automatically updated to reflect the committed changes.