This is an archive of the discontinued LLVM Phabricator instance.

Check the loop header before updating it in UpdateAnalysisInformation
AbandonedPublic

Authored by anna on Jun 2 2017, 9:17 AM.

Details

Summary

In UpdateAnalysisInformation, when passed in predecessors and the Old Basic
Block and the NewBasicBlock (that is split from the old one), we try to identify
if the loopheader has changed. The loop header changes to newBB if the OldBB was
actually the loop header.
This patch checks for that before changing the loop header. Specifically, we saw
a failure in IRCE where the loop header was changed incorrectly through a call
to SplitLandingPadPredecessors.

Event Timeline

anna created this revision.Jun 2 2017, 9:17 AM
anna added a comment.Jun 2 2017, 9:25 AM

One thing to mention: I think currently there's no case where SplitMakesNewLoopHeader is true when the OldBB is not a header in UpdateAnalysisInformation. This happens only in IRCE. However, it is possible at some point, when a subloop does not have dedicated exits, and we incorrectly update the header of the subloop.

anna abandoned this revision.Jun 2 2017, 10:58 AM

We're looking at fixing this in IRCE itself.