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

Sebastian Pop via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 6 14:10:26 PDT 2016


sebpop removed rL LLVM as the repository for this revision.
sebpop updated this revision to Diff 59781.
sebpop added a comment.

Updated patch to address the comments from George Burgess IV.


http://reviews.llvm.org/D21039

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

Index: llvm/lib/Transforms/Utils/MemorySSA.cpp
===================================================================
--- llvm/lib/Transforms/Utils/MemorySSA.cpp
+++ llvm/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.59781.patch
Type: text/x-patch
Size: 955 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160606/2872b5e8/attachment.bin>


More information about the llvm-commits mailing list