[polly] 812ce7f - [Polly] Refactoring isInnermost() from isl to use the C++ wrapper
Michael Kruse via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 5 19:16:59 PDT 2021
Author: patacca
Date: 2021-04-05T21:16:52-05:00
New Revision: 812ce7f9beb2b828032ddbd01d3aba4c1f9d76da
URL: https://github.com/llvm/llvm-project/commit/812ce7f9beb2b828032ddbd01d3aba4c1f9d76da
DIFF: https://github.com/llvm/llvm-project/commit/812ce7f9beb2b828032ddbd01d3aba4c1f9d76da.diff
LOG: [Polly] Refactoring isInnermost() from isl to use the C++ wrapper
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:
- Refactoring 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
Reviewed By: Meinersbur
Differential Revision: https://reviews.llvm.org/D99841
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 c6f8778da96ce..8b5b847d08213 100644
--- a/polly/include/polly/CodeGen/IslAst.h
+++ b/polly/include/polly/CodeGen/IslAst.h
@@ -139,7 +139,7 @@ class IslAstInfo {
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);
diff --git a/polly/lib/CodeGen/IslAst.cpp b/polly/lib/CodeGen/IslAst.cpp
index f6ff287c97277..013e9b31a10df 100644
--- a/polly/lib/CodeGen/IslAst.cpp
+++ b/polly/lib/CodeGen/IslAst.cpp
@@ -588,8 +588,8 @@ IslAstUserPayload *IslAstInfo::getNodePayload(const isl::ast_node &Node) {
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 @@ bool IslAstInfo::isExecutedInParallel(__isl_keep isl_ast_node *Node) {
// 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)) &&
More information about the llvm-commits
mailing list