-
Notifications
You must be signed in to change notification settings - Fork 788
[Driver] Use clang-offload-deps tool for generating device dependencies #2935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Driver] Use clang-offload-deps tool for generating device dependencies #2935
Conversation
f370ae6
to
371034f
Compare
This patch changes driver to use clang-offload-deps tool for generating dependence objects for SYCL and OpenMP programs when static fat libraries are used. Driver adds an additional link step on the host side to create host image which serves as an input for the clang-offload-deps tool. Dependence bitcode files produced by the tool are then compiled to objects where necessary and added to the device linker inputs. Signed-off-by: Sergey Dmitriev <[email protected]>
371034f
to
b6374c7
Compare
Use @llvm.used global variable for representing a reference for 'sycl' offloading kind. Signed-off-by: Sergey Dmitriev <[email protected]>
…bals Signed-off-by: Sergey Dmitriev <[email protected]>
804616c
to
ed4d6ec
Compare
clang/lib/Driver/Driver.cpp
Outdated
@@ -4742,6 +4774,28 @@ class OffloadingActionBuilder final { | |||
return false; | |||
} | |||
|
|||
void addDeviceDependencies(ActionList &LinkerInputs) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name addDeviceDependencies
threw me for a loop as it is similar to the existing addDeviceDepences
. is there a better name we can use here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does addDeviceLinkDependenciesFromHost
look better?
Signed-off-by: Sergey Dmitriev <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may have missed some design nuances, but the overall structure LGTM.
Signed-off-by: Sergey Dmitriev <[email protected]>
e8dd5a8
Is it possible for somebody else to approve this patch while @bader is on vacation? |
For in-tree builds with shared libraries, setting the rpath not only works, but is required. Fixes #2906 Original commit: KhronosGroup/SPIRV-LLVM-Translator@7c0db925422d1f5
This patch changes driver to use clang-offload-deps tool for generating
dependence objects for SYCL and OpenMP programs when static fat libraries
are used. Driver adds an additional link step on the host side to create
host image which serves as an input for the clang-offload-deps tool.
Dependence bitcode files produced by the tool are then compiled to
objects where necessary and added to the device linker inputs.
Signed-off-by: Sergey Dmitriev [email protected]