diff options
| author | Tobias Grosser <tobias@grosser.es> | 2016-09-08 14:08:05 +0000 |
|---|---|---|
| committer | Tobias Grosser <tobias@grosser.es> | 2016-09-08 14:08:05 +0000 |
| commit | b316dc166f8ad41c6d845870e065ded9c1c54399 (patch) | |
| tree | c61dd61b22d67dfc22821872cae41a243aa9adc8 /polly/lib/Analysis/ScopDetection.cpp | |
| parent | adfc971820733e0e9b9143d46558197c52abb831 (diff) | |
| download | bcm5719-llvm-b316dc166f8ad41c6d845870e065ded9c1c54399.tar.gz bcm5719-llvm-b316dc166f8ad41c6d845870e065ded9c1c54399.zip | |
ScopDetection: Make sure we do not accidentally divide by zero
This code path is likely never triggered, but by still handling this case
locally we avoid warnings in clangs static analyzer.
llvm-svn: 280939
Diffstat (limited to 'polly/lib/Analysis/ScopDetection.cpp')
| -rw-r--r-- | polly/lib/Analysis/ScopDetection.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp index 586beaf2741..b891c020410 100644 --- a/polly/lib/Analysis/ScopDetection.cpp +++ b/polly/lib/Analysis/ScopDetection.cpp @@ -1307,6 +1307,9 @@ bool ScopDetection::hasSufficientCompute(DetectionContext &Context, int NumLoops) const { int InstCount = 0; + if (NumLoops == 0) + return false; + for (auto *BB : Context.CurRegion.blocks()) if (Context.CurRegion.contains(LI->getLoopFor(BB))) InstCount += BB->size(); |

