On April 16, 2019 6:10:11 PM GMT+02:00, Michael Matz <m...@suse.de> 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:

Btw, this caller accounts for 30% of the calls to cp_build_qualified_type of 
which not all end up in build_qualified_type. 

>diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
>index 7045284..33f56f9 100644
>--- a/gcc/cp/typeck.c
>+++ b/gcc/cp/typeck.c
>@@ -1508,6 +1508,10 @@ same_type_ignoring_top_level_qualifiers_p (tree 
>   if (type1 == error_mark_node || type2 == error_mark_node)
>     return false;
> 
>+  if (type1 == type2)
>+    return true;
>+  if (TYPE_MAIN_VARIANT (type1) != TYPE_MAIN_VARIANT (type2))
>+    return false;
>   type1 = cp_build_qualified_type (type1, TYPE_UNQUALIFIED);
>   type2 = cp_build_qualified_type (type2, TYPE_UNQUALIFIED);
>
>
>Ciao,
>Michael.

Reply via email to