[polly] r312117 - [ScopBuilder/ScopInfo] Move ScopStmt::collectSurroundingLoops to ScopBuilder. NFC.
Michael Kruse via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 30 06:05:01 PDT 2017
Author: meinersbur
Date: Wed Aug 30 06:05:01 2017
New Revision: 312117
URL: http://llvm.org/viewvc/llvm-project?rev=312117&view=rev
Log:
[ScopBuilder/ScopInfo] Move ScopStmt::collectSurroundingLoops to ScopBuilder. NFC.
This method is only called in the SCoP building phase.
Therefore it fits better into ScopBuilder to separate
SCoP-construction from SCoP modeling.
Modified:
polly/trunk/include/polly/ScopBuilder.h
polly/trunk/include/polly/ScopInfo.h
polly/trunk/lib/Analysis/ScopBuilder.cpp
polly/trunk/lib/Analysis/ScopInfo.cpp
Modified: polly/trunk/include/polly/ScopBuilder.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopBuilder.h?rev=312117&r1=312116&r2=312117&view=diff
==============================================================================
--- polly/trunk/include/polly/ScopBuilder.h (original)
+++ polly/trunk/include/polly/ScopBuilder.h Wed Aug 30 06:05:01 2017
@@ -338,6 +338,9 @@ class ScopBuilder {
/// Build the domain of @p Stmt.
void buildDomain(ScopStmt &Stmt);
+ /// Fill NestLoops with loops surrounding @p Stmt.
+ void collectSurroundingLoops(ScopStmt &Stmt);
+
/// Build the access relation of all memory accesses of @p Stmt.
void buildAccessRelations(ScopStmt &Stmt);
Modified: polly/trunk/include/polly/ScopInfo.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopInfo.h?rev=312117&r1=312116&r2=312117&view=diff
==============================================================================
--- polly/trunk/include/polly/ScopInfo.h (original)
+++ polly/trunk/include/polly/ScopInfo.h Wed Aug 30 06:05:01 2017
@@ -1311,9 +1311,6 @@ private:
//@{
- /// Fill NestLoops with loops surrounding this statement.
- void collectSurroundingLoops();
-
/// Detect and mark reductions in the ScopStmt
void checkForReductions();
Modified: polly/trunk/lib/Analysis/ScopBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopBuilder.cpp?rev=312117&r1=312116&r2=312117&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopBuilder.cpp (original)
+++ polly/trunk/lib/Analysis/ScopBuilder.cpp Wed Aug 30 06:05:01 2017
@@ -918,6 +918,14 @@ void ScopBuilder::buildDomain(ScopStmt &
Stmt.Domain = Stmt.Domain.set_tuple_id(Id);
}
+void ScopBuilder::collectSurroundingLoops(ScopStmt &Stmt) {
+ isl::set Domain = Stmt.getDomain();
+ for (unsigned u = 0, e = Domain.dim(isl::dim::set); u < e; u++) {
+ isl::id DimId = Domain.get_dim_id(isl::dim::set, u);
+ Stmt.NestLoops.push_back(static_cast<Loop *>(DimId.get_user()));
+ }
+}
+
void ScopBuilder::buildAccessRelations(ScopStmt &Stmt) {
for (MemoryAccess *Access : Stmt.MemAccs) {
Type *ElementType = Access->getElementType();
@@ -1077,7 +1085,7 @@ void ScopBuilder::buildScop(Region &R, A
// The ScopStmts now have enough information to initialize themselves.
for (ScopStmt &Stmt : *scop) {
buildDomain(Stmt);
- Stmt.collectSurroundingLoops();
+ collectSurroundingLoops(Stmt);
buildAccessRelations(Stmt);
if (DetectReductions)
Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=312117&r1=312116&r2=312117&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Wed Aug 30 06:05:01 2017
@@ -1715,13 +1715,6 @@ buildConditionSets(Scop &S, BasicBlock *
ConditionSets);
}
-void ScopStmt::collectSurroundingLoops() {
- for (unsigned u = 0, e = Domain.dim(isl::dim::set); u < e; u++) {
- isl::id DimId = Domain.get_dim_id(isl::dim::set, u);
- NestLoops.push_back(static_cast<Loop *>(DimId.get_user()));
- }
-}
-
ScopStmt::ScopStmt(Scop &parent, Region &R, Loop *SurroundingLoop)
: Parent(parent), InvalidDomain(nullptr), Domain(nullptr), R(&R),
Build(nullptr), SurroundingLoop(SurroundingLoop) {
More information about the llvm-commits
mailing list