[SLP] Fix for PR32086: Count InsertElementInstr of the same elements as shuffle.
authorAlexey Bataev <a.bataev@hotmail.com>
Tue, 23 Jan 2018 19:30:26 +0000 (19:30 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Tue, 23 Jan 2018 19:30:26 +0000 (19:30 +0000)
commit6719e2418c1d8fc20a6a6b6a0540281736b591d6
treefb1d9c56e90e6f1c5544e88ab088a5fac110c3da
parent4a190fe62f58eeaa9b996665e27b4d8898b140a7
[SLP] Fix for PR32086: Count InsertElementInstr of the same elements as shuffle.

Summary:
If the same value is going to be vectorized several times in the same
tree entry, this entry is considered to be a gather entry and cost of
this gather is counter as cost of InsertElementInstrs for each gathered
value. But we can consider these elements as ShuffleInstr with
SK_PermuteSingle shuffle kind.

Reviewers: spatel, RKSimon, mkuper, hfinkel

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D38697

llvm-svn: 323246
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/test/Transforms/SLPVectorizer/X86/PR32086.ll
llvm/test/Transforms/SLPVectorizer/X86/blending-shuffle.ll
llvm/test/Transforms/SLPVectorizer/X86/hoist.ll