This is an archive of the discontinued LLVM Phabricator instance.

alignment info for cost estimation in SLP vectorization
Needs ReviewPublic

Authored by chentong on Nov 12 2015, 7:45 AM.

Details

Reviewers
llvm-commits
Summary

When the cost of load/store is estimated in SLP vectorization, constant "1" was always given to the cost model. This caused over estimate the cost of sequential version in some architectures that care about the alignment (such as PPC). The fix is to add alignment info.

Diff Detail

Event Timeline

chentong updated this revision to Diff 40049.Nov 12 2015, 7:45 AM
chentong retitled this revision from to alignment info for cost estimation in SLP vectorization.
chentong updated this object.
chentong added a reviewer: llvm-commits.
chentong added a subscriber: chentong.
mzolotukhin added inline comments.
lib/Transforms/Vectorize/SLPVectorizer.cpp
1620–1624

Please run clang-format on the patch.

1621–1624

What about alignment here? Should we still use 1?

chentong updated this revision to Diff 41047.Nov 24 2015, 7:37 AM
  1. yes, the alignment for vector type is changed
  2. clang-format is used

updates based on the comments:
yes, the alignment for vector type is changed
clang-format is used

Please add a test case. It should go in test/Transforms/SLPVectorizer/PowerPC (this directory does not currently exist, but please create it -- you'll need to add a lit.local.cfg file to the directory as well (just like test/Transforms/SLPVectorizer/X86/lit.local.cfg, but editing the file to change 'X86' to 'PowerPC').