]> granicus.if.org Git - llvm/commit
[Loop Vectorizer] Cost-based decision for vectorization form of memory instruction.
authorElena Demikhovsky <elena.demikhovsky@intel.com>
Wed, 8 Feb 2017 19:25:23 +0000 (19:25 +0000)
committerElena Demikhovsky <elena.demikhovsky@intel.com>
Wed, 8 Feb 2017 19:25:23 +0000 (19:25 +0000)
commit92cc2185b84dfd77a7b0b264c5d00467ca53f2a7
tree11a03f9b6ba168881a9b92eeaf4f62b4745812d8
parente77177e8675d00a942af1859ccd4e8548c4e91ab
[Loop Vectorizer] Cost-based decision for vectorization form of memory instruction.

Making the cost model selecting between Interleave, GatherScatter or Scalar vectorization form of memory instruction.
The right decision should be done for non-consecutive memory access instrcuctions that may have more than one vectorization solution.

This patch includes the following changes:
- Cost Model calculates the cost of Load/Store vector form and choose the better option between Widening, Interleave, GatherScactter and Scalarization. Cost Model keeps the widening decision.
- Arrays of Uniform and Scalar values are moved from Legality to Cost Model.
- Cost Model collects Uniforms and Scalars per VF. The collection is based on CM decision map of Loadis/Stores vectorization form.
- Vectorization of memory instruction is performed according to the CM decision.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294503 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Vectorize/LoopVectorize.cpp
test/Transforms/LoopVectorize/AArch64/interleaved-vs-scalar.ll [new file with mode: 0644]
test/Transforms/LoopVectorize/X86/consecutive-ptr-uniforms.ll
test/Transforms/LoopVectorize/X86/gather-vs-interleave.ll [new file with mode: 0644]