This is the mail archive of the gcc-regression@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Does this mean that cgraph_expand_function actually calls the back end to compile the rest of this function? It looks like it just expands the callees into the callers, fixes up the call graph, and then returns.Jan Hubicka wrote:
it sounds like I want to swap lines 2815 and 2817 of cgraphunit.c and see if it works.However, when is the inlining actually done? If by the time I scan the instructions, foo is already in bar, then there is no reason to have data associated with the cloned copy of foo. If the inlined copy of bar
It is done at the very end of compilation when the function is being compiled. The idea is that the global passes of IPA optimizers should work without actually touching function bodies, so we can do IPA where the bodies are stored on disk and loaded on demand in the future.
So what you see is matching the actual control flow of program.
is what I am scanning and if I can figure out this is a clone, we can do better. Also, I figure out the set of functions to scan by just looking
Clones are in the linked list starting on the cgraph_node (node->decl) and linked via node->next_clone pointer (this is however going to change soon once we support real cloning for intraprocedural constant propagation Rayza is working on).
at the list of cgraph nodes. If I can see the function after inlining, there is no reason to scan these either.
Also, do you ever fix up the cgraph? I.e. if you inline foo into bar, bar does not really call foo any more, it calls the functions that foo called.
Yes, once the inlining is done, the clones are elliminated. This is usefull for memory management to, so I can release the function body once all it's clones are dead.
Honza
======= cgraph_characterize_statics ();
cgraph_expand_all_functions ();
=======
This will not help you, since once functions are expanded and compiled,
there is nothing to optimize so the analysis will be faster but they
will do nothing.
This is wrong, the cloning can (in the grand scheme of things) make my analysis more precise. See below.One possibility might be to make aliasing (cgraph_characterize_statics?) to happen before cgraph_decide_inlining so you have fewer nodes to work on in the case the cloning is not going to make your analysis more precise.
I disagree. The best case scenario for the analysis that I am trying to perform is to haveThis can also make sense in the case we want to make use of the new information for intraprocedural IPA and function cloning that is done before inlining (but I know too little your and Razya's code to be sure that this can help)
You still need to manage way how to clone the datastrcture associated with nodes within cgraph_clone_node. In the case you just have couple of bitmaps that are read only after the analysis representing properties of function, I guess you can just keep them shared.
Honza
kenny
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |