[polly] r280939 - ScopDetection: Make sure we do not accidentally divide by zero
Tobias Grosser via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 8 07:08:05 PDT 2016
Author: grosser
Date: Thu Sep 8 09:08:05 2016
New Revision: 280939
URL: http://llvm.org/viewvc/llvm-project?rev=280939&view=rev
Log:
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.
Modified:
polly/trunk/lib/Analysis/ScopDetection.cpp
Modified: polly/trunk/lib/Analysis/ScopDetection.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopDetection.cpp?rev=280939&r1=280938&r2=280939&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopDetection.cpp (original)
+++ polly/trunk/lib/Analysis/ScopDetection.cpp Thu Sep 8 09:08:05 2016
@@ -1307,6 +1307,9 @@ bool ScopDetection::hasSufficientCompute
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();
More information about the llvm-commits
mailing list