[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:16:04 PDT 2023


craig.topper updated this revision to Diff 532321.
craig.topper added a comment.

Clarify that the integer value may be the name of an enum constant.


Repository:
  rG LLVM Github Monorepo

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

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,12 @@
 
   // 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. the integer value may be the name of an
+  // enum constant. 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,13 @@
 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. The integer value may be the name
+of an enum constant. 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.532321.patch
Type: text/x-patch
Size: 1549 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230616/f0e4528e/attachment.bin>


More information about the llvm-commits mailing list