CGO 2012 tutorial
From ildjit
A tutorial on ILDJIT will be presented at CGO 2012 (International Symposium on Code Generation and Optimization).
We believe ILDJIT can be useful to anyone doing research on compilation or computer architecture.
The tutorial at CGO will be interactive with "hands on" problem solving in areas of interest to the participants.
Abstract
ILDJIT is a mature, open source, publicly available compilation framework that includes both static and dynamic compilers. Examples of well known benchmark suites supported by ILDJIT are SPEC CPU2000, SPEC CPU2006, MiBench and PARSEC. ILDJIT provides a plugin-based framework for static, as well as dynamic tasks like code translation, code analysis, code optimization, runtime instrumentation and memory management. Its plugin-based framework allows users to easily customize execution both at installation time and at run-time (by dynamically loading and unloading plugins without perturbing execution). Moreover, its multi-threaded design allows novel introspection of parallel compilation strategies to reduce overheads and dynamically optimize running code on today's x86 multi-core systems.
The framework provides a rich intermediate language IR, which users can exploit inside their own extensions. ILDJIT allows users to choose which extensions to execute at static time and which ones to execute at runtime. In order to simplify the implementation of high level code analysis, IR includes both simple RISC-like instructions (e.g. load, store, add) and high level operations. High level operations include both classic thread synchronization tasks, such as wait for another thread, create thread, memory barriers and memory management tasks, such as create a new array, free a piece of memory and create a new aligned piece of memory.
ILDJIT supports the CIL language, which includes the full information of the source language by having a rich set of metadata. Nowadays, several source languages are successfully translated to CIL including C, C++, C#, Java, Python and LISP. Hence, by providing the full support of the complex CIL language, ILDJIT is able to manage, analyze and optimize all of the above languages. Users of ILDJIT do not need to handle unnecessary details of the source language used because they can rely on the IR of ILDJIT to perform their tasks.
We believe ILDJIT is useful to anyone interested in compilers and computer architecture research. It provides a platform for dynamically introspecting and performing code transformations on CIL bytecode programs. These management environments are emerging as the dominant front for run-time execution because of their platform-independent interoperability. In this tutorial, we demonstrate how users can exploit the ILDJIT framework for research-specific purposes. We will compare and contrast the ease of using ILDJIT relative to more commonly known tools like PIN and Dynamo. We will also demonstrate the ease of using ILDJIT relative to its CIL counterparts like Mono, DotNet and DotGNU that, while robust, are not well suited for research purposes. Design and development of software includes the monitoring of its runtime behaviors (e.g. for performance or memory usage evaluation), which depend on both the underlying platform and the compilation process. On the other hand, the design of new hardware includes evaluation of both its performance and power consumption while running software that expose typical workloads. Hence, both software and hardware evaluation need runtime analysis, which should also include static or dynamic software transformations.
Tutorial Objective
The tutorial provides a detailed look at ILDJIT aimed at both researchers and students. Participants will learn how to use ILDJIT and how it works. Participants will obtain a good understanding of the ILDJIT API, used for writing framework extensions that analyze and transform programs either at compile time or run time.
During this tutorial, we will extend the framework together, starting with a simple extension and moving to more complex ones. Extensions will be implemented in either C or C++ and we will test them on top of the virtual machine, which participants can download and use during the tutorial.
Requests
If there are specific topics you would like covered during the tutorial (such as code versioning, run time path analysis, or the like), please send requests right away to us.
Organizers
- Glenn Holloway
Speaker
Tutorial session
8:30 - 10:30: First part
- Overview
- Input Language
- Execution Models
10:30 - 11:00: Coffee break
11:00 - 12:00: Second part
- IR API
- A simple extension: codetool
- A simple extension: optimizationleveltool
12:00 - 1:30: Lunch break
1:30 - 3:30: Third part
- IR language
- Example of analysis: static and dynamic instructions
- Example of dynamic data profiler
- Example of runtime code versioning
3:30 - 4:00: Coffee break
4:00 - 5:00: Fourth part
- Internals of ILDJIT
- Dynamic Look-Ahead compilation
- Wrap up
Slides
Slides are available in PDF.
Virtual Machine
Download the VirtualBox virtual machine where ILDJIT has been installed and try the extensions used during this tutorial that you can find in the virtual machine or in this package.
