On Sun, May 12, 2013 at 11:25 PM, Viktor Pobedin <viktor.pobedin@xxxxxxxxx> wrote: > > What is the proper way of storing additional information in insn rtx object? > I'm adding two rtl passes to the gcc. The first pass does some analysis work > and needs to store information for each rtx while the second pass expected > do the optimization based on the information added by the first pass. > Currently I see few options for that: > 1. In the first pass insert notes before the insn and then look for them in > the second pass. > 2. Define and use my special REG_NOTE. Then it can be added to the insn rtx. > 3. Define my own array/hash with UID as a key. > > Is there more elegant way of doing that? If not what of the 3 mentioned > above you think is the best? I wouldn't use choice 1, because insns get rearranged in various ways by different passes. Either choice 2 or 3 ought to work, and those are both typical approaches for this kind of thing. It depends on how much information you have to store, and how you will work with information that is lost between the two passes. Ian