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