[PATCH] D131306: [llvm][misexpect] Track provenance of branch weights

Paul Kirth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 5 16:40:44 PDT 2022


paulkirth created this revision.
paulkirth added a reviewer: tejohnson.
Herald added subscribers: ormris, okura, kuter, hiraditya.
Herald added a project: All.
paulkirth requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: sstefan1.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.

MisExpect needs to know if a branch weight intrinsic originates from an
llvm.expect intrinsic.

This patch allows us to track that provenance by adding a new
metadata type that can be moved in concert with the existing branch
weights. The new metadata is copied whenever branch weights are copied,
and is removed when new branch weights are added.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131306

Files:
  clang/test/CodeGenCXX/attr-likelihood-if-branch-weights.cpp
  clang/test/CodeGenCXX/attr-likelihood-if-vs-builtin-expect.cpp
  llvm/include/llvm/IR/FixedMetadataKinds.def
  llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
  llvm/lib/Transforms/IPO/Attributor.cpp
  llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
  llvm/lib/Transforms/IPO/LowerTypeTests.cpp
  llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
  llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
  llvm/lib/Transforms/Scalar/LowerExpectIntrinsic.cpp
  llvm/lib/Transforms/Utils/Local.cpp
  llvm/lib/Transforms/Utils/MisExpect.cpp
  llvm/test/Transforms/LowerExpectIntrinsic/basic.ll
  llvm/test/Transforms/LowerExpectIntrinsic/expect-with-probability.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131306.450448.patch
Type: text/x-patch
Size: 16872 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220805/f05e6d71/attachment.bin>


More information about the llvm-commits mailing list