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


craig.topper added inline comments.


================
Comment at: llvm/docs/WritingAnLLVMBackend.rst:1772
+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.
----------------
arsenm wrote:
> Is this really true? Where is this implemented?
Here's the X86SSELevel code from X86GenSubtargetInfo.inc as an example

```
  if (Bits[X86::FeatureAVX] && X86SSELevel < AVX) X86SSELevel = AVX;
  if (Bits[X86::FeatureAVX2] && X86SSELevel < AVX2) X86SSELevel = AVX2;
  if (Bits[X86::FeatureAVX512] && X86SSELevel < AVX512) X86SSELevel = AVX512;
```


================
Comment at: llvm/docs/WritingAnLLVMBackend.rst:1773
+attribute will be set to the maximum value of all enabled features that share
+the attribute.
+
----------------
arsenm wrote:
> Don't refer to it as an attribute, attributes are a separate thing entirely
I was following the wording from the paragraph above and the .td. Should I change them all?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153180



More information about the llvm-commits mailing list