summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
diff options
context:
space:
mode:
authorAyal Zaks <ayal.zaks@intel.com>2018-10-14 17:53:02 +0000
committerAyal Zaks <ayal.zaks@intel.com>2018-10-14 17:53:02 +0000
commite567b5b5267e10a18d1504a654b856c118208768 (patch)
treeba6e7deab034bd46424d2f7827653f3ca0622cd4 /llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
parent61471cc0901892895355d854f641057526da1f2f (diff)
downloadbcm5719-llvm-e567b5b5267e10a18d1504a654b856c118208768.tar.gz
bcm5719-llvm-e567b5b5267e10a18d1504a654b856c118208768.zip
[LV] Fix comments reported when not vectorizing single iteration loops; NFC
Landing this as a separate part of https://reviews.llvm.org/D50480, being a seemingly unrelated change ([LV] Vectorizing loops of arbitrary trip count without remainder under opt for size). llvm-svn: 344483
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/LoopVectorize.cpp')
-rw-r--r--llvm/lib/Transforms/Vectorize/LoopVectorize.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index e93cfb34156..2ba2f00b4a5 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -4558,8 +4558,15 @@ Optional<unsigned> LoopVectorizationCostModel::computeMaxVF(bool OptForSize) {
// If we optimize the program for size, avoid creating the tail loop.
LLVM_DEBUG(dbgs() << "LV: Found trip count: " << TC << '\n');
+ if (TC == 1) {
+ ORE->emit(createMissedAnalysis("SingleIterationLoop")
+ << "loop trip count is one, irrelevant for vectorization");
+ LLVM_DEBUG(dbgs() << "LV: Aborting, single iteration (non) loop.\n");
+ return None;
+ }
+
// If we don't know the precise trip count, don't try to vectorize.
- if (TC < 2) {
+ if (TC == 0) {
ORE->emit(
createMissedAnalysis("UnknownLoopCountComplexCFG")
<< "unable to calculate the loop count due to complex control flow");
OpenPOWER on IntegriCloud