This is an archive of the discontinued LLVM Phabricator instance.

[HIP] Use option -nogpulib to disable linking device lib
ClosedPublic

Authored by yaxunl on Oct 1 2019, 2:18 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

yaxunl created this revision.Oct 1 2019, 2:18 PM
yaxunl added a reviewer: tra.
ashi1 accepted this revision.Oct 1 2019, 2:26 PM
This revision is now accepted and ready to land.Oct 1 2019, 2:26 PM
tra added a comment.Oct 1 2019, 3:42 PM

The functionality looks generic enough. Should it be just flink_builtin_bitcode?

yaxunl updated this revision to Diff 222746.Oct 1 2019, 8:00 PM
yaxunl retitled this revision from [HIP] Add option -fno-hip-link-builtin-bitcode to disable linking device lib to [HIP] Add option -fno-link-builtin-bitcode to disable linking device lib.

change the option name

ashi1 added a comment.Oct 2 2019, 6:33 AM

LGTM thank you

include/clang/Driver/Options.td
606 ↗(On Diff #222746)

Since this is a more generic approach, we won't need to specify HIP ?

yaxunl marked an inline comment as done.Oct 2 2019, 6:51 AM
yaxunl added inline comments.
include/clang/Driver/Options.td
606 ↗(On Diff #222746)

this patch only implemented this option for HIP. If it is used for other languages, this help text should be updated.

tra added inline comments.Oct 2 2019, 10:17 AM
include/clang/Driver/Options.td
606 ↗(On Diff #222746)

Hmm. Cuda currently uses -nocudalib for essentially the same purpose (Sort of like -nostdlib, but for CUDA). Perhaps we should consolidate all these into -nogpulib and alias -nocudalib to it.

hliao added a subscriber: hliao.Oct 3 2019, 6:56 AM
hliao added inline comments.
include/clang/Driver/Options.td
606 ↗(On Diff #222746)

how about other relevant options, such as replacing cuda-device-only with gpu-device-only or hip-device-only to avoid confusing with CUDA.

yaxunl updated this revision to Diff 223024.Oct 3 2019, 8:06 AM

use -nogpuarch

yaxunl retitled this revision from [HIP] Add option -fno-link-builtin-bitcode to disable linking device lib to [HIP] Use option -nogpulib to disable linking device lib.Oct 3 2019, 8:07 AM
tra accepted this revision.Oct 3 2019, 9:26 AM
tra added inline comments.Oct 3 2019, 9:36 AM
include/clang/Driver/Options.td
606 ↗(On Diff #222746)

We seem to be doing exactly that, only incrementally. In general it does make sense to consolidate the flags where the functionality is common.
cuda-device-only, cuda_host_only, cuda_compile_host_device and cuda-gpu-arch could be generalized to gpu-<something>.

This should be a separate patch, though.

yaxunl marked an inline comment as done.Oct 3 2019, 9:39 AM
yaxunl added inline comments.
include/clang/Driver/Options.td
606 ↗(On Diff #222746)

agree

ashi1 accepted this revision.Oct 3 2019, 10:29 AM

LGTM - Thanks for generalizing

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptOct 3 2019, 11:58 AM