Merge identical blocks when it doesn't reduce fallthrough. It is common for
the blocks created from critical edge splitting to be identical. We would like
to merge these blocks whenever doing so would not reduce fallthrough.
Details
- Reviewers
davidxl
Diff Detail
Event Timeline
lib/CodeGen/BranchFolding.cpp | ||
---|---|---|
604 | This may have bad effect on block layout if tail dup can recover from it. For instance, when both MBB1 and MBB2 have fall through successors. |
lib/CodeGen/BranchFolding.cpp | ||
---|---|---|
604 | Currently tail-duplication only copies instructions to the ends of blocks with unconditional jumps, so this won't conflict with tail-duplication. |
Now merge in a far more limited case, only if one of the blocks is missing a fallthrough in or out.
Also, only after layout so that we reliably know about fallthrough.
This may have bad effect on block layout if tail dup can recover from it. For instance, when both MBB1 and MBB2 have fall through successors.