summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--polly/include/polly/ScopInfo.h3
-rw-r--r--polly/lib/Analysis/ScopInfo.cpp6
2 files changed, 8 insertions, 1 deletions
diff --git a/polly/include/polly/ScopInfo.h b/polly/include/polly/ScopInfo.h
index 15b55b3d743..8ef4a4f4711 100644
--- a/polly/include/polly/ScopInfo.h
+++ b/polly/include/polly/ScopInfo.h
@@ -1900,6 +1900,9 @@ public:
/// @brief Return a range of all basic blocks in the SCoP.
Region::block_range blocks() const { return R.blocks(); }
+ /// @brief Return true if and only if @p BB dominates the SCoP.
+ bool isDominatedBy(const DominatorTree &DT, BasicBlock *BB) const;
+
/// @brief Get the maximum depth of the loop.
///
/// @return The maximum depth of the loop.
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp
index d2e6df3e452..72a10ab12f3 100644
--- a/polly/lib/Analysis/ScopInfo.cpp
+++ b/polly/lib/Analysis/ScopInfo.cpp
@@ -1874,6 +1874,10 @@ __isl_give isl_set *Scop::addNonEmptyDomainConstraints(isl_set *C) const {
return isl_set_intersect_params(C, DomainContext);
}
+bool Scop::isDominatedBy(const DominatorTree &DT, BasicBlock *BB) const {
+ return DT.dominates(BB, getEntry());
+}
+
void Scop::addUserAssumptions(AssumptionCache &AC, DominatorTree &DT,
LoopInfo &LI) {
auto &F = getFunction();
@@ -1883,7 +1887,7 @@ void Scop::addUserAssumptions(AssumptionCache &AC, DominatorTree &DT,
continue;
bool InScop = contains(CI);
- if (!InScop && !DT.dominates(CI->getParent(), R.getEntry()))
+ if (!InScop && !isDominatedBy(DT, CI->getParent()))
continue;
auto *L = LI.getLoopFor(CI->getParent());
OpenPOWER on IntegriCloud