[all-commits] [llvm/llvm-project] 68ea91: [openmp][wasm] Allow compiling OpenMP to WebAssemb...

Andrew Brown via All-commits all-commits at lists.llvm.org
Thu Dec 14 11:48:16 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 68ea91dd8b506764c0a89e9220cfcefcf3790973
      https://github.com/llvm/llvm-project/commit/68ea91dd8b506764c0a89e9220cfcefcf3790973
  Author: Andrew Brown <andrew.brown at intel.com>
  Date:   2023-12-14 (Thu, 14 Dec 2023)

  Changed paths:
    M llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
    M openmp/CMakeLists.txt
    M openmp/runtime/CMakeLists.txt
    M openmp/runtime/cmake/LibompGetArchitecture.cmake
    M openmp/runtime/cmake/config-ix.cmake
    M openmp/runtime/src/kmp.h
    M openmp/runtime/src/kmp_ftn_entry.h
    M openmp/runtime/src/kmp_gsupport.cpp
    M openmp/runtime/src/kmp_os.h
    M openmp/runtime/src/kmp_platform.h
    M openmp/runtime/src/kmp_runtime.cpp
    M openmp/runtime/src/kmp_utility.cpp
    M openmp/runtime/src/z_Linux_asm.S
    M openmp/runtime/src/z_Linux_util.cpp

  Log Message:
  -----------
  [openmp][wasm] Allow compiling OpenMP to WebAssembly  (#71297)

This change allows building the static OpenMP runtime, `libomp.a`, as
WebAssembly. It builds on the work done in [D142593] but goes further in
several ways:
 - it makes the OpenMP CMake files more WebAssembly-aware
- it conditions much more code (or code that had been refactored since
[D142593]) for `KMP_ARCH_WASM` and `KMP_OS_WASI`
- it fixes a Clang crash due to unimplemented common symbols in
WebAssembly

The commit messages have more details. Please understand this PR as a
start, not the completed work, for WebAssembly support in OpenMP.
Getting the tests running somehow would be a good next step, e.g.; but
what is contained here works, at least with recent versions of
[wasi-sdk] and engines that support [wasi-threads]. I suspect the same
is true for Emscripten and browsers, but I have not tested that
workflow.

[D142593]: https://reviews.llvm.org/D142593
[wasi-sdk]: https://github.com/WebAssembly/wasi-sdk
[wasi-threads]: https://github.com/WebAssembly/wasi-threads

---------

Co-authored-by: Atanas Atanasov <atanas.atanasov at intel.com>




More information about the All-commits mailing list