1 / 20

An Evaluation of Staged Run-Time Optimizations in DyC

An Evaluation of Staged Run-Time Optimizations in DyC. Brian Grant, Matthai Philipose, Markus Mock, Craig Chambers, and Susan J. Eggers presented by Laura Hiatt April 28, 2006. Run-Time Optimizations Motivation. In static optimizations, optimize based on static invariants

parley
Download Presentation

An Evaluation of Staged Run-Time Optimizations in DyC

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. An Evaluation of Staged Run-Time Optimizations in DyC Brian Grant, Matthai Philipose, Markus Mock, Craig Chambers, and Susan J. Eggers presented by Laura Hiatt April 28, 2006

  2. Run-Time Optimizations Motivation • In static optimizations, optimize based on static invariants • But - code often has invariants that aren’t known until run-time • Run-time optimizations can take advantage of these

  3. Selective, value-specific dynamic compilation • Selective dynamic compilation • Dynamically compile selected regions at run-time • Value-specific compilation • Run-time dynamic constant propagation and folding

  4. DyC in a nutshell • Programmer annotates code • Static variables • Other policies as well • DyC isolates ‘dynamic regions’ based on these variables • Compiles non-dynamic regions statically

  5. DyC in a nutshell • Compiles dynamic regions in stages • Does as much as possible statically (analysis, etc.) • Compilation is at run time when the static variable values are known • Creates compiler for each dynamic region • Generates code where the static variables are constants

  6. DyC’s components

  7. Run-time optimizations • Dynamic-to-static promotions and polyvariant specialization • At the beginning of each dynamic region, the relevant variables are promoted from dynamic to static • Multiple versions of the code are generated for each combination of possible promoted values

  8. Run-time optimizations • Static loads and calls • Usually memory assumed to be dynamic • Treat loads of invariant parts of structures, or functions, as static • Unchecked dispatching • If only one value of a static variable, don’t check in cache for correct version of dynamically compiled code

  9. Run-time optimizations • Complete loop unrolling • Based on polyvariant specialization • Completely eliminates unrolled loop • Copy propagation, dead-code elimination, strength reduction

  10. Example

  11. Example

  12. Results • Dynamic region performance

  13. Results • Whole program performance

  14. Results • Dynamic region performance - feature comparison

  15. Questions • How fair is it to place the burden of correctness on the programmer? • i.e. unchecked dispatching, static loads and calls • Loop unrolling can get out of hand • NXN matrix could get so big it doesn’t fit in cache • Given the variability in performance based on which optimizations are used, is this worth it?

  16. Selective, value-specific dynamic compilation • Research has shown that the overhead of run-time compilation amortized by increased efficiency of program • But this success is limited to single kernels • Dynamic compilation can’t cope “reasonably” with extra complexity of larger programs • What can we do about larger programs? • Some approaches exist, but haven’t made much progress

  17. Other optimizations • Internal promotions • Promotions at arbitrary program points in the middle of a dynamic region • Polyvariant division • Different combinations of static variables • Strength reduction • Using cheaper operations

  18. DyC Overhead • Cache lookups • Memory allocation • Handling dynamic branches • Checks for copy propagation • Dead-code elimination • Strength reduction • Operations to insure instruction-cache coherence • Instruction construction and emission • Branch patching • Hole patching • Static computations

  19. Workload Descriptions

  20. Workload optimizations

More Related