aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorPaul Kirth <paulkirth@google.com>2024-06-12 12:52:28 -0700
committerGitHub <noreply@github.com>2024-06-12 12:52:28 -0700
commit294f3ce5dde916c358d8f672b4a1c706c0387154 (patch)
tree77267737635ea3db2d2c6c0f0cbc99bcd1dae20b /clang/lib/Frontend/CompilerInvocation.cpp
parent7b8038426c52d5fee9c2f4cfe3e747e3a2b8efec (diff)
downloadllvm-294f3ce5dde916c358d8f672b4a1c706c0387154.zip
llvm-294f3ce5dde916c358d8f672b4a1c706c0387154.tar.gz
llvm-294f3ce5dde916c358d8f672b4a1c706c0387154.tar.bz2
Reapply "[llvm][IR] Extend BranchWeightMetadata to track provenance o… (#95281)
…f weights" #95136 Reverts #95060, and relands #86609, with the unintended code generation changes addressed. This patch implements the changes to LLVM IR discussed in https://discourse.llvm.org/t/rfc-update-branch-weights-metadata-to-allow-tracking-branch-weight-origins/75032 In this patch, we add an optional field to MD_prof meatdata nodes for branch weights, which can be used to distinguish weights added from llvm.expect* intrinsics from those added via other methods, e.g. from profiles or inserted by the compiler. One of the major motivations, is for use with MisExpect diagnostics, which need to know if branch_weight metadata originates from an llvm.expect intrinsic. Without that information, we end up checking branch weights multiple times in the case if ThinLTO + SampleProfiling, leading to some inaccuracy in how we report MisExpect related diagnostics to users. Since we change the format of MD_prof metadata in a fundamental way, we need to update code handling branch weights in a number of places. We also update the lang ref for branch weights to reflect the change.
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions