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.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/CodeGen/CGCUDABuiltin.cpp | ||
---|---|---|
109 ↗ | (On Diff #46206) | Not quite, you'll want to use AllocaInsertPt for this or even CreateTempAlloca. |
lib/CodeGen/CGCUDABuiltin.cpp | ||
---|---|---|
109 ↗ | (On Diff #46206) | Aha. Used AllocaInsertPt because it doesn't seem that there's an overload of CreateTempAlloca that takes an explicit size. |
lib/CodeGen/CGCUDABuiltin.cpp | ||
---|---|---|
105–108 ↗ | (On Diff #46293) | The fact that allocas for local variables should always go in the entry block is pretty widespread cultural knowledge in LLVM and clang. Most readers aren't going to need this comment, unless you expect that people working on CUDA won't have that background. Plus, if you use CreateTempAlloca, there won't be any question about which insert point should be used. |
109 ↗ | (On Diff #46293) | You can still use CreateTempAlloca by making an [i8 x N] LLVM type. You'll have to use CreateStructGEP below for forming GEPs. Overall I think that'd be nicer, since you don't need to worry about insertion at all. |
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 code is more likely to match what it wants.
lib/CodeGen/CGCUDABuiltin.cpp | ||
---|---|---|
105–108 ↗ | (On Diff #46293) | OK, yeah, I also don't like comments that explain something that everyone other than the author knows. Thanks. |
One inline nit then LGTM.
-eric
lib/CodeGen/CGCUDABuiltin.cpp | ||
---|---|---|
87 ↗ | (On Diff #46314) |
|
lib/CodeGen/CGCUDABuiltin.cpp | ||
---|---|---|
87 ↗ | (On Diff #46314) | Argh, I really need to set up a linter. I'm still doing readability reviews, and I cannot brain two styles. Sorry to keep wasting your time with silly stuff like this. |
lib/CodeGen/CGCUDABuiltin.cpp | ||
---|---|---|
87 ↗ | (On Diff #46314) | You could just use clang-format on everything :) |
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 tool.
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.