Skip to content

Commit 1ab2753

Browse files
QwertycowMooMeinersbur
authored andcommitted
[Polly] Refactoring IsInnermostParallel() in ISL to take the C++ wrapper object. NFC
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. Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D97425
1 parent 47c5576 commit 1ab2753

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

polly/include/polly/CodeGen/IslAst.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class IslAstInfo {
148148
static bool isOutermostParallel(__isl_keep isl_ast_node *Node);
149149

150150
/// Is this loop an innermost parallel loop?
151-
static bool isInnermostParallel(__isl_keep isl_ast_node *Node);
151+
static bool isInnermostParallel(const isl::ast_node &Node);
152152

153153
/// Is this loop a reduction parallel loop?
154154
static bool isReductionParallel(__isl_keep isl_ast_node *Node);

polly/lib/CodeGen/IslAst.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ static isl_printer *cbPrintFor(__isl_take isl_printer *Printer,
181181
if (DD)
182182
Printer = printLine(Printer, DepDisPragmaStr, DD);
183183

184-
if (IslAstInfo::isInnermostParallel(Node))
184+
if (IslAstInfo::isInnermostParallel(isl::manage_copy(Node)))
185185
Printer = printLine(Printer, SimdPragmaStr + BrokenReductionsStr);
186186

187187
if (IslAstInfo::isExecutedInParallel(Node))
@@ -481,7 +481,7 @@ static void walkAstForStatistics(__isl_keep isl_ast_node *Ast) {
481481
NumForLoops++;
482482
if (IslAstInfo::isParallel(Node))
483483
NumParallel++;
484-
if (IslAstInfo::isInnermostParallel(Node))
484+
if (IslAstInfo::isInnermostParallel(isl::manage_copy(Node)))
485485
NumInnermostParallel++;
486486
if (IslAstInfo::isOutermostParallel(Node))
487487
NumOutermostParallel++;
@@ -601,12 +601,12 @@ bool IslAstInfo::isInnermost(__isl_keep isl_ast_node *Node) {
601601
}
602602

603603
bool IslAstInfo::isParallel(__isl_keep isl_ast_node *Node) {
604-
return IslAstInfo::isInnermostParallel(Node) ||
604+
return IslAstInfo::isInnermostParallel(isl::manage_copy(Node)) ||
605605
IslAstInfo::isOutermostParallel(Node);
606606
}
607607

608-
bool IslAstInfo::isInnermostParallel(__isl_keep isl_ast_node *Node) {
609-
IslAstUserPayload *Payload = getNodePayload(isl::manage_copy(Node));
608+
bool IslAstInfo::isInnermostParallel(const isl::ast_node &Node) {
609+
IslAstUserPayload *Payload = getNodePayload(Node);
610610
return Payload && Payload->IsInnermostParallel;
611611
}
612612

polly/lib/CodeGen/IslNodeBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ static bool hasPartialAccesses(__isl_take isl_ast_node *Node) {
762762
void IslNodeBuilder::createFor(__isl_take isl_ast_node *For) {
763763
bool Vector = PollyVectorizerChoice == VECTORIZER_POLLY;
764764

765-
if (Vector && IslAstInfo::isInnermostParallel(For) &&
765+
if (Vector && IslAstInfo::isInnermostParallel(isl::manage_copy(For)) &&
766766
!IslAstInfo::isReductionParallel(For)) {
767767
int VectorWidth = getNumberOfIterations(isl::manage_copy(For));
768768
if (1 < VectorWidth && VectorWidth <= 16 && !hasPartialAccesses(For)) {

0 commit comments

Comments
 (0)