Skip to content

Commit fac122a

Browse files
phoebewangtstellar
authored andcommitted
[X86][Driver] Do not add -evex512 for -march=native when the target doesn't support AVX512 (#91694)
(cherry picked from commit 87f3407)
1 parent 47b6dc4 commit fac122a

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
@@ -1774,7 +1774,8 @@ bool sys::getHostCPUFeatures(StringMap<bool> &Features) {
17741774
Features["rtm"] = HasLeaf7 && ((EBX >> 11) & 1);
17751775
// AVX512 is only supported if the OS supports the context save for it.
17761776
Features["avx512f"] = HasLeaf7 && ((EBX >> 16) & 1) && HasAVX512Save;
1777-
Features["evex512"] = Features["avx512f"];
1777+
if (Features["avx512f"])
1778+
Features["evex512"] = true;
17781779
Features["avx512dq"] = HasLeaf7 && ((EBX >> 17) & 1) && HasAVX512Save;
17791780
Features["rdseed"] = HasLeaf7 && ((EBX >> 18) & 1);
17801781
Features["adx"] = HasLeaf7 && ((EBX >> 19) & 1);

0 commit comments

Comments
 (0)