mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-11 21:38:19 +00:00
PR21302. Vectorize only bottom-tested loops.
rdar://problem/18886083 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223171 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -3537,6 +3537,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');
|
||||
|
Reference in New Issue
Block a user