aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMax Kazantsev <max.kazantsev@azul.com>2019-02-12 06:14:27 +0000
committerMax Kazantsev <max.kazantsev@azul.com>2019-02-12 06:14:27 +0000
commitd268c90aa57629d11294e684f4e003499085a396 (patch)
tree11f40b0697cbab604ff41cdd39ef8a3bc82a0f4a /include
parentea98e2107dc30ad8b30a594879eafe40b5aa5a4f (diff)
downloadllvm-d268c90aa57629d11294e684f4e003499085a396.tar.gz
[NFC] Add parameter for keeping one-input Phis in DeleteDeadBlock(s)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353799 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Transforms/Utils/BasicBlockUtils.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/llvm/Transforms/Utils/BasicBlockUtils.h b/include/llvm/Transforms/Utils/BasicBlockUtils.h
index fad01f6e8b3..c264aaee70d 100644
--- a/include/llvm/Transforms/Utils/BasicBlockUtils.h
+++ b/include/llvm/Transforms/Utils/BasicBlockUtils.h
@@ -41,19 +41,25 @@ class Value;
/// Replace contents of every block in \p BBs with single unreachable
/// instruction. If \p Updates is specified, collect all necessary DT updates
-/// into this vector.
+/// into this vector. If \p DontDeleteUselessPHIs is true, one-input Phis in
+/// successors of blocks being deleted will be preserved.
void DetatchDeadBlocks(ArrayRef <BasicBlock *> BBs,
- SmallVectorImpl<DominatorTree::UpdateType> *Updates);
+ SmallVectorImpl<DominatorTree::UpdateType> *Updates,
+ bool DontDeleteUselessPHIs = false);
/// Delete the specified block, which must have no predecessors.
-void DeleteDeadBlock(BasicBlock *BB, DomTreeUpdater *DTU = nullptr);
+void DeleteDeadBlock(BasicBlock *BB, DomTreeUpdater *DTU = nullptr,
+ bool DontDeleteUselessPHIs = false);
/// 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 DontDeleteUselessPHIs is true, one-input Phis in successors of blocks
+/// being deleted will be preserved.
void DeleteDeadBlocks(ArrayRef <BasicBlock *> BBs,
- DomTreeUpdater *DTU = nullptr);
+ DomTreeUpdater *DTU = nullptr,
+ bool DontDeleteUselessPHIs = false);
/// 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