reducing dynamic compilation latency
play

Reducing Dynamic Compilation Latency Igor Bhm P rocessor A utomated - PowerPoint PPT Presentation

LLVM12 - European Conference, London Reducing Dynamic Compilation Latency Igor Bhm P rocessor A utomated S ynthesis by i T erative A nalysis The U niversity o f E dinburgh LLVM12 - European Conference, London Concurrent and Parallel


  1. LLVM’12 - European Conference, London Reducing Dynamic Compilation Latency Igor Böhm P rocessor A utomated S ynthesis by i T erative A nalysis The U niversity o f E dinburgh

  2. LLVM’12 - European Conference, London Concurrent and Parallel Dynamic Compilation Igor Böhm P rocessor A utomated S ynthesis by i T erative A nalysis The U niversity o f E dinburgh

  3. Dynamic Compilation What do we want to improve? Native Code Execution Interpretation Interp Native Interp Native Interp Native Time 2

  4. Dynamic Compilation What do we want to improve? Native Code Execution Interpretation Interp Native Interp Native Interp Native Time initially code is interpreted 2

  5. Dynamic Compilation What do we want to improve? Native Code Execution Interpretation Interp Native Interp Native Interp Native Time initially code is interpreted frequently executed code is compiled on-the-fly 2

  6. Dynamic Compilation What do we want to improve? Native Code Execution Interpretation Interp Native Interp Native Interp Native Time initially code is interpreted frequently executed code is compiled on-the-fly switch from interpretive to native code execution as soon as dynamically compiled code is available 2

  7. Dynamic Compilation What do we want to improve? Native Code Execution Interpretation Interp Native slow fast slow fast Interp Native Interp Native Time initially code is interpreted frequently executed code is compiled on-the-fly switch from interpretive to native code execution as soon as dynamically compiled code is available 2

  8. Dynamic Compilation What do we want to improve? Native Code Execution Interpretation Interp Native slow fast slow fast Native Interp Native Interp Interp Native Interp Native Time Earlier transition from interpretive to native execution 2

  9. Dynamic Compilation Interpretation Interp Compile Native Code Execution Interpretation with Profiling Profile Native 1 Dynamic Compilation using one Concurrent JIT Compiler Main Thread Time Interp Profile Interp Native Interp Profile Interp Profile Native Compiler Thread Time Thread 1 Compile Compile Compile 3

  10. Dynamic Compilation Interpretation Interp Compile Native Code Execution Interpretation with Profiling Profile Native 1 Dynamic Compilation using one Concurrent JIT Compiler Main Thread Time Interp Profile Interp Native Interp Profile Interp Profile Native Compiler Thread Time Thread 1 Compile Compile Compile 3

  11. Dynamic Compilation Interpretation Interp Compile Native Code Execution Interpretation with Profiling Profile Native 1 Dynamic Compilation using one Concurrent JIT Compiler Main Thread Time Interp Profile Interp Native Interp Profile Interp Profile Native Compiler Thread Time Thread 1 Compile Compile Compile 3

  12. Dynamic Compilation Interpretation Interp Compile Native Code Execution Interpretation with Profiling Profile Native 1 Dynamic Compilation using one Concurrent JIT Compiler Main Thread Time Interp Profile Interp Native Interp Profile Interp Profile Native Compiler Thread Time critical path Thread 1 Compile Compile Compile 3

  13. Dynamic Compilation Interpretation Interp Compile Native Code Execution Interpretation with Profiling Profile Native 1 Dynamic Compilation using one Concurrent JIT Compiler Main Thread Time Interp Profile Interp Native Interp Profile Interp Profile Native Compiler Thread Time critical path Thread 1 Compile Compile Compile 2 Dynamic Compilation using Concurrent and Parallel JIT Compiler Task Farm Main Thread Time Profile Native Profile Native Profile Native 3

  14. Dynamic Compilation Interpretation Interp Compile Native Code Execution Interpretation with Profiling Profile Native 1 Dynamic Compilation using one Concurrent JIT Compiler Main Thread Time Interp Profile Interp Native Interp Profile Interp Profile Native Compiler Thread Time critical path Thread 1 Compile Compile Compile 2 Dynamic Compilation using Concurrent and Parallel JIT Compiler Task Farm Main Thread Time Profile Native Profile Native Profile Native 3

  15. Dynamic Compilation Interpretation Interp Compile Native Code Execution Interpretation with Profiling Profile Native 1 Dynamic Compilation using one Concurrent JIT Compiler Main Thread Time Interp Profile Interp Native Interp Profile Interp Profile Native Compiler Thread Time critical path Thread 1 Compile Compile Compile 2 Dynamic Compilation using Concurrent and Parallel JIT Compiler Task Farm Main Thread Time Profile Native Profile Native Profile Native Compiler Thread Time Thread 1 Compile Compile Compile Compile Compiler Thread Time Thread 2 Compile Compile Compiler Thread Time Thread 3 Compile Compile Compile 3

  16. Dynamic Compilation Interpretation Interp Compile Native Code Execution Interpretation with Profiling Profile Native 1 Dynamic Compilation using one Concurrent JIT Compiler Main Thread Time Interp Profile Interp Native Interp Profile Interp Profile Native Compiler Thread Time critical path Thread 1 Compile Compile Compile 2 Dynamic Compilation using Concurrent and Parallel JIT Compiler Task Farm Main Thread Time Profile Native Profile Native Profile Native Compiler Thread Time Thread 1 Compile Compile Compile Compile Compiler Thread Time Thread 2 Compile Compile Compiler Thread Time Thread 3 Compile Compile Compile 3

  17. Dynamic Compilation Interpretation Interp Compile Native Code Execution Interpretation with Profiling Profile Native 1 Dynamic Compilation using one Concurrent JIT Compiler Main Thread Time Interp Profile Interp Native Interp Profile Interp Profile Native Compiler Thread Time critical path Thread 1 Compile Compile Compile 2 Dynamic Compilation using Concurrent and Parallel JIT Compiler Task Farm Main Thread Time Profile Native Profile Native Profile Native critical path Compiler Thread Time Thread 1 Compile Compile Compile Compile Compiler Thread Time Thread 2 Compile Compile Compiler Thread Time Thread 3 Compile Compile Compile 3

  18. Solution To Dynamic Compilation Latency Problem Concurrent and Parallel Dynamic Compilation Main Thread Time Profile Native Profile Native Profile Native Compiler Thread Time Thread 1 Compile Compile Compile Compile Compiler Thread Time Thread 2 Compile Compile Compiler Thread Time Thread 3 Compile Compile Compile 4

  19. Solution To Dynamic Compilation Latency Problem improve code discovery/profiling Concurrent and Parallel Dynamic Compilation Main Thread Time Profile Native Profile Native Profile Native Compiler Thread Time Thread 1 Compile Compile Compile Compile Compiler Thread Time Thread 2 Compile Compile Compiler Thread Time Thread 3 Compile Compile Compile 4

  20. Solution To Dynamic Compilation Latency Problem improve code discovery/profiling improve dynamic compilation workload throughput Concurrent and Parallel Dynamic Compilation Main Thread Time Profile Native Profile Native Profile Native Compiler Thread Time Thread 1 Compile Compile Compile Compile Compiler Thread Time Thread 2 Compile Compile Compiler Thread Time Thread 3 Compile Compile Compile 4

  21. How hard can Code Discovery be? 5

  22. How hard can Code Discovery be? Static Java byte-code JavaScript CIL 5

  23. How hard can Code Discovery be? Static Dynamic Java ARCompact byte-code binary x86 ARM JavaScript binary CIL binary 5

  24. How hard can Code Discovery be? “ A crucial problem in the decompilation or disassembly of computer programs is the identification of executable code, i.e. the separation of instructions from data. This problem, for most computer architectures, is equivalent to the Halting Problem and is therefore unsolvable in general. ” [Horspool and Marovac - 1980] 5

  25. Incremental Code Discovery Trace Interval Time A B C D E F G A F G A B I F G Sequence of interpreted basic blocks A Basic Block C FG Edges Return to Interpreter 6

  26. Incremental Code Discovery Trace Interval Time A B C D E F G A F G A B I F G 1 t' 1 Region after t' A B C D A Basic Block C FG Edges Return to Interpreter 6

  27. Incremental Code Discovery Trace Interval Time A B C D E F G A F G A B I F G 2 1 t'' t' 2 Region after t'' 1 Region after t' A A B B C C D D E A Basic Block F C FG Edges Return to G Interpreter 6

  28. Incremental Code Discovery Trace Interval Time A B C D E F G A F G A B I F G 3 2 1 t'' t''' t' 2 Region after t'' 3 1 Region after t''' Region after t' A A A B H B B C C C D D D E E I A Basic Block F F C FG Edges Return to G G Interpreter 6

  29. Incremental Code Discovery Trace Interval Time A B C D E F G A F G A B I F G 3 t''' 3 Region after t''' A H B Region == Dynamic CFG C D E I A Basic Block F C FG Edges Return to G Interpreter 6

  30. Concurrent and Parallel JIT Compilation in Action (reducing the critical path) Dynamic Code Discovery Native Code Execution Trace Native Simulation Native Trace Native Trace Native Trace 7

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend