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.
When ChainBB is unconditional branch to the TBB, and TBB has no
fallthrough predecessor and fallthrough successor, try to merge
ChainBB and TBB. This is legal under the one of following conditions:
- ChainBB is empty except for an unconditional branch.
- TBB has only one predecessor.
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 |
English grammar here is wrong; the first sentence is a fragment... and even if you fixed that it's hard to understand. Maybe something like the following: "Try to merge ChainBB and TBB. This is legal under the following conditions: 1. "...