[llvm-branch-commits] [polly] r183382 - scop detection: only handle functions with loops

Tobias Grosser grosser at fim.uni-passau.de
Wed Jun 5 19:49:41 PDT 2013


Author: grosser
Date: Wed Jun  5 21:48:53 2013
New Revision: 183382

URL: http://llvm.org/viewvc/llvm-project?rev=183382&view=rev
Log:
scop detection: only handle functions with loops

to detect scops in functions with no loops, use -polly-detect-scops-in-functions-without-loops

Merged from: https://llvm.org/svn/llvm-project/polly/trunk@182941

Modified:
    polly/branches/release_33/lib/Analysis/ScopDetection.cpp
    polly/branches/release_33/test/Cloog/CodeGen/constant_condition.ll
    polly/branches/release_33/test/Isl/CodeGen/constant_condition.ll
    polly/branches/release_33/test/ScheduleOptimizer/2012-10-14-Zero-Bands.ll
    polly/branches/release_33/test/ScopDetect/parametric-multiply-in-scev.ll

Modified: polly/branches/release_33/lib/Analysis/ScopDetection.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/branches/release_33/lib/Analysis/ScopDetection.cpp?rev=183382&r1=183381&r2=183382&view=diff
==============================================================================
--- polly/branches/release_33/lib/Analysis/ScopDetection.cpp (original)
+++ polly/branches/release_33/lib/Analysis/ScopDetection.cpp Wed Jun  5 21:48:53 2013
@@ -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:
 }
 
 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();
 

Modified: polly/branches/release_33/test/Cloog/CodeGen/constant_condition.ll
URL: http://llvm.org/viewvc/llvm-project/polly/branches/release_33/test/Cloog/CodeGen/constant_condition.ll?rev=183382&r1=183381&r2=183382&view=diff
==============================================================================
--- polly/branches/release_33/test/Cloog/CodeGen/constant_condition.ll (original)
+++ polly/branches/release_33/test/Cloog/CodeGen/constant_condition.ll Wed Jun  5 21:48:53 2013
@@ -1,4 +1,4 @@
-;RUN: opt %loadPolly %defaultOpts -polly-cloog -analyze < %s | FileCheck %s
+;RUN: opt %loadPolly %defaultOpts -polly-detect-scops-in-functions-without-loops -polly-cloog -analyze < %s | FileCheck %s
 
 ;#include <string.h>
 ;int A[1];

Modified: polly/branches/release_33/test/Isl/CodeGen/constant_condition.ll
URL: http://llvm.org/viewvc/llvm-project/polly/branches/release_33/test/Isl/CodeGen/constant_condition.ll?rev=183382&r1=183381&r2=183382&view=diff
==============================================================================
--- polly/branches/release_33/test/Isl/CodeGen/constant_condition.ll (original)
+++ polly/branches/release_33/test/Isl/CodeGen/constant_condition.ll Wed Jun  5 21:48:53 2013
@@ -1,4 +1,4 @@
-;RUN: opt %loadPolly %defaultOpts -polly-ast -analyze < %s | FileCheck %s
+;RUN: opt %loadPolly %defaultOpts -polly-detect-scops-in-functions-without-loops -polly-ast -analyze < %s | FileCheck %s
 
 ;#include <string.h>
 ;int A[1];

Modified: polly/branches/release_33/test/ScheduleOptimizer/2012-10-14-Zero-Bands.ll
URL: http://llvm.org/viewvc/llvm-project/polly/branches/release_33/test/ScheduleOptimizer/2012-10-14-Zero-Bands.ll?rev=183382&r1=183381&r2=183382&view=diff
==============================================================================
--- polly/branches/release_33/test/ScheduleOptimizer/2012-10-14-Zero-Bands.ll (original)
+++ polly/branches/release_33/test/ScheduleOptimizer/2012-10-14-Zero-Bands.ll Wed Jun  5 21:48:53 2013
@@ -1,4 +1,4 @@
-; RUN: opt %loadPolly -polly-opt-isl -analyze < %s | FileCheck %s
+; RUN: opt %loadPolly -polly-detect-scops-in-functions-without-loops -polly-opt-isl -analyze < %s | FileCheck %s
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 

Modified: polly/branches/release_33/test/ScopDetect/parametric-multiply-in-scev.ll
URL: http://llvm.org/viewvc/llvm-project/polly/branches/release_33/test/ScopDetect/parametric-multiply-in-scev.ll?rev=183382&r1=183381&r2=183382&view=diff
==============================================================================
--- polly/branches/release_33/test/ScopDetect/parametric-multiply-in-scev.ll (original)
+++ polly/branches/release_33/test/ScopDetect/parametric-multiply-in-scev.ll Wed Jun  5 21:48:53 2013
@@ -1,5 +1,5 @@
-; RUN: opt %loadPolly -polly-detect -analyze < %s | FileCheck %s
-; RUN: opt %loadPolly -polly-detect -polly-codegen-scev -analyze < %s | FileCheck %s
+; RUN: opt %loadPolly -polly-detect-scops-in-functions-without-loops -polly-detect -analyze < %s | FileCheck %s
+; RUN: opt %loadPolly -polly-detect-scops-in-functions-without-loops -polly-detect -polly-codegen-scev -analyze < %s | FileCheck %s
 
 
 ;  foo(float *A, long n, long k) {





More information about the llvm-branch-commits mailing list