[clang] [llvm] [X86][Driver] Do not add `-evex512` for `-march=native` when the target doesn't support AVX512 (PR #91694)

Phoebe Wang via cfe-commits cfe-commits at lists.llvm.org
Sun May 12 07:54:30 PDT 2024


phoebewang wrote:

@FireBurn Sorry, I just noticed #91719. The above comments were based on the issue #91076.

I didn't look at the source, but the command line doesn't have an AVX512 option. So I'm assuming the code may related function multi-versioning with manually specified target attributes regarding to AVX512 features.

The reason is the same as #91719, but the scenarios may be more common in practice. The defect in previous patch does expose a known issue with the design of EVEX512, which we have noted in https://clang.llvm.org/docs/UsersManual.html#x86

In a word, when user uses target attributes with AVX512 features, they should add an explicit `evex512` or `no-evex512` for robustness since LLVM 18. Missing it may result in some unexpected codegen or error in some corner case.

https://github.com/llvm/llvm-project/pull/91694


More information about the cfe-commits mailing list