This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch: cse "library" routines
- To: Richard Henderson <rth at cygnus dot com>
- Subject: Re: Patch: cse "library" routines
- From: Bernd Schmidt <bernds at balti dot cygnus dot co dot uk>
- Date: Tue, 14 Mar 2000 11:33:32 +0000 (GMT)
- cc: gcc-patches at gcc dot gnu dot org
> I'm not quite sure I understand this. Why would you not
> want to compare two things of the same type? It seems like
> a very good way to get confused.
>
> > ... and the two _with_hash variants of
> > htab_find and htab_find_slot (to avoid calling hashfn on the second argument
> > of the equality test which no longer needs to be an entry).
>
> And since you've now got the hash value stored in the cselib_val,
> why do you need the _with_hash variants? You've all but eliminated
> the cost of "computing" the value.
Before creating a new cselib_val, I need to find whether there's already one
that is equal to a given rtx (i.e. it has a location for which
rtx_equal_for_cselib_p returns 1 if compared to the given rtx). This is a
comparison of cselib_val against rtx. I'd have to make up a dummy cselib_val
to store the rtx into to avoid that; in that case I could also store the hash
value in the dummy, but I thought that kind of thing was too ugly.
Bernd