diff options
| author | Johannes Doerfert <jdoerfert@codeaurora.org> | 2014-08-01 08:14:28 +0000 |
|---|---|---|
| committer | Johannes Doerfert <jdoerfert@codeaurora.org> | 2014-08-01 08:14:28 +0000 |
| commit | ed67f8baf6847712aab6437050341e00975e1221 (patch) | |
| tree | d6ad0c14245d0c07246f1a5913fdf4e312efb9b1 | |
| parent | f16a808292b79d078c2bbff3707be2c6c83df826 (diff) | |
| download | bcm5719-llvm-ed67f8baf6847712aab6437050341e00975e1221.tar.gz bcm5719-llvm-ed67f8baf6847712aab6437050341e00975e1221.zip | |
Change the semantics of is*Parallel
The functions isParallel, isInnermostParallel and IsOutermostParallel in
IslAstInfo will now return true even in the presence of broken reductions.
To compensate for this change the negated result of isReductionParallel can
be used.
llvm-svn: 214488
| -rw-r--r-- | polly/lib/CodeGen/IslAst.cpp | 18 | ||||
| -rw-r--r-- | polly/lib/CodeGen/IslCodeGeneration.cpp | 6 |
2 files changed, 12 insertions, 12 deletions
diff --git a/polly/lib/CodeGen/IslAst.cpp b/polly/lib/CodeGen/IslAst.cpp index bd65acae5ee..b9da4479463 100644 --- a/polly/lib/CodeGen/IslAst.cpp +++ b/polly/lib/CodeGen/IslAst.cpp @@ -112,13 +112,15 @@ static isl_printer *printLine(__isl_take isl_printer *Printer, static isl_printer *cbPrintFor(__isl_take isl_printer *Printer, __isl_take isl_ast_print_options *Options, __isl_keep isl_ast_node *Node, void *) { - if (IslAstInfo::isInnermostParallel(Node)) + if (IslAstInfo::isInnermostParallel(Node) && + !IslAstInfo::isReductionParallel(Node)) Printer = printLine(Printer, "#pragma simd"); if (IslAstInfo::isInnermost(Node) && IslAstInfo::isReductionParallel(Node)) Printer = printLine(Printer, "#pragma simd reduction"); - if (IslAstInfo::isOutermostParallel(Node)) + if (IslAstInfo::isOutermostParallel(Node) && + !IslAstInfo::isReductionParallel(Node)) Printer = printLine(Printer, "#pragma omp parallel for"); if (!IslAstInfo::isInnermost(Node) && IslAstInfo::isReductionParallel(Node)) @@ -344,22 +346,18 @@ bool IslAstInfo::isInnermost(__isl_keep isl_ast_node *Node) { } bool IslAstInfo::isParallel(__isl_keep isl_ast_node *Node) { - IslAstUserPayload *Payload = getNodePayload(Node); - return Payload && - (Payload->IsInnermostParallel || Payload->IsOutermostParallel) && - !Payload->IsReductionParallel; + return IslAstInfo::isInnermostParallel(Node) || + IslAstInfo::isOutermostParallel(Node); } bool IslAstInfo::isInnermostParallel(__isl_keep isl_ast_node *Node) { IslAstUserPayload *Payload = getNodePayload(Node); - return Payload && Payload->IsInnermostParallel && - !Payload->IsReductionParallel; + return Payload && Payload->IsInnermostParallel; } bool IslAstInfo::isOutermostParallel(__isl_keep isl_ast_node *Node) { IslAstUserPayload *Payload = getNodePayload(Node); - return Payload && Payload->IsOutermostParallel && - !Payload->IsReductionParallel; + return Payload && Payload->IsOutermostParallel; } bool IslAstInfo::isReductionParallel(__isl_keep isl_ast_node *Node) { diff --git a/polly/lib/CodeGen/IslCodeGeneration.cpp b/polly/lib/CodeGen/IslCodeGeneration.cpp index 641b7876ee3..90b73214bbe 100644 --- a/polly/lib/CodeGen/IslCodeGeneration.cpp +++ b/polly/lib/CodeGen/IslCodeGeneration.cpp @@ -314,7 +314,8 @@ void IslNodeBuilder::createForSequential(__isl_take isl_ast_node *For) { CmpInst::Predicate Predicate; bool Parallel; - Parallel = IslAstInfo::isInnermostParallel(For); + Parallel = IslAstInfo::isInnermostParallel(For) && + !IslAstInfo::isReductionParallel(For); Body = isl_ast_node_for_get_body(For); @@ -366,7 +367,8 @@ void IslNodeBuilder::createForSequential(__isl_take isl_ast_node *For) { void IslNodeBuilder::createFor(__isl_take isl_ast_node *For) { bool Vector = PollyVectorizerChoice != VECTORIZER_NONE; - if (Vector && IslAstInfo::isInnermostParallel(For)) { + if (Vector && IslAstInfo::isInnermostParallel(For) && + !IslAstInfo::isReductionParallel(For)) { int VectorWidth = getNumberOfIterations(For); if (1 < VectorWidth && VectorWidth <= 16) { createForVector(For, VectorWidth); |

