- // Add an unconditional branch from 'false' to to 'false' successor if it
- // will not be the fallthrough block.
- if (NeedBr2 && !NeedBr1) {
- // If BBI2 isn't going to be merged in, then the existing fallthrough
- // or branch is fine.
- if (!canFallThroughTo(BBI.BB, BBI2->FalseBB)) {
- InsertUncondBranch(BBI2->BB, BBI2->FalseBB, TII);
- BBI2->HasFallThrough = false;
- }
- }
-
- // Keep them as two separate blocks if there is an early exit.
- if (!NeedBr1)
- MergeBlocks(*BBI1, *BBI2);
-
- // Merge the combined block into the entry of the diamond.