aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Tooling/Syntax/TreeTest.cpp
diff options
context:
space:
mode:
authorYevgeny Rouban <yrouban@azul.com>2020-06-04 15:34:14 +0700
committerYevgeny Rouban <yrouban@azul.com>2020-06-04 15:37:15 +0700
commitdcfa78a4ccec9772d9ff7fea536f81717cf30b24 (patch)
treec173f15bc333238cf81218129df7c6f990a3d1f1 /clang/unittests/Tooling/Syntax/TreeTest.cpp
parent2ebe30c6e4ab1d65fc8605051eb528fc26ffc621 (diff)
downloadllvm-dcfa78a4ccec9772d9ff7fea536f81717cf30b24.zip
llvm-dcfa78a4ccec9772d9ff7fea536f81717cf30b24.tar.gz
llvm-dcfa78a4ccec9772d9ff7fea536f81717cf30b24.tar.bz2
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
Diffstat (limited to 'clang/unittests/Tooling/Syntax/TreeTest.cpp')
0 files changed, 0 insertions, 0 deletions