Issue 126888
Summary [clang-cl] map `/vlen=` (used for AVX512 and AVX10.1) to `-mprefer-vector-width=`
Labels new issue
Assignees
Reporter zufuliu
    `/vlen` is a new option added in Visual Sudio 17.13, documented at https://learn.microsoft.com/en-us/cpp/build/reference/vlen?view=msvc-170

> # Arguments
> `/vlen=256`
> Specify a vector length of 256 bits for auto-vectorization and other optimizations.
> 
> `/vlen=512`
> Specify a vector length of 512 bits for auto-vectorization and other optimizations.
> 
> `/vlen`
> Specify the default vector length for the selected /arch setting.
> 
> # Remarks
> If a specific `/vlen` value isn't specified, the default vector length depends on the `/arch` flag setting. The `/vlen` flag can override the default vector length specified by `/arch:AVX512` or `/arch:AVX10.1` flag. For example:
> 
> * `/arch:AVX512 /vlen=256` overrides the default vector length of 512 bits specified by `/arch:AVX512` to be 256 bits.
> * `/arch:AVX10.1 /vlen=512` overrides the default vector length of 256 bits specified by `/arch:AVX10.1` to be 512 bits.
>
> When the specified `/vlen` value is incompatible with specified /arch flag, a warning is generated and default vector length for the `/arch` setting is used. For example:
> 
> * `/arch:AVX2 /vlen=512` generates a warning because AVX2 doesn't support 512-bit vectors. Vector length of 256 bits is used in this case.

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to