Hi, On Wed, Jul 01 2020, Gary Oblock via Gcc wrote: > Thank you Richard. > > I feel a bit dumb because I'm well aware of the GCC philosophy to have > any new code produced update the state. Of course I didn't know the > commands to do this for the call graph (which I really appreciate you giving.) > > However, the real reason I'm sending a reply is this. Are there any surprising > cases in IPA where GCC violates its philosophy and actually regenerates the > information?
if by "the information" you specifically mean call graph edges then no. (Regular) IPA optimizations are designed to also work when doing link time optimization (LTO) which means that unless they specifically load the (gimple) bodies of some selected functions, the bodies are not available to them. They only operate on the call graph and information they collected when generating summaries. Because gimple body is not available, call graph edges cannot be regenerated from it. In fact, when a call is redirected to a different/specialized function, at IPA time it is only recored in the call graph by redirecting the corresponding edge and the call statement is modified only at the end of IPA phase (in LTRANS in LTO-speak). This is necessary even when not using LTO because until specialized nodes get their own body, they share it with the node from which they were cloned. That means that several call graph edges, which do not share caller and may not even share the callee, refer to the same gimple statement - so the decl in the statement is actually meaningless and the edge encodes the important information. Martin