diff options
author | Max Kazantsev <max.kazantsev@azul.com> | 2019-02-12 06:14:27 +0000 |
---|---|---|
committer | Max Kazantsev <max.kazantsev@azul.com> | 2019-02-12 06:14:27 +0000 |
commit | d268c90aa57629d11294e684f4e003499085a396 (patch) | |
tree | 11f40b0697cbab604ff41cdd39ef8a3bc82a0f4a /include | |
parent | ea98e2107dc30ad8b30a594879eafe40b5aa5a4f (diff) | |
download | llvm-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.h | 14 |
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 |