[PATCH] D30633: [BPI] Reduce the probability of unreachable edge to minimal value greater than 0
Serguei Katkov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 16 21:53:38 PDT 2017
skatkov added inline comments.
================
Comment at: lib/Analysis/BranchProbabilityInfo.cpp:291
auto ToDistribute = BranchProbability::getZero();
- auto UnreachableProb = getUnreachableProbability(UnreachableIdxs.size());
+ auto UnreachableProb = UR_TAKEN_PROB;
for (auto i : UnreachableIdxs)
----------------
davidxl wrote:
> Not sure if we want to add a case to cover the meta data is smaller and is kept.
>
> The only possible way is to use 0 weight, which actually may end up creating a a larger BP (after BFI bumping it up). So we should probably add a comment here and unconditionally update the Unreachable branch (i.e. ignoring 0 weight metadata).
I prefer to keep it as is due to current logic is correct semantically independent on what UR_TAKEN_PROB is. If someone in the future increases the UR_TAKEN_PROB the code will work correctly anyway.
https://reviews.llvm.org/D30633
More information about the llvm-commits
mailing list