hiraditya added a comment. The general idea appears to be good, do you have any testcases reflect the change? Also correct me if I'm wrong, it seems changes to MergeBlockIntoPredecessor can be separated from other changes. Repository: rL LLVM https://reviews.llvm.org/D45300