[compiler-rt] [AArch64][compiler-rt] Add memcpy, memset, memmove, memchr simple imp… (PR #77496)

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 19 06:57:32 PST 2024


================
@@ -560,9 +560,12 @@ set(aarch64_SOURCES
   aarch64/fp_mode.c
 )
 
-if(COMPILER_RT_HAS_ASM_SME AND (COMPILER_RT_HAS_AUXV OR COMPILER_RT_BAREMETAL_BUILD))
-  list(APPEND aarch64_SOURCES aarch64/sme-abi.S aarch64/sme-abi-init.c)
+if(COMPILER_RT_HAS_AARCH64_SME AND (COMPILER_RT_HAS_AUXV OR COMPILER_RT_BAREMETAL_BUILD))
+  list(APPEND aarch64_SOURCES aarch64/sme-abi.S aarch64/sme-abi-init.c aarch64/sme-libc-routines.c)
   message(STATUS "AArch64 SME ABI routines enabled")
+  if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+    set_source_files_properties(aarch64/sme-libc-routines.c PROPERTIES COMPILE_FLAGS "-mllvm -disable-loop-idiom-all")
----------------
sdesmalen-arm wrote:

It seems that you can use the option `-fno-builtin` to avoid builtins being used in the implementation of these functions. This flag is supported by both GNU and Clang, which is better than passing some internal LLVM flag.

It does mean you'll need to add: `AND COMPILER_RT_HAS_FNO_BUILTIN_FLAG` to the condition on line 563 though.

https://github.com/llvm/llvm-project/pull/77496


More information about the llvm-commits mailing list