[compiler-rt] 3c8344f - [AArch64][SME] Fix broken compiler check for SME2 support in compiler-rt (#121625)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 6 01:38:00 PST 2025


Author: Amara Emerson
Date: 2025-01-06T01:37:56-08:00
New Revision: 3c8344f7ba7e33febb93dec40374d55119c8571b

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

LOG: [AArch64][SME] Fix broken compiler check for SME2 support in compiler-rt (#121625)

This compile time test uses inline asm with `.arch` directives to set
the target feature. It is however broken and always fails, since each
`asm()` construct in LLVM sets up a new AsmParser, and therefore the
`.arch` directive has no effect on later `asm()` contents. To fix this
we need to use a single inline `asm()` call with the entire code chunk
to emit contained inside.

Added: 
    

Modified: 
    compiler-rt/cmake/builtin-config-ix.cmake

Removed: 
    


################################################################################
diff  --git a/compiler-rt/cmake/builtin-config-ix.cmake b/compiler-rt/cmake/builtin-config-ix.cmake
index 706a1ff7eeb6db..b1bde47ec8555f 100644
--- a/compiler-rt/cmake/builtin-config-ix.cmake
+++ b/compiler-rt/cmake/builtin-config-ix.cmake
@@ -43,9 +43,9 @@ asm(\"cas w0, w1, [x2]\");
 builtin_check_c_compiler_source(COMPILER_RT_HAS_AARCH64_SME
 "
 void foo(void)  __arm_streaming_compatible {
-  asm(\".arch armv9-a+sme2\");
-  asm(\"smstart\");
-  asm(\"ldr zt0, [sp]\");
+  asm(\".arch armv9-a+sme2\\n\"
+      \"smstart\\n\"
+      \"ldr zt0, [sp]\");
 }
 ")
 


        


More information about the llvm-commits mailing list