This is an archive of the discontinued LLVM Phabricator instance.

[MBP] Fix a really horrible bug in MachineBlockPlacement, but behind a flag for now.
Needs ReviewPublic

Authored by djasper on Mar 6 2015, 6:23 AM.

Details

Reviewers
chandlerc
Summary

This is similar to Chandler's r231238 (most details on that commit log).

The difference is that Chandler's version led to putting outlined blocks in reverse order, which does seem to have a quite dramatic performance overhead.

In contrast, this version only picks the back of the worklist, if the previously placed machine block had a successor that wasn't placed for other reasons, especially:

  • It was cold.
  • It had a globally more important predecessor.

Using the back of the worklist in those circumstances keeps outlined branches together. Once an outlined branch was placed completely, there simply won't be any more successors and it is more useful to start with the hottest block from the entire worklist (and the first one for equal probabilities).

Diff Detail

Event Timeline

djasper updated this revision to Diff 21347.Mar 6 2015, 6:23 AM
djasper retitled this revision from to [MBP] Fix a really horrible bug in MachineBlockPlacement, but behind a flag for now..
djasper updated this object.
djasper edited the test plan for this revision. (Show Details)
djasper added a reviewer: chandlerc.
djasper added a subscriber: Unknown Object (MLST).
djasper updated this revision to Diff 21356.Mar 6 2015, 7:38 AM
djasper updated this object.

Re-added test. Nicely, none of the existing tests needs to be updated now.