This is the mail archive of the
mailing list for the GCC project.
hash_rtx and volatile subexpressions
- From: Andrey Belevantsev <abel at ispras dot ru>
- To: gcc mailing list <gcc at gcc dot gnu dot org>
- Date: Thu, 07 Jun 2007 18:05:46 +0400
- Subject: hash_rtx and volatile subexpressions
I would like to use some sort of hashing to speed up searching for an
insn in an availability set in the selective scheduler. It seems
natural using hash_rtx for this purpose. However, hash_rtx will not
hash any volatile subexpressions, returning 0 in this case. This is
fine by me, but together with the recursion optimization it has near
for (; i >= 0; i--)
/* If we are about to do the last recursive call
needed at this level, change it into iteration.
This function is called enough to be worth it. */
if (i == 0)
x = XEXP (x, i);
...one does not get a hash e.g. for any conditional jump like
(if_then_else (ne (reg:BI 262 p6 )
(const_int 0 [0x0]))
...because the pc subexpression is always the first one, and the
recursive call for it gets optimized by the above code, which results in
a zero hash for the whole pattern.
Is this intentional, or do we want to have 'return hash;' instead of
'return 0;' in all places when *do_not_record_p is set to 1? Is there a
better hash_rtx somewhere, which I don't know about?