[PATCH] D99841: [Polly] Refabricating isInnermost() from isl to use the C++ wrapper

Riccardo Mori via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 3 10:50:19 PDT 2021


patacca created this revision.
patacca added a reviewer: Meinersbur.
Herald added a reviewer: bollu.
patacca requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Polly use algorithms from the Integer Set Library (isl), which is a library written in C and which is incompatible with the rest of the LLVM as it is written in C++.

Changes made:

- Refabricating isInnermost() to take C++ bindings instead of the plain isl C api.
- Addition of manage_copy() when needed to get the reference for the isl_ast_node object


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D99841

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


Index: polly/lib/CodeGen/IslAst.cpp
===================================================================
--- polly/lib/CodeGen/IslAst.cpp
+++ polly/lib/CodeGen/IslAst.cpp
@@ -588,8 +588,8 @@
   return Payload;
 }
 
-bool IslAstInfo::isInnermost(__isl_keep isl_ast_node *Node) {
-  IslAstUserPayload *Payload = getNodePayload(isl::manage_copy(Node));
+bool IslAstInfo::isInnermost(const isl::ast_node &Node) {
+  IslAstUserPayload *Payload = getNodePayload(Node);
   return Payload && Payload->IsInnermost;
 }
 
@@ -626,7 +626,7 @@
   //       executed. This can possibly require run-time checks, which again
   //       raises the question of both run-time check overhead and code size
   //       costs.
-  if (!PollyParallelForce && isInnermost(Node))
+  if (!PollyParallelForce && isInnermost(isl::manage_copy(Node)))
     return false;
 
   return isOutermostParallel(isl::manage_copy(Node)) &&
Index: polly/include/polly/CodeGen/IslAst.h
===================================================================
--- polly/include/polly/CodeGen/IslAst.h
+++ polly/include/polly/CodeGen/IslAst.h
@@ -139,7 +139,7 @@
   static IslAstUserPayload *getNodePayload(const isl::ast_node &Node);
 
   /// Is this loop an innermost loop?
-  static bool isInnermost(__isl_keep isl_ast_node *Node);
+  static bool isInnermost(const isl::ast_node &Node);
 
   /// Is this loop a parallel loop?
   static bool isParallel(__isl_keep isl_ast_node *Node);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99841.335091.patch
Type: text/x-patch
Size: 1436 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210403/0d973332/attachment.bin>


More information about the llvm-commits mailing list