[PATCH] D50579: [LV] Teach about non header phis that have uses outside the loop

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 10 12:45:46 PDT 2018


anna created this revision.
anna added reviewers: Ayal, mkuper, mssimpso, efriedma.

This patch identifies non header phis that have no cyclic dependencies with
header phis (reduction/induction/first order recurrence phis).
If those phis have outside uses, we can still vectorize the loop and extract the 
last element. This is because the iteration dependence distance for these phis
can be widened upto VF (similar to how we do for induction/reduction) since they do not 
have a cyclic dependence with header phis.

The key point is to extract the last element from the vectorized phi and update
the scalar loop exit block phi to contain this extracted element from the vector
loop.


Repository:
  rL LLVM

https://reviews.llvm.org/D50579

Files:
  include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h
  lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
  lib/Transforms/Vectorize/LoopVectorize.cpp
  test/Transforms/LoopVectorize/no_outside_user.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50579.160171.patch
Type: text/x-patch
Size: 7384 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180810/6f198bb1/attachment.bin>


More information about the llvm-commits mailing list