This is an archive of the discontinued LLVM Phabricator instance.

[PM/LoopUnswitch] Fix how the cloned loops are handled when updating analyses.
ClosedPublic

Authored by chandlerc on Jun 1 2018, 12:00 PM.

Details

Summary

I noticed this issue because we didn't put the primary cloned loop into
the NonChildClonedLoops vector and so never iterated on it. Once
I fixed that, it made it clear why I had to do a really complicated and
unnecesasry dance when updating the loops to remain in canonical form --
I was unwittingly working around the fact that the primary cloned loop
wasn't in the expected list of cloned loops. Doh!

Now that we include it in this vector, we don't need to return it and we
can consolidate the update logic as we correctly have a single place
where it can be handled.

I've just added a test for the iteration order aspect as every time
I changed the update logic partially or incorrectly here, an existing
test failed and caught it so that seems well covered (which is also
evidenced by the extensive working around of this missing update).

Diff Detail

Repository
rL LLVM

Event Timeline

chandlerc created this revision.Jun 1 2018, 12:00 PM
sanjoy accepted this revision.Jun 1 2018, 6:09 PM

lgtm

This revision is now accepted and ready to land.Jun 1 2018, 6:09 PM
This revision was automatically updated to reflect the committed changes.