[PATCH] D118566: [LoopVectorizer] Don't perform interleaving of predicated scalar loops

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 30 06:31:27 PST 2022


dmgreen created this revision.
dmgreen added reviewers: fhahn, david-arm, sdesmalen, spatel, wsmoses.
Herald added a subscriber: hiraditya.
dmgreen requested review of this revision.
Herald added a project: LLVM.

The vectorizer will choose at times to "vectorize" loop with a scalar factor (VF=1) with interleaving (IC > 1). This can produce better code than the unroller (notable for reductions where it can produce independent reduction chains that are combined after the loop). At times this is not very beneficial though, for example when runtime checks are needed or when the scalar code requires predication.

This addresses the second point, preventing the vectorizer from interleaving when the scalar loop will require predication. This prevents it from making a bit of a mess, that is worse than the original and better left for the unroller to unroll if beneficial. It helps reverse some of the regressions from D118090 <https://reviews.llvm.org/D118090>.


https://reviews.llvm.org/D118566

Files:
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/test/Transforms/LoopVectorize/AArch64/scalar_interleave.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118566.404374.patch
Type: text/x-patch
Size: 10725 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220130/4ce1cfc2/attachment.bin>


More information about the llvm-commits mailing list