Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ See docs/process.md for more on how version tagging works.
- Revert #27397, which changed the way config keys such as NODE_JS were parsed
when reading the config file. This change broke emsdk installations that
contained spaces. (#27421)
- OpenMP was updated to LLVM 22.1.8 (#27437)

6.0.4 - 07/24/26
----------------
Expand Down
9 changes: 3 additions & 6 deletions system/lib/openmp/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
llvm's OpenMP
-------------

Note: This version of openmp is actually based on 1823581ecb but
we are in the process of updating it.

These files are from the llvm-project based on release 21.1.8.
These files are from the llvm-project based on release 22.1.8.

We maintain a local fork of llvm-project that contains any Emscripten
specific patches:

https://github.com/emscripten-core/llvm-project

The current patch is based on the emscripten-libs-21 branch.
The current patch is based on the emscripten-libs-22 branch.

Update Instructions
-------------------
Expand All @@ -23,4 +20,4 @@ Modifications

For a list of changes from upstream see the OpenMP files that are part of:

https://github.com/llvm/llvm-project/compare/llvmorg-21.1.8...emscripten-core:emscripten-libs-21
https://github.com/llvm/llvm-project/compare/llvmorg-22.1.8...emscripten-core:emscripten-libs-22
18 changes: 0 additions & 18 deletions system/lib/openmp/include/omp.h
Original file line number Diff line number Diff line change
Expand Up @@ -380,11 +380,6 @@
omp_uintptr_t value;
} omp_alloctrait_t;

typedef enum {
omp_access_cgroup = 0,
omp_access_pteam = 1
} omp_access_t;

# if defined(_WIN32)
// On Windows cl and icl do not support 64-bit enum, let's use integer then.
typedef omp_uintptr_t omp_allocator_handle_t;
Expand All @@ -408,7 +403,6 @@
extern __KMP_IMP omp_memspace_handle_t const omp_const_mem_space;
extern __KMP_IMP omp_memspace_handle_t const omp_high_bw_mem_space;
extern __KMP_IMP omp_memspace_handle_t const omp_low_lat_mem_space;
extern __KMP_IMP omp_memspace_handle_t const omp_cgroup_mem_space;
extern __KMP_IMP omp_memspace_handle_t const llvm_omp_target_host_mem_space;
extern __KMP_IMP omp_memspace_handle_t const llvm_omp_target_shared_mem_space;
extern __KMP_IMP omp_memspace_handle_t const llvm_omp_target_device_mem_space;
Expand Down Expand Up @@ -445,7 +439,6 @@
omp_const_mem_space = 2,
omp_high_bw_mem_space = 3,
omp_low_lat_mem_space = 4,
omp_cgroup_mem_space = 5,
llvm_omp_target_host_mem_space = 100,
llvm_omp_target_shared_mem_space = 101,
llvm_omp_target_device_mem_space = 102,
Expand All @@ -470,11 +463,6 @@
omp_allocator_handle_t allocator = omp_null_allocator,
omp_allocator_handle_t free_allocator = omp_null_allocator);
extern void __KAI_KMPC_CONVENTION omp_free(void * ptr, omp_allocator_handle_t a = omp_null_allocator);
extern void *__KAI_KMPC_CONVENTION omp_get_dyn_gprivate_ptr(size_t offset = 0, omp_access_t access_group = omp_access_cgroup);
extern void *__KAI_KMPC_CONVENTION omp_get_dyn_gprivate_nofb_ptr(size_t offset = 0, omp_access_t access_group = omp_access_cgroup);
extern size_t __KAI_KMPC_CONVENTION omp_get_dyn_gprivate_size(omp_access_t access_group = omp_access_cgroup);
extern omp_memspace_handle_t __KAI_KMPC_CONVENTION omp_get_dyn_gprivate_memspace(omp_access_t access_group = omp_access_cgroup);
extern size_t __KAI_KMPC_CONVENTION omp_get_gprivate_limit(int device_num, omp_access_t access_group = omp_access_cgroup);
# else
extern void *__KAI_KMPC_CONVENTION omp_alloc(size_t size, omp_allocator_handle_t a);
extern void *__KAI_KMPC_CONVENTION omp_aligned_alloc(size_t align, size_t size,
Expand All @@ -485,11 +473,6 @@
extern void *__KAI_KMPC_CONVENTION omp_realloc(void *ptr, size_t size, omp_allocator_handle_t allocator,
omp_allocator_handle_t free_allocator);
extern void __KAI_KMPC_CONVENTION omp_free(void *ptr, omp_allocator_handle_t a);
extern void *__KAI_KMPC_CONVENTION omp_get_dyn_gprivate_ptr(size_t offset, omp_access_t access_group);
extern void *__KAI_KMPC_CONVENTION omp_get_dyn_gprivate_nofb_ptr(size_t offset, omp_access_t access_group);
extern size_t __KAI_KMPC_CONVENTION omp_get_dyn_gprivate_size(omp_access_t access_group);
extern omp_memspace_handle_t __KAI_KMPC_CONVENTION omp_get_dyn_gprivate_memspace(omp_access_t access_group);
extern size_t __KAI_KMPC_CONVENTION omp_get_gprivate_limit(int device_num, omp_access_t access_group);
# endif

/* OpenMP TR11 routines to get memory spaces and allocators */
Expand Down Expand Up @@ -553,7 +536,6 @@

/* OpenMP 5.2 */
extern int __KAI_KMPC_CONVENTION omp_in_explicit_task(void);
#define omp_initial_device -1
#define omp_invalid_device -2

/* OpenMP 6.0 */
Expand Down
2 changes: 1 addition & 1 deletion system/lib/openmp/include/ompx.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#ifndef __OMPX_H
#define __OMPX_H

#if (defined(__NVPTX__) || defined(__AMDGPU__) || defined(__SPIRV__))
#if (defined(__NVPTX__) || defined(__AMDGPU__))
#include <gpuintrin.h>
#define __OMPX_TARGET_IS_GPU
#endif
Expand Down
6 changes: 2 additions & 4 deletions system/lib/openmp/prebuilt/kmp_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
#define OMPT_SUPPORT LIBOMP_OMPT_SUPPORT
#define LIBOMP_OMPD_SUPPORT 0
#define OMPD_SUPPORT LIBOMP_OMPD_SUPPORT
#define LIBOMP_TASKGRAPH_EXPERIMENTAL 0
#define OMP_TASKGRAPH_EXPERIMENTAL LIBOMP_TASKGRAPH_EXPERIMENTAL
#define LIBOMP_OMPX_TASKGRAPH 0
#define OMPX_TASKGRAPH LIBOMP_OMPX_TASKGRAPH
#define LIBOMP_PROFILING_SUPPORT 0
#define OMP_PROFILING_SUPPORT LIBOMP_PROFILING_SUPPORT
#define LIBOMP_OMPT_OPTIONAL 1
Expand Down Expand Up @@ -96,8 +96,6 @@
#define KMP_HAVE_POSIX_MEMALIGN LIBOMP_HAVE_POSIX_MEMALIGN
#define LIBOMP_HAVE__ALIGNED_MALLOC 0
#define KMP_HAVE__ALIGNED_MALLOC LIBOMP_HAVE__ALIGNED_MALLOC
#define LIBOMP_USE_CANCEL_THREADS 1
#define KMP_CANCEL_THREADS LIBOMP_USE_CANCEL_THREADS
#define OPENMP_ENABLE_LIBOMPTARGET 0
#define ENABLE_LIBOMPTARGET OPENMP_ENABLE_LIBOMPTARGET

Expand Down
4 changes: 1 addition & 3 deletions system/lib/openmp/prebuilt/kmp_i18n_default.inc
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,6 @@ __kmp_i18n_default_messages[] =
"Target memory not available, will use default allocator.",
"%1$s ignored: This machine is not a hybrid architecutre. Using \"%2$s\" instead.",
"%1$s ignored: %2$s is not available. Using \"%3$s\" instead.",
"%1$s() called inside a parallel or teams region; call ignored.",
"%1$s() called inside a parallel or teams region; call ignored.",
NULL
};

