Re: Question about optimizing function pointers for direct function calls

2024-06-12 Thread Hanke Zhang via Gcc
Hi Richard, Thanks for your reply. I'm looking forward to hearing from Honza! But I still have a small question about the IPA passes. If I want to make such a conversion (sum += foo[i].add == add ? add (1,2) : foo[i].add (1,2);), I definitely need to change the function's body. But the article "U

Re: Question about optimizing function pointers for direct function calls

2024-06-12 Thread Richard Biener via Gcc
On Wed, Jun 12, 2024 at 11:57 AM Hanke Zhang wrote: > > Richard Biener 于2024年5月24日周五 14:39写道: > > > > On Fri, May 24, 2024 at 5:53 AM Hanke Zhang via Gcc wrote: > > > > > > Hi, > > > I got a question about optimizing function pointers for direct > > > function calls in C. > > > > > > Consider th

Re: Question about optimizing function pointers for direct function calls

2024-06-12 Thread Hanke Zhang via Gcc
Richard Biener 于2024年5月24日周五 14:39写道: > > On Fri, May 24, 2024 at 5:53 AM Hanke Zhang via Gcc wrote: > > > > Hi, > > I got a question about optimizing function pointers for direct > > function calls in C. > > > > Consider the following scenario: one of the fields of a structure is a > > function

Re: Question about optimizing function pointers for direct function calls

2024-05-24 Thread Jeff Law via Gcc
On 5/23/24 9:51 PM, Hanke Zhang via Gcc wrote: Hi, I got a question about optimizing function pointers for direct function calls in C. Consider the following scenario: one of the fields of a structure is a function pointer, and all its assignments come from the same function. Can all its uses

Re: Question about optimizing function pointers for direct function calls

2024-05-23 Thread Richard Biener via Gcc
On Fri, May 24, 2024 at 5:53 AM Hanke Zhang via Gcc wrote: > > Hi, > I got a question about optimizing function pointers for direct > function calls in C. > > Consider the following scenario: one of the fields of a structure is a > function pointer, and all its assignments come from the same funct