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