]> granicus.if.org Git - llvm/commit
[PowerPC] Do the Simple Early Return in block-placement pass to optimize the blocks
authorKang Zhang <shkzhang@cn.ibm.com>
Fri, 26 Jul 2019 01:58:53 +0000 (01:58 +0000)
committerKang Zhang <shkzhang@cn.ibm.com>
Fri, 26 Jul 2019 01:58:53 +0000 (01:58 +0000)
commit39ace151b71d446b27dd79de4af935902312f979
treef51253f34c5fba42c9cb5b8468ea1c56360476ef
parent9466b7a1ed98c6a1ff808ceb97366d87c1152116
[PowerPC] 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`.

Below is an example
```
BB:                   | BB:
   XOR 3, 3, 4        |   XOR 3, 3, 4
   B TBB              |   B ChainBB
...                   | ...
ChainBB:              | ChainBB:
   B TBB              |   ADD 3, 3, 4
...                   |   BLR
TBB:                  |
   ADD 3, 3, 4        |
   BLR                |
```

Reviewed By: efriedma

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367080 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/MachineBlockPlacement.cpp
test/CodeGen/PowerPC/block-placement-1.mir
test/CodeGen/PowerPC/block-placement.mir