This is an archive of the discontinued LLVM Phabricator instance.

Remove assert from MachineLoop::getLoopPredecessor()
ClosedPublic

Authored by rampitec on Sep 16 2019, 2:01 PM.

Details

Summary

According to the documentation method returns predecessor
if the given loop's header has exactly one unique predecessor
outside the loop. Otherwise return null.

In reality it asserts if there is no predecessor outside of
the loop.

The testcase has the loop where predecessors outside of the
loop were not identified as analyzeBranch() was unable to
process the mask branch and returned true. That is also not
correct to assert for the truly dead loops.

Diff Detail

Event Timeline

rampitec created this revision.Sep 16 2019, 2:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 16 2019, 2:01 PM
arsenm accepted this revision.Sep 19 2019, 5:03 PM

LGTM with test fix

llvm/test/CodeGen/AMDGPU/loop_header_nopred.mir
7–8

Can you generate full checks?

This revision is now accepted and ready to land.Sep 19 2019, 5:03 PM
rampitec updated this revision to Diff 221037.Sep 20 2019, 8:20 AM
rampitec marked an inline comment as done.

Generated full checks.

This revision was automatically updated to reflect the committed changes.