Data Flow Analysis for Software Prefetching Linked Data Structures in Java Brendon Cahoon Dept. of Computer Science University of Massachusetts Amherst,

Slides:



Advertisements
Similar presentations
Chapter 22 Implementing lists: linked implementations.
Advertisements

Stacks, Queues, and Linked Lists
Linked Lists Linked Lists Representation Traversing a Linked List
P3 / 2004 Register Allocation. Kostis Sagonas 2 Spring 2004 Outline What is register allocation Webs Interference Graphs Graph coloring Spilling Live-Range.
School of EECS, Peking University “Advanced Compiler Techniques” (Fall 2011) Parallelism & Locality Optimization.
The University of Adelaide, School of Computer Science
Linked Lists. 2 Merge Sorted Lists Write an algorithm that merges two sorted linked lists The function should return a pointer to a single combined list.
Pointer Analysis – Part I Mayur Naik Intel Research, Berkeley CS294 Lecture March 17, 2009.
Chapter 17 Linked List Saurav Karmakar Spring 2007.
M180: Data Structures & Algorithms in Java
Linked Lists Compiled by Dr. Mohammad Alhawarat CHAPTER 04.
Praveen Yedlapalli Emre Kultursay Mahmut Kandemir The Pennsylvania State University.
Introduction to Advanced Topics Chapter 1 Mooly Sagiv Schrierber
Lecture 8 CS203. Implementation of Data Structures 2 In the last couple of weeks, we have covered various data structures that are implemented in the.
Chapter 1 Object Oriented Programming. OOP revolves around the concept of an objects. Objects are crated using the class definition. Programming techniques.
1 Chapter 24 Lists Stacks and Queues. 2 Objectives F To design list with interface and abstract class (§24.2). F To design and implement a dynamic list.
Establishing Local Temporal Heap Safety Properties with Applications to Compile-Time Memory Management Ran Shaham Eran Yahav Elliot Kolodner Mooly Sagiv.
Next Section: Pointer Analysis Outline: –What is pointer analysis –Intraprocedural pointer analysis –Interprocedural pointer analysis (Wilson & Lam) –Unification.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Advanced Compilers CMPSCI 710.
1 Improving Hash Join Performance through Prefetching _________________________________________________By SHIMIN CHEN Intel Research Pittsburgh ANASTASSIA.
Cache Conscious Allocation of Pointer Based Data Structures, Revisited with HW/SW Prefetching by: Josefin Hallberg, Tuva Palm and Mats Brorsson Presented.
Address-Value Delta (AVD) Prediction Onur Mutlu Hyesoon Kim Yale N. Patt.
Pointer analysis. Pointer Analysis Outline: –What is pointer analysis –Intraprocedural pointer analysis –Interprocedural pointer analysis Andersen and.
Improving the Performance of Object-Oriented Languages with Dynamic Predication of Indirect Jumps José A. Joao *‡ Onur Mutlu ‡* Hyesoon Kim § Rishi Agarwal.
Procedure Optimizations and Interprocedural Analysis Chapter 15, 19 Mooly Sagiv.
P ARALLEL P ROCESSING I NSTITUTE · F UDAN U NIVERSITY 1.
Data Structures Week 5 Further Data Structures The story so far  We understand the notion of an abstract data type.  Saw some fundamental operations.
CSE 131 Computer Science 1 Module 9: Linked Lists Using references to link objects Basic operations on linked lists Implementing a linked list of integers.
Putting Pointer Analysis to Work Rakesh Ghiya and Laurie J. Hendren Presented by Shey Liggett & Jason Bartkowiak.
Understanding Parallelism-Inhibiting Dependences in Sequential Java Programs Atanas (Nasko) Rountev Kevin Van Valkenburgh Dacong Yan P. Sadayappan Ohio.
Hybrid-Scheduling: A Compile-Time Approach for Energy–Efficient Superscalar Processors Madhavi Valluri and Lizy John Laboratory for Computer Architecture.
1 Advance Computer Architecture CSE 8383 Ranya Alawadhi.
Mark Marron, Mario Mendez-Lojo Manuel Hermenegildo, Darko Stefanovic, Deepak Kapur 1.
CS 46B: Introduction to Data Structures July 9 Class Meeting Department of Computer Science San Jose State University Summer 2015 Instructor: Ron Mak
Dynamic Object Sampling for Pretenuring Maria Jump Department of Computer Sciences The University of Texas at Austin Stephen M. Blackburn.
School of Engineering and Computer Science, Victoria University of Wellington COMP 103 Linked Structures.
Static Program Analysis of Embedded Software Ramakrishnan Venkitaraman Graduate Student, Computer Science Advisor: Dr. Gopal Gupta.
Sys. Prog & Scripting - Heriot Watt Univ 1 Systems Programming & Scripting Lecture 9: Systems Programming in C#
OOPLs /FEN March 2004 Object-Oriented Languages1 Object-Oriented Languages - Design and Implementation Java: Behind the Scenes Finn E. Nordbjerg,
Lists II. List ADT When using an array-based implementation of the List ADT we encounter two problems; 1. Overflow 2. Wasted Space These limitations are.
1 Recursive Data Structure Profiling Easwaran Raman David I. August Princeton University.
4-1 Topic 6 Linked Data Structures. 4-2 Objectives Describe linked structures Compare linked structures to array- based structures Explore the techniques.
Lists Chapter 8. 2 Linked Lists As an ADT, a list is –finite sequence (possibly empty) of elements Operations commonly include: ConstructionAllocate &
Carnegie Mellon Compiler Optimization of Memory-Resident Value Communication Between Speculative Threads Antonia Zhai, Christopher B. Colohan, J. Gregory.
Precomputation- based Prefetching By James Schatz and Bashar Gharaibeh.
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University Merging Equivalent Contexts for Scalable Heap-cloning-based Points-to.
1 Linked Lists (Lec 6). 2  Introduction  Singly Linked Lists  Circularly Linked Lists  Doubly Linked Lists  Multiply Linked Lists  Applications.
Pointer Analysis – Part I CS Pointer Analysis Answers which pointers can point to which memory locations at run-time Central to many program optimization.
Circular linked list A circular linked list is a linear linked list accept that last element points to the first element.
Data Structure & Algorithms
Linked Lists Chapter Introduction To The Linked List ADT Linked list: set of data structures (nodes) that contain references to other data structures.
Memory Management in Java Mr. Gerb Computer Science 4.
CSC 143 P 1 CSC 143 Recursion [Chapter 5]. CSC 143 P 2 Recursion  A recursive definition is one which is defined in terms of itself  Example:  Compound.
Copyright © 2012 Pearson Education, Inc. Chapter 17: Linked Lists.
Dynamic Representation and Prefetching of Linked Data Structures (or Introspection for Low-Level Data Prefetching) Mark Whitney & John Kubiatowicz ROC.
Parallel Computing Chapter 3 - Patterns R. HALVERSON MIDWESTERN STATE UNIVERSITY 1.
Chapter 3: Fundamental Data Structures: The Array and Linked Structures Data Structures in Java: From Abstract Data Types to the Java Collections Framework.
Vectors 5/31/2018 9:25 AM Presentation for use with the textbook Data Structures and Algorithms in Java, 6th edition, by M. T. Goodrich, R. Tamassia, and.
Lectures linked lists Chapter 6 of textbook
Compositional Pointer and Escape Analysis for Java Programs
Martin Rinard Laboratory for Computer Science
Address-Value Delta (AVD) Prediction
CS212D: Data Structures Week 5-6 Linked List.
Linked Lists Chapter 4.
Problem Understanding
Chapter 17: Linked Lists.
Pointer analysis.
Linked Lists.
CSC D70: Compiler Optimization Prefetching
Problem Understanding
Presentation transcript:

