For the Instruction version of
CachingMemorySSAWalker::getClobberingMemoryAccess, when checking the
cache for previously computed values, the key used was I's MemoryAccess,
instead of its defining access. If a previous call to the
non-instruction version of getClobberingMemoryAccess has been called, it
will have added I's MemoryAccess itself as the cached result (in the
case it is a MemoryDef).
For example, for the following code:
1 = MemoryDef(liveOnEntry) store %a
before this change (assuming the calls to getClobberingMemoryAccess are
made in order):
MSSA.getClobberingMemoryAccess(MSSA.getMemoryAccess(I), IMemLoc) -> 1 = MemoryDef(liveOnEntry) MSSA.getClobberingMemoryAccess(I) -> 1 = MemoryDef(liveOnEntry)
after this change, the second call correctly returns 'liveOnEntry':
MSSA.getClobberingMemoryAccess(MSSA.getMemoryAccess(I), IMemLoc) -> 1 = MemoryDef(liveOnEntry) MSSA.getClobberingMemoryAccess(I) -> liveOnEntry