[polly] r255473 - Check guaranteed execution by using DominatorTree

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 13 14:10:41 PST 2015


Author: meinersbur
Date: Sun Dec 13 16:10:40 2015
New Revision: 255473

URL: http://llvm.org/viewvc/llvm-project?rev=255473&view=rev
Log:
Check guaranteed execution by using DominatorTree

Before this commit, only the region's entry block was assumed to always
execute in a non-affine subregion. We replace this by a test whether it
dominates the exit block (this necessarily includes the entry block)
which should be more accurate.

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

Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=255473&r1=255472&r2=255473&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Sun Dec 13 16:10:40 2015
@@ -3885,12 +3885,13 @@ void ScopInfo::addMemoryAccess(BasicBloc
   Value *BaseAddr = BaseAddress;
   std::string BaseName = getIslCompatibleName("MemRef_", BaseAddr, "");
 
-  // The execution of a store is not guaranteed if not in the entry block of a
-  // subregion. However, scalar writes (llvm::Value definitions or one of a
+  // The execution of a store is not guaranteed if its parent block is not
+  // guaranteed to executed, here tested by checking whether it dominates the
+  // exit block. However, implicit writes (llvm::Value definitions or one of a
   // PHI's incoming values) must occur in well-formed IR code.
   bool isApproximated = (Kind == ScopArrayInfo::MK_Array) &&
                         Stmt->isRegionStmt() &&
-                        (Stmt->getRegion()->getEntry() != BB);
+                        !DT->dominates(BB, Stmt->getRegion()->getExit());
   if (isApproximated && Type == MemoryAccess::MUST_WRITE)
     Type = MemoryAccess::MAY_WRITE;
 




More information about the llvm-commits mailing list