diff options
author | Joseph Huber <jhuber6@vols.utk.edu> | 2022-05-25 13:22:26 -0400 |
---|---|---|
committer | Joseph Huber <jhuber6@vols.utk.edu> | 2022-05-25 16:30:53 -0400 |
commit | b7c8c4d8cf07d2e9e8cd157bccc8bd9e7c76415a (patch) | |
tree | b4591ccffb1898b185e5cf09d3273d3032d508a1 /llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp | |
parent | ab249fd87d30b152c4a2308c1fd7dff8b662adb9 (diff) | |
download | llvm-b7c8c4d8cf07d2e9e8cd157bccc8bd9e7c76415a.zip llvm-b7c8c4d8cf07d2e9e8cd157bccc8bd9e7c76415a.tar.gz llvm-b7c8c4d8cf07d2e9e8cd157bccc8bd9e7c76415a.tar.bz2 |
[Clang] Introduce `--offload-link` option to perform offload device linking
The new driver uses an augmented linker wrapper to perform the device
linking phase, but to the user looks like a regular linker invocation.
Contrary to the old driver, the new driver contains all the information
necessary to produce a linked device image in the host object itself.
Currently, we infer the usage of the device linker by the user
specifying an offloading toolchain, e.g. (--offload-arch=...) or
(-fopenmp-targets=...), but this shouldn't be strictly necessary.
This patch introduces a new option `--offload-link` to tell
the driver to use the offloading linker instead. So a compilation flow
can now look like this,
```
clang foo.cu --offload-new-driver -fgpu-rdc --offload-arch=sm_70 -c
clang foo.o --offload-link -lcudart
```
I was considering if this could be merged into the `-fuse-ld` option,
but because the device linker wraps over the users linker it would
conflict with that. In the future it's possible to merge this into `lld`
completely or `gold` via a plugin and we would use this option to
enable the device linking feature. Let me know what you think for this.
Reviewed By: tra
Differential Revision: https://reviews.llvm.org/D126398
Diffstat (limited to 'llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp')
0 files changed, 0 insertions, 0 deletions