Data Flow Analysis for Software Prefetching Linked Data Structures in Java Brendon Cahoon Dept. of Computer Science University of Massachusetts Amherst, MA Kathryn S. McKinley Dept. of Computer Sciences University of Texas at Austin Austin, TX

Motivation Object-oriented languages are mainstream Key performance issues –Same old: processor-memory gap, parallelism  Combination of modern processors and languages results in poor memory performance

RSIM Performance Compiled Java (Vortex) – no GC

Prefetching Arrays vs. Objects Most prior work concentrates on arrays –Compilers directly prefetch any element –Loop transformations enable effective scheduling –Successful results using both hardware and software Cannot use same techniques on linked data structures –Objects are small and disjoint –Access patterns are less regular and predictable –Only know the address of directly connected objects

Software Data Prefetching for Java Hide memory latency from linked structure traversals Introduced by Luk and Mowry for C programs: –We add data flow and interprocedural analysis –Identify pointer structures from declaration –Find pointer chasing in loops and self recursive calls Challenges introduced by Java –Dynamically allocated objects make analysis difficult –Small methods obscure context

Outline Data flow analysis for identifying linked structures –New intra and interprocedural analysis Greedy prefetching Jump-pointer prefetching Experimental results

Identifying Linked Structure Traversals We define a data flow solution: –Intraprocedural for loops –Interprocedural for recursion Benefits: –Independent of program representation –Many compilers use data flow frameworks –May be composed with other analyses Loop while (o != null) { t = o; … o = t.next; } Recursion method visit() { …. if (this.next != null) visit(this.next); }

