summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xpolly/include/polly/ScopInfo.h4
-rw-r--r--polly/lib/Analysis/ScopInfo.cpp15
-rw-r--r--polly/lib/ScheduleOptimizer.cpp11
3 files changed, 20 insertions, 10 deletions
diff --git a/polly/include/polly/ScopInfo.h b/polly/include/polly/ScopInfo.h
index dcd4c7c0235..6d368a4d7a0 100755
--- a/polly/include/polly/ScopInfo.h
+++ b/polly/include/polly/ScopInfo.h
@@ -43,6 +43,7 @@ struct isl_map;
struct isl_basic_map;
struct isl_id;
struct isl_set;
+struct isl_union_set;
struct isl_space;
struct isl_constraint;
@@ -572,6 +573,9 @@ public:
///
/// @return The isl context of this static control part.
isl_ctx *getIslCtx() const;
+
+ /// @brief Get a union set containing the iteration domains of all statements.
+ __isl_give isl_union_set *getDomains();
};
/// @brief Print Scop scop to raw_ostream O.
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp
index 30cfd5300ce..39318e0fb8b 100644
--- a/polly/lib/Analysis/ScopInfo.cpp
+++ b/polly/lib/Analysis/ScopInfo.cpp
@@ -938,6 +938,21 @@ void Scop::dump() const { print(dbgs()); }
isl_ctx *Scop::getIslCtx() const { return IslCtx; }
+__isl_give isl_union_set *Scop::getDomains() {
+ isl_union_set *Domain = NULL;
+
+ for (Scop::iterator SI = begin(), SE = end(); SI != SE; ++SI)
+ if ((*SI)->isFinalRead())
+ continue;
+ else if (!Domain)
+ Domain = isl_union_set_from_set((*SI)->getDomain());
+ else
+ Domain = isl_union_set_union(Domain,
+ isl_union_set_from_set((*SI)->getDomain()));
+
+ return Domain;
+}
+
ScalarEvolution *Scop::getSE() const { return SE; }
bool Scop::isTrivialBB(BasicBlock *BB, TempScop &tempScop) {
diff --git a/polly/lib/ScheduleOptimizer.cpp b/polly/lib/ScheduleOptimizer.cpp
index 80ea97ce443..7df544a40f6 100644
--- a/polly/lib/ScheduleOptimizer.cpp
+++ b/polly/lib/ScheduleOptimizer.cpp
@@ -423,16 +423,7 @@ bool IslScheduleOptimizer::runOnScop(Scop &S) {
| Dependences::TYPE_WAW;
isl_union_map *Dependences = D->getDependences(DependencyKinds);
- isl_union_set *Domain = NULL;
-
- for (Scop::iterator SI = S.begin(), SE = S.end(); SI != SE; ++SI)
- if ((*SI)->isFinalRead())
- continue;
- else if (!Domain)
- Domain = isl_union_set_from_set((*SI)->getDomain());
- else
- Domain = isl_union_set_union(Domain,
- isl_union_set_from_set((*SI)->getDomain()));
+ isl_union_set *Domain = S.getDomains();
if (!Domain)
return false;
OpenPOWER on IntegriCloud