[PATCH] D49083: [HIP] Register/unregister device fat binary only once

2018-07-20 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC337631: [HIP] Register/unregister device fat binary only once (authored by yaxunl, committed by ). Repository: rC Clang https://reviews.llvm.org/D49083 Files: lib/CodeGen/CGCUDANV.cpp test/CodeGen

[PATCH] D49083: [HIP] Register/unregister device fat binary only once

2018-07-19 Thread John McCall via Phabricator via cfe-commits
rjmccall accepted this revision. rjmccall added a comment. This revision is now accepted and ready to land. Alright, thanks, LGTM. https://reviews.llvm.org/D49083 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/

[PATCH] D49083: [HIP] Register/unregister device fat binary only once

2018-07-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 156424. yaxunl marked an inline comment as done. yaxunl added a comment. Revised by John's comments. https://reviews.llvm.org/D49083 Files: lib/CodeGen/CGCUDANV.cpp test/CodeGenCUDA/device-stub.cu Index: test/CodeGenCUDA/device-stub.cu =

[PATCH] D49083: [HIP] Register/unregister device fat binary only once

2018-07-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: lib/CodeGen/CGCUDANV.cpp:578 + DtorBuilder.CreateStore(Zero, GpuBinaryAddr); + DtorBuilder.CreateBr(ExitBlock); +DtorBuilder.SetInsertPoint(ExitBlock); rjmccall wrote

[PATCH] D49083: [HIP] Register/unregister device fat binary only once

2018-07-19 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: lib/CodeGen/CGCUDANV.cpp:466 + CtorBuilder.CreateStore(RegisterFatbinCall, GpuBinaryAddr); + CtorBuilder.CreateBr(ExitBlock); +CtorBuilder.SetInsertPoint(ExitBlock); I meant more putting all the code for I

[PATCH] D49083: [HIP] Register/unregister device fat binary only once

2018-07-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 156383. yaxunl marked 3 inline comments as done. yaxunl added a comment. Revised by John's comments. https://reviews.llvm.org/D49083 Files: lib/CodeGen/CGCUDANV.cpp test/CodeGenCUDA/device-stub.cu Index: test/CodeGenCUDA/device-stub.cu =

[PATCH] D49083: [HIP] Register/unregister device fat binary only once

2018-07-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 5 inline comments as done. yaxunl added inline comments. Comment at: lib/CodeGen/CGCUDANV.cpp:444 +auto HandleValue = +CtorBuilder.CreateAlignedLoad(GpuBinaryHandle, CGM.getPointerAlign()); +llvm::Constant *Zero = llvm::Constant::getNullValue(Handle

[PATCH] D49083: [HIP] Register/unregister device fat binary only once

2018-07-19 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: lib/CodeGen/CGCUDANV.cpp:444 +auto HandleValue = +CtorBuilder.CreateAlignedLoad(GpuBinaryHandle, CGM.getPointerAlign()); +llvm::Constant *Zero = llvm::Constant::getNullValue(HandleValue->getType()); yax

[PATCH] D49083: [HIP] Register/unregister device fat binary only once

2018-07-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: lib/CodeGen/CGCUDANV.cpp:444 +auto HandleValue = +CtorBuilder.CreateAlignedLoad(GpuBinaryHandle, CGM.getPointerAlign()); +llvm::Constant *Zero = llvm::Constant::getNullValue(Handle

[PATCH] D49083: [HIP] Register/unregister device fat binary only once

2018-07-18 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Thanks for the comment. Comment at: lib/CodeGen/CGCUDANV.cpp:444 +auto HandleValue = +CtorBuilder.CreateAlignedLoad(GpuBinaryHandle, CGM.getPointerAlign()); +llvm::Constant *Zero = llvm::Constant::getNullValue(HandleValue->getType());

[PATCH] D49083: [HIP] Register/unregister device fat binary only once

2018-07-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 156184. yaxunl marked 4 inline comments as done. yaxunl added a comment. Added comments about thread safety of ctor functions. https://reviews.llvm.org/D49083 Files: lib/CodeGen/CGCUDANV.cpp test/CodeGenCUDA/device-stub.cu Index: test/CodeGenCUDA/device

[PATCH] D49083: [HIP] Register/unregister device fat binary only once

2018-07-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: lib/CodeGen/CGCUDANV.cpp:444 +auto HandleValue = +CtorBuilder.CreateAlignedLoad(GpuBinaryHandle, CGM.getPointerAlign()); +llvm::Constant *Zero = llvm::Constant::getNullValue(HandleValue->getType()); rjmcc

[PATCH] D49083: [HIP] Register/unregister device fat binary only once

2018-07-18 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: lib/CodeGen/CGCUDANV.cpp:444 +auto HandleValue = +CtorBuilder.CreateAlignedLoad(GpuBinaryHandle, CGM.getPointerAlign()); +llvm::Constant *Zero = llvm::Constant::getNullValue(HandleValue->getType()); yax

[PATCH] D49083: [HIP] Register/unregister device fat binary only once

2018-07-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: lib/CodeGen/CGCUDANV.cpp:444 +auto HandleValue = +CtorBuilder.CreateAlignedLoad(GpuBinaryHandle, CGM.getPointerAlign()); +llvm::Constant *Zero = llvm::Constant::getNullValue(HandleValue->getType()); rjmcc

[PATCH] D49083: [HIP] Register/unregister device fat binary only once

2018-07-17 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: lib/CodeGen/CGCUDANV.cpp:444 +auto HandleValue = +CtorBuilder.CreateAlignedLoad(GpuBinaryHandle, CGM.getPointerAlign()); +llvm::Constant *Zero = llvm::Constant::getNullValue(HandleValue->getType()); Do

[PATCH] D49083: [HIP] Register/unregister device fat binary only once

2018-07-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D49083#1157586, @yaxunl wrote: > In https://reviews.llvm.org/D49083#1157568, @tra wrote: > > > > HIP generates one fat binary for all devices after linking. However, for > > > each compilation > > > unit a ctor function is emitted which regist

[PATCH] D49083: [HIP] Register/unregister device fat binary only once

2018-07-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 154894. yaxunl marked an inline comment as done. yaxunl added a comment. clean up function prefix. https://reviews.llvm.org/D49083 Files: lib/CodeGen/CGCUDANV.cpp test/CodeGenCUDA/device-stub.cu Index: test/CodeGenCUDA/device-stub.cu ===

[PATCH] D49083: [HIP] Register/unregister device fat binary only once

2018-07-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D49083#1157568, @tra wrote: > > HIP generates one fat binary for all devices after linking. However, for > > each compilation > > unit a ctor function is emitted which register the same fat binary. > > Measures need to be taken to make sure

[PATCH] D49083: [HIP] Register/unregister device fat binary only once

2018-07-10 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. > HIP generates one fat binary for all devices after linking. However, for each > compilation > unit a ctor function is emitted which register the same fat binary. > Measures need to be taken to make sure the fat binary is only registered > once. Are you saying that for

[PATCH] D49083: [HIP] Register/unregister device fat binary only once

2018-07-09 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, rjmccall. HIP generates one fat binary for all devices after linking. However, for each compilation unit a ctor function is emitted which register the same fat binary. Measures need to be taken to make sure the fat binary is only registe