number of spills and reloads

Qiong Cai qiong.cai@gmail.com
Wed Sep 1 14:02:00 GMT 2004


On Wed, 1 Sep 2004 13:38:40 +0100 (BST), Joern Rennecke
<joern.rennecke@superh.com> wrote:
> > I'm doing some experiments on Pentium machines, and basically I need 3 kinds
> > of statistics after reloading:
> > 1) number of memory stores, eg. [sp+4] <- r1
> > 2) number of memory loads, eg. r1 <- [sp+4]
> > 3) number of combined stores and loads with addressing mode available
> > on CISC-like architectures: eg. [sp+4] <- [sp+4] + r1, or r1 <- [sp+4]
> > + r1
> > where r1 is the hardware register.
> >
> > >From your previous email,  I think  the place in which REG is modifed
> > into MEM is only for case 3)??    Could you please tell me which
> 
> No, a reg->reg move can have either or both operands changed to a MEM,
> thus making it a load, a store, or a memory-memory move (where available).
> 
> > functions in the codes does this modification?
> 
> Look at alter_reg.

Ok. I will have a close look at this function. But it seems that no
actual code of the modification is generated in this function. Will
the spill decision made in this function be changed in later steps of
the reload?


> > For case (2), I don't have much clue.  Is it related to RELOAD_FOR_INPUT?
> > For the dump, it seems that for any non-optional RELOAD_FOR_INPUT or
> > RELOAD_FOR_OPERAND_ADDRESS, a "memory load" will be generated.
> > Is it correct?
> 
> A memory access need not have been generated by reload changing a register
> into a memory reference; it might also be a result of rtl generation.
> 
I know.  But I like to know the number of "new" load/store/memory
instructions genereated by register allocation/reload pass.


-- 
Qiong Cai
www.cse.unsw.edu.au/~qiongc



More information about the Gcc mailing list