General aim is to keep frequently-used values in registers as much as possible, to lower memory traffic. Can have a large effect on program performance. Variety of approaches are possible, differing in sophistication and in scope of analysis used. Spilling adds new instructions, which often affects the allocation analysis, requiring a new iteration. Spill variables which haven't been updated since last read from memory.
Register use never spans statements.
Use auxiliary table to track register use. Register Allocation for Expressions Choice of evaluation order can affect number of registers needed. If we compute left child first, need 4 regs, but doing right child first needs only 3. Can then save result of this evaluation in a register while doing other subtree. Label each node with minimum number of registers needed to evaluate subtree.