Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 0bac46f

Browse files
committed
[MemorySSA] Fix checkClobberSanity to skip Start only for Defs and Uses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340981 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent d78238e commit 0bac46f

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

lib/Analysis/MemorySSA.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -429,18 +429,23 @@ checkClobberSanity(const MemoryAccess *Start, MemoryAccess *ClobberAt,
429429
// We should never hit liveOnEntry, unless it's the clobber.
430430
assert(!MSSA.isLiveOnEntryDef(MA) && "Hit liveOnEntry before clobber?");
431431

432-
// If Start is a Def, skip self.
433-
if (MA == Start)
434-
continue;
435-
436432
if (const auto *MD = dyn_cast<MemoryDef>(MA)) {
437-
(void)MD;
433+
// If Start is a Def, skip self.
434+
if (MD == Start)
435+
continue;
436+
438437
assert(!instructionClobbersQuery(MD, MAP.second, Query.Inst, AA)
439438
.IsClobber &&
440439
"Found clobber before reaching ClobberAt!");
441440
continue;
442441
}
443442

443+
if (const auto *MU = dyn_cast<MemoryUse>(MA)) {
444+
assert (MU == Start &&
445+
"Can only find use in def chain if Start is a use");
446+
continue;
447+
}
448+
444449
assert(isa<MemoryPhi>(MA));
445450
Worklist.append(
446451
upward_defs_begin({const_cast<MemoryAccess *>(MA), MAP.second}),

0 commit comments

Comments
 (0)