Mark Marron 1, Deepak Kapur 2, Manuel Hermenegildo 1 1 Imdea-Software (Spain) 2 University of New Mexico 1.

Slides:



Advertisements
Similar presentations
Dataflow Analysis for Datarace-Free Programs (ESOP 11) Arnab De Joint work with Deepak DSouza and Rupesh Nasre Indian Institute of Science, Bangalore.
Advertisements

Garbage Collection in the Next C++ Standard Hans-J. Boehm, Mike Spertus, Symantec.
Objects and Classes David Walker CS 320. Advanced Languages advanced programming features –ML data types, exceptions, modules, objects, concurrency,...
Garbage collection David Walker CS 320. Where are we? Last time: A survey of common garbage collection techniques –Manual memory management –Reference.
Object-Orientation Meets Big Data Language Techniques towards Highly- Efficient Data-Intensive Computing Harry Xu UC Irvine.
Shape Analysis by Graph Decomposition R. Manevich M. Sagiv Tel Aviv University G. Ramalingam MSR India J. Berdine B. Cook MSR Cambridge.
Context-Sensitive Interprocedural Points-to Analysis in the Presence of Function Pointers Presentation by Patrick Kaleem Justin.
Compilation 2011 Static Analysis Johnni Winther Michael I. Schwartzbach Aarhus University.
Pointer Analysis – Part I Mayur Naik Intel Research, Berkeley CS294 Lecture March 17, 2009.
Names and Bindings.
Program Representations. Representing programs Goals.
Graphs Chapter 12. Chapter Objectives  To become familiar with graph terminology and the different types of graphs  To study a Graph ADT and different.
Course Outline Introduction in algorithms and applications Parallel machines and architectures Overview of parallel machines, trends in top-500 Cluster.
Memory Management. History Run-time management of dynamic memory is a necessary activity for modern programming languages Lisp of the 1960’s was one of.
Objects and Classes David Walker CS 320. Advanced Languages advanced programming features –ML data types, exceptions, modules, objects, concurrency,...
Pointer and Shape Analysis Seminar Context-sensitive points-to analysis: is it worth it? Article by Ondřej Lhoták & Laurie Hendren from McGill University.
Representing programs Goals. Representing programs Primary goals –analysis is easy and effective just a few cases to handle directly link related things.
Data Parallel Algorithms Presented By: M.Mohsin Butt
Next Section: Pointer Analysis Outline: –What is pointer analysis –Intraprocedural pointer analysis –Interprocedural pointer analysis (Wilson & Lam) –Unification.
Previous finals up on the web page use them as practice problems look at them early.
Graphs Chapter 12. Chapter 12: Graphs2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study a Graph.
Tentative Schedule 20/12 Interpreter+ Code Generation 27/12 Code Generation for Control Flow 3/1 Activation Records 10/1 Program Analysis 17/1 Register.
Fall 2007CS 2251 Graphs Chapter 12. Fall 2007CS 2252 Chapter Objectives To become familiar with graph terminology and the different types of graphs To.
Chapter 12 Trees. Copyright © 2005 Pearson Addison-Wesley. All rights reserved Chapter Objectives Define trees as data structures Define the terms.
Comparison Caller precisionCallee precisionCode bloat Inlining context-insensitive interproc Context sensitive interproc Specialization.
Introduction to Code Generation Mooly Sagiv html:// Chapter 4.
ECE669 L23: Parallel Compilation April 29, 2004 ECE 669 Parallel Computer Architecture Lecture 23 Parallel Compilation.
Pointer analysis. Pointer Analysis Outline: –What is pointer analysis –Intraprocedural pointer analysis –Interprocedural pointer analysis Andersen and.
C o n f i d e n t i a l Developed By Nitendra NextHome Subject Name: Data Structure Using C Title: Overview of Data Structure.
Linear Scan Register Allocation POLETTO ET AL. PRESENTED BY MUHAMMAD HUZAIFA (MOST) SLIDES BORROWED FROM CHRISTOPHER TUTTLE 1.
Language Evaluation Criteria
Mark Marron IMDEA-Software (Madrid, Spain) 1.
Mark Marron IMDEA-Software (Madrid, Spain) 1.
Introduction Overview Static analysis Memory analysis Kernel integrity checking Implementation and evaluation Limitations and future work Conclusions.
Algorithm Programming Bar-Ilan University תשס"ח by Moshe Fresko.
Representing and Using Graphs
CSSE501 Object-Oriented Development. Chapter 12: Implications of Substitution  In this chapter we will investigate some of the implications of the principle.
Mark Marron, Mario Mendez-Lojo Manuel Hermenegildo, Darko Stefanovic, Deepak Kapur 1.
OOPLs /FEN March 2004 Object-Oriented Languages1 Object-Oriented Languages - Design and Implementation Java: Behind the Scenes Finn E. Nordbjerg,
1 Records Record aggregate of data elements –Possibly heterogeneous –Elements/slots are identified by names –Elements in same fixed order in all records.
Model construction and verification for dynamic programming languages Radu Iosif
1 Recursive Data Structure Profiling Easwaran Raman David I. August Princeton University.
Mark Marron IMDEA-Software (Madrid, Spain) 1.
Union-find Algorithm Presented by Michael Cassarino.
Convergence of Model Checking & Program Analysis Philippe Giabbanelli CMPT 894 – Spring 2008.
Computer Science Projects Internal Assessment. Mastery Item Claimed Justification Where Listed Random Access File – Searching Lines P. 53 Random.
Chapter 3 - Language Design Principles
Review 1 Queue Operations on Queues A Dequeue Operation An Enqueue Operation Array Implementation Link list Implementation Examples.
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University Merging Equivalent Contexts for Scalable Heap-cloning-based Points-to.
Pointer Analysis Survey. Rupesh Nasre. Aug 24, 2007.
An Efficient CUDA Implementation of the Tree-Based Barnes Hut n-body Algorithm By Martin Burtscher and Keshav Pingali Jason Wengert.
AQUASUN - GLSVLSI '02April 19, AQUASUN: an adaptable 2D range index for CAD applications Michiel De Wilde Ghent University, Belgium.
Graphs Chapter 12. Chapter 12: Graphs2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study a Graph.
Mark Marron 1, Deepak Kapur 2, Manuel Hermenegildo 1 1 Imdea-Software (Spain) 2 University of New Mexico 1.
Pointer Analysis – Part I CS Pointer Analysis Answers which pointers can point to which memory locations at run-time Central to many program optimization.
GC Assertions: Using the Garbage Collector To Check Heap Properties Samuel Z. Guyer Tufts University Edward Aftandilian Tufts University.
Eliminating External Fragmentation in a Non-Moving Garbage Collector for Java Author: Fridtjof Siebert, CASES 2000 Michael Sallas Object-Oriented Languages.
Object Lifetime and Pointers
Advanced Computer Systems
Data Types In Text: Chapter 6.
Matlab.
Spring 2016 Program Analysis and Verification
Compositional Pointer and Escape Analysis for Java Programs
Hashing Exercises.
Capriccio – A Thread Model
Course Outline Introduction in algorithms and applications
Pointer analysis.
Introduction to Data Structure
Course Overview PART I: overview material PART II: inside a compiler
Presentation transcript:

