This is an archive of the discontinued LLVM Phabricator instance.

[fix-irreducible] Skip unreachable predecessors.
ClosedPublic

Authored by hliao on Jul 10 2020, 8:55 AM.

Details

Summary
  • Skip unreachable predecessors during header detection in SCC. Those unreachable blocks would be generated in the switch lowering pass in the corner cases or other frontends. Even though they could be removed through the CFG simplification, we should skip them during header detection.

Diff Detail

Event Timeline

hliao created this revision.Jul 10 2020, 8:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 10 2020, 8:55 AM

@cdevadas reported that other parts of the AMDGPU backend are also affected by the unreachable blocks being produced in the switch lowering. Instead of fixing each such pass separately, it seems the best way forward it to put the block elimination earlier in the flow. @cdevadas is already working on such a change.

hliao added a comment.Jul 10 2020, 9:42 AM

@cdevadas reported that other parts of the AMDGPU backend are also affected by the unreachable blocks being produced in the switch lowering. Instead of fixing each such pass separately, it seems the best way forward it to put the block elimination earlier in the flow. @cdevadas is already working on such a change.

I understand the cleanup of switch-lower pass could avoid the issue. But, as a general pass, it should be prepared to handle the general cases similar to other general passes. Also, it's a blocking issue to our schedule. Could you review this trivial change?

sameerds accepted this revision.Jul 10 2020, 9:33 PM

LGTM!

This revision is now accepted and ready to land.Jul 10 2020, 9:33 PM
This revision was automatically updated to reflect the committed changes.