diff options
author | Serguei Katkov <serguei.katkov@azul.com> | 2017-05-12 07:50:06 +0000 |
---|---|---|
committer | Serguei Katkov <serguei.katkov@azul.com> | 2017-05-12 07:50:06 +0000 |
commit | 63c9c81152234922b80e449f650e93e9c9bd0dca (patch) | |
tree | 45c8c2da4618d58e06eb9632e4c703ade55d9cd0 /llvm/test/Analysis/BranchProbabilityInfo/basic.ll | |
parent | 8769403d4996ca745a3d6cef3c29a73c0ab961db (diff) | |
download | bcm5719-llvm-63c9c81152234922b80e449f650e93e9c9bd0dca.tar.gz bcm5719-llvm-63c9c81152234922b80e449f650e93e9c9bd0dca.zip |
[BPI] Ignore remainder while distributing the remaining probability from unreachanble
This is a follow up patch for https://reviews.llvm.org/rL300440
to address a comment.
To make implementation to be consistent with other cases we just
ignore the remainder after distribution of remaining probability between
reachable edges.
If we reduced the probability of some edges coming to unreachable
blocks we should distribute the remaining part across other edges
coming to reachable blocks to satisfy the condition that sum of all
probabilities should be equal to one. If this remaining part is not
divided by number of "reachable" edges then we get this remainder.
This remainder probability should be pretty small. Other cases just ignore
if the sum of probabilities is not equal to one so we do the same.
Reviewers: chandlerc, sanjoy, vsk, junbuml, reames
Reviewed By: reames
Subscribers: reames, llvm-commits
Differential Revision: https://reviews.llvm.org/D32124
llvm-svn: 302883
Diffstat (limited to 'llvm/test/Analysis/BranchProbabilityInfo/basic.ll')
-rw-r--r-- | llvm/test/Analysis/BranchProbabilityInfo/basic.ll | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/test/Analysis/BranchProbabilityInfo/basic.ll b/llvm/test/Analysis/BranchProbabilityInfo/basic.ll index 84936b7761c..7bee1bd5737 100644 --- a/llvm/test/Analysis/BranchProbabilityInfo/basic.ll +++ b/llvm/test/Analysis/BranchProbabilityInfo/basic.ll @@ -452,7 +452,7 @@ entry: i32 3, label %case_d i32 4, label %case_e ], !prof !8 ; CHECK: edge entry -> case_a probability is 0x00000800 / 0x80000000 = 0.00% -; CHECK: edge entry -> case_b probability is 0x07fffe01 / 0x80000000 = 6.25% +; CHECK: edge entry -> case_b probability is 0x07fffdff / 0x80000000 = 6.25% ; CHECK: edge entry -> case_c probability is 0x67fffdff / 0x80000000 = 81.25% [HOT edge] ; CHECK: edge entry -> case_d probability is 0x07fffdff / 0x80000000 = 6.25% ; CHECK: edge entry -> case_e probability is 0x07fffdff / 0x80000000 = 6.25% @@ -495,7 +495,7 @@ entry: i32 4, label %case_e ], !prof !9 ; CHECK: edge entry -> case_a probability is 0x00000400 / 0x80000000 = 0.00% ; CHECK: edge entry -> case_b probability is 0x00000400 / 0x80000000 = 0.00% -; CHECK: edge entry -> case_c probability is 0x6aaaa800 / 0x80000000 = 83.33% [HOT edge] +; CHECK: edge entry -> case_c probability is 0x6aaaa7ff / 0x80000000 = 83.33% [HOT edge] ; CHECK: edge entry -> case_d probability is 0x0aaaa7ff / 0x80000000 = 8.33% ; CHECK: edge entry -> case_e probability is 0x0aaaa7ff / 0x80000000 = 8.33% @@ -535,7 +535,7 @@ entry: i32 4, label %case_e ], !prof !10 ; CHECK: edge entry -> case_a probability is 0x00000000 / 0x80000000 = 0.00% ; CHECK: edge entry -> case_b probability is 0x00000400 / 0x80000000 = 0.00% -; CHECK: edge entry -> case_c probability is 0x6e08fa2e / 0x80000000 = 85.96% [HOT edge] +; CHECK: edge entry -> case_c probability is 0x6e08fa2d / 0x80000000 = 85.96% [HOT edge] ; CHECK: edge entry -> case_d probability is 0x08fb80e9 / 0x80000000 = 7.02% ; CHECK: edge entry -> case_e probability is 0x08fb80e9 / 0x80000000 = 7.02% |