OSDN Git Service

[LV] Untangle the concepts of uniform and scalar
authorMatthew Simpson <mssimpso@codeaurora.org>
Tue, 2 Aug 2016 14:29:41 +0000 (14:29 +0000)
committerMatthew Simpson <mssimpso@codeaurora.org>
Tue, 2 Aug 2016 14:29:41 +0000 (14:29 +0000)
commit90b7f569d8903f6bb73d1d3bdab7f79ac05dd958
tree77e2bd2d0df8d53698fcf9cb315f7815954ba91c
parent22973d396cebaa1a4fcecea949cd1f2ebc9e0a26
[LV] Untangle the concepts of uniform and scalar

This patch refactors the logic in collectLoopUniforms and
collectValuesToIgnore, untangling the concepts of "uniform" and "scalar". It
adds isScalarAfterVectorization along side isUniformAfterVectorization to
distinguish the two. Known scalar values include those that are uniform,
getelementptr instructions that won't be vectorized, and induction variables
and induction variable update instructions whose users are all known to be
scalar.

This patch includes the following functional changes:

- In collectLoopUniforms, we mark uniform the pointer operands of interleaved
  accesses. Although non-consecutive, these pointers are treated like
  consecutive pointers during vectorization.

- In collectValuesToIgnore, we insert a value into VecValuesToIgnore if it
  isScalarAfterVectorization rather than isUniformAfterVectorization. This
  differs from the previous functionaly in that we now add getelementptr
  instructions that will not be vectorized into VecValuesToIgnore.

This patch also removes the ValuesNotWidened set used for induction variable
scalarization since, after the above changes, it is now equivalent to
isScalarAfterVectorization.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277460 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Vectorize/LoopVectorize.cpp
test/Transforms/LoopVectorize/induction.ll