[PATCH] D153180: [docs][TableGen][Target] Improve the documentation of the attribute value for SubtargetFeature.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 16 16:13:45 PDT 2023


craig.topper created this revision.
craig.topper added reviewers: arsenm, RKSimon, efriedma, pengfei.
Herald added a project: All.
craig.topper requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

The value "true" and "false" are treated specially and other values are treated as integers.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D153180

Files:
  llvm/docs/WritingAnLLVMBackend.rst
  llvm/include/llvm/Target/Target.td


Index: llvm/include/llvm/Target/Target.td
===================================================================
--- llvm/include/llvm/Target/Target.td
+++ llvm/include/llvm/Target/Target.td
@@ -1670,6 +1670,11 @@
 
   // Value - Value the attribute to be set to by feature.
   //
+  // A value of "true" or "false" implies the attribute is a bool. Otherwise,
+  // it is assumed to be an integer. If multiple features use the same integer
+  // attribute, the attribute will be set to the maximum value of all enabled
+  // features that share the attribute.
+  //
   string Value = v;
 
   // Desc - Feature description.  Used by command line (-mattr=) to display help
Index: llvm/docs/WritingAnLLVMBackend.rst
===================================================================
--- llvm/docs/WritingAnLLVMBackend.rst
+++ llvm/docs/WritingAnLLVMBackend.rst
@@ -1765,6 +1765,12 @@
 fifth parameter is a list of features whose presence is implied, and its
 default value is an empty array.)
 
+If the value for the attribute is the string "true" or "false", the attribute
+is assumed to be a bool and only one SubtargetFeature should refer to it.
+Otherwise, it is assumed to be an integer. If multiple features use the same
+integer attribute, the attribute will be set to the maximum value of all
+enabled features that share the attribute.
+
 .. code-block:: text
 
   class SubtargetFeature<string n, string a, string v, string d,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153180.532319.patch
Type: text/x-patch
Size: 1432 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230616/662b1874/attachment.bin>


More information about the llvm-commits mailing list