aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/ProcessImplicitDefs.cpp
diff options
context:
space:
mode:
authorShilei Tian <i@tianshilei.me>2022-04-22 18:07:20 -0400
committerShilei Tian <i@tianshilei.me>2022-04-22 18:07:28 -0400
commit20a9fb953e46b1d97aaee7b182b0f3d48f340bd1 (patch)
tree4344eb86404ce1039b27a5cca56f39cc53dae331 /llvm/lib/CodeGen/ProcessImplicitDefs.cpp
parent1cddcfdc3c683b393df1a5c9063252eb60e52818 (diff)
downloadllvm-20a9fb953e46b1d97aaee7b182b0f3d48f340bd1.zip
llvm-20a9fb953e46b1d97aaee7b182b0f3d48f340bd1.tar.gz
llvm-20a9fb953e46b1d97aaee7b182b0f3d48f340bd1.tar.bz2
[Clang][OpenMP] Fix the issue that temp cubin files are not removed after compilation when using new OpenMP driver
The root cause of this is, in `NVPTX::Assembler::ConstructJob`, the output file name might not match the `Output`'s file name passed into the function because `CudaToolChain::getInputFilename` is a specialized version. That means the real output file is not added to the temp files list, which will be all removed in the d'tor of `Compilation`. In order to "fix" it, in the function `NVPTX::OpenMPLinker::ConstructJob`, before calling `clang-nvlink-wrapper`, the function calls `getToolChain().getInputFilename(II)` to get the right output file name for each input, and add it to temp file, and then they can be removed w/o any issue. However, this whole logic doesn't work when using the new OpenMP driver because `NVPTX::OpenMPLinker::ConstructJob` is not called at all, which causing the issue that the cubin file generated in each single unit compilation is out of track. In this patch, we add the real output file into temp files if its name doesn't match `Output`. We add it when the file is an output instead of doing it when it is an input, like what we did in `NVPTX::OpenMPLinker::ConstructJob`, which makes more sense. Reviewed By: jhuber6 Differential Revision: https://reviews.llvm.org/D124253
Diffstat (limited to 'llvm/lib/CodeGen/ProcessImplicitDefs.cpp')
0 files changed, 0 insertions, 0 deletions