[polly] r270427 - Allow to check for dominance wrt. a SCoP [NFC]

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Mon May 23 05:43:44 PDT 2016


Author: jdoerfert
Date: Mon May 23 07:43:44 2016
New Revision: 270427

URL: http://llvm.org/viewvc/llvm-project?rev=270427&view=rev
Log:
Allow to check for dominance wrt. a SCoP [NFC]

Modified:
    polly/trunk/include/polly/ScopInfo.h
    polly/trunk/lib/Analysis/ScopInfo.cpp

Modified: polly/trunk/include/polly/ScopInfo.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopInfo.h?rev=270427&r1=270426&r2=270427&view=diff
==============================================================================
--- polly/trunk/include/polly/ScopInfo.h (original)
+++ polly/trunk/include/polly/ScopInfo.h Mon May 23 07:43:44 2016
@@ -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.

Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=270427&r1=270426&r2=270427&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Mon May 23 07:43:44 2016
@@ -1874,6 +1874,10 @@ __isl_give isl_set *Scop::addNonEmptyDom
   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(Assumption
       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());




More information about the llvm-commits mailing list