[LV/LAA] Avoid specializing a loop for stride=1 when this predicate implies a
authorDorit Nuzman <dorit.nuzman@intel.com>
Sun, 5 Nov 2017 16:53:15 +0000 (16:53 +0000)
committerDorit Nuzman <dorit.nuzman@intel.com>
Sun, 5 Nov 2017 16:53:15 +0000 (16:53 +0000)
commiteb13dd3eac777d1b3cfcbf6d28840c2e0a66e892
treede5c6f419dce552984d3385b67f0b12356bcc458
parent92403c12b5d81c6877e5fd037974eeb8b2075ec4
[LV/LAA] Avoid specializing a loop for stride=1 when this predicate implies a
single-iteration loop

This fixes PR34681. Avoid adding the "Stride == 1" predicate when we know that
Stride >= Trip-Count. Such a predicate will effectively optimize a single
or zero iteration loop, as Trip-Count <= Stride == 1.

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

llvm-svn: 317438
llvm/lib/Analysis/LoopAccessAnalysis.cpp
llvm/test/Transforms/LoopVectorize/pr34681.ll [new file with mode: 0644]
llvm/test/Transforms/LoopVectorize/version-mem-access.ll