summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHongbin Zheng <etherzhhb@gmail.com>2012-04-07 12:29:27 +0000
committerHongbin Zheng <etherzhhb@gmail.com>2012-04-07 12:29:27 +0000
commit3a2d6035d2753676e5c61ba199a773a6d94cc6e5 (patch)
tree3d157d7479c63c673a4b715fabb3ee16b4d23e2f
parent94868e6cc6be446824e853c15fd3cf3932edbee8 (diff)
downloadbcm5719-llvm-3a2d6035d2753676e5c61ba199a773a6d94cc6e5.tar.gz
bcm5719-llvm-3a2d6035d2753676e5c61ba199a773a6d94cc6e5.zip
ScopDetection: Add some comments to function "expandRegion".
llvm-svn: 154259
-rw-r--r--polly/lib/Analysis/ScopDetection.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp
index edced06d8f0..951bb9b4c53 100644
--- a/polly/lib/Analysis/ScopDetection.cpp
+++ b/polly/lib/Analysis/ScopDetection.cpp
@@ -385,16 +385,22 @@ Region *ScopDetection::expandRegion(Region &R) {
DetectionContext Context(*TmpRegion, *AA, false /*verifying*/);
DEBUG(dbgs() << "\t\tTrying " << TmpRegion->getNameStr() << "\n");
+ // Stop the expansion if there is any invalid block.
if (!allBlocksValid(Context))
break;
if (isValidExit(Context)) {
+ // If TmpRegion also has a valid exit, make it become the cadidate of the
+ // largest region as a valid SCoP.
if (CurrentRegion != &R)
delete CurrentRegion;
CurrentRegion = TmpRegion;
}
+ // Go on expand the region to find the largest region as a valid SCoP no
+ // matter it has a valid exit or not, because the expanded region may has
+ // a valid exit.
Region *TmpRegion2 = TmpRegion->getExpandedRegion();
if (TmpRegion != &R && TmpRegion != CurrentRegion)
OpenPOWER on IntegriCloud