[PATCH] D134394: Update docs about [[likely]] vs. PGO

Hans Wennborg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 21 15:40:46 PDT 2022


hans created this revision.
hans added reviewers: Mordante, aaron.ballman.
Herald added a subscriber: wenlei.
Herald added a project: All.
hans requested review of this revision.
Herald added a project: clang.

It sounds like these attributes do nothing when PGO is enabled, which is actually (or please correct me if I'm wrong) only the case when there is profile data coverage the specific statements in question. If there is no profile data, the attributes still apply.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D134394

Files:
  clang/include/clang/Basic/AttrDocs.td


Index: clang/include/clang/Basic/AttrDocs.td
===================================================================
--- clang/include/clang/Basic/AttrDocs.td
+++ clang/include/clang/Basic/AttrDocs.td
@@ -1963,8 +1963,9 @@
 likelihood. The positive likelihood is the more likely of path of execution
 than the neutral likelihood.
 
-These attributes have no effect on the generated code when using
-PGO (Profile-Guided Optimization) or at optimization level 0.
+These attributes have no effect on the generated code when there is PGO
+(Profile-Guided Optimization) data available for the statements, or at
+optimization level 0.
 
 In Clang, the attributes will be ignored if they're not placed on
 * the ``case`` or ``default`` label of a ``switch`` statement,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134394.462027.patch
Type: text/x-patch
Size: 758 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220921/67716bfb/attachment.bin>


More information about the cfe-commits mailing list