[Utils] Cleanup similar cases to MergeBlockIntoPredecessor.
authorAlina Sbirlea <asbirlea@google.com>
Wed, 16 Oct 2019 22:23:20 +0000 (22:23 +0000)
committerAlina Sbirlea <asbirlea@google.com>
Wed, 16 Oct 2019 22:23:20 +0000 (22:23 +0000)
commit4eb1a573fab3b2257e966c97a06d15159ecac922
tree1c6501dd1851fded8219b6f3b580e28078a835ae
parent471dc1fb286ae7551da1d4a0349970b2a9491052
[Utils] Cleanup similar cases to MergeBlockIntoPredecessor.

Summary:
There are two cases where a block is merged into its predecessor and the
MergeBlockIntoPredecessor API is not used. Update the API so it can be
reused in the other cases, in order to avoid code duplication.

Cleanup motivated by D68659.

Reviewers: chandlerc, sanjoy.google, george.burgess.iv

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68670

llvm-svn: 375050
llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h
llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
llvm/lib/Transforms/Utils/LoopRotationUtils.cpp