On Mon, 9 May 2022, Jan Hubicka wrote: > > On second thought, it might be better to keep the assert, and place the loop > > under 'if (optimize)'? > > The problem is that at IPA level it does not make sense to check > optimize flag as it is function specific. (shlib is OK to check it > anywhere since it is global.) > > So I think we really want to run the code only at the WPA time > (symtab_state>=IPA_SSA) and we want to see what is optimization flag of > those function referring the variable since that is what decided codegen > we will produce.
I'm not sure about the latter. Are you suggesting we give up on upgrading general-dynamic to local-dynamic if in a mixed-O scenario there is at least one -O0 function referring to the variable? Why? That function will end up even more deoptimized if we do that! Alexander