Builtin expansion versus headers optimization: Reductions

Jeff Law law@redhat.com
Thu Jun 4 13:15:00 GMT 2015


On 06/04/2015 06:33 AM, Jakub Jelinek wrote:
> On Thu, Jun 04, 2015 at 12:26:03PM +0000, Joseph Myers wrote:
>>> Again is this worth a gcc pass?
>>
>> This isn't a matter of compiler passes; it's additional checks in existing
>> built-in function handling.  Maybe that built-in function handling should
>> move to the match-and-simplify infrastructure (some, for libm functions
>> and bswap, already has) to make this even simpler to implement.
>
> GCC already has a pass that attempts to track known and earlier computed
> lengths of strings, and do various transformations and optimizations based
> on that, see the tree-ssa-strlen.c pass.  Most of that you really can't do
> at the glibc headers level.
Right.

Ondrej, if you have specific cases that you think ought to be optimized, 
but aren't, don't hesitate to file bugs for those testcases.

As Jakub noted, we already have significant infrastructure in place to 
optimize builtins and chains of builtins.  If something is missing, we 
definitely want to know about it so that it can be corrected.

jeff



More information about the Gcc mailing list