]> granicus.if.org Git - llvm/commit
[BPI] Ignore remainder while distributing the remaining probability from unreachanble
authorSerguei Katkov <serguei.katkov@azul.com>
Fri, 12 May 2017 07:50:06 +0000 (07:50 +0000)
committerSerguei Katkov <serguei.katkov@azul.com>
Fri, 12 May 2017 07:50:06 +0000 (07:50 +0000)
commit0a65c23b0e9468902b7bf0b5ec74ca2e45320d7b
treea3594b051ade39cd3e933b213105b3ed231579a3
parent2dfa410c1dc28900736a1f745ce9dd060fd6293b
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302883 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/BranchProbabilityInfo.cpp
test/Analysis/BranchProbabilityInfo/basic.ll