[PATCH] D70298: [LV] Avoid considering scalar-with-predication instructions as also uniform-after-vectorization, fix PR40816

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 15 02:24:17 PST 2019


Ayal created this revision.
Ayal added reviewers: fhahn, hsaito, rengolin, dcaballe, gilr.
Herald added subscribers: llvm-commits, rkruppe, hiraditya.
Herald added a project: LLVM.

Instructions identified as "scalar with predication" will be "vectorized" using a replicating region. If such instructions are also optimized as "uniform after vectorization", namely when only the first of VF lanes is used, such a replicating region becomes erroneous - only the first instance of the region can and should be formed. Fix such cases by not considering such instructions as "uniform after vectorization".

A TODO is left as such cases could be optimized by implementing single instance regions, but noting that such cases are rare. The specific case of PR40816 should be optimized by not vectorizing such instructions at all but instead recognizing them as DeadInstructions, or employing indvars to rid them before LV as discussed in https://reviews.llvm.org/D68577#1742745.

The added test case is a slight modification of the original one reported in the PR: the access pattern used here is not strided, to avoid the need for "-enable-interleaved-mem-accesses=0". This is a separate issue that calls for a separate patch.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D70298

Files:
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/test/Transforms/LoopVectorize/X86/consecutive-ptr-uniforms.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70298.229469.patch
Type: text/x-patch
Size: 9150 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191115/86a36a65/attachment.bin>


More information about the llvm-commits mailing list