[PATCH] D30710: [LV] Vectorize GEPs

Matthew Simpson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 7 11:21:59 PST 2017


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

This patch adds support for vectorizing GEPs. Previously, we only generated vector GEPs on-demand when creating gather or scatter operations. All GEPs from the original loop were scalarized by default, and if a pointer was to be stored to memory, we would have to build up the pointer vector with insertelement instructions.

With this patch, we will vectorize all GEPs that haven't already been marked for scalarization.

The patch refines collectLoopScalars to more exactly identify the scalar GEPs. The function now more closely resembles collectLoopUniforms. And the patch moves vector GEP creation out of vectorizeMemoryInstruction and into the main vectorization loop. The vector GEPs needed for gather and scatter operations will have already been generated before vectoring the memory accesses.

I think this patch makes sense on its own, but it's primarily motivated by a follow-on, which merges pointer induction variable widening with the rest of the induction widening code. The follow-on creates vector-of-pointer induction variables, and we need to be able to properly consume them.


https://reviews.llvm.org/D30710

Files:
  lib/Transforms/Vectorize/LoopVectorize.cpp
  test/Transforms/LoopVectorize/AArch64/first-order-recurrence.ll
  test/Transforms/LoopVectorize/X86/consecutive-ptr-uniforms.ll
  test/Transforms/LoopVectorize/X86/scatter_crash.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30710.90896.patch
Type: text/x-patch
Size: 27427 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170307/faab53d8/attachment.bin>


More information about the llvm-commits mailing list