This is an archive of the discontinued LLVM Phabricator instance.

[SLP] Remove redundancy of performing operand reordering twice: once in buildTree() and later in vectorizeTree().
ClosedPublic

Authored by vporpo on Mar 6 2019, 3:42 PM.

Details

Summary

This is a refactoring patch that removes the redundancy of performing operand reordering twice, once in buildTree() and later in vectorizeTree().
To achieve this we need to keep track of the operands within the TreeEntry struct while building the tree, and later in vectorizeTree() we are just accessing them from the TreeEntry in the right order.

This patch is the first in a series of patches that will allow for better operand reordering across chains of instructions (e.g., a chain of ADDs), as presented here: https://www.youtube.com/watch?v=gIEn34LvyNo

Diff Detail

Repository
rL LLVM

Event Timeline

vporpo created this revision.Mar 6 2019, 3:42 PM
ABataev added inline comments.Mar 11 2019, 7:53 AM
lib/Transforms/Vectorize/SLPVectorizer.cpp
606 ↗(On Diff #189605)

Use /// style of comments for the declarations

611 ↗(On Diff #189605)

=default;

617 ↗(On Diff #189605)

Maybe, better to have it only for the debug builds?

vporpo updated this revision to Diff 190132.Mar 11 2019, 11:45 AM
vporpo marked 3 inline comments as done.
This revision is now accepted and ready to land.Mar 11 2019, 11:52 AM

Please commit this, I don't have commit access.

Please commit this, I don't have commit access.

Definitely not today. @RKSimon ?

Please commit this, I don't have commit access.

Definitely not today. @RKSimon ?

No problem, will commit this shortly.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 12 2019, 3:50 AM
RKSimon reopened this revision.Mar 12 2019, 4:53 AM

@vporpo this had to be reverted due to build bot failures: http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/45145

Please can you take a look?

This revision is now accepted and ready to land.Mar 12 2019, 4:53 AM
RKSimon requested changes to this revision.Mar 12 2019, 4:53 AM
This revision now requires changes to proceed.Mar 12 2019, 4:53 AM
vporpo updated this revision to Diff 190370.Mar 12 2019, 6:53 PM

Thanks @RKSimon . Moving the operator<<() within the EdgeInfo struct fixes the build issue with clang 7.0.1.

RKSimon accepted this revision.Mar 22 2019, 2:21 PM

LGTM - tested with release build (no asserts)

This revision is now accepted and ready to land.Mar 22 2019, 2:21 PM
This revision was automatically updated to reflect the committed changes.