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

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 13 15:51:26 PST 2022


arsenm requested changes to this revision.
arsenm added inline comments.
This revision now requires changes to proceed.


================
Comment at: llvm/docs/LangRef.rst:2236-2237
 ``"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
----------------
The first sentence isn't grammatically correct. Also should not start out with the word legal


================
Comment at: llvm/docs/LangRef.rst:2239
+    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.
----------------
Still not stating what legal means in this context


================
Comment at: llvm/docs/LangRef.rst:2240
+    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
----------------
Grammar? 


================
Comment at: llvm/docs/LangRef.rst:2241
+    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.
----------------
return types?

Also what is the behavior for aggregates? Aggregates containing vectors? Nested aggregates with vectors?


================
Comment at: llvm/docs/LangRef.rst:2243
+    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
----------------
Returnings isn't a word; "return values"?


================
Comment at: llvm/docs/LangRef.rst:2244-2245
+    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
----------------
We can't spec attributes in terms of what clang's behavior is today


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139784



More information about the llvm-commits mailing list