On 9/14/19 8:39 AM, Martin Liška wrote: On 9/13/19 3:01 PM, Gary Oblock wrote:
So, back to my questions, any ideas about how to get initialization information? This is going to be a very powerful optimization for code with structures of arrays and I just need a little help getting around a few obstacles in my path. Sure. So I would point you to the IPA ICF pass, which makes merging of variables in WPA phase of LTO. Let's take a look at: ipa-icf.c:1839 (sem_variable::equals) where we do: if (DECL_INITIAL (decl) == error_mark_node && in_lto_p) dyn_cast <varpool_node *>(node)->get_constructor (); That's the way how load DECL_INITIAL of variables. Does it help you? Martin So Martin, let me get this straight, all of the initialization information can be fetched here? I ask this because I was under the impression that some of it was deleted and could not be recovered. The worst case scenario for my optimization (making it illegal) is if the user specified an initialization and the initialization disappeared without leaving a trace in the IR that it ever existed. Many thanks, Gary