Skip to content

Commit

Permalink
[X86][Driver] Do not add -evex512 for -march=native when the targ…
Browse files Browse the repository at this point in the history
…et doesn't support AVX512 (#91694)

(cherry picked from commit 87f3407)
  • Loading branch information
phoebewang authored and tstellar committed May 14, 2024
1 parent 47b6dc4 commit fac122a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion llvm/lib/TargetParser/Host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1774,7 +1774,8 @@ bool sys::getHostCPUFeatures(StringMap<bool> &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"];
if (Features["avx512f"])
Features["evex512"] = true;
Features["avx512dq"] = HasLeaf7 && ((EBX >> 17) & 1) && HasAVX512Save;
Features["rdseed"] = HasLeaf7 && ((EBX >> 18) & 1);
Features["adx"] = HasLeaf7 && ((EBX >> 19) & 1);
Expand Down

0 comments on commit fac122a

Please sign in to comment.