[PATCH] D97425: [Polly] Refactoring IsInnermostParallel() in ISL to take the C++ wrapper object. NFC
Kevin Zhou via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 24 16:36:11 PST 2021
QwertycowMoo created this revision.
QwertycowMoo added a reviewer: Meinersbur.
QwertycowMoo added a project: Polly.
Herald added a reviewer: bollu.
QwertycowMoo requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Currently, the IslAst library is a C library that would be incompatible with the rest of the LLVM because LLVM is written in C++.
I took one function, IsInnermostParallel(), and refactored it so that it would take the C++ wrapper object instead of using reference counters with the C ISL library. As well, all the references that use IsInnermostParallel() will use manage_copy() since they are still expecting the C object.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D97425
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
@@ -181,7 +181,7 @@
if (DD)
Printer = printLine(Printer, DepDisPragmaStr, DD);
- if (IslAstInfo::isInnermostParallel(Node))
+ if (IslAstInfo::isInnermostParallel(isl::manage_copy(Node)))
Printer = printLine(Printer, SimdPragmaStr + BrokenReductionsStr);
if (IslAstInfo::isExecutedInParallel(Node))
@@ -481,7 +481,7 @@
NumForLoops++;
if (IslAstInfo::isParallel(Node))
NumParallel++;
- if (IslAstInfo::isInnermostParallel(Node))
+ if (IslAstInfo::isInnermostParallel(isl::manage_copy(Node)))
NumInnermostParallel++;
if (IslAstInfo::isOutermostParallel(Node))
NumOutermostParallel++;
@@ -601,12 +601,12 @@
}
bool IslAstInfo::isParallel(__isl_keep isl_ast_node *Node) {
- return IslAstInfo::isInnermostParallel(Node) ||
+ return IslAstInfo::isInnermostParallel(isl::manage_copy(Node)) ||
IslAstInfo::isOutermostParallel(Node);
}
-bool IslAstInfo::isInnermostParallel(__isl_keep isl_ast_node *Node) {
- IslAstUserPayload *Payload = getNodePayload(isl::manage_copy(Node));
+bool IslAstInfo::isInnermostParallel(const isl::ast_node &Node) {
+ IslAstUserPayload *Payload = getNodePayload(Node);
return Payload && Payload->IsInnermostParallel;
}
Index: polly/include/polly/CodeGen/IslAst.h
===================================================================
--- polly/include/polly/CodeGen/IslAst.h
+++ polly/include/polly/CodeGen/IslAst.h
@@ -148,7 +148,7 @@
static bool isOutermostParallel(__isl_keep isl_ast_node *Node);
/// Is this loop an innermost parallel loop?
- static bool isInnermostParallel(__isl_keep isl_ast_node *Node);
+ static bool isInnermostParallel(const isl::ast_node &Node);
/// Is this loop a reduction parallel loop?
static bool isReductionParallel(__isl_keep isl_ast_node *Node);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97425.326239.patch
Type: text/x-patch
Size: 2023 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210225/f110caa4/attachment.bin>
More information about the llvm-commits
mailing list