[PATCH] D42922: [CUDA] Register relocatable GPU binaries

2018-04-20 Thread Jonas Hahnfeld via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC330425: [CUDA] Register relocatable GPU binaries (authored by Hahnfeld, committed by ). Repository: rC Clang https://reviews.llvm.org/D42922 Files: lib/CodeGen/CGCUDANV.cpp test/CodeGenCUDA/device

[PATCH] D42922: [CUDA] Register relocatable GPU binaries

2018-04-19 Thread Jonas Hahnfeld via Phabricator via cfe-commits
Hahnfeld updated this revision to Diff 143145. Hahnfeld marked an inline comment as done. Hahnfeld added a comment. Move module ID to corresponding `else` branch. https://reviews.llvm.org/D42922 Files: lib/CodeGen/CGCUDANV.cpp test/CodeGenCUDA/device-stub.cu Index: test/CodeGenCUDA/device-

[PATCH] D42922: [CUDA] Register relocatable GPU binaries

2018-04-19 Thread Artem Belevich via Phabricator via cfe-commits
tra added inline comments. Comment at: lib/CodeGen/CGCUDANV.cpp:364-377 + llvm::Constant *NVModuleIDConstant; + SmallString<64> NVModuleID; + if (RelocatableDeviceCode) { +// Generate a unique module ID. +llvm::raw_svector_ostream OS(NVModuleID); +OS << "__nv_" <<

[PATCH] D42922: [CUDA] Register relocatable GPU binaries

2018-04-19 Thread Jonas Hahnfeld via Phabricator via cfe-commits
Hahnfeld added inline comments. Comment at: lib/CodeGen/CGCUDANV.cpp:283-285 + llvm::FunctionType *RegisterGlobalsFnTy; + llvm::FunctionType *RegisterLinkedBinaryFnTy; + llvm::Function *DummyCallback; tra wrote: > Instead of tracking these through the conditio

[PATCH] D42922: [CUDA] Register relocatable GPU binaries

2018-04-19 Thread Jonas Hahnfeld via Phabricator via cfe-commits
Hahnfeld updated this revision to Diff 143136. Hahnfeld marked 2 inline comments as done. Hahnfeld added a comment. Move `FunctionType`s to methods and change test prefixes. https://reviews.llvm.org/D42922 Files: lib/CodeGen/CGCUDANV.cpp test/CodeGenCUDA/device-stub.cu Index: test/CodeGenC

[PATCH] D42922: [CUDA] Register relocatable GPU binaries

2018-04-19 Thread Artem Belevich via Phabricator via cfe-commits
tra added inline comments. Comment at: lib/CodeGen/CGCUDANV.cpp:283-285 + llvm::FunctionType *RegisterGlobalsFnTy; + llvm::FunctionType *RegisterLinkedBinaryFnTy; + llvm::Function *DummyCallback; Instead of tracking these through the conditionals of pretty lon

[PATCH] D42922: [CUDA] Register relocatable GPU binaries

2018-04-18 Thread Jonas Hahnfeld via Phabricator via cfe-commits
Hahnfeld added a comment. Ping https://reviews.llvm.org/D42922 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D42922: [CUDA] Register relocatable GPU binaries

2018-04-09 Thread Jonas Hahnfeld via Phabricator via cfe-commits
Hahnfeld updated this revision to Diff 141698. Hahnfeld added a comment. Correct test check prefix. https://reviews.llvm.org/D42922 Files: lib/CodeGen/CGCUDANV.cpp test/CodeGenCUDA/device-stub.cu Index: test/CodeGenCUDA/device-stub.cu ===

[PATCH] D42922: [CUDA] Register relocatable GPU binaries

2018-04-09 Thread Jonas Hahnfeld via Phabricator via cfe-commits
Hahnfeld updated this revision to Diff 141685. Hahnfeld added a comment. Sorry for the long delay. This update rebases the patch against current trunk and adapts the regression test. https://reviews.llvm.org/D42922 Files: lib/CodeGen/CGCUDANV.cpp test/CodeGenCUDA/device-stub.cu Index: tes

[PATCH] D42922: [CUDA] Register relocatable GPU binaries

2018-02-16 Thread Jonas Hahnfeld via Phabricator via cfe-commits
Hahnfeld marked an inline comment as done. Hahnfeld added inline comments. Comment at: lib/CodeGen/CGCUDANV.cpp:330-331 // the GPU side. for (const std::string &GpuBinaryFileName : CGM.getCodeGenOpts().CudaGpuBinaryFileNames) { llvm::ErrorOr> GpuBinaryOrErr = -

[PATCH] D42922: [CUDA] Register relocatable GPU binaries

2018-02-16 Thread Artem Belevich via Phabricator via cfe-commits
tra added inline comments. Comment at: lib/CodeGen/CGCUDANV.cpp:330-331 // the GPU side. for (const std::string &GpuBinaryFileName : CGM.getCodeGenOpts().CudaGpuBinaryFileNames) { llvm::ErrorOr> GpuBinaryOrErr = Hahnfeld wrote: > tra wrote: > >

[PATCH] D42922: [CUDA] Register relocatable GPU binaries

2018-02-16 Thread Jonas Hahnfeld via Phabricator via cfe-commits
Hahnfeld added inline comments. Comment at: lib/CodeGen/CGCUDANV.cpp:330-331 // the GPU side. for (const std::string &GpuBinaryFileName : CGM.getCodeGenOpts().CudaGpuBinaryFileNames) { llvm::ErrorOr> GpuBinaryOrErr = tra wrote: > Hahnfeld wrote

[PATCH] D42922: [CUDA] Register relocatable GPU binaries

2018-02-16 Thread Artem Belevich via Phabricator via cfe-commits
tra added inline comments. Comment at: lib/CodeGen/CGCUDANV.cpp:330-331 // the GPU side. for (const std::string &GpuBinaryFileName : CGM.getCodeGenOpts().CudaGpuBinaryFileNames) { llvm::ErrorOr> GpuBinaryOrErr = Hahnfeld wrote: > Can we actuall

[PATCH] D42922: [CUDA] Register relocatable GPU binaries

2018-02-12 Thread Jonas Hahnfeld via Phabricator via cfe-commits
Hahnfeld planned changes to this revision. Hahnfeld added a comment. Still no regression tests. I did some functional tests though (https://reviews.llvm.org/F5822023): With this patch Clang can generate valid object files with relocatable device code. For linking I still defer to `nvcc` and I'm

[PATCH] D42922: [CUDA] Register relocatable GPU binaries

2018-02-12 Thread Jonas Hahnfeld via Phabricator via cfe-commits
Hahnfeld updated this revision to Diff 133831. Hahnfeld added a comment. Rebase and fix `Debug` build. https://reviews.llvm.org/D42922 Files: lib/CodeGen/CGCUDANV.cpp Index: lib/CodeGen/CGCUDANV.cpp === --- lib/CodeGen/CGCUDANV.

[PATCH] D42922: [CUDA] Register relocatable GPU binaries

2018-02-05 Thread Jonas Hahnfeld via Phabricator via cfe-commits
Hahnfeld planned changes to this revision. Hahnfeld added a comment. I didn't write tests for this yet, but I wanted to get some early feedback on this and show what I have in mind. Comment at: lib/CodeGen/CGCUDANV.cpp:330-331 // the GPU side. for (const std::string &Gpu

[PATCH] D42922: [CUDA] Register relocatable GPU binaries

2018-02-05 Thread Jonas Hahnfeld via Phabricator via cfe-commits
Hahnfeld created this revision. Hahnfeld added reviewers: jlebar, tra, hfinkel. Herald added a subscriber: cfe-commits. nvcc generates a unique registration function for each object file that contains relocatable device code. Unique names are achieved with a module id that is also reflected in the