[MemorySSA] Temporary fix assert when reaching 0 limit.
authorAlina Sbirlea <asbirlea@google.com>
Fri, 29 Mar 2019 22:55:59 +0000 (22:55 +0000)
committerAlina Sbirlea <asbirlea@google.com>
Fri, 29 Mar 2019 22:55:59 +0000 (22:55 +0000)
llvm-svn: 357327

llvm/lib/Analysis/MemorySSA.cpp

index 7a3f2db..a810031 100644 (file)
@@ -543,8 +543,11 @@ template <class AliasAnalysisType> class ClobberWalker {
   walkToPhiOrClobber(DefPath &Desc, const MemoryAccess *StopAt = nullptr,
                      const MemoryAccess *SkipStopAt = nullptr) const {
     assert(!isa<MemoryUse>(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;