number of spills and reloads
Joern Rennecke
joern.rennecke@superh.com
Wed Sep 1 15:32:00 GMT 2004
> 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.
The actual modification of the reg is done in reload. The
register is changed in place, chaninging all its uses simultanously.
Look for this line:
PUT_CODE (reg, MEM);
> Will
> the spill decision made in this function be changed in later steps of
> the reload?
After a pseudo has been spilled using alter_reg, it might be reallocated
to a different hard register by retry_global_alloc.
Also, due to reload inheritance and reload_cse, not every access of a pseudo
that got spilled to a stack slot will actually use the stack slot.
Before the post_reload passes (like reload_cse), the number of memory
accesses generated by reload for a pseudo register that has been allocated
to a stack slot or other memory location can can be estimated by
the number of references to the pseudo, minus the ones where reload_as_needed
finds non-mmeory replacements for, times the number of memory accesses
needed per register access (in case of multi-word pseudos).
Some fuzzyness comes in in how much references you want to count for SUBREG
references and other read-modify-write constructs.
On other architectures, more complications arise from secondary reloads
for out-of-range offsets that require memory loads for the constants,
or using secondary memory to move between certain register classes.
More information about the Gcc
mailing list