commit 8ae4ed723d58c880923061db8b5f004450295df3
Author: ether <ethe...@gmail.com>
Date: Mon Apr 11 15:57:36 2011 +0800
ScopDetection: Only allow simple region as the top region of the scop.
diff --git a/lib/Analysis/ScopDetection.cpp b/lib/Analysis/ScopDetection.cpp
index 5cd714b..7bbd89d 100644
--- a/lib/Analysis/ScopDetection.cpp
+++ b/lib/Analysis/ScopDetection.cpp
@@ -576,21 +576,18 @@ bool ScopDetection::isValidRegion(DetectionContext &Context) const {
return false;
}
- if (!allBlocksValid(Context))
+ // Only a simple region is allowed.
+ if (!R.isSimple()) {
+ DEBUG(dbgs() << "Region not simple: " << R.getNameStr() << '\n');
+ STATSCOP(SimpleRegion);
return false;
+ }
- if (!isValidExit(Context))
+ if (!allBlocksValid(Context))
return false;
- BasicBlock *entry = R.getEntry();
- if (Loop *L = LI->getLoopFor(entry))
- if (L->getHeader() == entry && !R.isSimple()) {
- errs() << "Warning: Run a region simplify pass to increase coverage\n";
- if (!Context.Verifying) {
- STATSCOP(SimpleRegion);
- }
+ if (!isValidExit(Context))
return false;
- }
DEBUG(dbgs() << "OK\n");
return true;