This is an archive of the discontinued LLVM Phabricator instance.

[LV] Remove redundant basic block split
ClosedPublic

Authored by gilr on Apr 19 2017, 7:31 AM.

Details

Summary

This patch is part of D28975's breakdown.

The process of generating the control flow guarding predicated instructions includes:
(1) a call to SplitBlock(), which splits the basic block after the predicated instruction, producing:

--> HEAD -->  PRED --> TAIL -->

(2) a call to SplitBblockAndInsertIfThen() which splits the basic block before the predicated instruction into a "triangle", resulting
in a redundant basic block with an unconditional branch:

--> HEAD -->  PRED --> MERGE --> TAIL -->
          +----------------------^

By removing (1) we get:

--> HEAD -->  PRED --> MERGE/TAIL -->
          +--------------------^

Diff Detail

Repository
rL LLVM

Event Timeline

gilr created this revision.Apr 19 2017, 7:31 AM
gilr edited the summary of this revision. (Show Details)Apr 19 2017, 7:32 AM
gilr edited the summary of this revision. (Show Details)
mkuper accepted this revision.Apr 24 2017, 10:30 AM

Makes sense. LGTM.

This revision is now accepted and ready to land.Apr 24 2017, 10:30 AM
This revision was automatically updated to reflect the committed changes.