Missing codegen option corresponding to clang's prefer-vector-width #53312
Labels
A-codegen
Area: Code generation
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
Clang 7 added a codegen option,
-mprefer-vector-width=
, which allows specifying the preferred vector width for autovectorization. This allows preventing wide vector operations in codegen. Why? Because eagerly using wide vector operations can hurt performance on Intel CPUs in at least two ways:On the other hand, AVX512 doubles the number of vector registers, so it's useful for performance to enable
target_cpu=skylake-avx512
, even without using 512-bit operations.Unfortunately, there doesn't seem to be a way to use this option with rustc: it's not one of the
-C
codegen options, and passing-C llvm-args=-prefer-vector-width=256
givesIt would be great if rustc had a way to set the preferred vector width.
The text was updated successfully, but these errors were encountered: