[SimplifyCFG] Extend TryToSimplifyUncondBranchFromEmptyBlock for empty block includin...
authorHans Wennborg <hans@hanshq.net>
Mon, 2 May 2016 17:22:54 +0000 (17:22 +0000)
committerHans Wennborg <hans@hanshq.net>
Mon, 2 May 2016 17:22:54 +0000 (17:22 +0000)
commitb7599329fc28ec8f7086157ea50202fa5ba47f89
tree8eab5e3e0a4b7172f5af45d427da8cfe5dad4f21
parentce18ade406a58aac9cfdea74479a6412f30d920f
[SimplifyCFG] Extend TryToSimplifyUncondBranchFromEmptyBlock for empty block including lifetime intrinsics

Make it possible that TryToSimplifyUncondBranchFromEmptyBlock merges empty
basic block including lifetime intrinsics as well as phi nodes and
unconditional branch into its successor or predecessor(s).

If successor of empty block has single predecessor, all contents including
lifetime intrinsics are sinked into the successor. Otherwise, they are
hoisted into its predecessor(s) and then merged into the predecessor(s).

Patch by Josh Yoon <josh.yoon@samsung.com>!

Differential Revision: http://reviews.llvm.org/D19257

llvm-svn: 268254
llvm/include/llvm/IR/BasicBlock.h
llvm/lib/IR/BasicBlock.cpp
llvm/lib/Transforms/Utils/Local.cpp
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
llvm/test/Transforms/SimplifyCFG/lifetime.ll