Building on Phoenix Michael D. Smith Harvard University © Copyright by Michael D. Smith 2005 All rights reserved.

Slides:



Advertisements
Similar presentations
Compiler Support for Superscalar Processors. Loop Unrolling Assumption: Standard five stage pipeline Empty cycles between instructions before the result.
Advertisements

P3 / 2004 Register Allocation. Kostis Sagonas 2 Spring 2004 Outline What is register allocation Webs Interference Graphs Graph coloring Spilling Live-Range.
7. Optimization Prof. O. Nierstrasz Lecture notes by Marcus Denker.
Dynamic Optimization using ADORE Framework 10/22/2003 Wei Hsu Computer Science and Engineering Department University of Minnesota.
University of Maryland Smarter Code Generation for Dyninst Nick Rutar.
Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
Dynamic Branch PredictionCS510 Computer ArchitecturesLecture Lecture 10 Dynamic Branch Prediction, Superscalar, VLIW, and Software Pipelining.
Pipelining 5. Two Approaches for Multiple Issue Superscalar –Issue a variable number of instructions per clock –Instructions are scheduled either statically.
Stanford University CS243 Winter 2006 Wei Li 1 Register Allocation.
Register Allocation CS 671 March 27, CS 671 – Spring Register Allocation - Motivation Consider adding two numbers together: Advantages: Fewer.
1 Lecture 10: Static ILP Basics Topics: loop unrolling, static branch prediction, VLIW (Sections 4.1 – 4.4)
Zhiguo Ge, Weng-Fai Wong, and Hock-Beng Lim Proceedings of the Design, Automation, and Test in Europe Conference, 2007 (DATE’07) April /4/17.
Overview Motivations Basic static and dynamic optimization methods ADAPT Dynamo.
Program Representations. Representing programs Goals.
Pin : Building Customized Program Analysis Tools with Dynamic Instrumentation Chi-Keung Luk, Robert Cohn, Robert Muth, Harish Patil, Artur Klauser, Geoff.
1 S. Tallam, R. Gupta, and X. Zhang PACT 2005 Extended Whole Program Paths Sriraman Tallam Rajiv Gupta Xiangyu Zhang University of Arizona.
The Path to Multi-core Tools Paul Petersen. Multi-coreToolsThePathTo 2 Outline Motivation Where are we now What is easy to do next What is missing.
6/9/2015© Hal Perkins & UW CSEU-1 CSE P 501 – Compilers SSA Hal Perkins Winter 2008.
TM Pro64™: Performance Compilers For IA-64™ Jim Dehnert Principal Engineer 5 June 2000.
Representing programs Goals. Representing programs Primary goals –analysis is easy and effective just a few cases to handle directly link related things.
Cpeg421-08S/final-review1 Course Review Tom St. John.
Previous finals up on the web page use them as practice problems look at them early.
Machine SUIF Michael D. Smith Harvard University Division of Engineering and Applied Sciences June 2000 © Copyright by Michael D. Smith 2000 All rights.
Register Allocation (via graph coloring)
1 Liveness analysis and Register Allocation Cheng-Chia Chen.
Recap from last time: live variables x := 5 y := x + 2 x := x + 1 y := x y...
Wrapping Up Copyright 2003, Keith D. Cooper, Ken Kennedy & Linda Torczon, all rights reserved.
Introduction to Code Generation Copyright 2003, Keith D. Cooper, Ken Kennedy & Linda Torczon, all rights reserved.
Direction of analysis Although constraints are not directional, flow functions are All flow functions we have seen so far are in the forward direction.
Register Allocation and Spilling via Graph Coloring G. J. Chaitin IBM Research, 1982.
LLVM Developed by University of Illinois at Urbana-Champaign CIS dept Cisc 471 Matthew Warner.
Precision Going back to constant prop, in what cases would we lose precision?
Antigone Engine Kevin Kassing – Period
Topic #10: Optimization EE 456 – Compiling Techniques Prof. Carl Sable Fall 2003.
Analyzing parallel programs with Pin Moshe Bach, Mark Charney, Robert Cohn, Elena Demikhovsky, Tevi Devor, Kim Hazelwood, Aamer Jaleel, Chi- Keung Luk,
Dataflow Frequency Analysis based on Whole Program Paths Eduard Mehofer Institute for Software Science University of Vienna
Java Virtual Machine Case Study on the Design of JikesRVM.
U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Optimizing Compilers CISC 673 Spring 2009 Register Allocation John Cavazos University.
CMPE 511 Computer Architecture A Faster Optimal Register Allocator Betül Demiröz.
 2007 Pearson Education, Inc. All rights reserved C Functions -Continue…-
