Re: [PATCH] D16664: [CUDA] Generate CUDA's printf alloca in its function's entry block.

2016-01-28 Thread Justin Lebar via cfe-commits
jlebar marked an inline comment as done. Comment at: lib/CodeGen/CGCUDABuiltin.cpp:109 @@ -106,1 +108,3 @@ +// stacksave/stackrestore intrinsics, which cause ptxas to choke. +auto *Alloca = new llvm::AllocaInst( llvm::Type::getInt8Ty(Ctx),

Re: [PATCH] D16664: [CUDA] Generate CUDA's printf alloca in its function's entry block.

2016-01-28 Thread Justin Lebar via cfe-commits
jlebar marked an inline comment as done. jlebar added a comment. http://reviews.llvm.org/D16664 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D16664: [CUDA] Generate CUDA's printf alloca in its function's entry block.

2016-01-28 Thread Justin Lebar via cfe-commits
jlebar marked 3 inline comments as done. jlebar added a comment. Thank you for the reviews. Please have another look; I switched to using a struct proper. It's a lot cleaner! We're now assuming that the struct is aligned in the same way as vprintf wants, but if anything I expect this new

Re: [PATCH] D16664: [CUDA] Generate CUDA's printf alloca in its function's entry block.

2016-01-28 Thread Eric Christopher via cfe-commits
echristo accepted this revision. echristo added a reviewer: echristo. echristo added a comment. This revision is now accepted and ready to land. One inline nit then LGTM. -eric Comment at: lib/CodeGen/CGCUDABuiltin.cpp:87 @@ +86,3 @@ + // Construct and fill the args buffer

Re: [PATCH] D16664: [CUDA] Generate CUDA's printf alloca in its function's entry block.

2016-01-28 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 46314. jlebar marked an inline comment as done. jlebar added a comment. Use a struct rather than an i8 buffer. http://reviews.llvm.org/D16664 Files: lib/CodeGen/CGCUDABuiltin.cpp test/CodeGenCUDA/printf.cu Index: test/CodeGenCUDA/printf.cu

Re: [PATCH] D16664: [CUDA] Generate CUDA's printf alloca in its function's entry block.

2016-01-28 Thread Reid Kleckner via cfe-commits
rnk added inline comments. Comment at: lib/CodeGen/CGCUDABuiltin.cpp:105-108 @@ -104,2 +104,6 @@ } else { -BufferPtr = Builder.Insert(new llvm::AllocaInst( +// Insert our alloca not into the current BB, but into the function's entry +// block. This is important

Re: [PATCH] D16664: [CUDA] Generate CUDA's printf alloca in its function's entry block.

2016-01-28 Thread Eric Christopher via cfe-commits
echristo added inline comments. Comment at: lib/CodeGen/CGCUDABuiltin.cpp:109 @@ -106,1 +108,3 @@ +// stacksave/stackrestore intrinsics, which cause our nvvm backend to choke. +auto *Alloca = new llvm::AllocaInst( llvm::Type::getInt8Ty(Ctx),

Re: [PATCH] D16664: [CUDA] Generate CUDA's printf alloca in its function's entry block.

2016-01-28 Thread Justin Lebar via cfe-commits
Hm, well, https://llvm.org/svn/llvm-project/cfe/trunk/tools/clang-format/git-clang-format is close... Not sure if that triggers the bff clause, will consult my attorney. On Thu, Jan 28, 2016 at 4:09 PM, Justin Lebar wrote: > Do you have a script that will take as input a

Re: [PATCH] D16664: [CUDA] Generate CUDA's printf alloca in its function's entry block.

2016-01-28 Thread Justin Lebar via cfe-commits
jlebar marked an inline comment as done. Comment at: lib/CodeGen/CGCUDABuiltin.cpp:87 @@ +86,3 @@ + // Construct and fill the args buffer that we'll pass to vprintf. + llvm::Value* BufferPtr; + if (Args.size() <= 1) { echristo wrote: > * on the wrong side ;)

Re: [PATCH] D16664: [CUDA] Generate CUDA's printf alloca in its function's entry block.

2016-01-28 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. jlebar marked an inline comment as done. Closed by commit rL259122: [CUDA] Generate CUDA's printf alloca in its function's entry block. (authored by jlebar). Changed prior to commit:

Re: [PATCH] D16664: [CUDA] Generate CUDA's printf alloca in its function's entry block.

2016-01-28 Thread Justin Lebar via cfe-commits
Do you have a script that will take as input a commit range and git commit --amend clang-tidy fixes for lines modified in that range? Because if so, a) I would be your best friend forever, and b) It should be simple to convert that into a linter for arc to catch the case when I forget to run said

Re: [PATCH] D16664: [CUDA] Generate CUDA's printf alloca in its function's entry block.

2016-01-28 Thread Eric Christopher via cfe-commits
echristo added inline comments. Comment at: lib/CodeGen/CGCUDABuiltin.cpp:87 @@ +86,3 @@ + // Construct and fill the args buffer that we'll pass to vprintf. + llvm::Value* BufferPtr; + if (Args.size() <= 1) { jlebar wrote: > echristo wrote: > > * on the wrong

Re: [PATCH] D16664: [CUDA] Generate CUDA's printf alloca in its function's entry block.

2016-01-28 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 46293. jlebar added a comment. Address echristo's review comments. http://reviews.llvm.org/D16664 Files: lib/CodeGen/CGCUDABuiltin.cpp test/CodeGenCUDA/printf.cu Index: test/CodeGenCUDA/printf.cu

Re: [PATCH] D16664: [CUDA] Generate CUDA's printf alloca in its function's entry block.

2016-01-27 Thread Eric Christopher via cfe-commits
echristo added inline comments. Comment at: lib/CodeGen/CGCUDABuiltin.cpp:109 @@ -106,1 +108,3 @@ +// stacksave/stackrestore intrinsics, which cause ptxas to choke. +auto *Alloca = new llvm::AllocaInst( llvm::Type::getInt8Ty(Ctx), llvm::ConstantInt::get(Int32Ty,

[PATCH] D16664: [CUDA] Generate CUDA's printf alloca in its function's entry block.

2016-01-27 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: rnk. jlebar added subscribers: tra, echristo, jhen, cfe-commits. This is necessary to prevent llvm from generating stacksave intrinsics around this alloca. NVVM doesn't have a stack, and we don't handle said intrinsics. I'm not sure if