OSDN Git Service

[LV] Generate both scalar and vector integer induction variables
authorMatthew Simpson <mssimpso@codeaurora.org>
Tue, 2 Aug 2016 15:25:16 +0000 (15:25 +0000)
committerMatthew Simpson <mssimpso@codeaurora.org>
Tue, 2 Aug 2016 15:25:16 +0000 (15:25 +0000)
commit155b8551c65a1577cd5d73554527a7a7113c12df
tree49e7c6f40ed9a815918a417cb9d1f1f3aa3b2bdc
parentd170182063f52953bf17f319ea7d7151597b4a2f
[LV] Generate both scalar and vector integer induction variables

This patch enables the vectorizer to generate both scalar and vector versions
of an integer induction variable for a given loop. Previously, we only
generated a scalar induction variable if we knew all its users were going to be
scalar. Otherwise, we generated a vector induction variable. In the case of a
loop with both scalar and vector users of the induction variable, we would
generate the vector induction variable and extract scalar values from it for
the scalar users. With this patch, we now generate both versions of the
induction variable when there are both scalar and vector users and select which
version to use based on whether the user is scalar or vector.

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

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