Re: [PATCH] Add inchash support for vrange.

2023-04-18 Thread Jakub Jelinek via Gcc-patches
On Tue, Apr 18, 2023 at 01:33:47PM +0200, Aldy Hernandez wrote: > > > + const irange &r = as_a (v); > > > + if (r.varying_p ()) > > > + hstate.add_int (VR_VARYING); > > > + else > > > + hstate.add_int (VR_RANGE); > > > > Shouldn't this also > >hstate.add_int (r.num_pairs ()

Re: [PATCH] Add inchash support for vrange.

2023-04-18 Thread Aldy Hernandez via Gcc-patches
On 4/18/23 12:59, Jakub Jelinek wrote: On Tue, Apr 18, 2023 at 12:50:58PM +0200, Aldy Hernandez wrote: --- a/gcc/value-range.cc +++ b/gcc/value-range.cc @@ -232,6 +232,58 @@ vrange::dump (FILE *file) const pp_flush (&buffer); } +namespace inchash +{ + +void +add_vrange (const vrange

Re: [PATCH] Add inchash support for vrange.

2023-04-18 Thread Jakub Jelinek via Gcc-patches
On Tue, Apr 18, 2023 at 12:50:58PM +0200, Aldy Hernandez wrote: > --- a/gcc/value-range.cc > +++ b/gcc/value-range.cc > @@ -232,6 +232,58 @@ vrange::dump (FILE *file) const >pp_flush (&buffer); > } > > +namespace inchash > +{ > + > +void > +add_vrange (const vrange &v, inchash::hash &hstate,

Re: [PATCH] Add inchash support for vrange.

2023-04-18 Thread Aldy Hernandez via Gcc-patches
sts? p.s. Cleaned up the need for declaring add_vrange() a friend of frange now that we have a way of getting the nan_state elegantly.From b02b48a46a6b1a2f37e00f42a8e374298e745c0c Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Thu, 23 Feb 2023 08:48:28 +0100 Subject: [PATCH] Add inchash sup

Re: [PATCH] Add inchash support for vrange.

2023-04-18 Thread Jakub Jelinek via Gcc-patches
On Tue, Apr 18, 2023 at 11:33:05AM +0200, Jakub Jelinek wrote: > On Tue, Apr 18, 2023 at 11:06:38AM +0200, Aldy Hernandez via Gcc-patches > wrote: > > This patch provides inchash support for vrange. It is along the lines > > of the streaming support I just posted and will be used for IPA > > hash

Re: [PATCH] Add inchash support for vrange.

2023-04-18 Thread Jakub Jelinek via Gcc-patches
On Tue, Apr 18, 2023 at 11:06:38AM +0200, Aldy Hernandez via Gcc-patches wrote: > This patch provides inchash support for vrange. It is along the lines > of the streaming support I just posted and will be used for IPA > hashing of ranges. > > Thoughts? > > gcc/ChangeLog: > > * inchash.cc

Re: [PATCH] Add inchash support for vrange.

2023-04-18 Thread Aldy Hernandez via Gcc-patches
+namespace inchash +{ + +void +add_vrange (const vrange &v, inchash::hash &hstate, +unsigned int) +{ + if (v.undefined_p ()) +{ + hstate.add_int (VR_UNDEFINED); + return; +} + // Types are ignored throughout to inhibit two ranges being equal + // but having differe

[PATCH] Add inchash support for vrange.

2023-04-18 Thread Aldy Hernandez via Gcc-patches
This patch provides inchash support for vrange. It is along the lines of the streaming support I just posted and will be used for IPA hashing of ranges. Thoughts? gcc/ChangeLog: * inchash.cc (hash::add_real_value): New. * inchash.h (class hash): Add add_real_value. * val