Author: mzolotukhin
Date: Fri Dec 5 16:31:29 2014
New Revision: 223535
URL: http://llvm.org/viewvc/llvm-project?rev=223535&view=rev
Log:
Merging r223171:
PR21302. Vectorize only bottom-tested loops.
rdar://problem/18886083
Added:
llvm/branches/release_35/test/Transforms/LoopVectorize/loop-form.ll
- copied unchanged from r223171,
llvm/trunk/test/Transforms/LoopVectorize/loop-form.ll
Modified:
llvm/branches/release_35/ (props changed)
llvm/branches/release_35/lib/Transforms/Vectorize/LoopVectorize.cpp
Propchange: llvm/branches/release_35/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 5 16:31:29 2014
@@ -1,3 +1,3 @@
/llvm/branches/Apple/Pertwee:110850,110961
/llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,213653,213665,213726,213749,213773,213793,213798-213799,213815,213847,213880,213883-213884,213894-213896,213899,213915,213966,213999,214060,214129,214180,214287,214331,214423,214429,214519,214670,214674,214679,215685,215711,215806,216064,216262,216531,216920,217257,218745,221009,221408,221453,223163,223170
+/llvm/trunk:155241,213653,213665,213726,213749,213773,213793,213798-213799,213815,213847,213880,213883-213884,213894-213896,213899,213915,213966,213999,214060,214129,214180,214287,214331,214423,214429,214519,214670,214674,214679,215685,215711,215806,216064,216262,216531,216920,217257,218745,221009,221408,221453,223163,223170-223171
Modified: llvm/branches/release_35/lib/Transforms/Vectorize/LoopVectorize.cpp
URL:
http://llvm.org/viewvc/llvm-project/llvm/branches/release_35/lib/Transforms/Vectorize/LoopVectorize.cpp?rev=223535&r1=223534&r2=223535&view=diff
==============================================================================
--- llvm/branches/release_35/lib/Transforms/Vectorize/LoopVectorize.cpp
(original)
+++ llvm/branches/release_35/lib/Transforms/Vectorize/LoopVectorize.cpp Fri Dec
5 16:31:29 2014
@@ -3466,6 +3466,15 @@ bool LoopVectorizationLegality::canVecto
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');
_______________________________________________
llvm-branch-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-branch-commits