From: Daniel Berlin Date: Wed, 27 Sep 2017 05:35:19 +0000 (+0000) Subject: MemorySSAUpdater: Only add phis to insertedphis if we actually inserted them, not... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4f3c2f38a74b424e7cd9c8e4499233b5259d42dd;p=llvm MemorySSAUpdater: Only add phis to insertedphis if we actually inserted them, not if we just found existing ones git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314273 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/MemorySSAUpdater.cpp b/lib/Analysis/MemorySSAUpdater.cpp index 1ff84471c09..f28f8bd6bce 100644 --- a/lib/Analysis/MemorySSAUpdater.cpp +++ b/lib/Analysis/MemorySSAUpdater.cpp @@ -85,12 +85,11 @@ MemoryAccess *MemorySSAUpdater::getPreviousDefRecursive(BasicBlock *BB) { unsigned i = 0; for (auto *Pred : predecessors(BB)) Phi->addIncoming(PhiOps[i++], Pred); + InsertedPHIs.push_back(Phi); } - Result = Phi; } - if (MemoryPhi *MP = dyn_cast(Result)) - InsertedPHIs.push_back(MP); + // Set ourselves up for the next variable by resetting visited state. VisitedBlocks.erase(BB); return Result;