Data Flow Analysis Data flow information –Sets of tuples: Status values: not recurrent, possibly, recurrent Not recurrent : initial value Possibly : first use of a field reference Recurrent : an object accessed in linked structure traversal Intraproceedural: forward, flow-sensitive, may analysis Interprocedural: bidirectional, context-sensitive

Analysis Examples while (o != null) { s1: t = o.next; s2: o = t; } while (o != null) { s1: o = o.next; s2: o = bar(); } s1: o = o.next; s2: o = o.next; 1 st Iteration s1: o is not recurrent, set t to possibly s2: t is possibly, set o to possibly s1: set o to possibly s2: set o to possibly 1 st Iteration s1: set o to possibly s2: set o to not recurrent 2 nd Iteration s1: o is possibly, set t to recurrent s2: t is recurrent, set o to recurrent

Analysis Extensions for Common Idioms Track objects in fields or arrays –Class based field assignments –Arrays are monolithic Indirect recurrent objects –Unique objects referenced by linked structures while (e.f != null) { o = e.f; e.f = o.next; o.compute(); } while (e.hasMoreElements()) { o = (ObjType)e.nextElement(); o.compute(); }

Greedy Prefetching Prefetch directly connected objects Algorithm consists of two steps: –Detect accesses to linked structures –Schedule prefetches When object is not null Completely hiding latency is difficult

Greedy Prefetching Example Doubly linked list int sum (Dlist l) { int s = 0; while (l != null) { s =+ l.data; l = l.next; } return s; }

Greedy Prefetching Example Doubly linked list Greedy prefetching int sum (Dlist l) { int s = 0; while (l != null) { prefetch(l.next); s += l.data; l = l.next; } return s; }

Jump-Pointer Prefetching Prefetch indirectly connected objects –Tolerates more latency than greedy prefetching Algorithm contains three steps: –Find linked data structure traversal and creation sites –Create jump-pointers When creating or traversing the linked structure –Schedule prefetches Prefetch special jump-pointer field

Inserting Jump-Pointers at Creation Time Void add(ObjType o) { ListNode n = new ListNode(o); jumpObj = jumpQueue[i]; jumpObj.jmp = n; jumpQueue[i++%size] = n; if (head == null) { head = n; } else { tail.next = n; } tail = n; } jumpObj n

Jump-Pointer Prefetching Example int sum (Dlist l) { int s = 0; while (l != null) { prefetch(l.jmp); s += l.data; l = l.next; } return s; } Doubly linked list Jump-pointer prefetching

Experimental Results Object-oriented Olden benchmarks in Java Simulation using RSIM –Out-of-order, superscalar processor Compile programs using Vortex –Translate Java programs to Sparc assembly –Contains object-oriented, traditional optimizations –Linked structure analysis, greedy and jump-pointer prefetching

Prefetching Performance health mst perimtr treeadd bh bisort tsp voronoi em3d power

Prefetch Effectiveness health mst perimtr treeadd bh bisort tsp voronoi em3d power

Static Prefetch Statistics ProgramInterproceduralIntra- Procedural Fields MonoPoly Health815 Mst3 Perimeter98 Treeadd2 BH16810 Bisort44 Tsp614 Voronoi141 Em3d20 Power4

Contributions and Future Work New interprocedural data flow analysis for Java Evaluation of prefetching on Java programs Prefetching hides latency, but Room for improvement Other uses for analysis (work in progress) –Garbage collection: prefetching, object traversal –Prefetching arrays of objects