On Wed, 18 Jan 2017, Jakub Jelinek wrote: > > 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). > > One of the problems with that is that it means that you can't easily turn > addressable private variables into non-addressable ones once you force them > into such struct that can't be easily SRA split. > In contrast, if you can get the variable flags/attributes work, if they > become non-addressable (which is especially important to get rid of C++ > abstraction penalties), you simply don't add them into the specially > allocated block.
I agree; I'd like to implement the approach with per-variable attributes once it's clear how it ought to work (right now I'm not sure if placing CLOBBERs on both entry and exit would be enough; if I understood correctly, Richard is saying they might be moved, unless the middle-end is changed to prevent it). Do you want me to pursue that during the early days of stage 4? I think it would be nice to have the issue addressed in some way for the upcoming release. Thanks. Alexander