From ea18a93b26bd336e7bbe8c2b2d1bb3bf1d1c8d0f Mon Sep 17 00:00:00 2001 From: Max Kazantsev Date: Wed, 6 Feb 2019 06:33:02 +0000 Subject: [PATCH] [NFC] Revert rL353274 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353275 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Transforms/Utils/BasicBlockUtils.h | 13 +++---------- lib/Transforms/Utils/BasicBlockUtils.cpp | 15 +++++---------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/include/llvm/Transforms/Utils/BasicBlockUtils.h b/include/llvm/Transforms/Utils/BasicBlockUtils.h index 8134483b67d..a08d2a760a2 100644 --- a/include/llvm/Transforms/Utils/BasicBlockUtils.h +++ b/include/llvm/Transforms/Utils/BasicBlockUtils.h @@ -40,21 +40,14 @@ class TargetLibraryInfo; class Value; /// Delete the specified block, which must have no predecessors. -void DeleteDeadBlock( - BasicBlock *BB, DomTreeUpdater *DTU = nullptr, - SmallVectorImpl *DTUpdates = nullptr); +void DeleteDeadBlock(BasicBlock *BB, DomTreeUpdater *DTU = nullptr); /// Delete the specified blocks from \p BB. The set of deleted blocks must have /// no predecessors that are not being deleted themselves. \p BBs must have no /// duplicating blocks. If there are loops among this set of blocks, all /// relevant loop info updates should be done before this function is called. -/// If \p DTU is specified, all updates of DomTree are done immediately using -/// this updater. -/// If \p DTUpdates is specified, all updates to DomTree are also appended to -/// this vector, no matter if DTU is specified. -void DeleteDeadBlocks( - ArrayRef BBs, DomTreeUpdater *DTU = nullptr, - SmallVectorImpl *DTUpdates = nullptr); +void DeleteDeadBlocks(ArrayRef BBs, + DomTreeUpdater *DTU = nullptr); /// We know that BB has one predecessor. If there are any single-entry PHI nodes /// in it, fold them away. This handles the case when all entries to the PHI diff --git a/lib/Transforms/Utils/BasicBlockUtils.cpp b/lib/Transforms/Utils/BasicBlockUtils.cpp index 82b9979cfc5..cb8614fcb98 100644 --- a/lib/Transforms/Utils/BasicBlockUtils.cpp +++ b/lib/Transforms/Utils/BasicBlockUtils.cpp @@ -47,15 +47,12 @@ using namespace llvm; -void llvm::DeleteDeadBlock( - BasicBlock *BB, DomTreeUpdater *DTU, - SmallVectorImpl *DTUpdates) { - DeleteDeadBlocks({BB}, DTU, DTUpdates); +void llvm::DeleteDeadBlock(BasicBlock *BB, DomTreeUpdater *DTU) { + DeleteDeadBlocks({BB}, DTU); } -void llvm::DeleteDeadBlocks( - ArrayRef BBs, DomTreeUpdater *DTU, - SmallVectorImpl *DTUpdates) { +void llvm::DeleteDeadBlocks(ArrayRef BBs, + DomTreeUpdater *DTU) { #ifndef NDEBUG // Make sure that all predecessors of each dead block is also dead. SmallPtrSet Dead(BBs.begin(), BBs.end()); @@ -71,7 +68,7 @@ void llvm::DeleteDeadBlocks( // of their predecessors is going away. for (BasicBlock *Succ : successors(BB)) { Succ->removePredecessor(BB); - if (DTU || DTUpdates) + if (DTU) Updates.push_back({DominatorTree::Delete, BB, Succ}); } @@ -95,8 +92,6 @@ void llvm::DeleteDeadBlocks( } if (DTU) DTU->applyUpdates(Updates, /*ForceRemoveDuplicates*/ true); - if (DTUpdates) - DTUpdates->append(Updates.begin(), Updates.end()); for (BasicBlock *BB : BBs) if (DTU) -- 2.40.0