Optimistic%20Register%20Coalescing - PowerPoint PPT Presentation

About This Presentation
Title:

Optimistic%20Register%20Coalescing

Description:

Live range splitting. Experimental Results and Analyses. Summary. Outline. 3 ... Allocation result. Example of Live Range Splitting. 13. Base-case allocator ... – PowerPoint PPT presentation

Number of Views:11
Avg rating:3.0/5.0
Slides: 19
Provided by: sobeehalm
Learn more at: https://cseweb.ucsd.edu
Category:

less

Transcript and Presenter's Notes

Title: Optimistic%20Register%20Coalescing


1
Optimistic Register Coalescing
  • Sobeeh Almukhaizim
  • UC San Diego
  • Computer Science Engineering
  • Based on the work of
  • J. Park and S. Moon
  • School of Electrical Engineering
  • Seoul National University

2
Outline
  • Motivation and problem definition.
  • Register Allocation
  • Copy Coalescing
  • Optimistic Coalescing
  • Aggressive coalescing.
  • Live range splitting.
  • Experimental Results and Analyses
  • Summary

3
Motivation and problem definition.
  • Register allocation and copy coalescing.
  • Goal Minimize number of registers for a program
    ( faster execution ).
  • Live range variables that interfere with each
    other ? interference graph with minimum color k
    ( number of registers ).
  • NP-complete ? search for heuristics.

4
Register Allocation
  • Interference Graph
  • A node represents a live range
  • An edge represents concurrent liveness
  • Coloring Theorem
  • In a graph G, a node x with degree lower than k
    will have a color no matter how G-x is colored

5
Register Allocators
  • Yorktown Allocator (Chaitin et. al)
  • Spills a node whenever every node is significant
  • Optimistic Coloring Register Allocator (Briggs
    et. al)
  • Delays spill decision later
  • Differentiates potential-spill and actual-spill

6
Copy Coalescing
  • Coalescing in Graph Coloring
  • Merging two non-interfering nodes
  • Makes two nodes have the same color
  • Effective for copy elimination
  • Copy Coalescing
  • Merging two non-interfering copy-related nodes
  • Makes copies meaningless
  • Includes both negative and positive impact on
    colorability

7
Coalescing Impact on Colorability
  • Negative Impact
  • Produce higher-degree coalesced nodes
  • Positive Impact
  • Reduce the degrees of neighbors by one

2
1
1
2
a
b
ad
b
a
b
ab
k2
1
c
d
c
c
d
d
c
Positive Impact
Negative Impact
8
Previous Coalescing Heuristics
  • Aggressive Coalescing(Chaitin et. al)
  • Coalesce any non-interfering copy operands
  • Conservative Coalescing(Briggs et. al)
  • Coalesce if the coalesced node will not be
    potentially-spilled
  • Iterated Coalescing(George and Appel)
  • Repeat simplification and conservative coalescing

Aggressive
Conservative
Iterated
Copy Removal
best
worst
mid
Positive Impact
mid
small
big
Negative Impact
big
none
none
9
Optimistic Coalescing
  • Aggressive Coalescing
  • Live Range Splitting

Motivation of Optimistic Coalescing
Aggressive Coalescing
Copy Removal
Positive Impact
Optimistic View
Live Range Splitting
Negative Impact
10
Aggressive Coalescing
  • Advantages of Aggressive Coalescing
  • Removes many copies
  • Fully exploits the positive impact
  • Optimistically, aggressively coalesced node is
    not necessarily spilled

11
Live Range Splitting
  • Compensate for Negative Impact
  • What to Split
  • Coalesced live ranges
  • When to Split
  • At the color phase before spilling them actually
  • How to Split
  • Reproduce the primitive live ranges by undoing
    coalescing

12
Example of Live Range Splitting
a
k3
e
b
e
stack
abcd
f
d
f
g
c
g
Graph simplification
Aggressive coalescing
ab3
e1
e1
d
f2
f2
c1
g3
g3
Allocation result
13
Register Allocator Implementation
  • Base-case allocator
  • Yorktown allocator with aggressive coalescing
  • Briggs allocators with four different heuristics
  • with conservative coalescing (conservative)
  • with iterated coalescing (iterated)
  • with aggressive coalescing (aggressive)
  • with optimistic coalescing (optimistic)

14
Experimental Results
Ratio of removed copies
Ratio of introduced spill ops
15
Analysis of Aggressive Coalescing and Spilling
  • Due to aggressiveness, aggressive coalescing
    coalesces 66.0 more nodes
  • Due to optimistic view, aggressive coalescing
    spills only 5.6 of aggressively coalesced nodes
  • Due to live range splitting, optimistic
    coalescing reduces spills by 2.4

16
Analysis of Live Range Splitting
  • Due to live range splitting, 52 of otherwise
    spilled nodes are colored

17
Analysis of Positive impact
  • Due to positive impact, coalescing removes
    interference edges
  • Optimistic coalescing exploits 3.8 times more
    positive impact than iterated coalescing

18
Summary
  • Optimistic Coalescing
  • Aggressive coalescing
  • Aggressive copy elimination
  • Positive impact
  • Optimistic view
  • Live range splitting
  • Reduce negative impact
Write a Comment
User Comments (0)
About PowerShow.com