[llvm] f231829 - [CMake][BLAKE3] Fix unused -mavx512vl warning when CMAKE_OSX_ARCHITECTURES=arm64

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 13 12:45:40 PDT 2023


Author: Fangrui Song
Date: 2023-06-13T12:45:34-07:00
New Revision: f231829304d15dca0dad8bafe35c4277904db602

URL: https://github.com/llvm/llvm-project/commit/f231829304d15dca0dad8bafe35c4277904db602
DIFF: https://github.com/llvm/llvm-project/commit/f231829304d15dca0dad8bafe35c4277904db602.diff

LOG: [CMake][BLAKE3] Fix unused -mavx512vl warning when CMAKE_OSX_ARCHITECTURES=arm64

This fixes
```
% ninja -C out/play LLVMSupport
ninja: Entering directory `out/play'
[151/158] Building ASM object lib/Support/BLAKE3/CMakeFiles/LLVMSupportBlake3.dir/blake3_avx512_x86-64_unix.S.o
clang: warning: argument unused during compilation: '-mavx512vl' [-Wunused-command-line-argument]
```

and applies `disable_blake3_x86_simd()`.

This fixes the root cause of commit 5160f6fefb0021a0b23e99c7cf621a330241c211 ("broke cross-builds of llvm from x86_64 to arm64 mac"...)

Added: 
    

Modified: 
    llvm/lib/Support/BLAKE3/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Support/BLAKE3/CMakeLists.txt b/llvm/lib/Support/BLAKE3/CMakeLists.txt
index 85fe4f6f4206e..cb4f840461f7c 100644
--- a/llvm/lib/Support/BLAKE3/CMakeLists.txt
+++ b/llvm/lib/Support/BLAKE3/CMakeLists.txt
@@ -46,7 +46,7 @@ if (CAN_USE_ASSEMBLER)
         blake3_avx2_x86-64_windows_gnu.S
         blake3_avx512_x86-64_windows_gnu.S
       )
-      # Clang-6 needs this flag.
+      # Clang before 7 needs -mavx512vl to assemble some instructions.
       set_source_files_properties(blake3_avx512_x86-64_windows_gnu.S
         PROPERTIES COMPILE_OPTIONS "-mavx512vl")
     else()
@@ -54,7 +54,7 @@ if (CAN_USE_ASSEMBLER)
     endif()
   else()
     check_symbol_exists(__x86_64__ "" IS_X64)
-    if (IS_X64 OR CMAKE_OSX_ARCHITECTURES)
+    if (IS_X64 OR CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
       # In a macOS Universal build (setting CMAKE_OSX_ARCHITECTURES to multiple
       # values), compilation of the source files will target multiple architectures
       # (each source file is internally compiled once for each architecture).
@@ -66,7 +66,7 @@ if (CAN_USE_ASSEMBLER)
         blake3_avx2_x86-64_unix.S
         blake3_avx512_x86-64_unix.S
       )
-      # Clang-6 needs this flag.
+      # Clang before 7 needs -mavx512vl to assemble some instructions.
       set_source_files_properties(blake3_avx512_x86-64_unix.S
         PROPERTIES COMPILE_OPTIONS "-mavx512vl")
     else()


        


More information about the llvm-commits mailing list