[PATCH] D53612: [LV] Avoid vectorizing loops under opt for size that involve SCEV checks

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 23 14:18:23 PDT 2018


Ayal created this revision.
Ayal added reviewers: dorit, hsaito, dcaballe, fhahn, mkuper.
Herald added subscribers: llvm-commits, rkruppe, javed.absar.

The loop vectorizer may generate runtime SCEV checks for overflow and stride==1 cases, leading to execution of original scalar loop. The latter should be eliminated when optimizing for size. This patch fixes this behavior by preventing vectorization in such cases.

Reported by @uabelho in http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20181022/596443.html
Issue also occurs w/o "fold tail" patch, as demonstrated by additional tests.


Repository:
  rL LLVM

https://reviews.llvm.org/D53612

Files:
  lib/Transforms/Vectorize/LoopVectorize.cpp
  test/Transforms/LoopVectorize/X86/optsize.ll
  test/Transforms/LoopVectorize/pr30654-phiscev-sext-trunc.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53612.170750.patch
Type: text/x-patch
Size: 5807 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181023/8f283545/attachment.bin>


More information about the llvm-commits mailing list