This is an archive of the discontinued LLVM Phabricator instance.

[SLP] Apply external to vectorizable tree users cost adjustment for relevant aggregate build instructions only (UserCost).
ClosedPublic

Authored by vdmitrie on May 28 2020, 6:35 PM.

Details

Summary

Users are detected with findBuildAggregate routine and the trick is that following SLP vectorization may end up vectorizing entire list
with smaller chunks. Cost adjustment then is applied for individual chunks and these adjustments obviously have to be smaller than the
entire aggregate build cost.

Diff Detail

Event Timeline

vdmitrie created this revision.May 28 2020, 6:35 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 28 2020, 6:35 PM
ABataev added inline comments.May 29 2020, 6:05 AM
llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h
104

= None

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

CompensateUseCost

5988

!InsertUses.empty() instead of InsertUses.size() != 0

6068

Switching

vdmitrie updated this revision to Diff 267304.May 29 2020, 11:03 AM

Thank you, Alexey. I addressed your comments in new upload.

ABataev accepted this revision.May 29 2020, 11:33 AM

LG with a nit

llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h
96–100

I think you should use \p here instead of \param.

This revision is now accepted and ready to land.May 29 2020, 11:33 AM
vdmitrie updated this revision to Diff 267370.May 29 2020, 2:27 PM

replaced \param with \p

This revision was automatically updated to reflect the committed changes.