1 Optimizing compiler tools and building blocks project Alexander Drozdov, PhD Sergey Novikov, PhD.
CS 671 Compilers Prof. Kim Hazelwood Spring 2008.
Compiler Principles Fall Compiler Principles Lecture 0: Local Optimizations Roman Manevich Ben-Gurion University.
U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Optimizing Compilers CISC 673 Spring 2009 Overview of Compilers and JikesRVM John.
Introduction to Code Generation Copyright 2003, Keith D. Cooper, Ken Kennedy & Linda Torczon, all rights reserved. Students enrolled in Comp 412 at Rice.
CSCI1600: Embedded and Real Time Software Lecture 33: Worst Case Execution Time Steven Reiss, Fall 2015.
CS412/413 Introduction to Compilers Radu Rugina Lecture 18: Control Flow Graphs 29 Feb 02.
1 Control Flow Graphs. 2 Optimizations Code transformations to improve program –Mainly: improve execution time –Also: reduce program size Can be done.
High Performance Embedded Computing © 2007 Elsevier Lecture 10: Code Generation Embedded Computing Systems Michael Schulte Based on slides and textbook.
3/2/2016© Hal Perkins & UW CSES-1 CSE P 501 – Compilers Optimizing Transformations Hal Perkins Autumn 2009.
1 ROGUE Dynamic Optimization Framework Using Pin Vijay Janapa Reddi PhD. Candidate - Electrical And Computer Engineering University of Colorado at Boulder.
Michael J. Voss and Rudolf Eigenmann PPoPP, ‘01 (Presented by Kanad Sinha)
Welcome! Simone Campanoni
R Byte Code Optimization Compiler (1) March
An Efficient Compilation Framework for Languages Based on a Concurrent Process Calculus Yoshihiro Oyama Kenjiro Taura Akinori Yonezawa Yonezawa Laboratory.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Phoenix Based Dynamic Slicing Debugging Tool Eric Cheng Lin Xu Matt Gruskin Ravi Ramaseshan Microsoft Phoenix Intern Team (Summer '06)
Performance Optimizations in Dyninst
Optimizing Compilers Background
Online Subpath Profiling
Assembler Design Options
Methodology of a Compiler that Compresses Code using Echo Instructions
Module 1: Getting Started
Introduction to Code Generation
Optimizing Transformations Hal Perkins Autumn 2011
Wrapping Up Copyright 2003, Keith D. Cooper, Ken Kennedy & Linda Torczon, all rights reserved. Students enrolled in Comp 412 at Rice University have explicit.
Optimizing Transformations Hal Perkins Winter 2008
Optimization.
CSE P 501 – Compilers SSA Hal Perkins Autumn /31/2019
Presentation transcript:

Building on Phoenix Michael D. Smith Harvard University © Copyright by Michael D. Smith 2005 All rights reserved.

2 Wonderful Opportunity Compilation creeping into everything virtual execution environments security systems instrumentation tools Phoenix is a substrate that could unify these efforts allow me to focus on research and not infrastructure building

3 The Next 10 Minutes How I’m moving my research to Phoenix static compilation dynamic optimization (security and privacy) Why I’m hiding Phoenix as the substrate simplify the system for teaching minimize impact of future changes make extensions indistinguishable from that which is directly supported

4 Successful Transition A generalized algorithm for graph-coloring register allocation [ PLDI’04 ] we’ve made Chaitin’s approach simple to apply to real machines Used Phoenix’s extensibility features wrote a Phx.PlugIn replaces current register allocation phase didn’t extend Phx.IR, but did define new data structures built from existing classes

5 Research Work In-Progress New efforts in dynamic optimization Driving observation: runtime opt. differs from compile-time opt. opt. effort should pay off contextual info is costly Current research thrusts: phase ordering and combining optimizations [ PLDI’05 poster ] region selection [ in submission ]

6 Varia: Inference-driven Opt. Kelly Heffner and Kevin Redwine Tool for exploring opt. space represent opts. as inference rules explore space using a rules engine Easy to define new opts. combine opts. Many challenges x is dead after i i does not read x x is dead before i … x is dead after i … x is dead before i … i does not read x … … x is dead after i … i does not read x … facts rules facts match rule preconditions rule fires, producing a new fact

7 Improving Region Selection in Dynamic Optimization Systems David Hiniker and Kim Hazelwood A good region-selection algorithm limits profiling and optimization overheads brings together frequently executing code Two choices today: whole methods (for JIT compilation) traces (for everything else) Our current goal: beat Dynamo’s Next-Executing Tail (NET)

8 Our Proposed Techniques Last-Executed Iteration (LEI) select more traces that span loops avoid duplicating nested loops Trace Combination allow regions to include multiple overlapping paths reduces problems of separation and duplication in LEI & NET Open Question: better for optimization?

9 OPI/Phoenix Port (and update) of OPI/SUIF OPI: Optimization Programming Interface isolates opt. passes from substrate produces clean, textbook-like code puts core system features and later extensions on equal footing Result is a system that is better for teaching better for long-term research

10 History OPI/SUIF grew out of concurrent development of SUIF and Machine SUIF SUIF was substrate for Machine SUIF Headaches: we hated it when they (inevitably) changed some aspect of SUIF we didn’t “own” the source to SUIF and wanted different capabilities in the core

11 History Repeats OPI/SUIF grew out of concurrent development of SUIF and Machine SUIF and our users’ extensions Machine SUIF was substrate for x-SUIF Headaches: our users hated it when we (inevitably) changed some aspect of Machine SUIF our users didn’t “own” the source to Machine SUIF and wanted different capabilities in the core

12 Applicability to Phoenix The research community will use (not own) Phoenix The Phoenix API is still evolving Andy Ayers recently spoke for 135 min. and only gave a “superficial overview”on the Phoenix IR, symbols, and types Phoenix has been built to be extensible can decorate IR objects and grab control but no guidelines on how to produce compatible extensions

13 OPI/SUIF Code Example // Spill i-th source operand of instruction at h in // CFG node n, inserting a register-load instruction // just before h. void spill_src(InstrHandle h, int i, CfgNode* node) { Instr* instr = *h; Opnd opnd = get_src(instr, i); TypeId type = get_type(opnd); // replace operand by virtual register Opnd vr = opnd_reg(type); set_src(instr, i, vr); // load spilled value before original instruction Instr* ld = new_instr_alm(vr, load_opcode(t), opnd); insert_before(node, h, ld); } Key: OPI IR types in red. OPI functions in blue.

14 OPI/Phoenix Code Example // Spill i-th source operand of instruction at h in // CFG node n, inserting a register-load instruction // just before h. public void SpillSrc(InstrHandle h, int i, CfgNode node) { Instr instr = h.Value; Opnd opnd = GetSrc(instr, i); Type type = GetType(opnd); // replace operand by virtual register Opnd vr = NewOpndReg(type); SetSrc(instr, i, vr); // load spilled value before original instruction Instr ld = NewInstrAlm(vr, LoadOpcode(type), opnd); InsertBefore(node, h, ld); } Key: OPI IR types in red. OPI functions in blue.

15 Updates and Differences C# instead of C++ OO style, instead of C style stylistically better iterators etc. Machine SUIF included the development of a new LIR Phoenix provides us with a LIR eliminate IR stuff that crept into definition of OPI/SUIF

16 Conclusion We’re looking to use Phoenix in many different research projects common thread: the need to generate, analyze, or optimize code We’re also looking to make Phoenix an outstanding platform for pedagogy research that builds on the work of others