llvm-project/llvm/lib/Transforms
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
..
AggressiveInstCombine [SVE] Eliminate calls to default-false VectorType::get() from AggressiveInstCombine 2020-05-29 15:49:33 -07:00
CFGuard Add missing newlines at EOF; NFC 2020-02-12 15:57:25 +00:00
Coroutines CoroSplit: Fix coroutine splitting for retcon and retcon.once 2020-06-03 12:10:58 -07:00
Hello Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IPO [Instruction] Remove setProfWeight() 2020-06-04 15:10:55 +07:00
InstCombine [Instruction] Remove setProfWeight() 2020-06-04 15:10:55 +07:00
Instrumentation Extend InvokeInst !prof branch_weights metadata to unwind branches 2020-06-04 15:37:15 +07:00
ObjCARC [Pass] Ensure we don't include PassSupport.h or PassAnalysisSupport.h directly 2020-04-26 12:58:20 +01:00
Scalar [JumpThreading] Simplify FindMostPopularDest (NFC) 2020-06-02 18:43:31 -07:00
Utils [InstNamer] use 'i' for Instructions, not 'tmp' 2020-06-01 11:11:14 -04:00
Vectorize [VPlan] Support extracting lanes for defs managed in VPTransformState. 2020-06-03 12:14:16 +01:00
CMakeLists.txt Add Windows Control Flow Guard checks (/guard:cf). 2019-10-28 15:19:39 +00:00
LLVMBuild.txt Add Windows Control Flow Guard checks (/guard:cf). 2019-10-28 15:19:39 +00:00