From 97f34e887fe295834754f9b0a29e3b28b67c8da9 Mon Sep 17 00:00:00 2001 From: Daniel Berlin Date: Wed, 27 Sep 2017 05:35:19 +0000 Subject: [PATCH] MemorySSAUpdater: Only add phis to insertedphis if we actually inserted them, not if we just found existing ones llvm-svn: 314273 --- llvm/lib/Analysis/MemorySSAUpdater.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/llvm/lib/Analysis/MemorySSAUpdater.cpp b/llvm/lib/Analysis/MemorySSAUpdater.cpp index 1ff8447..f28f8bd 100644 --- a/llvm/lib/Analysis/MemorySSAUpdater.cpp +++ b/llvm/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; -- 2.7.4