[Openmp-commits] [llvm] [openmp] [openmp] Add support for arm64ec/arm64x to libomp (PR #175988)
David Truby via Openmp-commits
openmp-commits at lists.llvm.org
Wed Jan 14 08:50:27 PST 2026
https://github.com/DavidTruby updated https://github.com/llvm/llvm-project/pull/175988
>From 34085d345ecaa641455100c636052ca261e0bfe9 Mon Sep 17 00:00:00 2001
From: David Truby <david.truby at arm.com>
Date: Tue, 11 Nov 2025 15:34:27 +0000
Subject: [PATCH 1/2] [openmp] Add support for arm64ec/arm64x to libomp
This patch adds arm64ec and arm64x support to libomp, including cmake
support for building an Arm64X version of libomp.dll/libomp.lib that
can be used for both arm64ec and arm64 applications.
---
llvm/CMakeLists.txt | 13 +++
llvm/runtimes/CMakeLists.txt | 4 +
openmp/cmake/modules/LibompUtils.cmake | 2 +
openmp/runtime/CMakeLists.txt | 16 ++-
.../runtime/cmake/LibompGetArchitecture.cmake | 3 +
openmp/runtime/cmake/arm64x.cmake | 97 +++++++++++++++++++
openmp/runtime/src/kmp.h | 2 +-
openmp/runtime/src/kmp_atomic.cpp | 2 +-
openmp/runtime/src/kmp_os.h | 6 +-
openmp/runtime/src/kmp_platform.h | 8 +-
openmp/runtime/src/kmp_runtime.cpp | 2 +-
.../thirdparty/ittnotify/ittnotify_config.h | 2 +
openmp/runtime/src/z_Windows_NT-586_util.cpp | 6 +-
13 files changed, 151 insertions(+), 12 deletions(-)
create mode 100644 openmp/runtime/cmake/arm64x.cmake
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index f0e4f5d7d6f60..b8af551b51009 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -232,6 +232,19 @@ if(LIBC_GPU_BUILD)
list(APPEND RUNTIMES_amdgcn-amd-amdhsa_LLVM_ENABLE_RUNTIMES "libc")
endif()
+# Set up Arm64X build of the OpenMP runtime
+option(LIBOMP_ENABLE_ARM64X "Build the OpenMP library as Arm64X for compatibility with both Arm64 and Arm64EC" OFF)
+if(LIBOMP_ENABLE_ARM64X)
+ if(NOT LLVM_RUNTIME_TARGETS)
+ set(LLVM_RUNTIME_TARGETS "default")
+ endif()
+
+ if(NOT "arm64ec-pc-windows-msvc" IN_LIST LLVM_RUNTIME_TARGETS)
+ list(APPEND LLVM_RUNTIME_TARGETS "arm64ec-pc-windows-msvc")
+ endif()
+ set(RUNTIMES_arm64ec-pc-windows-msvc_LIBOMP_ENABLE_ARM64X ON)
+endif()
+
foreach(_name ${LLVM_RUNTIME_TARGETS})
if("libc" IN_LIST RUNTIMES_${_name}_LLVM_ENABLE_RUNTIMES)
if("${_name}" STREQUAL "amdgcn-amd-amdhsa" OR "${_name}" STREQUAL "nvptx64-nvidia-cuda")
diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt
index 1302334777613..052f91b65a633 100644
--- a/llvm/runtimes/CMakeLists.txt
+++ b/llvm/runtimes/CMakeLists.txt
@@ -707,3 +707,7 @@ if(build_runtimes)
set_property(GLOBAL APPEND PROPERTY LLVM_ALL_ADDITIONAL_TEST_TARGETS runtimes ${extra_deps})
endif()
endif()
+
+if(LIBOMP_ENABLE_ARM64X)
+ add_dependencies(runtimes-configure runtimes-arm64ec-pc-windows-msvc-build)
+endif()
diff --git a/openmp/cmake/modules/LibompUtils.cmake b/openmp/cmake/modules/LibompUtils.cmake
index a810881c2544e..b67b77339d074 100644
--- a/openmp/cmake/modules/LibompUtils.cmake
+++ b/openmp/cmake/modules/LibompUtils.cmake
@@ -105,6 +105,8 @@ function(libomp_get_legal_arch return_arch_string)
set(${return_arch_string} "AARCH64_32" PARENT_SCOPE)
elseif(${AARCH64_A64FX})
set(${return_arch_string} "AARCH64_A64FX" PARENT_SCOPE)
+ elseif(${ARM64EC})
+ set(${return_arch_string} "ARM64EC" PARENT_SCOPE)
elseif(${MIPS})
set(${return_arch_string} "MIPS" PARENT_SCOPE)
elseif(${MIPS64})
diff --git a/openmp/runtime/CMakeLists.txt b/openmp/runtime/CMakeLists.txt
index 93948b941f0dc..72d3308db2835 100644
--- a/openmp/runtime/CMakeLists.txt
+++ b/openmp/runtime/CMakeLists.txt
@@ -53,6 +53,8 @@ else() # Part of LLVM build
set(LIBOMP_ARCH aarch64_32)
elseif(LIBOMP_NATIVE_ARCH MATCHES "aarch64")
set(LIBOMP_ARCH aarch64)
+ elseif(LIBOMP_NATIVE_ARCH MATCHES "arm64ec")
+ set(LIBOMP_ARCH arm64ec)
elseif(LIBOMP_NATIVE_ARCH MATCHES "arm64")
set(LIBOMP_ARCH aarch64)
elseif(LIBOMP_NATIVE_ARCH MATCHES "arm")
@@ -91,7 +93,11 @@ if(LIBOMP_ARCH STREQUAL "aarch64")
endif()
endif()
-libomp_check_variable(LIBOMP_ARCH 32e x86_64 32 i386 arm ppc ppc64 ppc64le aarch64 aarch64_32 aarch64_a64fx mic mips mips64 riscv64 loongarch64 ve s390x sparc sparcv9 wasm32)
+if(LIBOMP_ENABLE_ARM64X)
+ include(arm64x)
+endif()
+
+libomp_check_variable(LIBOMP_ARCH 32e x86_64 32 i386 arm ppc ppc64 ppc64le aarch64 aarch64_32 aarch64_a64fx arm64ec mic mips mips64 riscv64 loongarch64 ve s390x sparc sparcv9 wasm32)
set(LIBOMP_LIB_TYPE normal CACHE STRING
"Performance,Profiling,Stubs library (normal/profile/stubs)")
@@ -193,6 +199,8 @@ elseif("${LIBOMP_ARCH}" STREQUAL "aarch64_32") # AARCH64_32 architecture
set(AARCH64_32 TRUE)
elseif("${LIBOMP_ARCH}" STREQUAL "aarch64_a64fx") # AARCH64_A64FX architecture
set(AARCH64_A64FX TRUE)
+elseif("${LIBOMP_ARCH}" STREQUAL "arm64ec") # ARM64EC architecture
+ set(ARM64EC TRUE)
elseif("${LIBOMP_ARCH}" STREQUAL "mic") # Intel(R) Many Integrated Core Architecture
set(MIC TRUE)
elseif("${LIBOMP_ARCH}" STREQUAL "mips") # MIPS architecture
@@ -454,3 +462,9 @@ set(LIBOMP_OMP_TOOLS_INCLUDE_DIR ${LIBOMP_OMP_TOOLS_INCLUDE_DIR} PARENT_SCOPE)
# make these variables available for tools/libompd:
set(LIBOMP_SRC_DIR ${LIBOMP_SRC_DIR} PARENT_SCOPE)
set(LIBOMP_OMPD_SUPPORT ${LIBOMP_OMPD_SUPPORT} PARENT_SCOPE)
+
+if(LIBOMP_ENABLE_ARM64X)
+ set(ARM64X_TARGETS omp ompimp)
+ handle_arm64x()
+endif()
+
diff --git a/openmp/runtime/cmake/LibompGetArchitecture.cmake b/openmp/runtime/cmake/LibompGetArchitecture.cmake
index 81aa700e3b6db..4127ea451ac91 100644
--- a/openmp/runtime/cmake/LibompGetArchitecture.cmake
+++ b/openmp/runtime/cmake/LibompGetArchitecture.cmake
@@ -17,6 +17,9 @@ function(libomp_get_architecture return_arch)
set(detect_arch_src_txt "
#if defined(__KNC__)
#error ARCHITECTURE=mic
+ // arm64ec also defines _M_AMD64 so this needs to be checked before that
+ #elif defined(_M_ARM64EC)
+ #error ARCHITECTURE=arm64ec
#elif defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64)
#error ARCHITECTURE=x86_64
#elif defined(__i386) || defined(__i386__) || defined(__IA32__) || defined(_M_I86) || defined(_M_IX86) || defined(__X86__) || defined(_X86_)
diff --git a/openmp/runtime/cmake/arm64x.cmake b/openmp/runtime/cmake/arm64x.cmake
new file mode 100644
index 0000000000000..a32485fda1a17
--- /dev/null
+++ b/openmp/runtime/cmake/arm64x.cmake
@@ -0,0 +1,97 @@
+# check if we have the right linker flags to enable Arm64X
+include(CheckLinkerFlag)
+check_linker_flag(CXX "LINKER:/linkreprofullpathrsp:test_rsp" LIBOMP_HAVE_LINKREPROFULLPATHRSP_FLAG)
+if(NOT LIBOMP_HAVE_LINKREPROFULLPATHRSP_FLAG)
+ message(FATAL_ERROR "Arm64X builds are enabled but the linker does not support the required flag. "
+ "Either update Visual Studio if using link.exe or add lld to LLVM_ENABLE_PROJECTS to use a newer lld.")
+endif()
+
+# directory where the link.rsp file generated during arm64 build will be stored
+set(arm64ReproDir "${LLVM_BINARY_DIR}/runtimes/repros-arm64ec")
+
+# Don't install the runtime if we are doing an arm64ec build for arm64x.
+# The hybrid arm64x runtime will get installed by the host (default) runtime build
+if (LIBOMP_ARCH STREQUAL "arm64ec")
+ set(CMAKE_SKIP_INSTALL_RULES On)
+endif()
+
+# This function reads in the content of the rsp file outputted from the arm64ec build for a target,
+# then passes the arm64ec libs and objs to the linker using /machine:arm64x to combine them with the
+# arm64 counterparts and create an arm64x binary.
+function(set_arm64ec_dll_dependencies target)
+ set(REPRO_FILE "${arm64ReproDir}/${target}.rsp")
+ file(STRINGS "${REPRO_FILE}" ARM64_OBJS REGEX obj\"$)
+ file(STRINGS "${REPRO_FILE}" ARM64_LIBS REGEX lib\"$)
+ string(REPLACE "\"" ";" ARM64_OBJS "${ARM64_OBJS}")
+ string(REPLACE "\"" ";" ARM64_LIBS "${ARM64_LIBS}")
+
+ get_target_property(libs "${target}" LINK_FLAGS)
+ set(non_def "")
+
+ # Separate out the /def flag from the other link flags, so we can replcae it with /defArm64Native.
+ foreach(lib ${libs})
+ if(lib MATCHES ".*\.def")
+ string(REPLACE "/DEF:" "" def ${lib})
+ else()
+ list(APPEND non_def "${lib}")
+ endif()
+ endforeach()
+ # Remove the /def link flag
+ set_target_properties("${target}" PROPERTIES LINK_FLAGS "${non_def}")
+
+ target_sources("${target}" PRIVATE ${ARM64_OBJS})
+ target_link_options("${target}" PRIVATE /machine:arm64x "/def:${arm64ReproDir}/${target}.def" "/defArm64Native:${def}")
+endfunction()
+
+# Replace the /def flag with /defArm64Native and add the arm64ec /def file.
+function(set_arm64ec_lib_dependencies target)
+ get_target_property(opts ${target} STATIC_LIBRARY_OPTIONS)
+ string(REPLACE "/DEF:" "/defArm64Native:" opts "${opts}")
+ set_target_properties(${target} PROPERTIES STATIC_LIBRARY_OPTIONS "/machine:arm64x;${opts};/def:${arm64ReproDir}/${target}.def")
+endfunction()
+
+# Copy the def file for arm64ec to the repros directory so we can use it in the arm64x builds and add the linkreprofullpathrsp flag.
+function(handle_arm64ec_target target)
+ get_target_property(type "${target}" TYPE)
+ if(type STREQUAL "SHARED_LIBRARY")
+ get_target_property(libs "${target}" LINK_FLAGS)
+ elseif(type STREQUAL "STATIC_LIBRARY")
+ get_target_property(libs "${target}" STATIC_LIBRARY_OPTIONS)
+ endif()
+ list(FILTER libs INCLUDE REGEX ".*\.def")
+ string(REPLACE "/DEF:" "" def "${libs}")
+
+ add_custom_target("${target}.def"
+ BYPRODUCTS "${arm64ReproDir}/${target}.def"
+ COMMAND ${CMAKE_COMMAND} -E copy
+ "${def}"
+ "${arm64ReproDir}/${target}.def"
+ DEPENDS "${def}")
+ add_dependencies(${target} "${target}.def")
+ # tell the linker to produce this special rsp file that has absolute paths to its inputs
+ if(type STREQUAL "SHARED_LIBRARY")
+ target_link_options(${target} PRIVATE "/LINKREPROFULLPATHRSP:${arm64ReproDir}/${target}.rsp")
+ endif()
+endfunction()
+
+# Handle the targets we have requested arm64x builds for.
+function(handle_arm64x)
+ # During the arm64ec build, create rsp files that containes the absolute path to the inputs passed to the linker (objs, libs).
+ if("${LIBOMP_ARCH}" STREQUAL "arm64ec")
+ file(MAKE_DIRECTORY ${arm64ReproDir})
+ foreach (target ${ARM64X_TARGETS})
+ handle_arm64ec_target("${target}")
+ endforeach()
+
+ # During the ARM64 build, modify the link step appropriately to produce an arm64x binary
+ elseif("${LIBOMP_ARCH}" STREQUAL "aarch64")
+ foreach (target ${ARM64X_TARGETS})
+ get_target_property(type ${target} TYPE)
+ if(type STREQUAL "SHARED_LIBRARY")
+ set_arm64ec_dll_dependencies("${target}")
+ elseif(type STREQUAL "STATIC_LIBRARY")
+ set_arm64ec_lib_dependencies("${target}")
+ endif()
+ endforeach()
+ endif()
+endfunction()
diff --git a/openmp/runtime/src/kmp.h b/openmp/runtime/src/kmp.h
index 36c40abaf1ef4..035012bd26725 100644
--- a/openmp/runtime/src/kmp.h
+++ b/openmp/runtime/src/kmp.h
@@ -3901,7 +3901,7 @@ extern void __kmp_check_stack_overlap(kmp_info_t *thr);
extern void __kmp_expand_host_name(char *buffer, size_t size);
extern void __kmp_expand_file_name(char *result, size_t rlen, char *pattern);
-#if KMP_ARCH_X86 || KMP_ARCH_X86_64 || (KMP_OS_WINDOWS && (KMP_ARCH_AARCH64 || KMP_ARCH_ARM))
+#if KMP_ARCH_X86 || KMP_ARCH_X86_64 || (KMP_OS_WINDOWS && (KMP_ARCH_AARCH64 || KMP_ARCH_ARM || KMP_ARCH_ARM64EC))
extern void
__kmp_initialize_system_tick(void); /* Initialize timer tick value */
#endif
diff --git a/openmp/runtime/src/kmp_atomic.cpp b/openmp/runtime/src/kmp_atomic.cpp
index 261e9f1beee67..d259737eb5ce1 100644
--- a/openmp/runtime/src/kmp_atomic.cpp
+++ b/openmp/runtime/src/kmp_atomic.cpp
@@ -832,7 +832,7 @@ static inline kmp_cmplx128_a16_t operator/(kmp_cmplx128_a16_t &lhs,
// end of the first part of the workaround for C78287
#endif // USE_CMPXCHG_FIX
-#if KMP_OS_WINDOWS && (KMP_ARCH_AARCH64 || KMP_ARCH_ARM)
+#if KMP_OS_WINDOWS && (KMP_ARCH_AARCH64 || KMP_ARCH_ARM || KMP_ARCH_ARM64EC)
// Undo explicit type casts to get MSVC ARM64 to build. Uses
// OP_CMPXCHG_WORKAROUND definition for OP_CMPXCHG
#undef OP_CMPXCHG
diff --git a/openmp/runtime/src/kmp_os.h b/openmp/runtime/src/kmp_os.h
index e8ad2a6fdb78e..6af1df8261596 100644
--- a/openmp/runtime/src/kmp_os.h
+++ b/openmp/runtime/src/kmp_os.h
@@ -153,7 +153,7 @@ typedef struct kmp_struct64 kmp_uint64;
#undef KMP_USE_X87CONTROL
#define KMP_USE_X87CONTROL 1
#endif
-#if KMP_ARCH_X86_64 || KMP_ARCH_AARCH64
+#if KMP_ARCH_X86_64 || KMP_ARCH_AARCH64 || KMP_ARCH_ARM64EC
#define KMP_INTPTR 1
typedef __int64 kmp_intptr_t;
typedef unsigned __int64 kmp_uintptr_t;
@@ -183,7 +183,7 @@ typedef unsigned long long kmp_uint64;
#define KMP_SIZE_T_SPEC KMP_UINT32_SPEC
#elif KMP_ARCH_X86_64 || KMP_ARCH_PPC64 || KMP_ARCH_AARCH64 || \
KMP_ARCH_MIPS64 || KMP_ARCH_RISCV64 || KMP_ARCH_LOONGARCH64 || \
- KMP_ARCH_VE || KMP_ARCH_S390X || KMP_ARCH_SPARC64
+ KMP_ARCH_VE || KMP_ARCH_S390X || KMP_ARCH_SPARC64 || KMP_ARCH_ARM64EC
#define KMP_SIZE_T_SPEC KMP_UINT64_SPEC
#else
#error "Can't determine size_t printf format specifier."
@@ -464,7 +464,7 @@ enum kmp_mem_fence_type {
// Synchronization primitives
-#if KMP_ASM_INTRINS && KMP_OS_WINDOWS && !((KMP_ARCH_AARCH64 || KMP_ARCH_ARM) && (KMP_COMPILER_CLANG || KMP_COMPILER_GCC))
+#if KMP_ASM_INTRINS && KMP_OS_WINDOWS && !((KMP_ARCH_AARCH64 || KMP_ARCH_ARM || KMP_ARCH_ARM64EC) && (KMP_COMPILER_CLANG || KMP_COMPILER_GCC))
#if KMP_MSVC_COMPAT && !KMP_COMPILER_CLANG
#pragma intrinsic(InterlockedExchangeAdd)
diff --git a/openmp/runtime/src/kmp_platform.h b/openmp/runtime/src/kmp_platform.h
index 609b7c4688842..9c6628b019c49 100644
--- a/openmp/runtime/src/kmp_platform.h
+++ b/openmp/runtime/src/kmp_platform.h
@@ -119,6 +119,7 @@
#define KMP_ARCH_X86_64 0
#define KMP_ARCH_AARCH64 0
#define KMP_ARCH_AARCH64_32 0
+#define KMP_ARCH_ARM64EC 0
#define KMP_ARCH_PPC64_ELFv1 0
#define KMP_ARCH_PPC64_ELFv2 0
#define KMP_ARCH_PPC64_XCOFF 0
@@ -133,7 +134,10 @@
#define KMP_ARCH_SPARC 0
#if KMP_OS_WINDOWS
-#if defined(_M_AMD64) || defined(__x86_64)
+#if defined(_M_ARM64EC)
+#undef KMP_ARCH_ARM64EC
+#define KMP_ARCH_ARM64EC 1
+#elif defined(_M_AMD64) || defined(__x86_64)
#undef KMP_ARCH_X86_64
#define KMP_ARCH_X86_64 1
#elif defined(__aarch64__) || defined(_M_ARM64)
@@ -291,7 +295,7 @@
KMP_ARCH_AARCH64 + KMP_ARCH_MIPS + KMP_ARCH_MIPS64 + \
KMP_ARCH_RISCV64 + KMP_ARCH_LOONGARCH64 + KMP_ARCH_VE + \
KMP_ARCH_S390X + KMP_ARCH_WASM + KMP_ARCH_PPC + \
- KMP_ARCH_AARCH64_32 + KMP_ARCH_SPARC)
+ KMP_ARCH_AARCH64_32 + KMP_ARCH_SPARC + KMP_ARCH_ARM64EC)
#error Unknown or unsupported architecture
#endif
diff --git a/openmp/runtime/src/kmp_runtime.cpp b/openmp/runtime/src/kmp_runtime.cpp
index 48e29c9f9fe45..3ef8996c75372 100644
--- a/openmp/runtime/src/kmp_runtime.cpp
+++ b/openmp/runtime/src/kmp_runtime.cpp
@@ -8924,7 +8924,7 @@ __kmp_determine_reduction_method(
#if KMP_ARCH_X86_64 || KMP_ARCH_PPC64 || KMP_ARCH_AARCH64 || \
KMP_ARCH_MIPS64 || KMP_ARCH_RISCV64 || KMP_ARCH_LOONGARCH64 || \
- KMP_ARCH_VE || KMP_ARCH_S390X || KMP_ARCH_WASM
+ KMP_ARCH_VE || KMP_ARCH_S390X || KMP_ARCH_WASM || KMP_ARCH_ARM64EC
#if KMP_OS_LINUX || KMP_OS_DRAGONFLY || KMP_OS_FREEBSD || KMP_OS_NETBSD || \
KMP_OS_OPENBSD || KMP_OS_WINDOWS || KMP_OS_DARWIN || KMP_OS_HAIKU || \
diff --git a/openmp/runtime/src/thirdparty/ittnotify/ittnotify_config.h b/openmp/runtime/src/thirdparty/ittnotify/ittnotify_config.h
index bd3fd9b43e574..73d00847d2e77 100644
--- a/openmp/runtime/src/thirdparty/ittnotify/ittnotify_config.h
+++ b/openmp/runtime/src/thirdparty/ittnotify/ittnotify_config.h
@@ -173,6 +173,8 @@
#ifndef ITT_ARCH
#if defined _M_IX86 || defined __i386__
#define ITT_ARCH ITT_ARCH_IA32
+#elif defined _M_ARM64EC
+#define ITT_ARCH ITT_ARCH_ARM64
#elif defined _M_X64 || defined _M_AMD64 || defined __x86_64__
#define ITT_ARCH ITT_ARCH_IA32E
#elif defined _M_IA64 || defined __ia64__
diff --git a/openmp/runtime/src/z_Windows_NT-586_util.cpp b/openmp/runtime/src/z_Windows_NT-586_util.cpp
index 37759feafd453..ec737285ab4a6 100644
--- a/openmp/runtime/src/z_Windows_NT-586_util.cpp
+++ b/openmp/runtime/src/z_Windows_NT-586_util.cpp
@@ -12,7 +12,7 @@
#include "kmp.h"
-#if (KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_AARCH64 || KMP_ARCH_ARM)
+#if (KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_AARCH64 || KMP_ARCH_ARM || KMP_ARCH_ARM64EC)
/* Only 32-bit "add-exchange" instruction on IA-32 architecture causes us to
use compare_and_store for these routines */
@@ -134,7 +134,7 @@ kmp_uint64 __kmp_test_then_and64(volatile kmp_uint64 *p, kmp_uint64 d) {
return old_value;
}
-#if KMP_ARCH_AARCH64 && KMP_COMPILER_MSVC
+#if (KMP_ARCH_AARCH64 && KMP_COMPILER_MSVC) || KMP_ARCH_ARM64EC
// For !KMP_COMPILER_MSVC, this function is provided in assembly form
// by z_Linux_asm.S.
int __kmp_invoke_microtask(microtask_t pkfn, int gtid, int tid, int argc,
@@ -189,4 +189,4 @@ int __kmp_invoke_microtask(microtask_t pkfn, int gtid, int tid, int argc,
}
#endif
-#endif /* KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_AARCH64 || KMP_ARCH_ARM */
+#endif /* KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_AARCH64 || KMP_ARCH_ARM || KMP_ARCH_ARM64EC */
\ No newline at end of file
>From 1aa75e0fe2dcd523df5f8d233163f7d96aa51af0 Mon Sep 17 00:00:00 2001
From: David Truby <david.truby at arm.com>
Date: Wed, 14 Jan 2026 16:49:42 +0000
Subject: [PATCH 2/2] clang-format
---
openmp/runtime/src/kmp.h | 3 ++-
openmp/runtime/src/kmp_os.h | 4 +++-
openmp/runtime/src/z_Windows_NT-586_util.cpp | 6 ++++--
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/openmp/runtime/src/kmp.h b/openmp/runtime/src/kmp.h
index 035012bd26725..55b1b5282df0f 100644
--- a/openmp/runtime/src/kmp.h
+++ b/openmp/runtime/src/kmp.h
@@ -3901,7 +3901,8 @@ extern void __kmp_check_stack_overlap(kmp_info_t *thr);
extern void __kmp_expand_host_name(char *buffer, size_t size);
extern void __kmp_expand_file_name(char *result, size_t rlen, char *pattern);
-#if KMP_ARCH_X86 || KMP_ARCH_X86_64 || (KMP_OS_WINDOWS && (KMP_ARCH_AARCH64 || KMP_ARCH_ARM || KMP_ARCH_ARM64EC))
+#if KMP_ARCH_X86 || KMP_ARCH_X86_64 || \
+ (KMP_OS_WINDOWS && (KMP_ARCH_AARCH64 || KMP_ARCH_ARM || KMP_ARCH_ARM64EC))
extern void
__kmp_initialize_system_tick(void); /* Initialize timer tick value */
#endif
diff --git a/openmp/runtime/src/kmp_os.h b/openmp/runtime/src/kmp_os.h
index 6af1df8261596..0fdf5a99bd1f8 100644
--- a/openmp/runtime/src/kmp_os.h
+++ b/openmp/runtime/src/kmp_os.h
@@ -464,7 +464,9 @@ enum kmp_mem_fence_type {
// Synchronization primitives
-#if KMP_ASM_INTRINS && KMP_OS_WINDOWS && !((KMP_ARCH_AARCH64 || KMP_ARCH_ARM || KMP_ARCH_ARM64EC) && (KMP_COMPILER_CLANG || KMP_COMPILER_GCC))
+#if KMP_ASM_INTRINS && KMP_OS_WINDOWS && \
+ !((KMP_ARCH_AARCH64 || KMP_ARCH_ARM || KMP_ARCH_ARM64EC) && \
+ (KMP_COMPILER_CLANG || KMP_COMPILER_GCC))
#if KMP_MSVC_COMPAT && !KMP_COMPILER_CLANG
#pragma intrinsic(InterlockedExchangeAdd)
diff --git a/openmp/runtime/src/z_Windows_NT-586_util.cpp b/openmp/runtime/src/z_Windows_NT-586_util.cpp
index ec737285ab4a6..7e64ae367ca8d 100644
--- a/openmp/runtime/src/z_Windows_NT-586_util.cpp
+++ b/openmp/runtime/src/z_Windows_NT-586_util.cpp
@@ -12,7 +12,8 @@
#include "kmp.h"
-#if (KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_AARCH64 || KMP_ARCH_ARM || KMP_ARCH_ARM64EC)
+#if (KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_AARCH64 || KMP_ARCH_ARM || \
+ KMP_ARCH_ARM64EC)
/* Only 32-bit "add-exchange" instruction on IA-32 architecture causes us to
use compare_and_store for these routines */
@@ -189,4 +190,5 @@ int __kmp_invoke_microtask(microtask_t pkfn, int gtid, int tid, int argc,
}
#endif
-#endif /* KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_AARCH64 || KMP_ARCH_ARM || KMP_ARCH_ARM64EC */
\ No newline at end of file
+#endif /* KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_AARCH64 || KMP_ARCH_ARM \
+ || KMP_ARCH_ARM64EC */
\ No newline at end of file
More information about the Openmp-commits
mailing list