The new driver supports LTO for RDC-mode compilations. However, this was
not correctly handled for non-LTO compilations. HIP can handle this as
it is fed to lld which will perform the LTO itself. CUDA however would
require every work which is wholly useless in non-RDC mode so it should
report an error.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
should we test with -ccc-print-phases instead? It is not clear what actions are produced by driver.
Of the four run lines added, three use -ccc-print-phases. The last uses just -### because otherwise the error message would not be triggered as it would quit before trying to generate the Clang job.
Ah, realized you meant with phases. This is good enough for NVPTX as there is no explicit assembler phase. LTO makes no difference for AMDGPU as it already outputs bitcode.
It is not clear whether the driver respects -foffload-lto when -fno-gpu-rdc is specified. -ccc-print-phases shows whether the driver generates bc or object. -ccc-print-bindings does not because it does not show the file types.
There's an existing test in the OpenMP toolchain that uses phases I believe, using bindings was just easier for making the tests. If you think it's worth changing then I'll do it, but it was just easier this way.
clang/test/Driver/hip-phases.hip | ||
---|---|---|
553 | do we need a test for -foffload-lto -fno-gpu-rdc ? |
clang/test/Driver/hip-phases.hip | ||
---|---|---|
553 | The test above still uses the bindings, all the matters for that one is that the jobs generated are legal and still the same. |
do we need a test for -foffload-lto -fno-gpu-rdc ?