This is an archive of the discontinued LLVM Phabricator instance.

[HIP] Make `--offload-add-rpath` alias of `-frtlib-add-rpath`
ClosedPublic

Authored by yaxunl on Mar 6 2023, 8:50 AM.

Details

Summary

HIP runtime is the language runtime of HIP. When users need
to specify rpath, they usually need to specify rpath for
both compiler-rt and HIP runtime. It seems redundant
to have separate options. Therefore make --offload-add-rpath
an alias to -frtlib-add-rpath.

Diff Detail

Event Timeline

yaxunl created this revision.Mar 6 2023, 8:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 6 2023, 8:50 AM
yaxunl requested review of this revision.Mar 6 2023, 8:50 AM
tra accepted this revision.Mar 6 2023, 11:04 AM

LGTM,

clang/include/clang/Driver/Options.td
4257

I'm not sure these HIP-specific details are needed here.
It may be better to generalize the generic description along the lines of "adds required architecture-specific directories to RPATH".

clang/test/Driver/hip-runtime-libs-linux.hip
16

I think you may still want to test with --offload-add-rpath, too.

This revision is now accepted and ready to land.Mar 6 2023, 11:04 AM

Seems fine. Should we eventually remove --offload-add-rpath and -fopenmp-implicit-rpath?

MaskRay accepted this revision.Mar 6 2023, 1:22 PM
yaxunl added a comment.Mar 9 2023, 1:10 PM

Seems fine. Should we eventually remove --offload-add-rpath and -fopenmp-implicit-rpath?

I agree we should eventually remove them and keep -frtlib-add-rpath only.

clang/include/clang/Driver/Options.td
4257

currently, it only adds compiler-rt path and HIP runtime path to RPATH. Making the help message generic for all language runtime will cause an incorrect impression to the users that this option adds all language runtime lib paths to RPATH but it actually does not.

clang/test/Driver/hip-runtime-libs-linux.hip
16

will do

Herald added a project: Restricted Project. · View Herald TranscriptMar 11 2023, 10:34 AM