This is an archive of the discontinued LLVM Phabricator instance.

[NFC][SLP] Add test case exposing SLP cost model bug.
ClosedPublic

Authored by vdmitrie on May 27 2020, 5:58 PM.

Details

Summary

The bug is related to aggregate build cost model adjustment that
adds a bias to cost triggering vectorization of actually unprofitable
to vectorize tree.

Diff Detail

Event Timeline

vdmitrie created this revision.May 27 2020, 5:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 27 2020, 5:58 PM

Please regenerate the tests with update_test_checks.py

Also, drop the "slp_" - its already in the slp test directory tree

llvm/test/Transforms/SLPVectorizer/X86/slp_vec_list_bias.ll
63 ↗(On Diff #266712)

ret void

spatel added inline comments.May 28 2020, 5:30 AM
llvm/test/Transforms/SLPVectorizer/X86/slp_vec_list_bias.ll
1 ↗(On Diff #266712)

Does "-tti" change the behavior?

8 ↗(On Diff #266712)

As suggested, if you auto-generate the CHECK lines using utils/update_test_checks.py, the test will show the full results. Warning - you should probably do something like "s/tmp/t/" to avoid problems with the script (see D80584).

It would also be nice to add a comment about the x86-specific asm that we want to avoid here ("vpaddd" or similar). There are later transforms in -vector-combine and DAGCombiner that could scalarize and solve this, but if we can fix the problem within SLP, then that's obviously better.

vdmitrie updated this revision to Diff 266900.May 28 2020, 9:03 AM

Thank you for prompt review.
Updated patch to address your comments.

spatel accepted this revision.May 28 2020, 9:49 AM

LGTM - see inline for typo in comment.

llvm/test/Transforms/SLPVectorizer/X86/vec_list_bias.ll
7

typo: subtracting?

This revision is now accepted and ready to land.May 28 2020, 9:49 AM
vdmitrie marked an inline comment as done.May 28 2020, 5:25 PM
vdmitrie added inline comments.
llvm/test/Transforms/SLPVectorizer/X86/vec_list_bias.ll
7

Thank you, Sanjay. I fixed it.

This revision was automatically updated to reflect the committed changes.