190 likes | 287 Views
Improving Region Selection in Dynamic Optimization Systems. Author: David Hiniker, Kim Hazelwood, Michael D. Smith Presenter: Oh Hyeong-Seok Date: 2006.11.22. Contents. Introduction NET Trace and Shortcomings Last-Executed Iterating (LEI) Algorithm Trace Combination Algorithm Conclusion.
E N D
Improving Region Selection in Dynamic Optimization Systems Author: David Hiniker, Kim Hazelwood, Michael D. Smith Presenter: Oh Hyeong-Seok Date: 2006.11.22
Contents • Introduction • NET Trace and Shortcomings • Last-Executed Iterating (LEI) Algorithm • Trace Combination Algorithm • Conclusion
Introduction • Dynamic Optimization System • Region Selection • Whole Method • Trace • Orthogonal problem: trace separation & excessive code duplication
NET trace • Select begin of trace • Backward branch • Exit from an existing trace • Start select trace when execution count threshold is reached • Trace continue • Backward branch • Branch taken to another trace • Size limit
Three Shortcoming - Loops • Can’t span interprocedural cycle • Can’t extend trace to interprocedural backward path NET Ideal A A E A B F B B C D to A D to C E D E call to E F to C F return E is lower address than D
Three Shortcomings – Nested Loops • Duplicate the beginning of an inner loop in a trace for an outer loop NET Ideal A B C A B C to C to A B to C A B to C to B C
Three Shortcomings – Unbiased branch • Trace can contain only one of the branch target NET A A B 50% 50% C D B C D F F to E D to B to E 5% 95% E F
Last-Executed Iteration • Select cyclic trace • Based on history buffer • Form from backward branch or exit from code cache • Trace end when cycle is completed or next instruction begin existing trace • Select frequently executed trace • Trace after the branch executes predefined number of time Tcyc
Trace Combination • Simple extension of trace selection • Lower trace selection threshold • Observe the trace generated for the next several execution, and combine • Trace combination select • 1st step: include only those blocks that occur in frequently executed traces • 2nd step: include executed paths that rejoin those blocks
Storing a Trace • Store each observed trace independently • Compact representation
Constructing the CFG • Construct a control-flow graph for the observed traces • Incrementally adding each observed trace • Mark each block which appear in traces Tmin times
Marking Paths that Rejoin • Mark if any successor of a unmarked basic block is marked
Experiment • Create a Framework for simulating • Relies on the Pin • Unbounded code cache • SPECint2000 benchmark • Definition • Hit Rate: percentage of executed program instruction from code cache • Code Expansion: number of program instructions that are copied into the code cache • Region Transition: jump between regions in the code caches
LEI Trace Result • Code Expansion and Region Transitions • 99% of execution occur natively from the code cache (difference between NET and LEI less than 0.2% in most benchmark)
Region Combination Result • Region Transitions
Conclusion • Identified NET trace-selection algorithm • Develop two new region-selection algorithm • Better select regions of frequently executing code and improve locality of execution