number of spills and reloads

James E Wilson wilson@specifixinc.com
Wed Sep 1 20:18:00 GMT 2004


Qiong Cai wrote:
> 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.

I don't think you can get the numbers you want by instrumenting reload. 
  reload is a very complicated pass that does not match your model.

I'd suggest instead that you add before and after reload passes, that 
count the number of memory loads and stores by scanning all of the 
instructions in a function.  Thus the number of loads/stores emitted by 
reload is the difference between the two.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



More information about the Gcc mailing list