What are Spilled variables in ARM (Advanced RISC Machines)


Spilled Variables


In a Microcontroller there are two types of memory, one is because of Registers and other is main Memory, Since Register can be accessed more easily so more important variable should be allocated to the registers. The Compiler tries to allocate a register to each variable, also it tries to allocate different local variables in the same register, then excess variables are stored in STACK

Such stacked variables are called Spilled variables, since they are written out of memory, Spilled variables are quite slow to access.To implement a function efficiently in ARM you need to Minimise the number of spilled variables to Ensure the critical(important) variables are stored in registers

Defination 2:

In Register allocators a variable can be assigned to either a CPU register or to main memory, the variable assigned to register can be accessed with speed, althought a microcontroller/computer have limited number of registers, so these are allocated to the main memory, hence spilled variables are variables that are allocated in main memory.
Spilling is movement of variable from register to main memory
while moving a variable from memory to register is called filling
Previous
Next Post »