[llvm-commits] [PATCH 4/5] Extend replaceAllUsesWith() on a BasicBlock.

Jay Foad jay.foad at gmail.com
Thu Jun 16 04:09:25 PDT 2011


Extend replaceAllUsesWith() on a BasicBlock to also update any phi
nodes in the block's successors. This mimics what would have happened
when PHINodes were proper Users of their incoming blocks. (Note that
this only works if OldBB->replaceAllUsesWith(NewBB) is called when
OldBB still has a terminator instruction, so it still has some
successors.)

This has only been split out from the previous patch for ease of review.
They will be committed together to keep things bisectable.
---
 include/llvm/BasicBlock.h                |    4 ++++
 lib/Transforms/Scalar/LoopUnswitch.cpp   |    8 ++++----
 lib/Transforms/Utils/BasicBlockUtils.cpp |    6 +++---
 lib/Transforms/Utils/CloneFunction.cpp   |    6 +++---
 lib/Transforms/Utils/InlineFunction.cpp  |   10 +++++-----
 lib/Transforms/Utils/Local.cpp           |    8 ++++----
 lib/Transforms/Utils/LoopUnroll.cpp      |    6 +++---
 lib/VMCore/BasicBlock.cpp                |   16 ++++++++++++++++
 lib/VMCore/Value.cpp                     |    3 +++
 9 files changed, 45 insertions(+), 22 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-Extend-replaceAllUsesWith-on-a-BasicBlock.patch
Type: text/x-patch
Size: 8756 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110616/ccdbd6c4/attachment.bin>


More information about the llvm-commits mailing list