12.07.2015 Views

Iterated Register Coalescing - School of Computer Science

Iterated Register Coalescing - School of Computer Science

Iterated Register Coalescing - School of Computer Science

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

306 · Lal George and Andrew AppelSSA constantpropagationrecklesscoalesce<strong>of</strong> equal−tag movesSSA constantpropagation(optional)buildfirst timeconservativecoalescebuildsubsequentroundsrecklesscoalescesimplifyconservativecoalescesimplifyfreezepotentialspillpotentialspillselectselectdonedoneactualspillspillsactualspillspillsanyanyFig. 4.Briggs’s algorithm.Fig. 5.<strong>Iterated</strong> algorithm.move could have been eliminated. This type <strong>of</strong> lookahead is expensive. For similarreasons the move between c and d cannot be eliminated. In the example <strong>of</strong> Figure 2none <strong>of</strong> the moves were eliminated using either conservative coalescing or biasedselection.Figure 4 shows the flow <strong>of</strong> control in Briggs’s register allocator. The potential-spilland actual-spill phases are related to “optimistic coloring,” discussed in Section 5.1.Rematerialization. Briggs et al. observe that variables with constant values canbe spilled very cheaply: no store is necessary, and at each use the value maybe reloaded or recomputed. Therefore, such variables are good candidates forspilling, and the spill selection algorithm should be informed by the results <strong>of</strong> aACM Transactions on Programming Languages and Systems, Vol. 18, No. 3, May 1996, Pages 300-324.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!