[Openmp-commits] [openmp] [llvm] [openmp][wasm] Allow compiling OpenMP to WebAssembly (PR #71297)

Shilei Tian via Openmp-commits openmp-commits at lists.llvm.org
Sat Nov 4 20:00:18 PDT 2023


================
@@ -2286,7 +2286,27 @@ KMP_PREFIX_UNDERSCORE(__kmp_unnamed_critical_addr):
 #if KMP_OS_LINUX
 # if KMP_ARCH_ARM || KMP_ARCH_AARCH64
 .section .note.GNU-stack,"",%progbits
-# else
+# elif !KMP_ARCH_WASM
 .section .note.GNU-stack,"", at progbits
 # endif
 #endif
+
+#if KMP_ARCH_WASM
+.data
+.global .gomp_critical_user_
+.global .gomp_critical_user_.var
+.global .gomp_critical_user_.reduction.var
+.global __kmp_unnamed_critical_addr
+.gomp_critical_user_:
+.zero 4
+.size .gomp_critical_user_, 4
+.gomp_critical_user_.var:
+.zero 4
+.size .gomp_critical_user_.var, 4
+.gomp_critical_user_.reduction.var:
+.zero 4
+.size .gomp_critical_user_.reduction.var, 4
+__kmp_unnamed_critical_addr:
+    .4byte .gomp_critical_user_
+    .size __kmp_unnamed_critical_addr, 4
+#endif
----------------
shiltian wrote:

WASM doesn't require special definition of functions like `__kmp_invoke_microtask`?

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


More information about the Openmp-commits mailing list