Expand Down Expand Up @@ -471,7 +469,7 @@ __kmp_i18n_sections[] =
{ 5, __kmp_i18n_default_meta },
{ 79, __kmp_i18n_default_strings },
{ 6, __kmp_i18n_default_formats },
{ 303, __kmp_i18n_default_messages },
{ 301, __kmp_i18n_default_messages },
{ 29, __kmp_i18n_default_hints },
{ 0, NULL }
};
Expand Down
2 changes: 0 additions & 2 deletions system/lib/openmp/prebuilt/kmp_i18n_id.inc
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,6 @@ enum kmp_i18n_id {
kmp_i18n_msg_TargetMemNotAvailable,
kmp_i18n_msg_AffIgnoringNonHybrid,
kmp_i18n_msg_AffIgnoringNotAvailable,
kmp_i18n_msg_SetNumTeamsInParOrTeamsRegion,
kmp_i18n_msg_SetTeamsThreadLimitInParOrTeamsRegion,
kmp_i18n_msg_last,

// Set #5, hints.
Expand Down
48 changes: 22 additions & 26 deletions system/lib/openmp/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ endif()
configure_file(${LIBOMP_INC_DIR}/omp.h.var ${LIBOMP_HEADERS_INTDIR}/omp.h @ONLY)
configure_file(${LIBOMP_INC_DIR}/ompx.h.var ${LIBOMP_HEADERS_INTDIR}/ompx.h @ONLY)
configure_file(kmp_config.h.cmake kmp_config.h @ONLY)
if(LIBOMP_OMPT_SUPPORT)
if(${LIBOMP_OMPT_SUPPORT})
configure_file(${LIBOMP_INC_DIR}/omp-tools.h.var ${LIBOMP_HEADERS_INTDIR}/omp-tools.h @ONLY)
endif()

Expand Down Expand Up @@ -81,13 +81,11 @@ if(STUBS_LIBRARY)
else()
# Get C++ files
set(LIBOMP_CXXFILES
kmp_adt.cpp
kmp_alloc.cpp
kmp_atomic.cpp
kmp_csupport.cpp
kmp_debug.cpp
kmp_itt.cpp
kmp_invoke_microtask.cpp
kmp_environment.cpp
kmp_error.cpp
kmp_global.cpp
Expand All @@ -111,9 +109,9 @@ else()
# Windows specific files
libomp_append(LIBOMP_CXXFILES z_Windows_NT_util.cpp)
libomp_append(LIBOMP_CXXFILES z_Windows_NT-586_util.cpp)
if(LIBOMP_ARCH STREQUAL "i386" OR LIBOMP_ARCH STREQUAL "x86_64")
if(${LIBOMP_ARCH} STREQUAL "i386" OR ${LIBOMP_ARCH} STREQUAL "x86_64")
libomp_append(LIBOMP_ASMFILES z_Windows_NT-586_asm.asm) # Windows assembly file
elseif((LIBOMP_ARCH STREQUAL "aarch64" OR LIBOMP_ARCH STREQUAL "arm") AND (NOT MSVC OR CMAKE_C_COMPILER_ID STREQUAL "Clang"))
elseif((${LIBOMP_ARCH} STREQUAL "aarch64" OR ${LIBOMP_ARCH} STREQUAL "arm") AND (NOT MSVC OR CMAKE_C_COMPILER_ID STREQUAL "Clang"))
# z_Linux_asm.S works for AArch64 and ARM Windows too.
libomp_append(LIBOMP_GNUASMFILES z_Linux_asm.S)
else()
Expand Down Expand Up @@ -176,7 +174,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)

# Build libomp library. Add LLVMSupport dependency if building in-tree with
# libomptarget profiling enabled.
if(NOT OPENMP_ENABLE_LIBOMP_PROFILING)
if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
add_library(omp ${LIBOMP_LIBRARY_KIND} $<TARGET_OBJECTS:obj.omp>)
set_property(TARGET omp PROPERTY FOLDER "OpenMP/Libraries")
# Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
Expand All @@ -190,10 +188,7 @@ else()
# libomp must be a C++ library such that it can link libLLVMSupport
set(LIBOMP_LINKER_LANGUAGE CXX)
endif()

openmp_register_meta_dep(omp)

if(LIBOMP_USE_HWLOC)
if(${LIBOMP_USE_HWLOC})
# Since we are using an OBJECT library, the PRIVATE and INTERFACE options are split
# (instead of using PUBLIC): obj.omp for compiling itself, omp for propagating
# the options to other libraries that depend on it, e.g. libompd.
Expand Down Expand Up @@ -385,15 +380,15 @@ if(WIN32)
endif()

# Move files to exports/ directory if requested
if(LIBOMP_COPY_EXPORTS)
if(${LIBOMP_COPY_EXPORTS})
include(LibompExports)
endif()

# Micro test rules for after library has been built (cmake/LibompMicroTests.cmake)
include(LibompMicroTests)
add_custom_target(libomp-micro-tests)
set_target_properties(libomp-micro-tests PROPERTIES FOLDER "OpenMP/Tests")
if(NOT MIC AND NOT CMAKE_CROSSCOMPILING)
if(NOT ${MIC} AND NOT CMAKE_CROSSCOMPILING)
add_dependencies(libomp-micro-tests libomp-test-touch)
endif()
if(NOT WIN32 AND NOT APPLE)
Expand All @@ -406,29 +401,31 @@ add_dependencies(libomp-micro-tests libomp-test-deps)

# `omp` needs to be exported if in-tree build.
set(export_to_llvmexports)
get_target_export_arg(omp LLVM export_to_llvmexports)
set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS omp)
if (NOT OPENMP_STANDALONE_BUILD)
get_target_export_arg(omp LLVM export_to_llvmexports)
set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS omp)
endif()

