This is an archive of the discontinued LLVM Phabricator instance.

Revive http://reviews.llvm.org/D12778 to handle forward-hot-prob and backward-hot-prob consistently.
ClosedPublic

Authored by danielcdh on Jun 3 2016, 2:52 PM.

Details

Summary

Consider the following diamond CFG:

A
/ \
B C
\/
D

Suppose A->B and A->C have probabilities 81% and 19%. In block-placement, A->B is called a hot edge and the final placement should be ABDC. However, the current implementation outputs ABCD. This is because when choosing the next block of B, it checks if Freq(C->D) > Freq(B->D) * 20%, which is true (if Freq(A) = 100, then Freq(B->D) = 81, Freq(C->D) = 19, and 19 > 81*20%=16.2). Actually, we should use 25% instead of 20% as the probability here, so that we have 19 < 81*25%=20.25, and the desired ABDC layout will be generated.

Diff Detail

Event Timeline

danielcdh updated this revision to Diff 59629.Jun 3 2016, 2:52 PM
danielcdh retitled this revision from to Revive http://reviews.llvm.org/D12778 to handle forward-hot-prob and backward-hot-prob consistently..
danielcdh updated this object.
danielcdh added reviewers: davidxl, djasper.
danielcdh added a subscriber: llvm-commits.
davidxl accepted this revision.Jun 7 2016, 10:42 PM
davidxl edited edge metadata.

this makes sense.

lgtm.

This revision is now accepted and ready to land.Jun 7 2016, 10:42 PM
danielcdh closed this revision.Jun 8 2016, 2:36 PM