[PATCH] D139784: [Doc] Refactor descriptions of `min-legal-vector-width`

Phoebe Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 10 22:19:24 PST 2022


pengfei created this revision.
pengfei added reviewers: arsenm, craig.topper, jdoerfert.
Herald added a subscriber: StephenFan.
Herald added a project: All.
pengfei requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

Based on comments from @arsenm.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139784

Files:
  llvm/docs/LangRef.rst


Index: llvm/docs/LangRef.rst
===================================================================
--- llvm/docs/LangRef.rst
+++ llvm/docs/LangRef.rst
@@ -2233,13 +2233,19 @@
     value of min. If the attribute is not present, no assumptions are made
     about the range of vscale.
 ``"min-legal-vector-width"="<size>"``
-    This attribute indicates the minimum legal vector width required by the
-    calling convension. It is the maximum width of vector arguments and
-    returnings in the function and functions called by this function. Because
-    all the vectors are supposed to be legal type for compatibility.
-    Backends are free to ignore the attribute if they don't need to support
-    different maximum legal vector types or such information can be inferred by
-    other attributes.
+    This attribute indicates the minimum vector width in bits that code
+    generator must make them legal. It is required by the target’s ABI.
+    A target like X86 may dynamically decide vector types in the function are
+    legal or not according to optimizations. When this attribute is set, code
+    generator will not turn vector types with the same or below size illegal.
+    The value is calculated from the vector arguments and returnings in the
+    function and functions directly called by this function.
+    A value 0 means no vector types in arguments and returnings in the function
+    as well as its callees. Lack of the attribute means the IR didn't come from
+    clang and can't be trusted to have been audited.
+    This attribute doesn't guarantee arbitrary vector width specified will be
+    treated as legal type in code generator. Users are not encouraged to
+    directly pass or return vector types out of the capacity of their targets.
 
 Call Site Attributes
 ----------------------


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139784.481896.patch
Type: text/x-patch
Size: 1821 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221211/0f21aa6b/attachment.bin>


More information about the llvm-commits mailing list