mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-11 05:24:16 +00:00
MemorySSA: fix memory access local dominance function for live on entry
A memory access defined on function entry cannot be locally dominated by another memory access. The patch was split from http://reviews.llvm.org/D19338 which exposes the problem. Differential Revision: http://reviews.llvm.org/D21039 llvm-svn: 272436
This commit is contained in:
parent
858bed9b6b
commit
b4051eb864
@ -623,6 +623,21 @@ bool MemorySSA::locallyDominates(const MemoryAccess *Dominator,
|
||||
|
||||
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());
|
||||
|
Loading…
Reference in New Issue
Block a user