This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: SSA range class and removal of VR_ANTI_RANGEs
- From: David Malcolm <dmalcolm at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>, Aldy Hernandez <aldyh at redhat dot com>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, Andrew MacLeod <amacleod at redhat dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 23 May 2017 10:29:58 -0400
- Subject: Re: SSA range class and removal of VR_ANTI_RANGEs
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dmalcolm at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 97EAE659A3
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 97EAE659A3
- References: <dbad7708-d495-402c-c9d8-626a9c8202b9@redhat.com> <20170523121117.GU8499@tucnak>
On Tue, 2017-05-23 at 14:11 +0200, Jakub Jelinek wrote:
> On Tue, May 23, 2017 at 06:48:15AM -0400, Aldy Hernandez wrote:
[...]
> > --- /dev/null
> > +++ b/gcc/range.h
> > +
> > +You should have received a copy of the GNU General Public License
> > +along with GCC; see the file COPYING3. If not see
> > +<http://www.gnu.org/licenses/>. */
> > +
> > +#ifndef GCC_RANGE_H
> > +#define GCC_RANGE_H
> > +#define MAX_RANGES 6
> > +
> > +typedef class irange *irange_p;
> > +enum irange_type { RANGE_PLAIN, RANGE_INVERT };
The irange class needs a leading comment, which would go a long way to
documenting the patch as a whole, I think (i.e. I'm not just nit
-picking here :) )
> > +class GTY(()) irange
> > +{
> > + private:
> > + bool overflow;
> > + size_t n;
> > + void prepend (wide_int x, wide_int y);
> > + void append (wide_int x, wide_int y);
> > + void remove (unsigned i, unsigned j);
> > + void canonicalize ();
> > + /* This is stupid. These two should be private, but the GTY
> > + machinery can't look inside an irange. */
> > + public:
> > + tree type;
> > + wide_int bounds[MAX_RANGES];
> > +
> > +public:
> ...
> > + void Union (wide_int x, wide_int y);
> > + bool Union (const irange &r);
> > + bool Union (const irange &r1, const irange &r2);
>
> Do we really want methods starting with capital letters?
> I understand why you can't use union, but I don't think we use
> CamelCase
> anywhere.
FWIW in the JIT, I have a class switch_ (i.e. with a trailing
underscore). Maybe we should use trailing underscores for names that
clash with reserved words?
Dave