This is the mail archive of the gcc-patches@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: Move reg_equiv_* into a single structure


On 05/14/10 05:15, Richard Guenther wrote:
On Thu, May 13, 2010 at 8:12 PM, Jeff Law<law@redhat.com> wrote:
IRA&  reload share a variety of reg_equiv_XXX arrays.  My reload-v2 work
sits between IRA&  reload and needs to grow those arrays as new pseudos are
created for split ranges.

Right now I have to grow each array separately.  It works, but I find it
rather ugly.  I also find it to be a major pain to get state for a single
pseudo in gdb...  ie:

p reg_equiv_init[153]
p reg_equiv_constant[153]
p reg_equiv_address[153]
p reg_equiv_invariant[153]
p reg_equiv_memory_loc[153]
....


This patch takes those objects and puts them into structure and creates an array of those structures indexed by pseudo #. So there's only one array to grow if a new pseudo is introduced and to get the equivalency state of a pseudo we can just do

p reg_equivs[153]

Bootstrapped and regression tested on x86_64-unknown-linux-gnu. OK?
You might want to consider using a GC allocated VEC instead to save
the separate size variable.
I've got no strong opinions on this. If you'd like that change, I'm happy to make it.

Also I wonder how this patch affects cache locality of accesses?
Outlined in my message to Paolo... I haven't measured it, but I'd be extremely surprised if any change is measurable.

Jeff


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