This is an archive of the discontinued LLVM Phabricator instance.

Fix maxLoopDepth computation in ScopInfo
ClosedPublic

Authored by dpeixott on Jan 9 2015, 5:56 PM.

Details

Summary

The max loop depth was incorrectly computed for scops that contain a
block from a loop but do not contain the entire loop. We need to
check that the full loop is contained in the block when computing
the max loop depth.

Diff Detail

Event Timeline

dpeixott updated this revision to Diff 17965.Jan 9 2015, 5:56 PM
dpeixott retitled this revision from to Fix maxLoopDepth computation in ScopInfo.
dpeixott added reviewers: grosser, jdoerfert, zinob.
dpeixott updated this object.
dpeixott added a subscriber: Unknown Object (MLST).
jdoerfert accepted this revision.Jan 9 2015, 6:16 PM
jdoerfert edited edge metadata.

LGTM

This revision is now accepted and ready to land.Jan 9 2015, 6:16 PM
grosser edited edge metadata.Jan 9 2015, 11:00 PM

Yes, this looks good. I wonder in which context you run into this? Is it possible to provide a test case that covers this?

Also, the commit message is slightly inaccurate:

We need to check that the full loop is contained in the block when computing

in the _region_

dpeixott updated this revision to Diff 18064.Jan 12 2015, 5:17 PM
dpeixott edited edge metadata.

Added test case and fixed commit message.

Tobi,

I added a test case and also an explanation in the commit message on when we can hit this problem.

These scops occur when a region containing an inner loop is expanded
to include some blocks from the outer loop, but it cannot be fully
expanded to contain the outer loop because the region containing the
outer loop is invalid.

This revision was automatically updated to reflect the committed changes.