aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2014-12-09 07:48:25 +0000
committerDimitry Andric <dim@FreeBSD.org>2014-12-09 07:48:25 +0000
commit292d912acf15d9f7b3ce2961275a86a71fdf08e8 (patch)
tree6dbe335b4a077a2b8f4c64e07a8def9a2e3e6a2a /contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
parentd7e0694a595722a6839f88ec7219a981ed734b95 (diff)
Notes
Diffstat (limited to 'contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp')
-rw-r--r--contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 531d349d845d..c1e8df9512a6 100644
--- a/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -3466,6 +3466,15 @@ bool LoopVectorizationLegality::canVectorize() {
return false;
}
+ // We only handle bottom-tested loops, i.e. loop in which the condition is
+ // checked at the end of each iteration. With that we can assume that all
+ // instructions in the loop are executed the same number of times.
+ if (TheLoop->getExitingBlock() != TheLoop->getLoopLatch()) {
+ emitAnalysis(
+ Report() << "loop control flow is not understood by vectorizer");
+ return false;
+ }
+
// We need to have a loop header.
DEBUG(dbgs() << "LV: Found a loop: " <<
TheLoop->getHeader()->getName() << '\n');