<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/126888>126888</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [clang-cl] map `/vlen=` (used for AVX512 and AVX10.1) to `-mprefer-vector-width=`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          zufuliu
      </td>
    </tr>
</table>

<pre>
    `/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.

</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyslV9vrDYTxj-N92a0CIawGy642PdNkXrbU6W9NfYAbo2N_GfTnE9fmYVNsslJU6lSpGgZmOc3M4893Hs1GKKGVf9j1cOOxzBa13yPfdQq7jornxt2yBm2Z02GHXJQHjgYegI7B2UNcClJgjLwqHzkGr5FqSwUx6woGf4fpBVxIhNIAg8whjB7Vp4YtgxbTdyZbFLCWW_7kAk7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