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.

<strong>Iterated</strong> <strong>Register</strong> <strong>Coalescing</strong> · 321Coalesceprocedure Coalesce()let m (=copy(x,y)) ∈ worklistMovesx := GetAlias(x)y := GetAlias(y)if y ∈ precolored thenlet (u, v) =(y, x)elselet (u, v) =(x, y)worklistMoves := worklistMoves \{m}if (u = v) thencoalescedMoves := coalescedMoves ∪{m}AddWorkList(u)else if v ∈ precolored ∨ (u, v) ∈ adjSet thenconstrainedMoves := constrainedMoves ∪{m}addWorkList(u)addWorkList(v)else if u ∈ precolored ∧ (∀t ∈ Adjacent(v), OK(t, u))∨ u ∉ precolored ∧ Conservative(Adjacent(u) ∪ Adjacent(v)) thencoalescedMoves := coalescedMoves ∪{m}Combine(u,v)AddWorkList(u)elseactiveMoves := activeMoves ∪{m}Only moves in the worklistMoves are considered in the coalesce phase. When amove is coalesced, it may no longer be move related and can be added to the simplifyworklist by the procedure AddWorkList. OK implements the heuristic used forcoalescing a precolored register. Conservative implements the Briggs conservativecoalescing heuristic.procedure AddWorkList(u)if (u ∉ precolored ∧ not(MoveRelated(u)) ∧ degree[u] < K) thenfreezeWorklist := freezeWorklist \{u}simplifyWorklist := simplifyWorklist ∪{u}AddWorkListfunction OK(t,r)degree[t]

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

Saved successfully!

Ooh no, something went wrong!