[PATCH] D31979: [LV] Fix the vector code generation for first order recurrence

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 12 07:48:28 PDT 2017


anna created this revision.
Herald added a subscriber: mzolotukhin.

In first order recurrences where phi's are used outside the loop,
we should generate an additional vector.extract of the second last element from
the vectorized phi update.
This is because we require the phi itself (which is the value at the second last
iteration of the vector loop) and not the phi's update within the loop.

Fixes PR32396.


https://reviews.llvm.org/D31979

Files:
  lib/Transforms/Utils/LoopUtils.cpp
  lib/Transforms/Vectorize/LoopVectorize.cpp
  test/Transforms/LoopVectorize/AArch64/loop-vectorization-factors.ll
  test/Transforms/LoopVectorize/first-order-recurrence.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31979.94971.patch
Type: text/x-patch
Size: 7773 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170412/ddca7845/attachment-0001.bin>


More information about the llvm-commits mailing list