This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Don't build the offloading driver without a source input
ClosedPublic

Authored by jhuber6 on May 16 2022, 10:19 AM.

Details

Summary

The Clang driver additional stages to build a complete offloading
program for applications using CUDA or OpenMP offloading. This normally
requires either a source file input or a valid object file to be
handled. This would cause problems when trying to compile an assembly or
LLVM IR file through clang with flags that would enable offloading. This
patch simply adds a check to prevent the offloading toolchain from being
used if we don't have a valid source file.

Diff Detail

Event Timeline

jhuber6 created this revision.May 16 2022, 10:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 16 2022, 10:19 AM
jhuber6 requested review of this revision.May 16 2022, 10:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 16 2022, 10:19 AM
This revision is now accepted and ready to land.May 16 2022, 10:20 AM
This revision was landed with ongoing or failed builds.May 16 2022, 3:19 PM
This revision was automatically updated to reflect the committed changes.
yaxunl added a comment.EditedMay 17 2022, 8:58 AM

HIP toolchain allows clang driver to compile bundled bitcode or assembly for mixed host/device compilation or device-only multi-GPU compilation.

e.g.

clang --hip-link -fgpu-rdc --offload-arch=gfx906 --offload-arch=gfx908 a.bc b.s

Can you add a test to make sure this does not break HIP toolchain? Thanks.

HIP toolchain allows clang driver to compile bundled bitcode or assembly for mixed host/device compilation or device-only multi-GPU compilation.

e.g.

clang --offload-arch=gfx906 --offload-arch=gfx908 a.bc b.s

Can you add a test to make sure this does not break HIP toolchain? Thanks.

This only changes the new driver, which doesn't support HIP right now anyway. This should be captured by some existing tests but I could try to dig them up

HIP toolchain allows clang driver to compile bundled bitcode or assembly for mixed host/device compilation or device-only multi-GPU compilation.

e.g.

clang --offload-arch=gfx906 --offload-arch=gfx908 a.bc b.s

Can you add a test to make sure this does not break HIP toolchain? Thanks.

This only changes the new driver, which doesn't support HIP right now anyway. This should be captured by some existing tests but I could try to dig them up

If it is only for the new driver that is fine. Thanks.