OSDN Git Service

[LoopVectorize] Make interleaved-accesses analysis less conservative about
authorDorit Nuzman <dorit.nuzman@intel.com>
Sun, 30 Oct 2016 12:23:26 +0000 (12:23 +0000)
committerDorit Nuzman <dorit.nuzman@intel.com>
Sun, 30 Oct 2016 12:23:26 +0000 (12:23 +0000)
commitb10d92715814802a020d7438ec354ded46219769
tree3aafa500ce0eb09fc25ac223f867fe03e19084b8
parent648888d1c23187d01000ea4ae5811e6a0d880fcd
[LoopVectorize] Make interleaved-accesses analysis less conservative about
possible pointer-wrap-around concerns, in some cases.

Before this patch, collectConstStridedAccesses (part of interleaved-accesses
analysis) called getPtrStride with [Assume=false, ShouldCheckWrap=true] when
examining all candidate pointers. This is too conservative. Instead, this
patch makes collectConstStridedAccesses use an optimistic approach, calling
getPtrStride with [Assume=true, ShouldCheckWrap=false], and then, once the
candidate interleave groups have been formed, revisits the pointer-wrapping
analysis but only where it matters: namely, in groups that have gaps, and where
the gaps are not at the very end of the group (in which case the loop is
peeled). This second time getPtrStride is called with [Assume=false,
ShouldCheckWrap=true], but this could further be improved to using Assume=true,
once we also add the logic to track that we are not going to meet the scev
runtime checks threshold.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285517 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Vectorize/LoopVectorize.cpp
test/Transforms/LoopVectorize/AArch64/gather-cost.ll
test/Transforms/LoopVectorize/ARM/gather-cost.ll
test/Transforms/LoopVectorize/X86/gather-cost.ll
test/Transforms/LoopVectorize/interleaved-accesses-1.ll [new file with mode: 0644]
test/Transforms/LoopVectorize/interleaved-accesses-2.ll [new file with mode: 0644]
test/Transforms/LoopVectorize/interleaved-accesses-3.ll [new file with mode: 0644]