This is an archive of the discontinued LLVM Phabricator instance.

Do not incorrectly set the inverted flag.
ClosedPublic

Authored by etherzhhb on Nov 27 2014, 6:50 AM.

Details

Reviewers
grosser
Summary

In TempScopInfo::buildCondition we extract the conditions to guard the
BB *in addition of* loop bounds. This means we should only consider the
conditions in the paths (in CFG) that do not contain cycles (loops).

At the same time, we set the invert flag if the FalseBB of the current
branch dominates our target BB to indicate that we reach the target BB
with an inverted condition from the current branch.

In this case, the path from the FalseBB contains a cycle if the FalseBB
is the target of a backedge. The conditions implied by such a path should
not be consider. We can identify such a case by checking if the TrueBB
also dominates our target BB, which means we can also reach our target
BB from the TrueBB, without going through the backedge.

Diff Detail

Event Timeline

etherzhhb updated this revision to Diff 16695.Nov 27 2014, 6:50 AM
etherzhhb retitled this revision from to Do not incorrectly set the inverted flag..
etherzhhb updated this object.
etherzhhb edited the test plan for this revision. (Show Details)
etherzhhb added a reviewer: grosser.
etherzhhb added a subscriber: Unknown Object (MLST).
grosser accepted this revision.Nov 27 2014, 9:26 AM
grosser edited edge metadata.

Please include the test case that belongs to this change.

Otherwise LGTM. Feel free to commit.

This revision is now accepted and ready to land.Nov 27 2014, 9:26 AM
etherzhhb closed this revision.Nov 27 2014, 7:31 PM

r222907 with the case that you sent me

Thanks