OSDN Git Service

[SLPVectorizer] Don't ignore scalar extraction instructions of aggregate value
authorGuozhi Wei <carrot@google.com>
Thu, 14 Dec 2017 19:35:43 +0000 (19:35 +0000)
committerGuozhi Wei <carrot@google.com>
Thu, 14 Dec 2017 19:35:43 +0000 (19:35 +0000)
commit44388667e99de222d3943ef56d099aa470d30925
tree6a5ae0e36e221e9b046a9cc4bad38c03ec683c4e
parentb9a44ec3ca3f9d5cfb01bbcd64a0e015e05aaaa3
[SLPVectorizer] Don't ignore scalar extraction instructions of aggregate value

In SLPVectorizer, the vector build instructions (insertvalue for aggregate type) is passed to BoUpSLP.buildTree, it is treated as UserIgnoreList, so later in cost estimation, the cost of these instructions are not counted.
For aggregate value, later usage are more likely to be done in scalar registers, either used as individual scalars or used as a whole for function call or return value. Ignore scalar extraction instructions may cause too aggressive vectorization for aggregate values, and slow down performance. So for vectorization of aggregate value, the scalar extraction instructions are required in cost estimation.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320736 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Transforms/Vectorize/SLPVectorizer.h
lib/Transforms/Vectorize/SLPVectorizer.cpp
test/Transforms/SLPVectorizer/PowerPC/aggregate.ll [new file with mode: 0644]
test/Transforms/SLPVectorizer/X86/aggregate.ll [new file with mode: 0644]