[Analysis] Remove changeCondBranchToUnconditionalTo (NFC)
authorKazu Hirata <kazu@google.com>
Sun, 11 Jul 2021 00:21:32 +0000 (17:21 -0700)
committerKazu Hirata <kazu@google.com>
Sun, 11 Jul 2021 00:31:43 +0000 (17:31 -0700)
The last use was removed on Jan 21, 2021 in commit
0895b836d74ed333468ddece2102140494eb33b6.

llvm/include/llvm/Analysis/MemorySSAUpdater.h
llvm/lib/Analysis/MemorySSAUpdater.cpp

index b0bf2e5ead6238a9ddc5f4ca7342867a3415cfc1..659e6aff6e28b8b78919988e098c64c412a8e404 100644 (file)
@@ -240,11 +240,6 @@ public:
   /// successors.
   void changeToUnreachable(const Instruction *I);
 
-  /// Conditional branch BI is changed or replaced with an unconditional branch
-  /// to `To`. Update Phis in BI's successors to remove BI's BB.
-  void changeCondBranchToUnconditionalTo(const BranchInst *BI,
-                                         const BasicBlock *To);
-
   /// Get handle on MemorySSA.
   MemorySSA* getMemorySSA() const { return MSSA; }
 
index faaafae543fab1f15db04fb57a39b83fe2f656f8..616864f360bf3f6fbdb52fcab73d168cf6184d35 100644 (file)
@@ -1426,22 +1426,6 @@ void MemorySSAUpdater::changeToUnreachable(const Instruction *I) {
   tryRemoveTrivialPhis(UpdatedPHIs);
 }
 
-void MemorySSAUpdater::changeCondBranchToUnconditionalTo(const BranchInst *BI,
-                                                         const BasicBlock *To) {
-  const BasicBlock *BB = BI->getParent();
-  SmallVector<WeakVH, 16> UpdatedPHIs;
-  for (const BasicBlock *Succ : successors(BB)) {
-    removeDuplicatePhiEdgesBetween(BB, Succ);
-    if (Succ != To)
-      if (auto *MPhi = MSSA->getMemoryAccess(Succ)) {
-        MPhi->unorderedDeleteIncomingBlock(BB);
-        UpdatedPHIs.push_back(MPhi);
-      }
-  }
-  // Optimize trivial phis.
-  tryRemoveTrivialPhis(UpdatedPHIs);
-}
-
 MemoryAccess *MemorySSAUpdater::createMemoryAccessInBB(
     Instruction *I, MemoryAccess *Definition, const BasicBlock *BB,
     MemorySSA::InsertionPlace Point) {