Re: [PATCH][RFC] Improve get_qualified_type linear list walk

2019-04-17 Thread Marc Glisse
On Wed, 17 Apr 2019, Jeff Law wrote: * tree.c (get_qualified_type): Put found type variants at the head of the variant list. Seems quite reasonable to me. I just hope we don't find a case where this is the exact worst case behavior ;-) That seems unlikely. Competitive

Re: [PATCH][RFC] Improve get_qualified_type linear list walk

2019-04-17 Thread Jeff Law
On 4/16/19 6:55 AM, Richard Biener wrote: > > The following makes the C++ FEs heavy use of build_qualified_type > cheaper. When looking at a tramp3d -fsyntax-only compile you can > see that for 470.000 build_qualified_type calls we end up > with 9.492.205 calls to check_qualified_type (thus we

Re: [PATCH][RFC] Improve get_qualified_type linear list walk

2019-04-17 Thread Michael Matz
Hi, On Tue, 16 Apr 2019, Jakub Jelinek wrote: > > + if (type1 == type2) > > +return true; > > + if (TYPE_MAIN_VARIANT (type1) != TYPE_MAIN_VARIANT (type2)) > > +return false; > > Is this second one correct though? Doesn't comptypes return for various > cases true even if the

Re: [PATCH][RFC] Improve get_qualified_type linear list walk

2019-04-17 Thread Michael Matz
Hi, On Wed, 17 Apr 2019, Richard Biener wrote: > for the C++ FE the LRU cache effectively moves the unqualified > variants first in the variant list. Since we always first > build the unqualified variants before the qualified ones > the unqualified ones tend to be at the end of the list.

Re: [PATCH][RFC] Improve get_qualified_type linear list walk

2019-04-17 Thread Richard Biener
On Tue, 16 Apr 2019, Michael Matz wrote: > Hi, > > On Tue, 16 Apr 2019, Richard Biener wrote: > > > Comments? > > I was quickly testing also with some early-outs but didn't get conclusive > performance results (but really only superficial testing) so I'm not > proposing it, like so: > >

Re: [PATCH][RFC] Improve get_qualified_type linear list walk

2019-04-16 Thread Richard Biener
On April 16, 2019 6:14:45 PM GMT+02:00, Jakub Jelinek wrote: >On Tue, Apr 16, 2019 at 04:10:11PM +, Michael Matz wrote: >> I was quickly testing also with some early-outs but didn't get >conclusive >> performance results (but really only superficial testing) so I'm not >> proposing it, like

Re: [PATCH][RFC] Improve get_qualified_type linear list walk

2019-04-16 Thread Richard Biener
On April 16, 2019 6:10:11 PM GMT+02:00, Michael Matz wrote: >Hi, > >On Tue, 16 Apr 2019, Richard Biener wrote: > >> Comments? > >I was quickly testing also with some early-outs but didn't get >conclusive >performance results (but really only superficial testing) so I'm not >proposing it, like

Re: [PATCH][RFC] Improve get_qualified_type linear list walk

2019-04-16 Thread Jakub Jelinek
On Tue, Apr 16, 2019 at 04:10:11PM +, Michael Matz wrote: > I was quickly testing also with some early-outs but didn't get conclusive > performance results (but really only superficial testing) so I'm not > proposing it, like so: > > diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c > index

Re: [PATCH][RFC] Improve get_qualified_type linear list walk

2019-04-16 Thread Michael Matz
Hi, On Tue, 16 Apr 2019, Richard Biener wrote: > Comments? I was quickly testing also with some early-outs but didn't get conclusive performance results (but really only superficial testing) so I'm not proposing it, like so: diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index

[PATCH][RFC] Improve get_qualified_type linear list walk

2019-04-16 Thread Richard Biener
The following makes the C++ FEs heavy use of build_qualified_type cheaper. When looking at a tramp3d -fsyntax-only compile you can see that for 470.000 build_qualified_type calls we end up with 9.492.205 calls to check_qualified_type (thus we visit around 20 variant type candidates) ending up