summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/EarlyCSE.cpp
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2016-06-08 21:30:12 +0000
committerDehao Chen <dehao@google.com>2016-06-08 21:30:12 +0000
commit769219b11afaefa6e5526d439e45a031a93db85d (patch)
treeb9ac024bc091b7320b44decbc41cca8512e987bb /llvm/lib/Transforms/Scalar/EarlyCSE.cpp
parent96c63abad87714ebc7e7a531297a89b54d5f24de (diff)
downloadbcm5719-llvm-769219b11afaefa6e5526d439e45a031a93db85d.tar.gz
bcm5719-llvm-769219b11afaefa6e5526d439e45a031a93db85d.zip
Revive http://reviews.llvm.org/D12778 to handle forward-hot-prob and backward-hot-prob consistently.
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. Reviewers: djasper, davidxl Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D20989 llvm-svn: 272203
Diffstat (limited to 'llvm/lib/Transforms/Scalar/EarlyCSE.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud