[CodeGen] Do the Simple Early Return in block-placement pass to optimize the blocks
authorKang Zhang <shkzhang@cn.ibm.com>
Sat, 10 Aug 2019 09:58:52 +0000 (09:58 +0000)
committerKang Zhang <shkzhang@cn.ibm.com>
Sat, 10 Aug 2019 09:58:52 +0000 (09:58 +0000)
commit36cd84bdd9a7bca22b04341aa6abbf4d6b6e86d2
treef83118e5a3dd5346e758f14940255e6cb2cb7036
parent3ab587df82c8f917a7048e7797b90267694ad938
[CodeGen] Do the Simple Early Return in block-placement pass to optimize the blocks

Summary:

In `block-placement` pass, it will create some patterns for unconditional we can do the simple early retrun.
But the `early-ret` pass is before `block-placement`, we don't want to run it again.
This patch is to do the simple early return to optimize the blocks at the last of `block-placement`.

Reviewed By: efriedma

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

llvm-svn: 368509
llvm/lib/CodeGen/MachineBlockPlacement.cpp
llvm/test/CodeGen/PowerPC/block-placement-1.mir
llvm/test/CodeGen/PowerPC/block-placement.mir