From: Alina Sbirlea Date: Fri, 29 Mar 2019 22:55:59 +0000 (+0000) Subject: [MemorySSA] Temporary fix assert when reaching 0 limit. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d266d2b04f83614042f16250d54e50e1359fb084;p=llvm [MemorySSA] Temporary fix assert when reaching 0 limit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357327 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/MemorySSA.cpp b/lib/Analysis/MemorySSA.cpp index 7a3f2db8831..a8100312f21 100644 --- a/lib/Analysis/MemorySSA.cpp +++ b/lib/Analysis/MemorySSA.cpp @@ -543,8 +543,11 @@ template class ClobberWalker { walkToPhiOrClobber(DefPath &Desc, const MemoryAccess *StopAt = nullptr, const MemoryAccess *SkipStopAt = nullptr) const { assert(!isa(Desc.Last) && "Uses don't exist in my world"); - assert(UpwardWalkLimit && *UpwardWalkLimit > 0 && - "Need a positive walk limit"); + assert(UpwardWalkLimit && "Need a valid walk limit"); + // This will not do any alias() calls. It returns in the first iteration in + // the loop below. + if (*UpwardWalkLimit == 0) + (*UpwardWalkLimit)++; for (MemoryAccess *Current : def_chain(Desc.Last)) { Desc.Last = Current;