projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
adfc971
)
ScopDetection: Make sure we do not accidentally divide by zero
author
Tobias Grosser
<tobias@grosser.es>
Thu, 8 Sep 2016 14:08:05 +0000
(14:08 +0000)
committer
Tobias Grosser
<tobias@grosser.es>
Thu, 8 Sep 2016 14:08:05 +0000
(14:08 +0000)
This code path is likely never triggered, but by still handling this case
locally we avoid warnings in clangs static analyzer.
llvm-svn: 280939
polly/lib/Analysis/ScopDetection.cpp
patch
|
blob
|
history
diff --git
a/polly/lib/Analysis/ScopDetection.cpp
b/polly/lib/Analysis/ScopDetection.cpp
index
586beaf
..
b891c02
100644
(file)
--- 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();