[LV] Fix insertion point for shuffle vectors in first order recurrence
authorAnna Thomas <anna@azul.com>
Tue, 9 May 2017 14:29:33 +0000 (14:29 +0000)
committerAnna Thomas <anna@azul.com>
Tue, 9 May 2017 14:29:33 +0000 (14:29 +0000)
commit0691483435e2626cc26d11e0c58be6fe353d00e3
treefa52c9e8e5eb4ecffd1c8c1c5557fb19dcf03d9a
parentf22f885b6695a13159e9a8a1d79d3af88c80f37a
[LV] Fix insertion point for shuffle vectors in first order recurrence

Summary:
In first order recurrence vectorization, when the previous value is a phi node, we need to
set the insertion point to the first non-phi node.
We can have the previous value being a phi node, due to the generation of new
IVs as part of trunc optimization [1].

[1] https://reviews.llvm.org/rL294967

Reviewers: mssimpso, mkuper

Subscribers: mzolotukhin, llvm-commits

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

llvm-svn: 302532
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/test/Transforms/LoopVectorize/induction.ll