[polly] r183113 - scop detection: do not run scop detection on regions without loops
Sebastian Pop
spop at codeaurora.org
Mon Jun 3 09:35:37 PDT 2013
Author: spop
Date: Mon Jun 3 11:35:37 2013
New Revision: 183113
URL: http://llvm.org/viewvc/llvm-project?rev=183113&view=rev
Log:
scop detection: do not run scop detection on regions without loops
otherwise, use -polly-detect-scops-in-regions-without-loops to also detect scops
in regions without loops
Modified:
polly/trunk/lib/Analysis/ScopDetection.cpp
polly/trunk/test/Cloog/CodeGen/constant_condition.ll
polly/trunk/test/Isl/CodeGen/constant_condition.ll
polly/trunk/test/Isl/CodeGen/simple_non_single_entry.ll
polly/trunk/test/ScheduleOptimizer/2012-10-14-Zero-Bands.ll
polly/trunk/test/ScopDetect/parametric-multiply-in-scev.ll
polly/trunk/test/ScopDetect/simple_non_single_entry.ll
Modified: polly/trunk/lib/Analysis/ScopDetection.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopDetection.cpp?rev=183113&r1=183112&r2=183113&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopDetection.cpp (original)
+++ polly/trunk/lib/Analysis/ScopDetection.cpp Mon Jun 3 11:35:37 2013
@@ -73,6 +73,11 @@ DetectScopsWithoutLoops("polly-detect-sc
cl::desc("Detect scops in functions without loops"),
cl::Hidden, cl::init(false), cl::cat(PollyCategory));
+static cl::opt<bool>
+DetectRegionsWithoutLoops("polly-detect-scops-in-regions-without-loops",
+ cl::desc("Detect scops in regions 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(""),
@@ -466,8 +471,20 @@ Region *ScopDetection::expandRegion(Regi
return LastValidRegion;
}
+static bool regionWithoutLoops(Region &R, LoopInfo *LI) {
+ for (Region::block_iterator I = R.block_begin(), E = R.block_end(); I != E;
+ ++I)
+ if (R.contains(LI->getLoopFor(*I)))
+ return false;
+
+ return true;
+}
void ScopDetection::findScops(Region &R) {
+
+ if (!DetectRegionsWithoutLoops && regionWithoutLoops(R, LI))
+ return;
+
DetectionContext Context(R, *AA, false /*verifying*/);
LastFailure = "";
Modified: polly/trunk/test/Cloog/CodeGen/constant_condition.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Cloog/CodeGen/constant_condition.ll?rev=183113&r1=183112&r2=183113&view=diff
==============================================================================
--- polly/trunk/test/Cloog/CodeGen/constant_condition.ll (original)
+++ polly/trunk/test/Cloog/CodeGen/constant_condition.ll Mon Jun 3 11:35:37 2013
@@ -1,4 +1,4 @@
-;RUN: opt %loadPolly %defaultOpts -polly-detect-scops-in-functions-without-loops -polly-cloog -analyze < %s | FileCheck %s
+;RUN: opt %loadPolly %defaultOpts -polly-detect-scops-in-regions-without-loops -polly-detect-scops-in-functions-without-loops -polly-cloog -analyze < %s | FileCheck %s
;#include <string.h>
;int A[1];
Modified: polly/trunk/test/Isl/CodeGen/constant_condition.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/CodeGen/constant_condition.ll?rev=183113&r1=183112&r2=183113&view=diff
==============================================================================
--- polly/trunk/test/Isl/CodeGen/constant_condition.ll (original)
+++ polly/trunk/test/Isl/CodeGen/constant_condition.ll Mon Jun 3 11:35:37 2013
@@ -1,4 +1,4 @@
-;RUN: opt %loadPolly %defaultOpts -polly-detect-scops-in-functions-without-loops -polly-ast -analyze < %s | FileCheck %s
+;RUN: opt %loadPolly %defaultOpts -polly-detect-scops-in-regions-without-loops -polly-detect-scops-in-functions-without-loops -polly-ast -analyze < %s | FileCheck %s
;#include <string.h>
;int A[1];
Modified: polly/trunk/test/Isl/CodeGen/simple_non_single_entry.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/CodeGen/simple_non_single_entry.ll?rev=183113&r1=183112&r2=183113&view=diff
==============================================================================
--- polly/trunk/test/Isl/CodeGen/simple_non_single_entry.ll (original)
+++ polly/trunk/test/Isl/CodeGen/simple_non_single_entry.ll Mon Jun 3 11:35:37 2013
@@ -1,5 +1,5 @@
-; RUN: opt %loadPolly -polly-codegen-isl -analyze < %s | FileCheck %s
-; RUN: opt %loadPolly -polly-codegen-isl -S < %s | FileCheck %s -check-prefix=CHECK-CODE
+; RUN: opt %loadPolly -polly-detect-scops-in-regions-without-loops -polly-codegen-isl -analyze < %s | FileCheck %s
+; RUN: opt %loadPolly -polly-detect-scops-in-regions-without-loops -polly-codegen-isl -S < %s | FileCheck %s -check-prefix=CHECK-CODE
; void f(long A[], long N) {
; long i;
Modified: polly/trunk/test/ScheduleOptimizer/2012-10-14-Zero-Bands.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScheduleOptimizer/2012-10-14-Zero-Bands.ll?rev=183113&r1=183112&r2=183113&view=diff
==============================================================================
--- polly/trunk/test/ScheduleOptimizer/2012-10-14-Zero-Bands.ll (original)
+++ polly/trunk/test/ScheduleOptimizer/2012-10-14-Zero-Bands.ll Mon Jun 3 11:35:37 2013
@@ -1,4 +1,4 @@
-; RUN: opt %loadPolly -polly-detect-scops-in-functions-without-loops -polly-opt-isl -analyze < %s | FileCheck %s
+; RUN: opt %loadPolly -polly-detect-scops-in-regions-without-loops -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/trunk/test/ScopDetect/parametric-multiply-in-scev.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopDetect/parametric-multiply-in-scev.ll?rev=183113&r1=183112&r2=183113&view=diff
==============================================================================
--- polly/trunk/test/ScopDetect/parametric-multiply-in-scev.ll (original)
+++ polly/trunk/test/ScopDetect/parametric-multiply-in-scev.ll Mon Jun 3 11:35:37 2013
@@ -1,5 +1,5 @@
-; 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
+; RUN: opt %loadPolly -polly-detect-scops-in-regions-without-loops -polly-detect-scops-in-functions-without-loops -polly-detect -analyze < %s | FileCheck %s
+; RUN: opt %loadPolly -polly-detect-scops-in-regions-without-loops -polly-detect-scops-in-functions-without-loops -polly-detect -polly-codegen-scev -analyze < %s | FileCheck %s
; foo(float *A, long n, long k) {
Modified: polly/trunk/test/ScopDetect/simple_non_single_entry.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopDetect/simple_non_single_entry.ll?rev=183113&r1=183112&r2=183113&view=diff
==============================================================================
--- polly/trunk/test/ScopDetect/simple_non_single_entry.ll (original)
+++ polly/trunk/test/ScopDetect/simple_non_single_entry.ll Mon Jun 3 11:35:37 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-regions-without-loops -polly-detect -analyze < %s | FileCheck %s
+; RUN: opt %loadPolly -polly-detect-scops-in-regions-without-loops -polly-detect -polly-codegen-scev -analyze < %s | FileCheck %s
; void f(long A[], long N) {
; long i;
More information about the llvm-commits
mailing list