forked from OSchip/llvm-project
Add option to control reduction detection
llvm-svn: 245598
This commit is contained in:
parent
40985016b2
commit
d83b8a83ec
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue