This patch adds a new RTL function for worksharing. Currently we use
__kmpc_for_static_init for both the distribute and parallel
portion of the loop clause. This patch replaces the distribute portion
with a new runtime call __kmpc_distribute_static_init. Currently this
will be used exactly the same way, but will make it easier in the future
to fine-tune the distribute and parallel portion of the loop.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LG.
We might be able to revert/simplify this eventually again but for now it makes it much simpler to distinguish the distribute and workshare (=for) via their call site.
clang/lib/CodeGen/CGOpenMPRuntime.cpp | ||
---|---|---|
2860 | Could we pass the 4 potential functions to createForStaticInitFunction (or similar name) to avoid the duplication? Or just pass a flag. |
hi, we seem to have a link time error after this patch in our buildbot
https://lab.llvm.org/staging/#/builders/182/builds/2023
- TEST 'libomptarget :: amdgcn-amd-amdhsa :: mapping/private_mapping.c' FAILED ****
Script:
: 'RUN: at line 1'; /work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/./bin/clang -fopenmp -fno-experimental-isel -I /work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.src/openmp/libomptarget/test -I /work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/runtimes/runtimes-bins/openmp/libomptarget -L /work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/runtimes/runtimes-bins/openmp/libomptarget -Wl,-rpath,/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/runtimes/runtimes-bins/openmp/runtime/src --libomptarget-amdgcn-bc-path=/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/runtimes/runtimes-bins/openmp/libomptarget -fopenmp-targets=amdgcn-amd-amdhsa /work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.src/openmp/libomptarget/test/mapping/private_mapping.c -o /work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/runtimes/runtimes-bins/openmp/libomptarget/test/amdgcn-amd-amdhsa/mapping/Output/private_mapping.c.tmp && /work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/runtimes/runtimes-bins/openmp/libomptarget/test/amdgcn-amd-amdhsa/mapping/Output/private_mapping.c.tmp | /work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/./bin/FileCheck /work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.src/openmp/libomptarget/test/mapping/private_mapping.c
Exit Code: 1
Command Output (stdout):
$ ":" "RUN: at line 1"
$ "/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/./bin/clang" "-fopenmp" "-fno-experimental-isel" "-I" "/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.src/openmp/libomptarget/test" "-I" "/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/runtimes/runtimes-bins/openmp/runtime/src" "-L" "/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/runtimes/runtimes-bins/openmp/libomptarget" "-L" "/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/runtimes/runtimes-bins/openmp/runtime/src" "-Wl,-rpath,/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/runtimes/runtimes-bins/openmp/libomptarget" "-Wl,-rpath,/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/runtimes/runtimes-bins/openmp/runtime/src" "--libomptarget-amdgcn-bc-path=/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/runtimes/runtimes-bins/openmp/libomptarget" "-fopenmp-targets=amdgcn-amd-amdhsa" "/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.src/openmp/libomptarget/test/mapping/private_mapping.c" "-o" "/work/omp-vega20-0/openmp-offload-amdgpu-project/llvm.build/runtimes/runtimes-bins/openmp/libomptarget/test/amdgcn-amd-amdhsa/mapping/Output/private_mapping.c.tmp"
command stderr:
lld: error: undefined symbol: __kmpc_distribute_static_init_4
referenced by /tmp/private_mapping-6f3f07-gfx906-d001f0.o:(omp_outlined)
referenced by /tmp/private_mapping-6f3f07-gfx906-d001f0.o:(omp_outlined)
lld: error: undefined symbol: __kmpc_distribute_static_fini
referenced by /tmp/private_mapping-6f3f07-gfx906-d001f0.o:(omp_outlined)
referenced by /tmp/private_mapping-6f3f07-gfx906-d001f0.o:(omp_outlined)
referenced by /tmp/private_mapping-6f3f07-gfx906-d001f0.o:(__omp_outlined__.1)
referenced 1 more times
clang-14: error: amdgcn-link command failed with exit code 1 (use -v to see invocation)
error: command failed with exit status: 1
lld: error: undefined symbol: __kmpc_distribute_static_init_4
referenced by /tmp/private_mapping-6f3f07-gfx906-d001f0.o:(omp_outlined)
referenced by /tmp/private_mapping-6f3f07-gfx906-d001f0.o:(omp_outlined)
lld: error: undefined symbol: __kmpc_distribute_static_fini
referenced by /tmp/private_mapping-6f3f07-gfx906-d001f0.o:(omp_outlined)
referenced by /tmp/private_mapping-6f3f07-gfx906-d001f0.o:(omp_outlined)
referenced by /tmp/private_mapping-6f3f07-gfx906-d001f0.o:(__omp_outlined__.1)
referenced 1 more times
clang-14: error: amdgcn-link command failed with exit code 1 (use -v to see invocation)
looks like subsequent builders passed. we might have an issue where the runtime was not fully built when the test ran.
please disregard , your patch is fine.
[AMD Official Use Only]
Yes, thank you, it was two dependent patches
Builder 1 only saw 1st patch, failed, then 2nd patch arrived, and passed.
Builder 2 picked up both and passed
All good.
Could we pass the 4 potential functions to createForStaticInitFunction (or similar name) to avoid the duplication? Or just pass a flag.