summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2015-08-20 19:08:11 +0000
committerTobias Grosser <tobias@grosser.es>2015-08-20 19:08:11 +0000
commitd83b8a83eccac2c7e931959238f6dd9fd7e98f36 (patch)
tree6a295cf4cac91cf5e2053efb974e142c3c1b17ba
parent40985016b2dcce0ca78c5b4d7b6a440588dc12d9 (diff)
downloadbcm5719-llvm-d83b8a83eccac2c7e931959238f6dd9fd7e98f36.tar.gz
bcm5719-llvm-d83b8a83eccac2c7e931959238f6dd9fd7e98f36.zip
Add option to control reduction detection
llvm-svn: 245598
-rw-r--r--polly/lib/Analysis/ScopInfo.cpp11
-rw-r--r--polly/test/ScopInfo/NonAffine/non_affine_loop_condition.ll9
2 files changed, 18 insertions, 2 deletions
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp
index 2f6e59c351d..d5e43970faf 100644
--- a/polly/lib/Analysis/ScopInfo.cpp
+++ b/polly/lib/Analysis/ScopInfo.cpp
@@ -80,6 +80,11 @@ static cl::opt<std::string> UserContextStr(
cl::desc("Provide additional constraints on the context parameters"),
cl::init(""), cl::cat(PollyCategory));
+static cl::opt<bool> DetectReductions("polly-detect-reductions",
+ cl::desc("Detect and exploit reductions"),
+ cl::Hidden, cl::ZeroOrMore,
+ cl::init(true), cl::cat(PollyCategory));
+
// Create a sequence of two schedules. Either argument may be null and is
// interpreted as the empty schedule. Can also return null if both schedules are
// empty.
@@ -894,7 +899,8 @@ ScopStmt::ScopStmt(Scop &parent, TempScop &tempScop, const Region &CurRegion,
buildAccesses(tempScop, Block, Block != EntryBB);
deriveAssumptions(Block);
}
- checkForReductions();
+ if (DetectReductions)
+ checkForReductions();
}
ScopStmt::ScopStmt(Scop &parent, TempScop &tempScop, const Region &CurRegion,
@@ -910,7 +916,8 @@ ScopStmt::ScopStmt(Scop &parent, TempScop &tempScop, const Region &CurRegion,
buildDomain(tempScop, CurRegion);
buildAccesses(tempScop, BB);
deriveAssumptions(BB);
- checkForReductions();
+ if (DetectReductions)
+ checkForReductions();
}
/// @brief Collect loads which might form a reduction chain with @p StoreMA
diff --git a/polly/test/ScopInfo/NonAffine/non_affine_loop_condition.ll b/polly/test/ScopInfo/NonAffine/non_affine_loop_condition.ll
index 66c41ef5d9d..bf17db95248 100644
--- a/polly/test/ScopInfo/NonAffine/non_affine_loop_condition.ll
+++ b/polly/test/ScopInfo/NonAffine/non_affine_loop_condition.ll
@@ -1,4 +1,11 @@
; RUN: opt %loadPolly -polly-scops -polly-allow-nonaffine-branches -polly-allow-nonaffine-loops -analyze < %s | FileCheck %s
+
+
+; RUN: opt %loadPolly -polly-scops -polly-detect-reductions \
+; RUN: -polly-allow-nonaffine-branches \
+; RUN: -polly-allow-nonaffine-loops -analyze < %s \
+; RUN: -polly-detect-reductions=false \
+; RUN: | FileCheck %s -check-prefix=NO-REDUCTION
;
; void f(int *A, int *C) {
; for (int i = 0; i < 1024; i++) {
@@ -24,6 +31,8 @@
; CHECK: { Stmt_bb3__TO__bb10[i0] -> MemRef_A[i0] };
; CHECK: }
+; NO-REDUCTION-NOT: Reduction Type: +
+
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define void @f(i32* %A, i32* %C) {
OpenPOWER on IntegriCloud