llvm-project/llvm/test/Analysis/BranchProbabilityInfo
Yevgeny Rouban dcfa78a4cc Extend InvokeInst !prof branch_weights metadata to unwind branches
Allow InvokeInst to have the second optional prof branch weight for
its unwind branch. InvokeInst is a terminator with two successors.
It might have its unwind branch taken many times. If so
the BranchProbabilityInfo unwind branch heuristic can be inaccurate.
This patch allows a higher accuracy calculated with both branch
weights set.

Changes:
 - A new section about InvokeInst is added to
   the BranchWeightMetadata page. It states the old information that
   missed in the doc and adds new about the second branch weight.
 - Verifier is changed to allow either 1 or 2 branch weights
   for InvokeInst.
 - A new test is written for BranchProbabilityInfo to demonstrate
   the main improvement of the simple fix in calcMetadataWeights().
 - Several new testcases are created for Inliner. Those check that
    both weights are accounted for invoke instruction weight
    calculation.
 - PGOUseFunc::setBranchWeights() is fixed to be applicable to
   InvokeInst.

Reviewers: davidxl, reames, xur, yamauchi
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80618
2020-06-04 15:37:15 +07:00
..
basic.ll Extend InvokeInst !prof branch_weights metadata to unwind branches 2020-06-04 15:37:15 +07:00
deopt-intrinsic.ll
fcmp.ll
libfunc_call.ll
loop.ll
noreturn.ll Reland "b19ec1eb3d0c [BPI] Improve unreachable/ColdCall heurstics to handle loops." 2019-12-02 10:28:40 -08:00
pr18705.ll
pr22718.ll Migrate function attribute "no-frame-pointer-elim" to "frame-pointer"="all" as cleanups after D56351 2019-12-24 15:57:33 -08:00
switch.ll [BPI] Incorrect probability reported in case of mulptiple edges. 2020-04-30 11:41:03 +07:00
zero_heuristics.ll