This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Hashing regs and subregs


"Paulo J. Matos" <paulo@matos-sorge.com> writes:

> I am developing a new pass and looking for suggestions on the best way
> to record in a data structure which regs and subregs I have seen and
> which mode they are in through the insn chain so I know if I find
> duplicates.
>
> Any suggestions on the best way to do this?
> Are there any rtx hashes already implemented somewhere?

Note that pseudo-regs always have the same mode.  Hard regs and subregs
do not.

There are lots of ways to record regs and subregs.  There is nothing
very wrong with allocate a VEC of size max_reg_num ().  Plenty of passes
do that.

If you really want a hash table, you can use iterative_hash_rtx to get
the hash code.  Just pass 0 as the hash argument.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]