Marix

Reasons for Scratch Register Usage

Discussion created by Marix on Jun 7, 2011
Latest reply on Jun 7, 2011 by himanshu.gautam

Hi,

I was somewhat wondering whether there is any additional reason but "The compiler generates spill code (shuffling values to, and from, memory) if it cannot fit all the live values into registers." (Programming Guide) for usage of scratch registers.

The reason I am wondering is that I have a kernel which reports the following in its generatred ISA file:

MaxScratchRegsNeeded = 92
SQ_PGM_RESOURCES:NUM_GPRS = 36

I have other kernel which report using 64 GPRs, so it wonders me why the compiler wouldn't trade some of the scratching for some additional register usage.

Outcomes