summaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorEvgeniy Brevnov <evgueni.brevnov@gmail.com>2020-04-29 14:08:01 +0700
committerEvgeniy Brevnov <evgueni.brevnov@gmail.com>2020-04-30 11:41:03 +0700
commitbb0842a3f11e5d5a13d3212b627d9f1521bff553 (patch)
treee8e231555219bffa8f34daf678fa1c8c12bb6efe /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent3e68a667047d1541e445c8f47501d69f5b1a497d (diff)
[BPI] Incorrect probability reported in case of mulptiple edges.
Summary: By design 'BranchProbabilityInfo:: getEdgeProbability(const BasicBlock *Src, const BasicBlock *Dst) const' should return sum of probabilities over all edges from Src to Dst. Current implementation is buggy and returns 1/num_of_successors if probabilities are not explicitly set. Note current implementation of BPI printing has an issue as well and annotates each edge with sum of probabilities over all ages from one basic block to another. That's why 30% probability reported (instead of 10%) in the lit test. This is not urgent issue since only printing is affected. Note also current implementation assumes that either all or none edges have probabilities set. This is not the only place which uses such assumption. At least we should assert that in verifier. In addition we can think on a more robust API of BPI which would prevent situations. Reviewers: skatkov, yrouban, taewookoh Reviewed By: skatkov Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D79071
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions