This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Sign extension elimination
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: Leehod Baruch <leehod dot baruch at weizmann dot ac dot il>
- Cc: Mircea Namolaru <namolaru at il dot ibm dot com>, gcc-patches at gcc dot gnu dot org, roger at eyesopen dot com, leehod at gmail dot com
- Date: Sat, 25 Mar 2006 09:29:57 -0500
- Subject: Re: [PATCH] Sign extension elimination
- References: <OF7DAB777E.97AC672B-ONC225711E.00497450-42257122.0052DBE4@il.ibm.com> <20060228034521.GA11259@lucon.org> <1209.81.218.151.198.1141118408.squirrel@81.218.151.198> <20060228150336.GA8359@lucon.org> <1141144343.6054.6.camel@localhost> <1204.82.81.231.211.1143288564.squirrel@82.81.231.211>
> Sorry for the *long* time it took me to respond to your note.
> I suddenly remembered that I wanted to respond but it slipped
> my mined.
>
> You are right that our problem could have been solved this way,
> but the reason that I made this *extra_info flag is that the
> problem is general and doesn't concern only the sign_extension
> optimization.
Yes, but that doesn't affect the suggestion.
> In the web optimization there is an implementation of a
> union-find data structure, but it wasn't general enough.
> In many cases, when a union-find data structure is being used
> there is a need to attach more information to each node and
> to update this information when two nodes are being connected.
Right, and you can attach information to each node in the manner i
suggested, and still have it updated when the nodes are being connected
(that is why you have a function pointer).
Again, this avoids wasting a pointer in the structure for people who
*don't* need it.
In effect, it's like subclassing the union-find datastructure would be
in C++.