[PATCH] D21039: Fix memory access local dominance function for live on entry

Sebastian Pop via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 10 14:43:24 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL272436: MemorySSA: fix memory access local dominance function for live on entry (authored by spop).

Changed prior to commit:
  http://reviews.llvm.org/D21039?vs=59781&id=60406#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D21039

Files:
  llvm/trunk/lib/Transforms/Utils/MemorySSA.cpp

Index: llvm/trunk/lib/Transforms/Utils/MemorySSA.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Utils/MemorySSA.cpp
+++ llvm/trunk/lib/Transforms/Utils/MemorySSA.cpp
@@ -623,6 +623,21 @@
 
   assert((Dominator->getBlock() == Dominatee->getBlock()) &&
          "Asking for local domination when accesses are in different blocks!");
+
+  // A node dominates itself.
+  if (Dominatee == Dominator)
+    return true;
+
+  // When Dominatee is defined on function entry, it is not dominated by another
+  // memory access.
+  if (isLiveOnEntryDef(Dominatee))
+    return false;
+
+  // When Dominator is defined on function entry, it dominates the other memory
+  // access.
+  if (isLiveOnEntryDef(Dominator))
+    return true;
+
   // Get the access list for the block
   const AccessListType *AccessList = getBlockAccesses(Dominator->getBlock());
   AccessListType::const_reverse_iterator It(Dominator->getIterator());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21039.60406.patch
Type: text/x-patch
Size: 973 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160610/17f52162/attachment.bin>


More information about the llvm-commits mailing list