diff --git a/polly/include/polly/CodeGen/IslAst.h b/polly/include/polly/CodeGen/IslAst.h --- a/polly/include/polly/CodeGen/IslAst.h +++ b/polly/include/polly/CodeGen/IslAst.h @@ -151,7 +151,7 @@ static bool isInnermostParallel(const isl::ast_node &Node); /// Is this loop a reduction parallel loop? - static bool isReductionParallel(__isl_keep isl_ast_node *Node); + static bool isReductionParallel(const isl::ast_node &Node); /// Will the loop be run as thread parallel? static bool isExecutedInParallel(__isl_keep isl_ast_node *Node); @@ -160,8 +160,7 @@ static __isl_give isl_union_map *getSchedule(__isl_keep isl_ast_node *Node); /// Get minimal dependence distance or nullptr if not available. - static __isl_give isl_pw_aff * - getMinimalDependenceDistance(__isl_keep isl_ast_node *Node); + static isl_pw_aff *getMinimalDependenceDistance(const isl::ast_node &Node); /// Get the nodes broken reductions or a nullptr if not available. static MemoryAccessSet *getBrokenReductions(__isl_keep isl_ast_node *Node); diff --git a/polly/lib/CodeGen/IslAst.cpp b/polly/lib/CodeGen/IslAst.cpp --- a/polly/lib/CodeGen/IslAst.cpp +++ b/polly/lib/CodeGen/IslAst.cpp @@ -171,7 +171,8 @@ static isl_printer *cbPrintFor(__isl_take isl_printer *Printer, __isl_take isl_ast_print_options *Options, __isl_keep isl_ast_node *Node, void *) { - isl_pw_aff *DD = IslAstInfo::getMinimalDependenceDistance(Node); + isl_pw_aff *DD = + IslAstInfo::getMinimalDependenceDistance(isl::manage_copy(Node)); const std::string BrokenReductionsStr = getBrokenReductionsStr(Node); const std::string KnownParallelStr = "#pragma known-parallel"; const std::string DepDisPragmaStr = "#pragma minimal dependence distance: "; @@ -478,7 +479,7 @@ NumInnermostParallel++; if (IslAstInfo::isOutermostParallel(isl::manage_copy(Node))) NumOutermostParallel++; - if (IslAstInfo::isReductionParallel(Node)) + if (IslAstInfo::isReductionParallel(isl::manage_copy(Node))) NumReductionParallel++; if (IslAstInfo::isExecutedInParallel(Node)) NumExecutedInParallel++; @@ -608,8 +609,8 @@ return Payload && Payload->IsOutermostParallel; } -bool IslAstInfo::isReductionParallel(__isl_keep isl_ast_node *Node) { - IslAstUserPayload *Payload = getNodePayload(isl::manage_copy(Node)); +bool IslAstInfo::isReductionParallel(const isl::ast_node &Node) { + IslAstUserPayload *Payload = getNodePayload(Node); return Payload && Payload->IsReductionParallel; } @@ -630,7 +631,7 @@ return false; return isOutermostParallel(isl::manage_copy(Node)) && - !isReductionParallel(Node); + !isReductionParallel(isl::manage_copy(Node)); } __isl_give isl_union_map * @@ -640,8 +641,8 @@ } __isl_give isl_pw_aff * -IslAstInfo::getMinimalDependenceDistance(__isl_keep isl_ast_node *Node) { - IslAstUserPayload *Payload = getNodePayload(isl::manage_copy(Node)); +IslAstInfo::getMinimalDependenceDistance(const isl::ast_node &Node) { + IslAstUserPayload *Payload = getNodePayload(Node); return Payload ? Payload->MinimalDependenceDistance.copy() : nullptr; } diff --git a/polly/lib/CodeGen/IslNodeBuilder.cpp b/polly/lib/CodeGen/IslNodeBuilder.cpp --- a/polly/lib/CodeGen/IslNodeBuilder.cpp +++ b/polly/lib/CodeGen/IslNodeBuilder.cpp @@ -778,7 +778,7 @@ bool Vector = PollyVectorizerChoice == VECTORIZER_POLLY; if (Vector && IslAstInfo::isInnermostParallel(isl::manage_copy(For)) && - !IslAstInfo::isReductionParallel(For)) { + !IslAstInfo::isReductionParallel(isl::manage_copy(For))) { int VectorWidth = getNumberOfIterations(isl::manage_copy(For)); if (1 < VectorWidth && VectorWidth <= 16 && !hasPartialAccesses(For)) { createForVector(For, VectorWidth); @@ -790,8 +790,8 @@ createForParallel(For); return; } - bool Parallel = - (IslAstInfo::isParallel(For) && !IslAstInfo::isReductionParallel(For)); + bool Parallel = (IslAstInfo::isParallel(For) && + !IslAstInfo::isReductionParallel(isl::manage_copy(For))); createForSequential(isl::manage(For), Parallel); }