[PATCH] D107952: [AMDGPU][OpenMP] Use llvm-link to link ocml libraries

Jon Chesterfield via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 12 04:15:45 PDT 2021


JonChesterfield added a comment.

This is semantically different to using mlink-builtin-bitcode with clang. The former internalizes all the symbols after they are introduced, using llvm-link does not. I'm not immediately sure whether that is a problem - the symbols in rocm device libs should all be `__prefixed` - but it's potentially bad for code size.

Suggest we fix the test case and leave restoring internalize for a later patch, thoughts?



================
Comment at: clang/test/Driver/amdgpu-openmp-toolchain.c:80
+// CHECK-LIB-DEVICE: {{.*}}llvm-link{{.*}}ocml.bc"{{.*}}ockl.bc"{{.*}}oclc_daz_opt_on.bc"{{.*}}oclc_unsafe_math_off.bc"{{.*}}oclc_finite_only_off.bc"{{.*}}oclc_correctly_rounded_sqrt_on.bc"{{.*}}oclc_wavefrontsize64_on.bc"{{.*}}oclc_isa_version_803.bc"
+// "llvm-link" "/tmp/amdgpu-openmp-toolchain-e9dcd9.bc" "/home/prince/source/repos/llvm-project/clang/test/Driver/Inputs/rocm/amdgcn/bitcode/ocml.bc" "/home/prince/source/repos/llvm-project/clang/test/Driver/Inputs/rocm/amdgcn/bitcode/ockl.bc" "/home/prince/source/repos/llvm-project/clang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_daz_opt_on.bc" "/home/prince/source/repos/llvm-project/clang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_unsafe_math_off.bc" "/home/prince/source/repos/llvm-project/clang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_finite_only_off.bc" "/home/prince/source/repos/llvm-project/clang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_correctly_rounded_sqrt_on.bc" "/home/prince/source/repos/llvm-project/clang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_wavefrontsize64_on.bc" "/home/prince/source/repos/llvm-project/clang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_isa_version_803.bc" "-o" "/tmp/amdgpu-openmp-toolchain-e9dcd9-gfx803-linked-4095ab.bc"
----------------
This will fail on machines with a different directory layout, perhaps copy the `{{.*}}` pattern from above


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107952/new/

https://reviews.llvm.org/D107952



More information about the cfe-commits mailing list