Attempting to Calculate the number of spills

I would like to calculate the number of spill that are inserted into the code does anyone know where I should start.

Start with passing -stats and look for:
3 regalloc - Number of spills inserted
2 regalloc - Number of splits finished
Is that what you want?