Monday, June 12, 2006

Def/Use sites

Today I finished coding a class that maps each virtual register to all the instructions where they are used, (and defined). This class will be useful during register allocation. It will allow to place load and store instructions efficiently, and, most important, it will allow to compute the spilling factor of each virtual. I call spilling factor a number that determines which virtual is the best candidate to be spilled. The heuristics I am using takes into consideration how many times the register has been used, and the nesting depth of the using (and defining) instructions. For this example control flow graph here, the dump() function will produce this output. Check the .h and the .cpp classes.

0 Comments:

Post a Comment

<< Home