This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU][OpenMP] Use llvm-link to link ocml libraries
ClosedPublic

Authored by pdhaliwal on Aug 12 2021, 1:47 AM.

Details

Summary

This fixes the 'unused linker option: -lm' warning when compiling
program with -c.

Diff Detail

Event Timeline

pdhaliwal created this revision.Aug 12 2021, 1:47 AM
pdhaliwal requested review of this revision.Aug 12 2021, 1:47 AM
Herald added a project: Restricted Project. · View Herald Transcript

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?

clang/test/Driver/amdgpu-openmp-toolchain.c
80

This will fail on machines with a different directory layout, perhaps copy the {{.*}} pattern from above

pdhaliwal updated this revision to Diff 365965.Aug 12 2021, 4:27 AM

Remove redundant test

pdhaliwal added inline comments.Aug 12 2021, 4:29 AM
clang/test/Driver/amdgpu-openmp-toolchain.c
80

This was accidently put up as a comment to check the actual 'CHECK' line.

JonChesterfield accepted this revision.Aug 12 2021, 4:40 AM

LG, thanks!

This revision is now accepted and ready to land.Aug 12 2021, 4:40 AM
This revision was landed with ongoing or failed builds.Aug 13 2021, 1:07 AM
This revision was automatically updated to reflect the committed changes.