[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@375050 91177308-0d34-0410-b5e6-96231b3b80d8
4 files changed