[llvm-branch-commits] [llvm] fac122a - [X86][Driver] Do not add `-evex512` for `-march=native` when the target doesn't support AVX512 (#91694)
Tom Stellard via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue May 14 16:28:30 PDT 2024
Author: Phoebe Wang
Date: 2024-05-14T16:26:16-07:00
New Revision: fac122ac439191d5f46da6400681c54b0bf7e3db
URL: https://github.com/llvm/llvm-project/commit/fac122ac439191d5f46da6400681c54b0bf7e3db
DIFF: https://github.com/llvm/llvm-project/commit/fac122ac439191d5f46da6400681c54b0bf7e3db.diff
LOG: [X86][Driver] Do not add `-evex512` for `-march=native` when the target doesn't support AVX512 (#91694)
(cherry picked from commit 87f3407856e61a73798af4e41b28bc33b5bf4ce6)
Added:
Modified:
llvm/lib/TargetParser/Host.cpp
Removed:
################################################################################
diff --git a/llvm/lib/TargetParser/Host.cpp b/llvm/lib/TargetParser/Host.cpp
index 1adef15771fa1..848b531dd8dd9 100644
--- a/llvm/lib/TargetParser/Host.cpp
+++ b/llvm/lib/TargetParser/Host.cpp
@@ -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);
More information about the llvm-branch-commits
mailing list