From 40fb4eeff9ee59382f6bc37c622bde99c2a9a02a Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Wed, 19 May 2021 20:26:33 +0300 Subject: [PATCH] [NFCI][Local] TryToSimplifyUncondBranchFromEmptyBlock(): use DeleteDeadBlocks() --- llvm/lib/Transforms/Utils/Local.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index 0dc9545..13a2f30 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -1150,12 +1150,11 @@ bool llvm::TryToSimplifyUncondBranchFromEmptyBlock(BasicBlock *BB, assert(succ_empty(BB) && "The successor list of BB isn't empty before " "applying corresponding DTU updates."); - if (DTU) { + if (DTU) DTU->applyUpdates(Updates); - DTU->deleteBB(BB); - } else { - BB->eraseFromParent(); // Delete the old basic block. - } + + DeleteDeadBlock(BB, DTU); + return true; } -- 2.7.4