From 57d20cbf467fc69ebd575209d101f73ab4461e84 Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Wed, 19 May 2021 11:54:27 +0300 Subject: [PATCH] [NFCI][SimplifyCFG] simplifyUnreachable(): use DeleteDeadBlock() --- llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index ffeafea..dd3c968 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -4851,11 +4851,7 @@ bool SimplifyCFGOpt::simplifyUnreachable(UnreachableInst *UI) { // If this block is now dead, remove it. if (pred_empty(BB) && BB != &BB->getParent()->getEntryBlock()) { - // We know there are no successors, so just nuke the block. - if (DTU) - DTU->deleteBB(BB); - else - BB->eraseFromParent(); + DeleteDeadBlock(BB, DTU); return true; } -- 2.7.4