# Install rules
# We want to install libomp in ${DESTDIR}/${CMAKE_INSTALL_FULL_LIBDIR}
# We want to install headers in ${DESTDIR}/${CMAKE_INSTALL_FULL_INCLUDEDIR}
if(WIN32)
install(TARGETS omp ${export_to_llvmexports} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT openmp)
install(TARGETS ${LIBOMP_IMP_LIB_TARGET} ARCHIVE DESTINATION "${OPENMP_INSTALL_LIBDIR}" COMPONENT openmp)
install(TARGETS omp ${export_to_llvmexports} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
install(TARGETS ${LIBOMP_IMP_LIB_TARGET} ARCHIVE DESTINATION "${OPENMP_INSTALL_LIBDIR}")
# Create aliases (regular copies) of the library for backwards compatibility
set(LIBOMP_ALIASES "libiomp5md")
foreach(alias IN LISTS LIBOMP_ALIASES)
install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E copy \"${LIBOMP_LIB_FILE}\"
\"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \"${CMAKE_INSTALL_FULL_BINDIR}\")" COMPONENT openmp)
\"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \"${CMAKE_INSTALL_FULL_BINDIR}\")")
extend_path(outdir "${CMAKE_INSTALL_PREFIX}" "${OPENMP_INSTALL_LIBDIR}")
install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E copy \"${LIBOMP_IMP_LIB_FILE}\"
\"${alias}${CMAKE_STATIC_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \"${outdir}\")" COMPONENT openmp)
\"${alias}${CMAKE_STATIC_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \"${outdir}\")")
endforeach()
else()

