Skip to content

Commit c8d6e04

Browse files
committed
[MemorySSA] Temporary fix assert when reaching 0 limit.
llvm-svn: 357327
1 parent 44551cf commit c8d6e04

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

llvm/lib/Analysis/MemorySSA.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,11 @@ template <class AliasAnalysisType> class ClobberWalker {
543543
walkToPhiOrClobber(DefPath &Desc, const MemoryAccess *StopAt = nullptr,
544544
const MemoryAccess *SkipStopAt = nullptr) const {
545545
assert(!isa<MemoryUse>(Desc.Last) && "Uses don't exist in my world");
546-
assert(UpwardWalkLimit && *UpwardWalkLimit > 0 &&
547-
"Need a positive walk limit");
546+
assert(UpwardWalkLimit && "Need a valid walk limit");
547+
// This will not do any alias() calls. It returns in the first iteration in
548+
// the loop below.
549+
if (*UpwardWalkLimit == 0)
550+
(*UpwardWalkLimit)++;
548551

549552
for (MemoryAccess *Current : def_chain(Desc.Last)) {
550553
Desc.Last = Current;

0 commit comments

Comments
 (0)