[polly] r183798 - scop detection: run isValidLoop as early as possible

Sebastian Pop spop at codeaurora.org
Tue Jun 11 15:20:32 PDT 2013


Author: spop
Date: Tue Jun 11 17:20:32 2013
New Revision: 183798

URL: http://llvm.org/viewvc/llvm-project?rev=183798&view=rev
Log:
scop detection: run isValidLoop as early as possible

to discard regions with invalid loops before going through the contents of the
basic blocks

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=183798&r1=183797&r2=183798&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopDetection.cpp (original)
+++ polly/trunk/lib/Analysis/ScopDetection.cpp Tue Jun 11 17:20:32 2013
@@ -395,10 +395,6 @@ bool ScopDetection::isValidBasicBlock(Ba
     if (!isValidInstruction(*I, Context))
       return false;
 
-  Loop *L = LI->getLoopFor(&BB);
-  if (L && L->getHeader() == &BB && !isValidLoop(L, Context))
-    return false;
-
   return true;
 }
 
@@ -538,6 +534,13 @@ bool ScopDetection::allBlocksValid(Detec
   Region &R = Context.CurRegion;
 
   for (Region::block_iterator I = R.block_begin(), E = R.block_end(); I != E;
+       ++I) {
+    Loop *L = LI->getLoopFor(*I);
+    if (L && L->getHeader() == *I && !isValidLoop(L, Context))
+      return false;
+  }
+
+  for (Region::block_iterator I = R.block_begin(), E = R.block_end(); I != E;
        ++I)
     if (!isValidCFG(**I, Context))
       return false;





More information about the llvm-commits mailing list