[MemorySSA] Update phi map with replacement value.
authorAlina Sbirlea <asbirlea@google.com>
Tue, 1 Sep 2020 18:56:17 +0000 (11:56 -0700)
committerAlina Sbirlea <asbirlea@google.com>
Tue, 1 Sep 2020 18:56:40 +0000 (11:56 -0700)
llvm/lib/Analysis/MemorySSAUpdater.cpp

index 671d9e6..19f434f 100644 (file)
@@ -713,8 +713,8 @@ void MemorySSAUpdater::updateForClonedLoop(const LoopBlocksRPO &LoopBlocks,
           NewPhi->addIncoming(IncPhi, IncBB);
       }
     }
-    if (onlySingleValue(NewPhi)) {
-      MPhiMap[Phi] = nullptr;
+    if (auto *SingleAccess = onlySingleValue(NewPhi)) {
+      MPhiMap[Phi] = SingleAccess;
       removeMemoryAccess(NewPhi);
     }
   };