]> granicus.if.org Git - llvm/commitdiff
MemorySSAUpdater: Only add phis to insertedphis if we actually inserted them, not...
authorDaniel Berlin <dberlin@dberlin.org>
Wed, 27 Sep 2017 05:35:19 +0000 (05:35 +0000)
committerDaniel Berlin <dberlin@dberlin.org>
Wed, 27 Sep 2017 05:35:19 +0000 (05:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314273 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/MemorySSAUpdater.cpp

index 1ff84471c094675cfbeea698715faf9b0560d6ef..f28f8bd6bce2cc806772e7a0fafe5ad46c30dc37 100644 (file)
@@ -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<MemoryPhi>(Result))
-      InsertedPHIs.push_back(MP);
+
     // Set ourselves up for the next variable by resetting visited state.
     VisitedBlocks.erase(BB);
     return Result;