[PATCH] D130933: Add docs for function attributes hot/cold

Ofek Shilon via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 9 12:30:39 PDT 2022


OfekShilon updated this revision to Diff 451237.
OfekShilon added a comment.

Addressed Aaron's comments (thanks!). Hope I got the update-diff procedure right.
I don't have commit permissions, would appreciate if someone could push this.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130933/new/

https://reviews.llvm.org/D130933

Files:
  clang/include/clang/Basic/Attr.td
  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
@@ -5245,7 +5245,7 @@
   let Category = DocCatFunction;
   let Content = [{
 ``__attribute__((hot))`` marks a function as hot, as a manual alternative to PGO hotness data. 
-In case PGO data is available too user annotated ``__attribute__((hot))`` overwrites profile count based hotness (unlike ``__attribute__((cold))``).
+If PGO data is available, the annotation ``__attribute__((hot))`` overrides the profile count based hotness (unlike ``__attribute__((cold))``).
 }];
 }
 
@@ -5253,7 +5253,7 @@
   let Category = DocCatFunction;
   let Content = [{
 ``__attribute__((cold))`` marks a function as cold, as a manual alternative to PGO hotness data. 
-In case PGO data is available too profile count based hotness overwrites user annotated ``__attribute__((cold))`` (unlike ``__attribute__((hot))``).
+If PGO data is available, the profile count based hotness overrides the ``__attribute__((cold))`` annotation (unlike ``__attribute__((hot))``).
 }];
 }
 
Index: clang/include/clang/Basic/Attr.td
===================================================================
--- clang/include/clang/Basic/Attr.td
+++ clang/include/clang/Basic/Attr.td
@@ -1074,6 +1074,7 @@
   let Spellings = [GCC<"cold">];
   let Subjects = SubjectList<[Function]>;
   let Documentation = [ColdFunctionEntryDocs];
+  let SimpleHandler = 1;
 }
 
 def Common : InheritableAttr {
@@ -1519,6 +1520,7 @@
   let Spellings = [GCC<"hot">];
   let Subjects = SubjectList<[Function]>;
   let Documentation = [HotFunctionEntryDocs];
+  let SimpleHandler = 1;
 }
 def : MutualExclusions<[Hot, Cold]>;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130933.451237.patch
Type: text/x-patch
Size: 1764 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220809/33e3293f/attachment.bin>


More information about the cfe-commits mailing list