This is an archive of the discontinued LLVM Phabricator instance.

[LoopSimplifyCFG] Fix order of deletion of complex dead subloops
ClosedPublic

Authored by mkazantsev on Dec 27 2018, 11:51 PM.

Details

Summary

Function DeleteDeadBlock requires that all predecessors of a block
being deleted have already been deleted, with the exception of a
single-block loop. When we use it for removal of dead subloops that
contain more than one block, we may not fulfull this requirement and
fail an assertion.

This patch replaces invocation of DeleteDeadBlock with a generalized
version DeleteDeadBlocks that is able to deal with multiple dead blocks,
even if they contain some cycles.

Diff Detail

Event Timeline

This revision is now accepted and ready to land.Jan 16 2019, 4:50 AM
This revision was automatically updated to reflect the committed changes.