[ScopInfo] Translate Scop::getIdForParam to isl++ [NFC]
authorTobias Grosser <tobias@grosser.es>
Sun, 6 Aug 2017 19:31:27 +0000 (19:31 +0000)
committerTobias Grosser <tobias@grosser.es>
Sun, 6 Aug 2017 19:31:27 +0000 (19:31 +0000)
llvm-svn: 310220

polly/include/polly/ScopInfo.h
polly/lib/Analysis/ScopInfo.cpp
polly/lib/CodeGen/IslNodeBuilder.cpp
polly/lib/CodeGen/PPCGCodeGeneration.cpp
polly/lib/Support/SCEVAffinator.cpp

index 3b7e7d4..cdc6182 100644 (file)
@@ -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.
   ///
index 77d60e7..cbcffbb 100644 (file)
@@ -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);
   }
 
index 22248df..dec8eab 100644 (file)
@@ -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);
index c03a1bd..8661555 100644 (file)
@@ -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));
     }
 
index 43924e8..30939f9 100644 (file)
@@ -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);