Skip to content

Commit 87f3407

Browse files
authored
[X86][Driver] Do not add -evex512 for -march=native when the target doesn't support AVX512 (#91694)
1 parent 2c5f470 commit 87f3407

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/TargetParser/Host.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -1802,7 +1802,8 @@ bool sys::getHostCPUFeatures(StringMap<bool> &Features) {
18021802
Features["rtm"] = HasLeaf7 && ((EBX >> 11) & 1);
18031803
// AVX512 is only supported if the OS supports the context save for it.
18041804
Features["avx512f"] = HasLeaf7 && ((EBX >> 16) & 1) && HasAVX512Save;
1805-
Features["evex512"] = Features["avx512f"];
1805+
if (Features["avx512f"])
1806+
Features["evex512"] = true;
18061807
Features["avx512dq"] = HasLeaf7 && ((EBX >> 17) & 1) && HasAVX512Save;
18071808
Features["rdseed"] = HasLeaf7 && ((EBX >> 18) & 1);
18081809
Features["adx"] = HasLeaf7 && ((EBX >> 19) & 1);

0 commit comments

Comments
 (0)