Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
RyuJIT Tutorial

RyuJIT

The Open Source Just in Time Compiler for .NET

WHEN & WHERE

This tutorial will be given at PLDI 2016.

ABSTRACT

This tutorial will present an introduction to RyuJIT (rē-yü-jit), an industry leading, high performance Just-in-Time compiler that supports the Microsoft .NET ecosystem. RyuJIT is also used to deliver world class performance on in house 1st party services like Office 365, Bing, and Exchange through innovative design and focus on business results. RyuJIT is shipping in the .NET 4.6 product and is now open source as part of CoreCLR.

An overview of the architecture of RyuJIT will be presented, including the internal representation (IR) and compilation phases with a focus on key design and implementation details that enable RyuJIT’s throughput/performance trade off. Participants will then be guided through the process of adding a simple feature to RyuJIT.

AUDIENCE

The tutorial will particularly benefit research or practitioner attendees who are interested in doing a research or product development involving new features, optimizations or targets for .NET. Attendees are encouraged to clone the repo and install the necessary tools (freely downloadable) in advance, in order to walk through the sample feature.

OUTLINE

The outline of the tutorial is as follows:

  • High-level overview of the architecture of the CoreCLR .NET runtime, and the role of the JIT:
    • How is RyuJIT invoked?
    • What are its inputs and outputs?
  • Internal Representation (IR) in RyuJIT:
    • What is the structure of the IR?
    • How do its characteristics vary during the compilation process?
  • Phases of RyuJIT:
    • What are the phases of compilation in RyuJIT?
    • What analyses does RyuJIT do and how are they captured?
    • What transformations are done, and what are their invariants?
  • Supporting technologies and components:
    • How does RyuJIT get information about the runtime environment?
    • How does RyuJIT do instruction encoding?
    • How is additional information collected and encoded for the garbage collector, the debugger and exception handling?
  • Building and running CoreCLR with RyuJIT
  • Dumps and other tools
  • Walkthrough of a new feature implementation in RyuJIT:
    • Adding a new IR instruction.
    • Adding a new instruction encoding.
    • Identifying a pattern in the incoming IL that can be transformed to use the new IR instruction.
  • Summary, takeaways and pointers to more information.
  • Q&A

OUTCOMES/CONCLUSION

Participants will walk away with an understanding of the RyuJIT code base, and the tools involved in developing new features and functionality for RyuJIT.

BIO

Carol Thompson Eidt is the lead architect on the RyuJIT compiler for .NET at Microsoft, continuing a lifetime passion for code transformation and performance. She joined Microsoft in 2005, after 22 years at HP. Her career has encompassed compiler optimization, code generation, instruction set architecture, dynamic translation, and systems management software. Carol has been actively involved in the Code Generation and Optimization symposium (CGO): serving as co-chair in 2012; co-chair of the program committee in 2011, as well as being a member of their program and steering committees for a number of years. She was on the design team for both the PA-RISC and Itanium architectures, designed and developed compiler optimization for both processor families, and has participated in the standardization of both C# and CLI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment