This is an archive of the discontinued LLVM Phabricator instance.

[BasicBlock] fix looping in getPostdominatingDeoptimizeCall
ClosedPublic

Authored by fedor.sergeev on Jan 17 2020, 2:08 AM.

Details

Summary

Blindly following unique-successors chain appeared to be a bad idea.
In a degenerate case when block jumps to itself that goes into endless loop.

Discovered this problem when playing with additional changes,
managed to reproduce it on existing LoopPredication code.

Fix by checking a "visited" set while iterating through unique successors.

Event Timeline

fedor.sergeev created this revision.Jan 17 2020, 2:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 17 2020, 2:08 AM

adding CHECK-LABEL to the test so it passes with lit

skatkov accepted this revision.Jan 17 2020, 2:23 AM

Good catch.

This revision is now accepted and ready to land.Jan 17 2020, 2:23 AM
This revision was automatically updated to reflect the committed changes.