[llvm] 40fb4ee - [NFCI][Local] TryToSimplifyUncondBranchFromEmptyBlock(): use DeleteDeadBlocks()
Roman Lebedev via llvm-commits
llvm-commits at lists.llvm.org
Wed May 19 10:39:03 PDT 2021
Author: Roman Lebedev
Date: 2021-05-19T20:38:30+03:00
New Revision: 40fb4eeff9ee59382f6bc37c622bde99c2a9a02a
URL: https://github.com/llvm/llvm-project/commit/40fb4eeff9ee59382f6bc37c622bde99c2a9a02a
DIFF: https://github.com/llvm/llvm-project/commit/40fb4eeff9ee59382f6bc37c622bde99c2a9a02a.diff
LOG: [NFCI][Local] TryToSimplifyUncondBranchFromEmptyBlock(): use DeleteDeadBlocks()
Added:
Modified:
llvm/lib/Transforms/Utils/Local.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 0dc954532d33..13a2f30442cc 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;
}
More information about the llvm-commits
mailing list