Is there a way (attribute, pragma, ?) to disable SROA for some aggregates?
Background: In some test code for may target an attribute for overlays was attached to an array (aggregate). The compiler splits the array into its elements and each element inherits the attribute. Finally the assembler places all elements at the same start address in memory because they are in the same overlay region.
My quick and dirty approach was to introduce an attribute nosroa that is attached to a global variable when an overlay attribute is attached. The functions GlobalOpt.cpp::SRAGlobal exits early if the global variable has this attribute attached.
Ah, now I understand.
The code is OpenCL-ish. The local array has the qualifier __local, which doesn’t change the visibility of the array (and it’s local linkage) but transforms it to a global (and static) variable.
Hm, changing the linkage type might be dangerous. I have to think about another solution.
Thanks.