This was previously done in some places, but for example not for
bundling so that single object compilation with -c failed. In
addition cubin was used for all file types during unbundling which
is incorrect for assembly files that are passed to ptxas.
Tighten up the tests so that we can't regress in that area.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
A different approach would be to completely replace the type in Driver::ConstructPhaseAction but
- this was previously considered a too radical change,
- we currently don't have the necessary information (ToolChain, OffloadKind) to take that decision,
- this might break in subtle places that compare the type with TY_Object.
lib/Driver/ToolChains/Cuda.cpp | ||
---|---|---|
431 ↗ | (On Diff #123588) | Considering that the function may also return an object file can you add an assert here that getInputFileName(II) returns a cubin in this case? |
461 ↗ | (On Diff #123588) | Can you put this info in a comment just before the if statement? |
test/Driver/openmp-offload-gpu.c | ||
51 ↗ | (On Diff #123588) | This is kind of optional but since the name of the tool contains the word "bundler" and you are performing an unbundling operation, could you also check that the -unbundle flag is passed? |
lib/Driver/ToolChains/Clang.cpp | ||
---|---|---|
5341–5344 ↗ | (On Diff #123588) | Can we ever have more than one dependence? If not, perhaps add an assert. |
lib/Driver/ToolChains/Cuda.cpp | ||
461 ↗ | (On Diff #123588) | I usually find conditions expressed in positive terms are much easier to understand at a glance. |
lib/Driver/ToolChains/Cuda.h | ||
144 ↗ | (On Diff #123588) | virtual is redundant here. |
Address reviewers' comments.
lib/Driver/ToolChains/Clang.cpp | ||
---|---|---|
5341–5344 ↗ | (On Diff #123588) | No, there should only be one for inputs to the bundler. I've added the assert and all tests pass. |
lib/Driver/ToolChains/Cuda.h | ||
144 ↗ | (On Diff #123588) | (I've also changed this for getAuxTriple above.) |
Looks OK to me. I'll defer to gtbercea@ for the final stamp.
test/Driver/openmp-offload-gpu.c | ||
---|---|---|
34 ↗ | (On Diff #123649) | Please split long RUN lines. here and below. |