Page MenuHomePhabricator

Optionally disable the BadCFGConflict check in MachineBlockPlacement.cpp

Authored by djasper on Jan 14 2015, 8:36 AM.



Some benchmarks have shown that this could lead to a potential performance benefit.

A possible explanation. In diamond-shaped CFGs (A followed by either B or C both followed by D), putting B and C both in between A and D leads to the code being less dense than it could be. Always either B or C have to be skipped increasing the chance of cache misses etc. Moving either B or C to after D might be beneficial on average.

In the long run, but we should probably do a better job of analyzing the basic block and branch probabilities to move the correct one of B or C to after D. But even if we don't use this in the long run, it is a good baseline for benchmarking.

Diff Detail


Event Timeline

djasper updated this revision to Diff 18160.Jan 14 2015, 8:36 AM
djasper retitled this revision from to Optionally disable the BadCFGConflict check in MachineBlockPlacement.cpp.
djasper updated this object.
djasper edited the test plan for this revision. (Show Details)
djasper added a reviewer: chandlerc.
djasper added subscribers: Unknown Object (MLST), klimek.
chandlerc edited edge metadata.Jan 14 2015, 12:20 PM

Thanks for this!

I've committed this with an added flag and more tests.

This revision was automatically updated to reflect the committed changes.