This is an archive of the discontinued LLVM Phabricator instance.

[LoopInfo] Fix getUniqueNonLatchExitBlocks
ClosedPublic

Authored by skatkov on Jul 16 2019, 12:57 AM.

Details

Summary

It is possible that exit block has two predecessors and one of them is a latch
block while another is not.

Current algorithm is based on the assumption that all exits are dedicated
and therefore we can check only first predecessor of loop exit to find all unique
exits.

However if we do not consider latch block and it is first predecessor of some
exit then this exit will be found.

Regression test is added.

As a side effect of algorithm re-writing, the restriction that all exits are dedicated
is eliminated

Diff Detail

Event Timeline

skatkov created this revision.Jul 16 2019, 12:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 16 2019, 12:57 AM
This revision is now accepted and ready to land.Jul 16 2019, 12:02 PM
This revision was automatically updated to reflect the committed changes.