Page MenuHomePhabricator

[SimplifyCFG] Cleanup redundant conditions [NFC].

Authored by asbirlea on Aug 1 2019, 11:33 AM.



Since the for loop iterates over BB's predecessors, the branch conditions found must have BB as one of the successors.
For an unconditional branch the successor must be BB, added assert.
For a conditional branch, one of the two successors must be BB, simplify else if to else and assert.
Sink common instructions outside the if/else block.

Diff Detail


Event Timeline

asbirlea created this revision.Aug 1 2019, 11:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 1 2019, 11:33 AM
Herald added a subscriber: jlebar. · View Herald Transcript
This revision is now accepted and ready to land.Aug 1 2019, 4:20 PM
This revision was automatically updated to reflect the committed changes.