[PATCH] D153667: [HIP]: Add gpu-link-output to control link job creation
Joseph Huber via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 26 16:09:41 PDT 2023
jhuber6 added a comment.
In D153667#4450705 <https://reviews.llvm.org/D153667#4450705>, @jrbyrnes wrote:
> In D153667#4450517 <https://reviews.llvm.org/D153667#4450517>, @jhuber6 wrote:
>
>> What's the difference here between this and the existing `--hip-link`?
>
> Hi @jhuber6
>
> The commit is poorly named, the main purpose is to introduce `-no-gpu-link-output.`
>
> We want a way to produce relocatable from source. In terms of the Driver, this means building actions and jobs for phases up to `phases::Assemble`. `-no- gpu-link-output` does this by overriding BuildActions to stop after `phases::Assemble` (similar to `-no-gpu-bundle-output`). `-gpu-link-output` is NFCI. COMGR would be the client of this, and it would be up to COMGR to handle linking of the relocatable.
>
> AFAICT, `-hip-link` allows for linking of offload-bundles, so it is conceptually different. We can get (somewhat) close to what we with `-emit-llvm -hip-link`, but that is probably more due to `-emit-llvm`. `-hip-link` by itself produces linker actions / jobs which what we are trying to avoid here.
So, you run the backend and obtain a relocatable ELF, but do not link it via `lld`? If I'm understanding this correctly, that would be the difference between `-flto` and `-fno-lto`, or `-foffload-lto` and `-fno-offload-lto`, AMDGPU always having `-flto` on currently. Also I recall AMDGPU / HIP completely disabling the backend step at some point, so it only emits LLVM-IR.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D153667/new/
https://reviews.llvm.org/D153667
More information about the cfe-commits
mailing list