[llvm] 87f3407 - [X86][Driver] Do not add `-evex512` for `-march=native` when the target doesn't support AVX512 (#91694)
    via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Thu May  9 22:25:40 PDT 2024
    
    
  
Author: Phoebe Wang
Date: 2024-05-10T13:25:37+08:00
New Revision: 87f3407856e61a73798af4e41b28bc33b5bf4ce6
URL: https://github.com/llvm/llvm-project/commit/87f3407856e61a73798af4e41b28bc33b5bf4ce6
DIFF: https://github.com/llvm/llvm-project/commit/87f3407856e61a73798af4e41b28bc33b5bf4ce6.diff
LOG: [X86][Driver] Do not add `-evex512` for `-march=native` when the target doesn't support AVX512 (#91694)
Added: 
    
Modified: 
    llvm/lib/TargetParser/Host.cpp
Removed: 
    
################################################################################
diff  --git a/llvm/lib/TargetParser/Host.cpp b/llvm/lib/TargetParser/Host.cpp
index 834f4536f93a..c5156c6cb802 100644
--- a/llvm/lib/TargetParser/Host.cpp
+++ b/llvm/lib/TargetParser/Host.cpp
@@ -1802,7 +1802,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-commits
mailing list