[PATCH] D158668: Add getLikelyBranchWeight helper function

Matthias Braun via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 23 13:47:02 PDT 2023


MatzeB created this revision.
MatzeB added reviewers: lebedev.ri, spatel, davidxl, wenlei, hoy, paulkirth.
Herald added subscribers: StephenFan, modimo, hiraditya, mcrosier.
Herald added a project: All.
MatzeB requested review of this revision.
Herald added subscribers: llvm-commits, cfe-commits, wangpc.
Herald added projects: clang, LLVM.

- Add getLikelyBranchWeight() function returning the value of the `-likely-branch-weight` option defaulting to 2000.
- Remove `-unlikely-branch-weight` option and just use 1.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D158668

Files:
  clang/test/CodeGenCXX/attr-likelihood-if-branch-weights.cpp
  llvm/docs/MisExpect.rst
  llvm/include/llvm/IR/ProfDataUtils.h
  llvm/lib/IR/ProfDataUtils.cpp
  llvm/lib/Transforms/Scalar/LowerExpectIntrinsic.cpp
  llvm/test/Transforms/LowerExpectIntrinsic/phi_unexpect.ll
  llvm/test/Transforms/PGOProfile/misexpect-branch-overflow.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158668.552872.patch
Type: text/x-patch
Size: 8890 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230823/78edad07/attachment.bin>


More information about the cfe-commits mailing list