From: Tobias Grosser Date: Sun, 6 Aug 2017 19:31:27 +0000 (+0000) Subject: [ScopInfo] Translate Scop::getIdForParam to isl++ [NFC] X-Git-Tag: llvmorg-6.0.0-rc1~10744 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9a63570b13a261e15682b8e197d6bfae4854ba1e;p=platform%2Fupstream%2Fllvm.git [ScopInfo] Translate Scop::getIdForParam to isl++ [NFC] llvm-svn: 310220 --- diff --git a/polly/include/polly/ScopInfo.h b/polly/include/polly/ScopInfo.h index 3b7e7d4..cdc6182 100644 --- a/polly/include/polly/ScopInfo.h +++ b/polly/include/polly/ScopInfo.h @@ -2419,7 +2419,7 @@ public: /// @param Parameter A SCEV that was recognized as a Parameter. /// /// @return The corresponding isl_id or NULL otherwise. - __isl_give isl_id *getIdForParam(const SCEV *Parameter) const; + isl::id getIdForParam(const SCEV *Parameter) const; /// Get the maximum region of this static control part. /// diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index 77d60e7..cbcffbb 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -2193,10 +2193,10 @@ void Scop::addParams(const ParameterSetTy &NewParameters) { } } -__isl_give isl_id *Scop::getIdForParam(const SCEV *Parameter) const { +isl::id Scop::getIdForParam(const SCEV *Parameter) const { // Normalize the SCEV to get the representing element for an invariant load. Parameter = getRepresentingInvariantLoadSCEV(Parameter); - return isl_id_copy(ParameterIds.lookup(Parameter)); + return isl::manage(isl_id_copy(ParameterIds.lookup(Parameter))); } __isl_give isl_set * @@ -3903,7 +3903,7 @@ void Scop::addInvariantLoads(ScopStmt &Stmt, InvariantAccessesTy &InvMAs) { if (!Values.count(AccInst)) continue; - if (isl_id *ParamId = getIdForParam(Parameter)) { + if (isl_id *ParamId = getIdForParam(Parameter).release()) { int Dim = isl_set_find_dim_by_id(DomainCtx, isl_dim_param, ParamId); if (Dim >= 0) DomainCtx = isl_set_eliminate(DomainCtx, isl_dim_param, Dim, 1); @@ -4292,7 +4292,7 @@ isl::space Scop::getFullParamSpace() const { unsigned PDim = 0; for (const SCEV *Parameter : Parameters) { - isl::id Id = isl::manage(getIdForParam(Parameter)); + isl::id Id = getIdForParam(Parameter); Space = Space.set_dim_id(isl::dim::param, PDim++, Id); } diff --git a/polly/lib/CodeGen/IslNodeBuilder.cpp b/polly/lib/CodeGen/IslNodeBuilder.cpp index 22248df..dec8eab 100644 --- a/polly/lib/CodeGen/IslNodeBuilder.cpp +++ b/polly/lib/CodeGen/IslNodeBuilder.cpp @@ -1057,7 +1057,7 @@ bool IslNodeBuilder::materializeParameters(isl_set *Set) { bool IslNodeBuilder::materializeParameters() { for (const SCEV *Param : S.parameters()) { - isl_id *Id = S.getIdForParam(Param); + isl_id *Id = S.getIdForParam(Param).release(); if (!materializeValue(Id)) return false; } @@ -1344,7 +1344,7 @@ bool IslNodeBuilder::preloadInvariantEquivClass( } if (SE.isSCEVable(AccInstTy)) { - isl_id *ParamId = S.getIdForParam(SE.getSCEV(AccInst)); + isl_id *ParamId = S.getIdForParam(SE.getSCEV(AccInst)).release(); if (ParamId) IDToValue[ParamId] = PreloadVal; isl_id_free(ParamId); diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp index c03a1bd..8661555 100644 --- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp +++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp @@ -2597,7 +2597,7 @@ public: auto *Zero = isl_ast_expr_from_val(isl_val_zero(S->getIslCtx())); for (const SCEV *P : S->parameters()) { - isl_id *Id = S->getIdForParam(P); + isl_id *Id = S->getIdForParam(P).release(); Names = isl_id_to_ast_expr_set(Names, Id, isl_ast_expr_copy(Zero)); } diff --git a/polly/lib/Support/SCEVAffinator.cpp b/polly/lib/Support/SCEVAffinator.cpp index 43924e8..30939f9 100644 --- a/polly/lib/Support/SCEVAffinator.cpp +++ b/polly/lib/Support/SCEVAffinator.cpp @@ -233,7 +233,7 @@ __isl_give PWACtx SCEVAffinator::visit(const SCEV *Expr) { // expression, but create a new parameter in the isl_pw_aff. This allows us // to treat subexpressions that we cannot translate into an piecewise affine // expression, as constant parameters of the piecewise affine expression. - if (isl_id *Id = S->getIdForParam(Expr)) { + if (isl_id *Id = S->getIdForParam(Expr).release()) { isl_space *Space = isl_space_set_alloc(Ctx, 1, NumIterators); Space = isl_space_set_dim_id(Space, isl_dim_param, 0, Id);