install(TARGETS omp ${export_to_llvmexports} ${LIBOMP_INSTALL_KIND} DESTINATION "${OPENMP_INSTALL_LIBDIR}" COMPONENT openmp)
install(TARGETS omp ${export_to_llvmexports} ${LIBOMP_INSTALL_KIND} DESTINATION "${OPENMP_INSTALL_LIBDIR}")

if(LIBOMP_INSTALL_ALIASES)
if(${LIBOMP_INSTALL_ALIASES})
# Create aliases (symlinks) of the library for backwards compatibility
extend_path(outdir "${CMAKE_INSTALL_PREFIX}" "${OPENMP_INSTALL_LIBDIR}")
if(AIX)
Expand All @@ -441,12 +438,12 @@ else()
foreach(alias IN LISTS LIBOMP_ALIASES)
install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E create_symlink \"${LIBOMP_LIB_NAME}${LIBRARY_SUFFIX}\"
\"${alias}${LIBRARY_SUFFIX}\" WORKING_DIRECTORY
\"\$ENV{DESTDIR}${outdir}\")" COMPONENT openmp)
\"\$ENV{DESTDIR}${outdir}\")")
endforeach()
if(LIBOMP_ENABLE_SHARED AND NOT AIX)
install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E create_symlink \"${LIBOMP_LIB_FILE}\"
\"${VERSIONED_LIBGOMP_NAME}\" WORKING_DIRECTORY
\"\$ENV{DESTDIR}${outdir}\")" COMPONENT openmp)
\"\$ENV{DESTDIR}${outdir}\")")
endif()
endif()
endif()
Expand All @@ -455,11 +452,10 @@ install(
${LIBOMP_HEADERS_INTDIR}/omp.h
${LIBOMP_HEADERS_INTDIR}/ompx.h
DESTINATION ${LIBOMP_HEADERS_INSTALL_PATH}
COMPONENT openmp
)
if(LIBOMP_OMPT_SUPPORT)
install(FILES ${LIBOMP_HEADERS_INTDIR}/omp-tools.h DESTINATION ${LIBOMP_HEADERS_INSTALL_PATH} COMPONENT openmp)
if(${LIBOMP_OMPT_SUPPORT})
install(FILES ${LIBOMP_HEADERS_INTDIR}/omp-tools.h DESTINATION ${LIBOMP_HEADERS_INSTALL_PATH})
# install under legacy name ompt.h
install(FILES ${LIBOMP_HEADERS_INTDIR}/omp-tools.h DESTINATION ${LIBOMP_HEADERS_INSTALL_PATH} RENAME ompt.h COMPONENT openmp)
install(FILES ${LIBOMP_HEADERS_INTDIR}/omp-tools.h DESTINATION ${LIBOMP_HEADERS_INSTALL_PATH} RENAME ompt.h)
set(LIBOMP_OMP_TOOLS_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE)
endif()
1 change: 0 additions & 1 deletion system/lib/openmp/src/dllexports
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,6 @@ kmp_set_disp_num_buffers 890
llvm_omp_target_shared_mem_space DATA
llvm_omp_target_device_mem_space DATA
omp_null_mem_space DATA
omp_cgroup_mem_space DATA

%ifndef stub
# Ordinals between 900 and 999 are reserved
Expand Down
2 changes: 0 additions & 2 deletions system/lib/openmp/src/i18n/en_US.txt
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,6 @@ AffHWSubsetIgnoringAttr "KMP_HW_SUBSET: ignoring %1$s attribute. This machi
TargetMemNotAvailable "Target memory not available, will use default allocator."
AffIgnoringNonHybrid "%1$s ignored: This machine is not a hybrid architecutre. Using \"%2$s\" instead."
AffIgnoringNotAvailable "%1$s ignored: %2$s is not available. Using \"%3$s\" instead."
SetNumTeamsInParOrTeamsRegion "%1$s() called inside a parallel or teams region; call ignored."
SetTeamsThreadLimitInParOrTeamsRegion "%1$s() called inside a parallel or teams region; call ignored."

# --------------------------------------------------------------------------------------------------
-*- HINTS -*-
Expand Down
Loading
Loading