Reasons for Scratch Register Usage

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


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

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.