OSDN Git Service

[SLP] Revert r312791 and other necessary commits, except for TTI and
authorChandler Carruth <chandlerc@gmail.com>
Fri, 15 Sep 2017 22:23:27 +0000 (22:23 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Fri, 15 Sep 2017 22:23:27 +0000 (22:23 +0000)
commitf405097e96e57344db1430039df71d7c60f43746
treec3939caa0ebebeca12da462b36d3b8162e8d19f2
parenta0f1ea32df562bd3397047159ecad7eaea5d9bf8
[SLP] Revert r312791 and other necessary commits, except for TTI and
CostModel.

The original patch added support for horizontal min/max reductions to
the SLP vectorizer.

This patch causes LLVM to miscompile fairly simple signed min
reductions. I have attached a test progrom to http://llvm.org/PR34635
that shows the behavior change after this patch. We found this in a test
for the open source Eigen library, but also in other code.

Unfortunately, the revert is moderately challenging. It required
reverting:
r313042: [SLP] Test with multiple uses of conditional op and wrong parent.
r312853: [SLP] Fix buildbots, NFC.
r312793: [SLP] Fix the warning about paths not returning the value, NFC.
r312791: [SLP] Support for horizontal min/max reduction.

And even then, I had to completely skip reverting the changes to TTI and
CostModel because r312832 rewrote so much of this code. Plus, the cost
modeling changes aren implicated in the miscompile, so they should be
fine and will just not be used until this gets re-introduced.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313409 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Vectorize/SLPVectorizer.cpp
test/Transforms/SLPVectorizer/X86/horizontal-list.ll
test/Transforms/SLPVectorizer/X86/horizontal-minmax.ll