Mark Marron 1, Deepak Kapur 2, Manuel Hermenegildo 1 1 Imdea-Software (Spain) 2 University of New Mexico 1

 Want to identify regions (sets of objects) that are conceptually related  Conceptually related Same recursive data structure Stored in equivalent locations (e.g., same array)  Extract information via static analysis  Apply memory optimizations on regions instead of over entire heap Region Allocation/Collection Region/Parallel GC Optimized Layout 2

 Must be Dynamic Variable based partitions too coarse, do not represent composition well. Allocation site based too imprecise, can cause spurious grouping of objects.  Must be Repartitionable Want to track program splitting and merging regions: list append, subset operations. 3

 Base on storage shape graph Nodes represent sets of objects (or recursive data structures), edges represent sets of pointers Has natural representation heap regions and relations between them Efficient  Annotate nodes and edges with additional instrumentation properties For region identification only need type information 4

 Recursive Structures Group objects representing same recursive structure, keep distinct from other recursive structures  References Group objects stored in similar sets of locations together (objects in A, in B, both A and B)  Composite Structures Group objects in each subcomponent, group similar components hierarchically 5

 The general approach taken to Identifying Recursive Data Structures is well known Look at type information to determine which objects may be part of a recursive structure Based on connectivity group these recursive objects together  Two subtle distinctions made in this work Only group objects in complete recursive structure Ignore back pointers in computing complete recursive structures 6

