llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
25.96k stars 10.6k forks source link

[X86] Enable EVEX512 when host CPU has AVX512 #90479

Closed phoebewang closed 2 weeks ago

phoebewang commented 2 weeks ago

This is used when -march=native run on an unknown CPU to old version of LLVM.

github-actions[bot] commented 2 weeks ago

:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

You can test this locally with the following command: ``````````bash git-clang-format --diff 8d5386669ed63548daf1bee415596582d6d78d7d 9e84562bbea4d733199bef8d760c8e7a02bdb941 -- llvm/lib/TargetParser/Host.cpp ``````````
View the diff from clang-format here. ``````````diff diff --git a/llvm/lib/TargetParser/Host.cpp b/llvm/lib/TargetParser/Host.cpp index e911d15498..c71adadbb7 100644 --- a/llvm/lib/TargetParser/Host.cpp +++ b/llvm/lib/TargetParser/Host.cpp @@ -1801,7 +1801,7 @@ bool sys::getHostCPUFeatures(StringMap &Features) { Features["rtm"] = HasLeaf7 && ((EBX >> 11) & 1); // AVX512 is only supported if the OS supports the context save for it. Features["avx512f"] = HasLeaf7 && ((EBX >> 16) & 1) && HasAVX512Save; - Features["evex512"] = Features["avx512f"]; + Features["evex512"] = Features["avx512f"]; Features["avx512dq"] = HasLeaf7 && ((EBX >> 17) & 1) && HasAVX512Save; Features["rdseed"] = HasLeaf7 && ((EBX >> 18) & 1); Features["adx"] = HasLeaf7 && ((EBX >> 19) & 1); ``````````
phoebewang commented 2 weeks ago

cherry-pick https://github.com/llvm/llvm-project/commit/b3291793f11924a3b62601aabebebdcfbb12a9a1

nikic commented 2 weeks ago

/cherry-pick b3291793f11924a3b62601aabebebdcfbb12a9a1

llvmbot commented 2 weeks ago

/pull-request llvm/llvm-project#90545