From 0bac46f10e9f436dcf97f92099fc2cbeee04d7c2 Mon Sep 17 00:00:00 2001 From: Alina Sbirlea Date: Wed, 29 Aug 2018 22:38:51 +0000 Subject: [PATCH] [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 --- lib/Analysis/MemorySSA.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/Analysis/MemorySSA.cpp b/lib/Analysis/MemorySSA.cpp index 1c5858abf8c..ee702fd3c5d 100644 --- a/lib/Analysis/MemorySSA.cpp +++ b/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(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(MA)) { + assert (MU == Start && + "Can only find use in def chain if Start is a use"); + continue; + } + assert(isa(MA)); Worklist.append( upward_defs_begin({const_cast(MA), MAP.second}),