Skip to content

[clang-cl] map /vlen= (used for AVX512 and AVX10.1) to -mprefer-vector-width= #126888

Open
@zufuliu

Description

@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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang-cl`clang-cl` driver. Don't use for other compiler partsenhancementImproving things as opposed to bug fixing, e.g. new or missing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions