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

Jay Foad jay.foad at gmail.com
Thu Jun 16 07:02:31 PDT 2011


On 16 June 2011 12:09, Jay Foad <jay.foad at gmail.com> wrote:
> 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(-)

I forgot that this part also requires a small change in Clang, attached.

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


More information about the cfe-commits mailing list