This is an archive of the discontinued LLVM Phabricator instance.

[NFC][Utils] deleteDeadLoop(): add an assert that exit block has some non-PHI instruction
ClosedPublic

Authored by lebedev.ri on Apr 23 2019, 6:22 AM.

Details

Summary

If deleteDeadLoop() is called on such a loop, that has "bad" exit block,
one that e.g. has no terminator instruction, the DIBuilder::insertDbgValueIntrinsic()
will be told to insert the Dbg Value Intrinsic after nullptr
(since there is no first non-PHI instruction), which will cause it to not insert
those instructions into any basic block. The instructions will be parent-less,
and IR verifier will complain. It is rather obvious to track down the root cause
when that happens, so let's just assert it never happens.

Diff Detail

Repository
rL LLVM

Event Timeline

lebedev.ri created this revision.Apr 23 2019, 6:22 AM
vsk accepted this revision.Apr 25 2019, 2:12 PM

Thanks, lgtm.

This revision is now accepted and ready to land.Apr 25 2019, 2:12 PM
In D61008#1479450, @vsk wrote:

Thanks, lgtm.

Thank you for the review!

This revision was automatically updated to reflect the committed changes.