diff options
author | Alina Sbirlea <asbirlea@google.com> | 2018-08-29 22:38:51 +0000 |
---|---|---|
committer | Alina Sbirlea <asbirlea@google.com> | 2018-08-29 22:38:51 +0000 |
commit | 5bce4d5a85b49519e0f3b0a8eaad6421c4eb387d (patch) | |
tree | f689fa298c01adb8fc7daca63441cd9d2d0b43df | |
parent | 5d26313ce0142059eddc25ca2f7ed013ea44810a (diff) | |
download | bcm5719-llvm-5bce4d5a85b49519e0f3b0a8eaad6421c4eb387d.tar.gz bcm5719-llvm-5bce4d5a85b49519e0f3b0a8eaad6421c4eb387d.zip |
[MemorySSA] Fix checkClobberSanity to skip Start only for Defs and Uses.
llvm-svn: 340981
-rw-r--r-- | llvm/lib/Analysis/MemorySSA.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/llvm/lib/Analysis/MemorySSA.cpp b/llvm/lib/Analysis/MemorySSA.cpp index 1c5858abf8c..ee702fd3c5d 100644 --- a/llvm/lib/Analysis/MemorySSA.cpp +++ b/llvm/lib/Analysis/MemorySSA.cpp @@ -429,18 +429,23 @@ checkClobberSanity(const MemoryAccess *Start, MemoryAccess *ClobberAt, // We should never hit liveOnEntry, unless it's the clobber. assert(!MSSA.isLiveOnEntryDef(MA) && "Hit liveOnEntry before clobber?"); - // If Start is a Def, skip self. - if (MA == Start) - continue; - if (const auto *MD = dyn_cast<MemoryDef>(MA)) { - (void)MD; + // If Start is a Def, skip self. + if (MD == Start) + continue; + assert(!instructionClobbersQuery(MD, MAP.second, Query.Inst, AA) .IsClobber && "Found clobber before reaching ClobberAt!"); continue; } + if (const auto *MU = dyn_cast<MemoryUse>(MA)) { + assert (MU == Start && + "Can only find use in def chain if Start is a use"); + continue; + } + assert(isa<MemoryPhi>(MA)); Worklist.append( upward_defs_begin({const_cast<MemoryAccess *>(MA), MAP.second}), |