This is an archive of the discontinued LLVM Phabricator instance.

[LoopInfo] Verify BBMap tracks innermost loops for BBs.
ClosedPublic

Authored by fhahn on Apr 23 2018, 9:42 AM.

Details

Summary

By checking that none of the child loops contain a BB we make sure BBMap
contains the innermost loop defining BB. This invariant was violated in
LoopInterchange and got caught by this assertion.

Diff Detail

Repository
rL LLVM

Event Timeline

fhahn created this revision.Apr 23 2018, 9:42 AM

LoopInterchange did that wrong and this additional assertion catches that. The fix for LoopInterchange is at D45970

efriedma accepted this revision.Apr 23 2018, 12:35 PM
efriedma added a subscriber: efriedma.

LGTM

While you're at it, could you also add a check to compareLoops to make sure the DenseBlockSet is consistent?

This revision is now accepted and ready to land.Apr 23 2018, 12:35 PM
fhahn updated this revision to Diff 143648.Apr 23 2018, 2:38 PM
fhahn retitled this revision from [LoopInfo] Verify BBMap tracks deepest loops for BBs. to [LoopInfo] Verify BBMap tracks innermost loops for BBs..
fhahn edited the summary of this revision. (Show Details)

Add check to make sure the blocks sets match. I had to add a function to get a handle for a const blocks sets, what do you think? I would be happy to split this up in 2 patches if necessary.

This revision was automatically updated to reflect the committed changes.