[PATCH] D118084: [CUDA, NVPTX] Pass byval aggregates directly

2022-01-26 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. In D118084#3272154 , @lebedev.ri wrote: > My last idea was about allowing splitting > > struct { > int a; > int b[2]; > } a; > > into > > // not in a struct anymore! > int a; > int b[2] This looks like it's a somew

[PATCH] D118084: [CUDA, NVPTX] Pass byval aggregates directly

2022-01-26 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In D118084#3271110 , @tra wrote: > In D118084#3271073 , @jdoerfert > wrote: > >> @lebedev.ri wanted to teach SROA how to deal with dynamic indices before, >> IIRC. It seems to be gene

[PATCH] D118084: [CUDA, NVPTX] Pass byval aggregates directly

2022-01-25 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. In D118084#3271073 , @jdoerfert wrote: > @lebedev.ri wanted to teach SROA how to deal with dynamic indices before, > IIRC. It seems to be generally useful. Interesting. I'd like to hear more. > This patch can wait till then? Yes.

[PATCH] D118084: [CUDA, NVPTX] Pass byval aggregates directly

2022-01-25 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a subscriber: lebedev.ri. jdoerfert added a comment. @lebedev.ri wanted to teach SROA how to deal with dynamic indices before, IIRC. It seems to be generally useful. This patch can wait till then? Comment at: clang/lib/CodeGen/TargetInfo.cpp:7193 EIT-

[PATCH] D118084: [CUDA, NVPTX] Pass byval aggregates directly

2022-01-25 Thread Artem Belevich via Phabricator via cfe-commits
tra planned changes to this revision. tra added a comment. Getting rid of byval helps getting rid of locals in quite a few places, but runs into a new problem. 😕 Looks like this change does have unexpected side-effects. When we need to dynamically index into a struct passed directly, there's no

[PATCH] D118084: [CUDA, NVPTX] Pass byval aggregates directly

2022-01-25 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment. The RFC discussion concluded this should be fine wrt. the interoperability use cases we want to support. Code change looks good but I have one question. Comment at: clang/lib/CodeGen/TargetInfo.cpp:7183 } -return getNaturalAlignIndirect(Ty,

[PATCH] D118084: [CUDA, NVPTX] Pass byval aggregates directly

2022-01-24 Thread Artem Belevich via Phabricator via cfe-commits
tra created this revision. tra added reviewers: jdoerfert, yaxunl. Herald added subscribers: asavonic, bixia. tra requested review of this revision. Herald added a project: clang. Changes the NVPTX ABI to pass aggregates directly. Only clang-generated IR is affected. The change does not affect AB