summaryrefslogtreecommitdiffstats
path: root/polly/lib/Analysis/ScopDetection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'polly/lib/Analysis/ScopDetection.cpp')
-rw-r--r--polly/lib/Analysis/ScopDetection.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp
index 7aa629fb86e..bbf15ff1bf2 100644
--- a/polly/lib/Analysis/ScopDetection.cpp
+++ b/polly/lib/Analysis/ScopDetection.cpp
@@ -68,6 +68,11 @@
using namespace llvm;
using namespace polly;
+static cl::opt<bool>
+DetectScopsWithoutLoops("polly-detect-scops-in-functions-without-loops",
+ cl::desc("Detect scops in functions without loops"),
+ cl::Hidden, cl::init(false), cl::cat(PollyCategory));
+
static cl::opt<std::string>
OnlyFunction("polly-only-func", cl::desc("Only run on a single function"),
cl::value_desc("function-name"), cl::ValueRequired, cl::init(""),
@@ -625,9 +630,12 @@ void ScopDetection::printLocations(llvm::Function &F) {
}
bool ScopDetection::runOnFunction(llvm::Function &F) {
+ LI = &getAnalysis<LoopInfo>();
+ if (!DetectScopsWithoutLoops && LI->empty())
+ return false;
+
AA = &getAnalysis<AliasAnalysis>();
SE = &getAnalysis<ScalarEvolution>();
- LI = &getAnalysis<LoopInfo>();
RI = &getAnalysis<RegionInfo>();
Region *TopRegion = RI->getTopLevelRegion();
OpenPOWER on IntegriCloud