Re: Question about function body and function specialization

2020-07-16 Thread Erick Ochoa
On 16/07/2020 12:11, Martin Jambor wrote: Hi, On Wed, Jul 15 2020, Erick Ochoa wrote: On 15.07.20 05:03, Martin Jambor wrote: [...] At IPA time, the best way is always to look at the call graph edges, something like: cgraph_edge *cs = caller_cgraph_node->get_edge (s); examine

Re: Re: Question about function body and function specialization

2020-07-16 Thread Martin Jambor
Hi, On Wed, Jul 15 2020, Erick Ochoa wrote: > On 15.07.20 05:03, Martin Jambor wrote: [...] >> At IPA time, the best way is always to look at the call graph edges, >> something like: >> >> cgraph_edge *cs = caller_cgraph_node->get_edge (s); >> examine (e->callee); >> >> Note that if

Re: Re: Question about function body and function specialization

2020-07-15 Thread Erick Ochoa
On 15.07.20 05:03, Martin Jambor wrote: Hi, On Tue, Jul 14 2020, Erick Ochoa wrote: On 14/07/2020 12:37, Erick Ochoa wrote: Hello, I have a function foo defined on a source file. Sometimes, a function pointer pointing to foo is passed as a parameter to other functions where foo is called

Re: Question about function body and function specialization

2020-07-15 Thread Martin Jambor
Hi, On Wed, Jul 15 2020, Erick Ochoa wrote: > Hi, > > I narrowed down that ipa-inline is marking these indirect functions as > unreachable (these functions have been specialized and therefore should > now be direct functions). Therefore, symtab_remove_unreachable_nodes is > called on them.

Re: Question about function body and function specialization

2020-07-15 Thread Erick Ochoa
Hi, I narrowed down that ipa-inline is marking these indirect functions as unreachable (these functions have been specialized and therefore should now be direct functions). Therefore, symtab_remove_unreachable_nodes is called on them. Running the following (immediately after materialization):

Re: Question about function body and function specialization

2020-07-15 Thread Martin Jambor
Hi, On Tue, Jul 14 2020, Erick Ochoa wrote: > On 14/07/2020 12:37, Erick Ochoa wrote: >> Hello, >> >> I have a function foo defined on a source file. Sometimes, a function >> pointer pointing to foo is passed as a parameter to other functions >> where foo is called indirectly. This indirect

Re: Question about function body and function specialization

2020-07-14 Thread Erick Ochoa
Actually, another interesting hint is that the original foo function takes two parameters. The function I am seeing inside the FOR_EACH_FUNCTION_WITH_GIMPLE_BODY is a specialized function of foo with only 1 parameter. However, the indirect function call is a version of foo which has not been