OSDN Git Service

[LV] Vectorize first-order recurrences
authorMatthew Simpson <mssimpso@codeaurora.org>
Fri, 19 Feb 2016 17:56:08 +0000 (17:56 +0000)
committerMatthew Simpson <mssimpso@codeaurora.org>
Fri, 19 Feb 2016 17:56:08 +0000 (17:56 +0000)
commit3dd74513a8db49868139018685852319b5cae85d
tree7976d762960dc606654c04c353da0c8b60ca6270
parentd3b66593b0bd3109b62ed8eaf0c2d24cac84b903
[LV] Vectorize first-order recurrences

This patch enables the vectorization of first-order recurrences. A first-order
recurrence is a non-reduction recurrence relation in which the value of the
recurrence in the current loop iteration equals a value defined in the previous
iteration. The load PRE of the GVN pass often creates these recurrences by
hoisting loads from within loops.

In this patch, we add a new recurrence kind for first-order phi nodes and
attempt to vectorize them if possible. Vectorization is performed by shuffling
the values for the current and previous iterations. The vectorization cost
estimate is updated to account for the added shuffle instruction.

Contributed-by: Matthew Simpson and Chad Rosier <mcrosier@codeaurora.org>
Differential Revision: http://reviews.llvm.org/D16197

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261346 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Transforms/Utils/LoopUtils.h
lib/Transforms/Utils/LoopUtils.cpp
lib/Transforms/Vectorize/LoopVectorize.cpp
test/Transforms/LoopVectorize/AArch64/first-order-recurrence.ll [new file with mode: 0644]