diff options
Diffstat (limited to 'polly/lib/Analysis/ScopDetection.cpp')
-rw-r--r-- | polly/lib/Analysis/ScopDetection.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp index 594d656a284..c0dba128beb 100644 --- a/polly/lib/Analysis/ScopDetection.cpp +++ b/polly/lib/Analysis/ScopDetection.cpp @@ -1029,8 +1029,14 @@ bool ScopDetection::canUseISLTripCount(Loop *L, // Ensure the loop has valid exiting blocks as well as latches, otherwise we // need to overapproximate it as a boxed loop. SmallVector<BasicBlock *, 4> LoopControlBlocks; - L->getLoopLatches(LoopControlBlocks); L->getExitingBlocks(LoopControlBlocks); + + // Loops without exiting blocks cannot be handled by the schedule generation + // as it depends on a region covering that is not given. + if (LoopControlBlocks.empty()) + return false; + + L->getLoopLatches(LoopControlBlocks); for (BasicBlock *ControlBB : LoopControlBlocks) { if (!isValidCFG(*ControlBB, true, false, Context)) return false; |