This is an archive of the discontinued LLVM Phabricator instance.

[Analysis] Print out unreachable loops
ClosedPublic

Authored by modocache on May 4 2017, 12:03 PM.

Details

Summary

When writing a loop pass I made a mistake and hit the assertion
"Unreachable block in loop". Later, I hit an assertion when I called
BasicBlock::eraseFromParent() incorrectly: "Use still stuck around
after Def is destroyed". This latter assertion, however, printed out
exactly which value is being deleted and what uses remain, which helped
me debug the issue.

To help people debugging their loop passes in the future, print out
exactly which basic block is unreachable in a loop.

Event Timeline

modocache created this revision.May 4 2017, 12:03 PM
This revision is now accepted and ready to land.May 5 2017, 10:40 AM
modocache closed this revision.May 6 2017, 9:36 AM

Thank you, Mehdi! :)

davide added a subscriber: davide.May 7 2017, 9:48 AM
davide added inline comments.
include/llvm/Analysis/LoopInfoImpl.h
272

We prefer llvm_unreachable in this case.