This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Sign extension elimination
- From: "Leehod Baruch" <leehod dot baruch at weizmann dot ac dot il>
- To: "Daniel Berlin" <dberlin at dberlin dot org>
- 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 14:09:24 +0200 (IST)
- 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>
> Leehod, Mircea, just for future reference:
>
>
> A better way to do the union-find stuff, rather than put a member in
> struct web for extra info, would probably be to do the following:
>
>
> struct sign_extension_web
> {
> struct web web;
> <your extra fields>
> };
>
> You should be able to pass pointers to sign_extension_web to the union
> find functions without any problems, and wouldn't need to have "void
> *extra_info" in struct web.
>
>
> --Dan
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.
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.
Leehod.