aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/MemorySSA.cpp
diff options
context:
space:
mode:
authorAlina Sbirlea <asbirlea@google.com>2019-03-29 22:55:59 +0000
committerAlina Sbirlea <asbirlea@google.com>2019-03-29 22:55:59 +0000
commitc8d6e0496dc3bd44e15d640cd2c465cbfd1a6b08 (patch)
treebf09f6f02598e36cf184dec85517533b24c1fb2c /llvm/lib/Analysis/MemorySSA.cpp
parent44551cf69380549205e386ae8b1d5518bafd44eb (diff)
downloadllvm-c8d6e0496dc3bd44e15d640cd2c465cbfd1a6b08.zip
llvm-c8d6e0496dc3bd44e15d640cd2c465cbfd1a6b08.tar.gz
llvm-c8d6e0496dc3bd44e15d640cd2c465cbfd1a6b08.tar.bz2
[MemorySSA] Temporary fix assert when reaching 0 limit.
llvm-svn: 357327
Diffstat (limited to 'llvm/lib/Analysis/MemorySSA.cpp')
-rw-r--r--llvm/lib/Analysis/MemorySSA.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/MemorySSA.cpp b/llvm/lib/Analysis/MemorySSA.cpp
index 7a3f2db..a810031 100644
--- a/llvm/lib/Analysis/MemorySSA.cpp
+++ b/llvm/lib/Analysis/MemorySSA.cpp
@@ -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;