[all-commits] [llvm/llvm-project] b92154: SplitIndirectBrCriticalEdges: Fix Branch Probabili...

Yevgeny Rouban via All-commits all-commits at lists.llvm.org
Thu May 7 01:32:41 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: b921543c494bfb321114602902aacb9392e840da
      https://github.com/llvm/llvm-project/commit/b921543c494bfb321114602902aacb9392e840da
  Author: Yevgeny Rouban <yrouban at azul.com>
  Date:   2020-05-07 (Thu, 07 May 2020)

  Changed paths:
    M llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp
    M llvm/unittests/Transforms/Utils/BasicBlockUtilsTest.cpp

  Log Message:
  -----------
  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




More information about the All-commits mailing list