diff options
| author | Johannes Doerfert <doerfert@cs.uni-saarland.de> | 2016-04-03 23:09:06 +0000 |
|---|---|---|
| committer | Johannes Doerfert <doerfert@cs.uni-saarland.de> | 2016-04-03 23:09:06 +0000 |
| commit | d5edbd61a15b5416b9d10dbb4cb058a7493af75d (patch) | |
| tree | b169d7b668dc5dc3022d8c4a378097fe32a5188a /polly/lib/Analysis/ScopDetection.cpp | |
| parent | fef609f15e09b4c42334a8ff8c2de29af502ff56 (diff) | |
| download | bcm5719-llvm-d5edbd61a15b5416b9d10dbb4cb058a7493af75d.tar.gz bcm5719-llvm-d5edbd61a15b5416b9d10dbb4cb058a7493af75d.zip | |
[FIX] Do not create a SCoP in the presence of infinite loops
If a loop has no exiting blocks the region covering we use during
schedule genertion might not cover that loop properly. For now we bail
out as we would not optimize these loops anyway.
llvm-svn: 265280
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; |

