[polly] ea37ee5 - [Polly] Update IslAstInfo::getNodePayload to use isl C++ interface. NFC.

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 18 15:54:25 PST 2021


Author: Michael Kruse
Date: 2021-02-18T17:53:32-06:00
New Revision: ea37ee5bc40fccb7e226f669fe7b6cc4041025cb

URL: https://github.com/llvm/llvm-project/commit/ea37ee5bc40fccb7e226f669fe7b6cc4041025cb
DIFF: https://github.com/llvm/llvm-project/commit/ea37ee5bc40fccb7e226f669fe7b6cc4041025cb.diff

LOG: [Polly] Update IslAstInfo::getNodePayload to use isl C++ interface. NFC.

Added: 
    

Modified: 
    polly/include/polly/CodeGen/IslAst.h
    polly/lib/CodeGen/IslAst.cpp

Removed: 
    


################################################################################
diff  --git a/polly/include/polly/CodeGen/IslAst.h b/polly/include/polly/CodeGen/IslAst.h
index fc2a5e461fa1..f73e6472bb32 100644
--- a/polly/include/polly/CodeGen/IslAst.h
+++ b/polly/include/polly/CodeGen/IslAst.h
@@ -136,7 +136,7 @@ class IslAstInfo {
   ///
   ///{
   /// Get the complete payload attached to @p Node.
-  static IslAstUserPayload *getNodePayload(__isl_keep isl_ast_node *Node);
+  static IslAstUserPayload *getNodePayload(const isl::ast_node &Node);
 
   /// Is this loop an innermost loop?
   static bool isInnermost(__isl_keep isl_ast_node *Node);

diff  --git a/polly/lib/CodeGen/IslAst.cpp b/polly/lib/CodeGen/IslAst.cpp
index d846df18d92b..c70c839cd010 100644
--- a/polly/lib/CodeGen/IslAst.cpp
+++ b/polly/lib/CodeGen/IslAst.cpp
@@ -587,17 +587,16 @@ __isl_give isl_ast_expr *IslAstInfo::getRunCondition() {
   return Ast.getRunCondition();
 }
 
-IslAstUserPayload *IslAstInfo::getNodePayload(__isl_keep isl_ast_node *Node) {
-  isl_id *Id = isl_ast_node_get_annotation(Node);
+IslAstUserPayload *IslAstInfo::getNodePayload(const isl::ast_node &Node) {
+  isl::id Id = Node.get_annotation();
   if (!Id)
     return nullptr;
-  IslAstUserPayload *Payload = (IslAstUserPayload *)isl_id_get_user(Id);
-  isl_id_free(Id);
+  IslAstUserPayload *Payload = (IslAstUserPayload *)Id.get_user();
   return Payload;
 }
 
 bool IslAstInfo::isInnermost(__isl_keep isl_ast_node *Node) {
-  IslAstUserPayload *Payload = getNodePayload(Node);
+  IslAstUserPayload *Payload = getNodePayload(isl::manage_copy(Node));
   return Payload && Payload->IsInnermost;
 }
 
@@ -607,17 +606,17 @@ bool IslAstInfo::isParallel(__isl_keep isl_ast_node *Node) {
 }
 
 bool IslAstInfo::isInnermostParallel(__isl_keep isl_ast_node *Node) {
-  IslAstUserPayload *Payload = getNodePayload(Node);
+  IslAstUserPayload *Payload = getNodePayload(isl::manage_copy(Node));
   return Payload && Payload->IsInnermostParallel;
 }
 
 bool IslAstInfo::isOutermostParallel(__isl_keep isl_ast_node *Node) {
-  IslAstUserPayload *Payload = getNodePayload(Node);
+  IslAstUserPayload *Payload = getNodePayload(isl::manage_copy(Node));
   return Payload && Payload->IsOutermostParallel;
 }
 
 bool IslAstInfo::isReductionParallel(__isl_keep isl_ast_node *Node) {
-  IslAstUserPayload *Payload = getNodePayload(Node);
+  IslAstUserPayload *Payload = getNodePayload(isl::manage_copy(Node));
   return Payload && Payload->IsReductionParallel;
 }
 
@@ -642,24 +641,24 @@ bool IslAstInfo::isExecutedInParallel(__isl_keep isl_ast_node *Node) {
 
 __isl_give isl_union_map *
 IslAstInfo::getSchedule(__isl_keep isl_ast_node *Node) {
-  IslAstUserPayload *Payload = getNodePayload(Node);
+  IslAstUserPayload *Payload = getNodePayload(isl::manage_copy(Node));
   return Payload ? isl_ast_build_get_schedule(Payload->Build) : nullptr;
 }
 
 __isl_give isl_pw_aff *
 IslAstInfo::getMinimalDependenceDistance(__isl_keep isl_ast_node *Node) {
-  IslAstUserPayload *Payload = getNodePayload(Node);
+  IslAstUserPayload *Payload = getNodePayload(isl::manage_copy(Node));
   return Payload ? Payload->MinimalDependenceDistance.copy() : nullptr;
 }
 
 IslAstInfo::MemoryAccessSet *
 IslAstInfo::getBrokenReductions(__isl_keep isl_ast_node *Node) {
-  IslAstUserPayload *Payload = getNodePayload(Node);
+  IslAstUserPayload *Payload = getNodePayload(isl::manage_copy(Node));
   return Payload ? &Payload->BrokenReductions : nullptr;
 }
 
 isl_ast_build *IslAstInfo::getBuild(__isl_keep isl_ast_node *Node) {
-  IslAstUserPayload *Payload = getNodePayload(Node);
+  IslAstUserPayload *Payload = getNodePayload(isl::manage_copy(Node));
   return Payload ? Payload->Build : nullptr;
 }
 


        


More information about the llvm-commits mailing list