diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/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));