From a6c7669e734d73f4379cc2583d6ac0401631e38c Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sat, 10 Jul 2021 17:21:32 -0700 Subject: [PATCH] [Analysis] Remove changeCondBranchToUnconditionalTo (NFC) The last use was removed on Jan 21, 2021 in commit 0895b836d74ed333468ddece2102140494eb33b6. --- include/llvm/Analysis/MemorySSAUpdater.h | 5 ----- lib/Analysis/MemorySSAUpdater.cpp | 16 ---------------- 2 files changed, 21 deletions(-) diff --git a/include/llvm/Analysis/MemorySSAUpdater.h b/include/llvm/Analysis/MemorySSAUpdater.h index b0bf2e5ead6..659e6aff6e2 100644 --- a/include/llvm/Analysis/MemorySSAUpdater.h +++ b/include/llvm/Analysis/MemorySSAUpdater.h @@ -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; } diff --git a/lib/Analysis/MemorySSAUpdater.cpp b/lib/Analysis/MemorySSAUpdater.cpp index faaafae543f..616864f360b 100644 --- a/lib/Analysis/MemorySSAUpdater.cpp +++ b/lib/Analysis/MemorySSAUpdater.cpp @@ -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 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) {