On Wed, 18 Jan 2017, Jakub Jelinek wrote: > > It is, but I think my approach is compatible with inlining too (and has a > > more > > localized impact on the compiler). > > But your 2/5 patch disables inlining into the SIMT regions. Or do you mean > the approach with some new IFN for the pointers to privatized vars?
I think it can be done either in the current framework, or in that more involved approach with a new IFN. > How would that work with the inliner (all copies of addressable vars/params > from functions inlined into the SIMT region would need to gain something > similar)? Inlining needs to do just like omp-low; if we take the current framework, it would need to collect addressable locals into one struct, replace references to those locals by field references in the inlined body. Then it needs to appropriately increase allocation size/alignment in SIMT_ENTER() call arguments. And finally it would need to initialize the pointer to structure, either immediately after SIMT_ENTER, or in a more fine-grained manner by a __builtin_alloca_with_align-like function (__b_a_w_a is not usable for that itself, because currently for known sizes gcc can make it a local variable). Alexander