Re: Fix slow value range hash

2018-02-26 Thread Jakub Jelinek
On Mon, Feb 26, 2018 at 12:04:53PM +0100, Jan Hubicka wrote:
> Hi,
> this is patch Jakub posted to IRC while discussing slow ipa-cp jump function
> streaming. The problem is that hash hashes types as iterative types but later
> compares them as pointers.  Iterative hash is trying to make semantically
> equivalent types really equivalent.
> 
> Alternatively we may try to unify types that are semantically equivalent
> but it seems bit slopy to do at stage4.
> 
> Bootstrapped/regtested x86_64-linux, OK?

Please see http://gcc.gnu.org/r257940 , it is already committed.

Jakub


Re: Fix slow value range hash

2018-02-26 Thread Jakub Jelinek
On Mon, Feb 26, 2018 at 12:12:21PM +0100, Jan Hubicka wrote:
> > On Mon, Feb 26, 2018 at 12:04:53PM +0100, Jan Hubicka wrote:
> > > Hi,
> > > this is patch Jakub posted to IRC while discussing slow ipa-cp jump 
> > > function
> > > streaming. The problem is that hash hashes types as iterative types but 
> > > later
> > > compares them as pointers.  Iterative hash is trying to make semantically
> > > equivalent types really equivalent.
> > > 
> > > Alternatively we may try to unify types that are semantically equivalent
> > > but it seems bit slopy to do at stage4.
> > > 
> > > Bootstrapped/regtested x86_64-linux, OK?
> > 
> > Please see http://gcc.gnu.org/r257940 , it is already committed.
> Good, can you please backport it to gcc 7?

Will do within a week, I have dozens of other commits that need backporting.

Jakub


Re: Fix slow value range hash

2018-02-26 Thread Jan Hubicka
> On Mon, Feb 26, 2018 at 12:04:53PM +0100, Jan Hubicka wrote:
> > Hi,
> > this is patch Jakub posted to IRC while discussing slow ipa-cp jump function
> > streaming. The problem is that hash hashes types as iterative types but 
> > later
> > compares them as pointers.  Iterative hash is trying to make semantically
> > equivalent types really equivalent.
> > 
> > Alternatively we may try to unify types that are semantically equivalent
> > but it seems bit slopy to do at stage4.
> > 
> > Bootstrapped/regtested x86_64-linux, OK?
> 
> Please see http://gcc.gnu.org/r257940 , it is already committed.
Good, can you please backport it to gcc 7?

Thanks,
Honza
> 
>   Jakub


Fix slow value range hash

2018-02-26 Thread Jan Hubicka
Hi,
this is patch Jakub posted to IRC while discussing slow ipa-cp jump function
streaming. The problem is that hash hashes types as iterative types but later
compares them as pointers.  Iterative hash is trying to make semantically
equivalent types really equivalent.

Alternatively we may try to unify types that are semantically equivalent
but it seems bit slopy to do at stage4.

Bootstrapped/regtested x86_64-linux, OK?

Honza

patch by Jakub Jelinek
* ipa-prop.c (ipa_vr_ggc_hash_traits::hash): Hash pointers rather
than iterative types.
Index: ipa-prop.c
===
--- ipa-prop.c  (revision 257931)
+++ ipa-prop.c  (working copy)
@@ -113,9 +113,10 @@ struct ipa_vr_ggc_hash_traits : public g
   hash (const value_range *p)
   {
 gcc_checking_assert (!p->equiv);
-hashval_t t = (hashval_t) p->type;
-t = iterative_hash_expr (p->min, t);
-return iterative_hash_expr (p->max, t);
+inchash::hash hstate (p->type);
+hstate.add_ptr (p->min);
+hstate.add_ptr (p->max);
+return hstate.end ();
   }
   static bool
   equal (const value_range *a, const value_range *b)