]> granicus.if.org Git - llvm/commit
[LV] Vectorize GEPs
authorMatthew Simpson <mssimpso@codeaurora.org>
Thu, 23 Mar 2017 16:29:58 +0000 (16:29 +0000)
committerMatthew Simpson <mssimpso@codeaurora.org>
Thu, 23 Mar 2017 16:29:58 +0000 (16:29 +0000)
commit77a842c0a2f188f2d9b41b46aac9539937949535
tree627ecbb3ad1925fd303324fd124ba3abc368b961
parentde4fa9880719f50784a34b0065568428c574aa70
[LV] Vectorize GEPs

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.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298620 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Vectorize/LoopVectorize.cpp
test/Transforms/LoopVectorize/X86/consecutive-ptr-uniforms.ll
test/Transforms/LoopVectorize/X86/scatter_crash.ll
test/Transforms/LoopVectorize/vector-geps.ll [new file with mode: 0644]