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

Phoebe Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 22 05:35:32 PST 2022


pengfei updated this revision to Diff 484805.
pengfei added a comment.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Move doc to comments.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139784

Files:
  clang/lib/CodeGen/CodeGenFunction.cpp


Index: clang/lib/CodeGen/CodeGenFunction.cpp
===================================================================
--- clang/lib/CodeGen/CodeGenFunction.cpp
+++ clang/lib/CodeGen/CodeGenFunction.cpp
@@ -492,13 +492,19 @@
   if (CurFnInfo->getMaxVectorWidth() > LargestVectorWidth)
     LargestVectorWidth = CurFnInfo->getMaxVectorWidth();
 
-  // Add the required-vector-width attribute. This contains the max width from:
-  // 1. min-vector-width attribute used in the source program.
+  // Add the min-legal-vector-width attribute. This contains the max width from:
+  // 1. min-legal-vector-width attribute used in the source program.
   // 2. Any builtins used that have a vector width specified.
   // 3. Values passed in and out of inline assembly.
   // 4. Width of vector arguments and return types for this function.
-  // 5. Width of vector aguments and return types for functions called by this
+  // 5. Width of vector arguments and return types for functions called by this
   //    function.
+  // This attribute is intended for X86 backend use only. The "min legal" in the
+  // name means the minimum width in bits that vector types have must be treated
+  // as legal types by code generator.
+  // Note: The 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.
   if (getContext().getTargetInfo().getTriple().isX86())
     CurFn->addFnAttr("min-legal-vector-width",
                      llvm::utostr(LargestVectorWidth));


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139784.484805.patch
Type: text/x-patch
Size: 1611 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221222/346f70be/attachment.bin>


More information about the llvm-commits mailing list