summaryrefslogtreecommitdiffstats
path: root/polly/lib/Analysis/ScopDetection.cpp
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2014-01-27 14:24:53 +0000
committerTobias Grosser <tobias@grosser.es>2014-01-27 14:24:53 +0000
commit4449e5265560d620cd8c7e01f9b636b70ed936fd (patch)
tree7e6c284a177868443dea4d443bf33de6123ce49f /polly/lib/Analysis/ScopDetection.cpp
parent26292ccc9121cc7751a3ba344e7295c324a4d73b (diff)
downloadbcm5719-llvm-4449e5265560d620cd8c7e01f9b636b70ed936fd.tar.gz
bcm5719-llvm-4449e5265560d620cd8c7e01f9b636b70ed936fd.zip
Detection: Allow to filter the regions that can be detected
llvm-svn: 200224
Diffstat (limited to 'polly/lib/Analysis/ScopDetection.cpp')
-rw-r--r--polly/lib/Analysis/ScopDetection.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp
index 4247e279749..9456ab3afa5 100644
--- a/polly/lib/Analysis/ScopDetection.cpp
+++ b/polly/lib/Analysis/ScopDetection.cpp
@@ -84,6 +84,13 @@ OnlyFunction("polly-only-func", cl::desc("Only run on a single function"),
cl::value_desc("function-name"), cl::ValueRequired, cl::init(""),
cl::cat(PollyCategory));
+static cl::opt<std::string>
+OnlyRegion("polly-only-region",
+ cl::desc("Only run on certain regions (The provided identifier must "
+ "appear in the name of the region's entry block"),
+ cl::value_desc("identifier"), cl::ValueRequired, cl::init(""),
+ cl::cat(PollyCategory));
+
static cl::opt<bool>
IgnoreAliasing("polly-ignore-aliasing",
cl::desc("Ignore possible aliasing of the array bases"),
@@ -626,12 +633,19 @@ bool ScopDetection::isValidRegion(DetectionContext &Context) const {
DEBUG(dbgs() << "Checking region: " << R.getNameStr() << "\n\t");
- // The toplevel region is no valid region.
if (R.isTopLevelRegion()) {
DEBUG(dbgs() << "Top level region is invalid"; dbgs() << "\n");
return false;
}
+ if (!R.getEntry()->getName().count(OnlyRegion)) {
+ DEBUG({
+ dbgs() << "Region entry does not match -polly-region-only";
+ dbgs() << "\n";
+ });
+ return false;
+ }
+
if (!R.getEnteringBlock()) {
BasicBlock *entry = R.getEntry();
Loop *L = LI->getLoopFor(entry);
OpenPOWER on IntegriCloud