SplitIndirectBrCriticalEdges: Fix Branch Probability update
Splitting critical edges for indirect branches the SplitIndirectBrCriticalEdges() function may break branch probabilities if target basic block happens to have unset a probability for any of its successors. That is because in such cases the getEdgeProbability(Target) function returns probability 1/NumOfSuccessors and it is called after Target was split (thus Target has a single successor). As the result the correspondent successor of the split block gets probability 100% but 1/NumOfSuccessors is expected (or better be left unset). Reviewers: yamauchi Differential Revision: https://reviews.llvm.org/D78806
Loading
Please register or sign in to comment