7 class Enode { Enode[] fromN; … }

 The grouping of objects that are in the same container or related composite structures is more difficult  Given regions R, R’ when do they represent conceptually equivalent sets of objects Stored in the same types of locations (variables, collections, referred to by same object fields) Have same type of recursive signature (can split leaf contents of recursive structures from internal recursive component) 8

9

 N-Body Simulation in 3-dimensions  Uses Fast Multi-Pole method with space decomposition tree For nearby bodies use naive n 2 algorithm For distant bodies compute center of mass of many bodies and treat as single point mass 10

11

12 for(…) { root = null; makeTree(); Iterator bm = this.bodyTabRev.iterator(); while(bm.hasNext()) bm.next().hackGravity(root); Iterator bp = this.bodyTabRev.iterator(); while(bm.hasNext()) bm.next().propUpdatedAccel(); }

 Statically collect, space decomposition tree and all MathVector/double[] objects (11% of GC work). 13

 GC objects reachable from the acc/vel fields in parallel with the hackGravity method (no overhead). 14

 Inline Double[] into MathVector objects, 23% serial speedup 37% memory use reduction. 15

BenchmarkLOCAnalysis Time Analysis Memory Region Ok tsp s<30 MBY em3d s<30 MBY voronoi s<30 MBY bh s<30 MBY db s<30 MBY raytrace s38 MBY exp s48 MBY debug s122 MBY 16

 Simple interpreter and debug environment for large subset of Java language  14,000+ Loc (in normalized form), 90 Classes Additional 1500 Loc for specialized standard library handling stubs.  Large recursive call structures, large inheritance trees with numerous virtual method implementations  Wide range of data structure types, extensive use of java.util collections, heap contains both shared and unshared structures. 17

 Region Information provides excellent basis for driving many memory optimizations and supporting other analysis work  A simple set of heuristics (when taking into account a few subtleties) is sufficient for grouping memory objects  Recent work shows excellent scalability on non-trivial programs  Further work on developing robust infrastructure for further evaluation and applications 18

19

 Many programs (particularly OO programs) use back pointers to parent objects Makes type recursive even though structure is finite Can lead to grouping many structures that are conceptually distinct in the program Simply ignore them based on depth from roots  Similarly want to wait until structures are finished before merging them Preserves analysis precision during construction of recursive structures Prevents grouping of objects that have recursive types but are used in finite heap structures 20

 Using heuristics based on declared type information and connectivity group Objects that make up recursive data structures Objects that are stored in the same sets of containers (arrays, java.util collections) Objects that are in the same kind of composite structure  Use incremental approach to identify these structures (for efficiency in dataflow analysis) 21

22 exp vars Heap

23 exp vars {+, -, *, /} {Const} {Var} {Var[]}

24

25

26

27

28

 We have the core of a practical heap analysis technique Performance:  Analyze moderate size non-trivial Java programs  Runtime on the order of 10s of seconds  Recent work should improve scalability Accuracy:  Precisely represent connectivity, sharing, shape properties + region and dependence information Qualitatively Useful  Used results in multiple optimization domains  Want to apply tool to other problems, work on improvements in frontend, IR and exporting results 29

Demo of the shape analysis and benchmark code available at:

31 exp vars Heap {+, -, *, /}

32 exp vars Heap {+, -, *, /} {Const} {Var}