Register Allocation Amitabha Sanyal Department of Computer Science & Engineering IIT Bombay
|
|
- Derick Walters
- 5 years ago
- Views:
Transcription
1 Register Allocation Amitabha Sanyal Department of Computer Science & Engineering IIT Bombay
2 Global Register Allocation Register Allocation : AS 1
3 Possible Approaches Approach 1: Divide the register set into two parts. Local register set: For evaluating expressions. Global register set: For holding frequently used variables across longer stretches of code. A global register allocation phase allocates register to variables over certain regions. A Sethi-Ullman or Aho-Johnson like algorithm generates code for expressions Variables at leaf are either in global registers, or can be loaded in local registers if available, or operated from memory interior nodes are evaluated and held in registers, or spilled and operated from memory. Register Allocation : AS 2
4 Possible Approaches Approach 2: No partitioning of register set. Generate code for expression using Sethi-Ullman or Aho-Johnson or BURG. However, think of the registers as being symbolic registers. A global register allocation strategy assigns physical registers to to both, variables and symbolic registers. Using Sethi-Ullman or Aho-Johnson ensures good order of evaluation. Results in short live ranges - good for register allocation. Using Sethi-Ullman, Aho-Johnson or BURS ensures great code selection. Register Allocation : AS 3
5 Global Register Allocation Problem To decide: which variables values should be held in registers, and in what regions of the program so as to ensure that heavily used variables are operated out of registers, and minimize register spills into memory. Best known solution is register allocation through graph coloring. Register Allocation : AS 4
6 A Motivating Example Consider the program shown below: x = 2; y = 4; w = x + y z = x + w u = x * y x = z * 2 s1 s2 s3 s4 s5 s6 Identify webs (defined later) in the program. Each web is held in a symbolic register. s1 = 2; s2 = 4; s3 = s1 + s2 s4 = s1 + 1 s5 = s1 * s2 s6 = s4 * 2 Register Allocation : AS 5
7 A Motivating Example Next, build an interference graph. Color interference graph with the same number of colors as registers. R2 s3 R1 s1 R1 s5 s2 R3 s4 R2 s6 R2 Replace symbolic registers by real registers. R1 = 2; R3 = 4; R2 = R1 + R3 R2 = R1 + 1 R1 = R1 * R3 R2 = R2 * 2 Register Allocation : AS 6
8 Register Allocation by Graph Coloring Major steps Identifying units of allocation web identification. Representing webs - rewriting using symbolic registers. Reducing the number of live ranges (symbolic) register coalescing. Explicating allocation constraints constructing the interference graph. Estimating penalties of non-allocation spill cost estimation. The coloring logic Reducing the problem size pruning obviously colorable edges. Running out of colors selecting registers for spilling. Register Allocation : AS 7
9 A Running Example Original program B1: a := b+c*d d := d*b a e := a+f B2: f := a*d e B3: b := d+f e := a c*b B4: b := d+c Register Allocation : AS 8
10 A Running Example After Sethi-Ullman B1: t1 = b t2 = c t2 = t2 * d t1 = t1 + t2 a = t1 t1 = d t1 = t1 * b t1 = t1 a d = t1 t1 = a t1 = t1 + f e = t1 B2: t1 = a B3: t1 = d t1 = t1 * d t1 = t1 e f = t1 t1 = t1 + f b = t1 t1 = a t2 = c t2 = t2 * b t1 = t1 t2 e = t1 B4: t1 = d t1 = t1 + c b = t1 Register Allocation : AS 9
11 Candidates for Allocation Webs A variable is not a good candidate for allocation of register. a variable can be used for different purposes in different parts of the program. forcing the variable to be in the same register unnecessary constraint. A good candidate for register is a web. A web consists of intersecting du-chains. x = 1 x = 2 z = x + 3 x = 4 y = x + 1 p = x + 7 q = y + z Register Allocation : AS 10
12 Representing Webs by Symbolic Registers Variables corresponding to webs are replaced by symbolic registers. B1: s1 = sb1 s2 = sc s3 = s2 * sd1 s4 = s1 + s3 sa = s4 s5 = sd1 s6 = s5 * sb1 s7 = s6 sa sd2 = s7 s8 = sa s9 = s8 + sf1 se1 = s9 B2: s10 = sa s11 = s10 * sd2 s12 = s11 se1 sf2 = s12 B3: s13 = sd2 s14 = s13 + sf1 sb2 = s14 s15 = sa s16 = sc s17 = s16 * sb2 s18 = s15 s17 se2 = s18 B4: s19 = sd2 s20 = s19 + sc sb3 = s20 Register Allocation : AS 11
13 Register coalescing Number of live ranges can be decreased by the transformation illustrated below sj si si = sj Neither si nor sj defined along this path sj No other definition... =..si.. of si reaches here... =..sj..... =..sj..... =..sj.. Example of situation where copy statements can be generated following Sethi- Ullman algorithm, loading a left leaf into a register. Register Allocation : AS 12
14 Running Example After Register Coalescing B1: s3 = sc * sd1 s4 = sb1 + s3 s6 = sd1 * sb1 s7 = s6 s4 s9 = s4 + sf1 e = s9 B2: s11 = s4 * s7 s12 = s11 s9 f = s12 B3: s14 = s7 + sf1 s17 = sc * s14 s18 = s4 s17 e = s18 B4: s20 = s7 + sc b = s20 Register Allocation : AS 13
15 What is interference? Naive definition: two webs interfere if they are live (are present) at a common point in the program. 2n+1 interfering webs by this definition. Better definition: two webs interfere when the definition point of one intersects with the other. n interfering webs in the example. cond a1 =... a2 = an =... b1 =... b2 = bn =... cond 2n webs live at this point... = a1... = a = an... = b1... = b = bn Register Allocation : AS 14
16 Estimating Spill Costs Spilling a web means inserting a store after each definition of the web variable. inserting a load before each use of the web variable d1: x =... d2: x =... u1:...=..x.. u2:...=..x.. d1: x =... d2: x =... m = x m = x x = m u1:...=..x.. x = m u2:...=..x.. spilling converts a large web into many very small webs. Register Allocation : AS 15
17 Estimating Spill Costs The spill cost of a web is the average of spill costs along all the paths in the web. The spill cost along a path p is (loads p LOADCOST + stores p STORECOST) 10 d where: loads p is the number of loads introduced in the path p due to spilling. stores p is the number of stores, and d is the nesting depth of the web. Register Allocation : AS 16
18 The coloring logic Chaitin allocator While stack is not empty, do: Prune: If there is a node whose degree is less than the total number of colors (registers), remove the node and stack it. Such a node is always colorable. Spill: If there is no such node available, spill a web with least spill cost, and readjust the interference graph. Take out elements from the stack and color them in turn. Register Allocation : AS 17
19 The coloring logic Chaitin allocator cannot color the diamond graph with two colors. R B B It is true that not colorable degree more than available colors However, Chaitin s allocator assumes that degree more than available colors not colorable which need not be true. R Register Allocation : AS 18
20 The coloring logic Chaitin allocator spills more than necessary for the following example: subroutine SVD(M, N,..) do I = 1,N do J = 1, M A(I,J) = B(I,J) end endo do deeply nested loops endo do deeply nested loops endo do deeply nested loops endo do deeply nested loops endo N I M J It takes an early spilling decision which it cannot reverse later Register Allocation : AS 19
21 The coloring logic Preston-Briggs allocator While stack is not empty, do: Prune: If there is a node whose degree is less than the total number of colors (registers), remove the node and stack it. Such a node is always colorable. Spill: If there is no such node available, choose a web with least spill cost, mark it as a candidate for spilling and stack it. Examine elements from the stack. If the element is a colorable node, assign it a color If it is a candidate for spilling, spill, readjust the interference graph and repeat the entire process Register Allocation : AS 20
22 Running Example Rewriting code with allocated registers B1: r2 := r7 * r3 r5 := r4 + r2 /* r5(a)=b+c*d */ r2 := r3 * r4 r4 := r2 r5 /* r4(d)=d*b a */ r3 := r5 + r6 e := r3 /* e=a+f */ B2: r2 := r5 * r4 r2 := r2 r3 f := r2 /* f=a*d e */ B3: r2 := r4 + r6 /* r2(b)=d+f */ r3 := r7 * r2 r2 := r5 r3 e := r2 /* e=a c*b*/ B4: r2 := r4 + r7 b := r2 /* b=d+c*/ Register Allocation : AS 21
23 Shaping the code Many processors require the code to be of the form: ri = ri op rj, or ri = ri op m we can apply the following transformations: 1. Replace ri := rj op rk by rj := rj op rk provided rj is not live beyond this instruction. Replace ri := rj op rk by rk := rk op rj provided op is commutative, and rk is not live beyond this instruction. Replace each subsequent use of ri by rj or rk. 2. Otherwise, replace each instruction ri := rj op rk by the pair of instructions ri := rj and ri := ri op rk. Register Allocation : AS 22
24 Running Example After shaping code B1: r2 := r7 r2 := r2 * r3 r5 := r4 r5 := r5 + r2 r4 := r4 * r3 r4 := r4 r5 r3 := r5 r3 := r3 + r6 e := r3 # # * # B3: r6 := r6 + r4 r6 := r6 * r7 r5 := r5 r6 e := r5 * * * B2: r5 := r5 * r4 r5 := r5 r3 f := r5 * * B4: r4 := r4 + r7 b := r4 * Register Allocation : AS 23
register allocation saves energy register allocation reduces memory accesses.
Lesson 10 Register Allocation Full Compiler Structure Embedded systems need highly optimized code. This part of the course will focus on Back end code generation. Back end: generation of assembly instructions
More informationRegister Allocation. Global Register Allocation Webs and Graph Coloring Node Splitting and Other Transformations
Register Allocation Global Register Allocation Webs and Graph Coloring Node Splitting and Other Transformations Copyright 2015, Pedro C. Diniz, all rights reserved. Students enrolled in the Compilers class
More informationCode generation for modern processors
Code generation for modern processors Definitions (1 of 2) What are the dominant performance issues for a superscalar RISC processor? Refs: AS&U, Chapter 9 + Notes. Optional: Muchnick, 16.3 & 17.1 Instruction
More informationCode generation for modern processors
Code generation for modern processors What are the dominant performance issues for a superscalar RISC processor? Refs: AS&U, Chapter 9 + Notes. Optional: Muchnick, 16.3 & 17.1 Strategy il il il il asm
More informationOutline. Register Allocation. Issues. Storing values between defs and uses. Issues. Issues P3 / 2006
P3 / 2006 Register Allocation What is register allocation Spilling More Variations and Optimizations Kostis Sagonas 2 Spring 2006 Storing values between defs and uses Program computes with values value
More informationCompiler Design. Register Allocation. Hwansoo Han
Compiler Design Register Allocation Hwansoo Han Big Picture of Code Generation Register allocation Decides which values will reside in registers Changes the storage mapping Concerns about placement of
More informationGlobal Register Allocation
Global Register Allocation Y N Srikant Computer Science and Automation Indian Institute of Science Bangalore 560012 NPTEL Course on Compiler Design Outline n Issues in Global Register Allocation n The
More informationGlobal Register Allocation - Part 3
Global Register Allocation - Part 3 Y N Srikant Computer Science and Automation Indian Institute of Science Bangalore 560012 NPTEL Course on Compiler Design Outline Issues in Global Register Allocation
More informationToday More register allocation Clarifications from last time Finish improvements on basic graph coloring concept Procedure calls Interprocedural
More Register Allocation Last time Register allocation Global allocation via graph coloring Today More register allocation Clarifications from last time Finish improvements on basic graph coloring concept
More informationGlobal Register Allocation - Part 2
Global Register Allocation - Part 2 Y N Srikant Computer Science and Automation Indian Institute of Science Bangalore 560012 NPTEL Course on Compiler Design Outline Issues in Global Register Allocation
More informationRegister Allocation 3/16/11. What a Smart Allocator Needs to Do. Global Register Allocation. Global Register Allocation. Outline.
What a Smart Allocator Needs to Do Register Allocation Global Register Allocation Webs and Graph Coloring Node Splitting and Other Transformations Determine ranges for each variable can benefit from using
More informationRegister Allocation. Preston Briggs Reservoir Labs
Register Allocation Preston Briggs Reservoir Labs An optimizing compiler SL FE IL optimizer IL BE SL A classical optimizing compiler (e.g., LLVM) with three parts and a nice separation of concerns: front
More informationCSE P 501 Compilers. Register Allocation Hal Perkins Autumn /22/ Hal Perkins & UW CSE P-1
CSE P 501 Compilers Register Allocation Hal Perkins Autumn 2011 11/22/2011 2002-11 Hal Perkins & UW CSE P-1 Agenda Register allocation constraints Local methods Faster compile, slower code, but good enough
More informationRedundant Computation Elimination Optimizations. Redundancy Elimination. Value Numbering CS2210
Redundant Computation Elimination Optimizations CS2210 Lecture 20 Redundancy Elimination Several categories: Value Numbering local & global Common subexpression elimination (CSE) local & global Loop-invariant
More informationCSC D70: Compiler Optimization Register Allocation
CSC D70: Compiler Optimization Register Allocation Prof. Gennady Pekhimenko University of Toronto Winter 2018 The content of this lecture is adapted from the lectures of Todd Mowry and Phillip Gibbons
More informationRegister Allocation (wrapup) & Code Scheduling. Constructing and Representing the Interference Graph. Adjacency List CS2210
Register Allocation (wrapup) & Code Scheduling CS2210 Lecture 22 Constructing and Representing the Interference Graph Construction alternatives: as side effect of live variables analysis (when variables
More informationRegister allocation. Overview
Register allocation Register allocation Overview Variables may be stored in the main memory or in registers. { Main memory is much slower than registers. { The number of registers is strictly limited.
More informationLiveness Analysis and Register Allocation
Liveness Analysis and Register Allocation Leonidas Fegaras CSE 5317/4305 L10: Liveness Analysis and Register Allocation 1 Liveness Analysis So far we assumed that we have a very large number of temporary
More informationRegister Allocation. Register Allocation. Local Register Allocation. Live range. Register Allocation for Loops
DF00100 Advanced Compiler Construction Register Allocation Register Allocation: Determines values (variables, temporaries, constants) to be kept when in registers Register Assignment: Determine in which
More informationFall Compiler Principles Lecture 12: Register Allocation. Roman Manevich Ben-Gurion University
Fall 2014-2015 Compiler Principles Lecture 12: Register Allocation Roman Manevich Ben-Gurion University Syllabus Front End Intermediate Representation Optimizations Code Generation Scanning Lowering Local
More informationCompiler Optimization Techniques
Compiler Optimization Techniques Department of Computer Science, Faculty of ICT February 5, 2014 Introduction Code optimisations usually involve the replacement (transformation) of code from one sequence
More informationRegister Allocation. 2. register contents, namely which variables, constants, or intermediate results are currently in a register, and
Register Allocation Introduction The main idea behind good register allocation is to keep variables and constants in registers as long as possible and to never spill intermediate results into memory. Thus,
More informationLecture 6. Register Allocation. I. Introduction. II. Abstraction and the Problem III. Algorithm
I. Introduction Lecture 6 Register Allocation II. Abstraction and the Problem III. Algorithm Reading: Chapter 8.8.4 Before next class: Chapter 10.1-10.2 CS243: Register Allocation 1 I. Motivation Problem
More informationLow-level optimization
Low-level optimization Advanced Course on Compilers Spring 2015 (III-V): Lecture 6 Vesa Hirvisalo ESG/CSE/Aalto Today Introduction to code generation finding the best translation Instruction selection
More informationThe C2 Register Allocator. Niclas Adlertz
The C2 Register Allocator Niclas Adlertz 1 1 Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated
More informationIntroduction to Query Processing and Query Optimization Techniques. Copyright 2011 Ramez Elmasri and Shamkant Navathe
Introduction to Query Processing and Query Optimization Techniques Outline Translating SQL Queries into Relational Algebra Algorithms for External Sorting Algorithms for SELECT and JOIN Operations Algorithms
More informationSORTING AND SELECTION
2 < > 1 4 8 6 = 9 CHAPTER 12 SORTING AND SELECTION ACKNOWLEDGEMENT: THESE SLIDES ARE ADAPTED FROM SLIDES PROVIDED WITH DATA STRUCTURES AND ALGORITHMS IN JAVA, GOODRICH, TAMASSIA AND GOLDWASSER (WILEY 2016)
More informationSORTING, SETS, AND SELECTION
CHAPTER 11 SORTING, SETS, AND SELECTION ACKNOWLEDGEMENT: THESE SLIDES ARE ADAPTED FROM SLIDES PROVIDED WITH DATA STRUCTURES AND ALGORITHMS IN C++, GOODRICH, TAMASSIA AND MOUNT (WILEY 2004) AND SLIDES FROM
More informationGlobal Register Allocation - 2
Global Register Allocation - 2 Y N Srikant Computer Science and Automation Indian Institute of Science Bangalore 560012 NPTEL Course on Principles of Compiler Design Outline n Issues in Global Register
More informationRegister Allocation via Hierarchical Graph Coloring
Register Allocation via Hierarchical Graph Coloring by Qunyan Wu A THESIS Submitted in partial fulfillment of the requirements for the degree of MASTER OF SCIENCE IN COMPUTER SCIENCE MICHIGAN TECHNOLOGICAL
More informationGoal is to produce more ecient code for expressions
Better code generation Goal is to produce more ecient code for expressions We consider directed acyclic graphs (DAG) \optimal" register allocation for trees Sethi-Ullman \more optimal" register allocation
More informationLow-Level Issues. Register Allocation. Last lecture! Liveness analysis! Register allocation. ! More register allocation. ! Instruction scheduling
Low-Level Issues Last lecture! Liveness analysis! Register allocation!today! More register allocation!later! Instruction scheduling CS553 Lecture Register Allocation I 1 Register Allocation!Problem! Assign
More informationRegister Allocation. Ina Schaefer Selected Aspects of Compilers 100. Register Allocation
Efficient code has to use the available registers on the target machine as much as possible: Accessing registers is much faster then accessing memory (the same holds for cache). Two Aspects: : Determine
More informationRematerialization. Graph Coloring Register Allocation. Some expressions are especially simple to recompute: Last Time
Graph Coloring Register Allocation Last Time Chaitin et al. Briggs et al. Today Finish Briggs et al. basics An improvement: rematerialization Rematerialization Some expressions are especially simple to
More informationRegister allocation. Register allocation: ffl have value in a register when used. ffl limited resources. ffl changes instruction choices
Register allocation IR instruction selection register allocation machine code errors Register allocation: have value in a register when used limited resources changes instruction choices can move loads
More informationAlgorithms for Query Processing and Optimization. 0. Introduction to Query Processing (1)
Chapter 19 Algorithms for Query Processing and Optimization 0. Introduction to Query Processing (1) Query optimization: The process of choosing a suitable execution strategy for processing a query. Two
More informationDIVIDE AND CONQUER ALGORITHMS ANALYSIS WITH RECURRENCE EQUATIONS
CHAPTER 11 SORTING ACKNOWLEDGEMENT: THESE SLIDES ARE ADAPTED FROM SLIDES PROVIDED WITH DATA STRUCTURES AND ALGORITHMS IN C++, GOODRICH, TAMASSIA AND MOUNT (WILEY 2004) AND SLIDES FROM NANCY M. AMATO AND
More informationChapter 3. Algorithms for Query Processing and Optimization
Chapter 3 Algorithms for Query Processing and Optimization Chapter Outline 1. Introduction to Query Processing 2. Translating SQL Queries into Relational Algebra 3. Algorithms for External Sorting 4. Algorithms
More informationApril 15, 2015 More Register Allocation 1. Problem Register values may change across procedure calls The allocator must be sensitive to this
More Register Allocation Last time Register allocation Global allocation via graph coloring Today More register allocation Procedure calls Interprocedural April 15, 2015 More Register Allocation 1 Register
More informationRegister allocation. instruction selection. machine code. register allocation. errors
Register allocation IR instruction selection register allocation machine code errors Register allocation: have value in a register when used limited resources changes instruction choices can move loads
More informationChapter 4: Sorting. Spring 2014 Sorting Fun 1
Chapter 4: Sorting 7 4 9 6 2 2 4 6 7 9 4 2 2 4 7 9 7 9 2 2 9 9 Spring 2014 Sorting Fun 1 What We ll Do! Quick Sort! Lower bound on runtimes for comparison based sort! Radix and Bucket sort Spring 2014
More informationDigital Arithmetic. Digital Arithmetic: Operations and Circuits Dr. Farahmand
Digital Arithmetic Digital Arithmetic: Operations and Circuits Dr. Farahmand Binary Arithmetic Digital circuits are frequently used for arithmetic operations Fundamental arithmetic operations on binary
More informationSorting. Data structures and Algorithms
Sorting Data structures and Algorithms Acknowledgement: These slides are adapted from slides provided with Data Structures and Algorithms in C++ Goodrich, Tamassia and Mount (Wiley, 2004) Outline Bubble
More informationRui Wang, Assistant professor Dept. of Information and Communication Tongji University.
Instructions: ti Language of the Computer Rui Wang, Assistant professor Dept. of Information and Communication Tongji University it Email: ruiwang@tongji.edu.cn Computer Hierarchy Levels Language understood
More informationLecture 21 CIS 341: COMPILERS
Lecture 21 CIS 341: COMPILERS Announcements HW6: Analysis & Optimizations Alias analysis, constant propagation, dead code elimination, register allocation Available Soon Due: Wednesday, April 25 th Zdancewic
More informationLecture 15 Register Allocation & Spilling
I. Motivation Lecture 15 Register Allocation & Spilling I. Introduction II. Abstraction and the Problem III. Algorithm IV. Spilling Problem Allocation of variables (pseudo-registers) to hardware registers
More informationQuick-Sort. Quick-Sort 1
Quick-Sort 7 4 9 6 2 2 4 6 7 9 4 2 2 4 7 9 7 9 2 2 9 9 Quick-Sort 1 Outline and Reading Quick-sort ( 4.3) Algorithm Partition step Quick-sort tree Execution example Analysis of quick-sort (4.3.1) In-place
More informationCode Generation: Integrated Instruction Selection and Register Allocation Algorithms
Code Generation: Integrated Instruction Selection and Register Allocation Algorithms (www.cse.iitb.ac.in/ as) Department of Computer Science and Engineering, Indian Institute of Technology, Bombay February
More informationUL TEST REPORT AND PROCEDURE
Issue Date: 2014-11-25 Page 1 of 22 Report Reference # E186249-A273-UL UL TEST REPORT AND PROCEDURE Standard: Certification Type: CCN: Product: Model: UL 60950-1, 2nd Edition, 2014-10-14 (Information Technology
More informationLinear Scan Register Allocation. Kevin Millikin
Linear Scan Register Allocation Kevin Millikin Register Allocation Register Allocation An important compiler optimization Compiler: unbounded # of virtual registers Processor: bounded (small) # of registers
More informationAssociation Pattern Mining. Lijun Zhang
Association Pattern Mining Lijun Zhang zlj@nju.edu.cn http://cs.nju.edu.cn/zlj Outline Introduction The Frequent Pattern Mining Model Association Rule Generation Framework Frequent Itemset Mining Algorithms
More informationFast Sorting and Selection. A Lower Bound for Worst Case
Lists and Iterators 0//06 Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 0 Fast Sorting and Selection USGS NEIC. Public domain government
More informationAdvanced optimizations of cache performance ( 2.2)
Advanced optimizations of cache performance ( 2.2) 30 1. Small and Simple Caches to reduce hit time Critical timing path: address tag memory, then compare tags, then select set Lower associativity Direct-mapped
More informationCS 406/534 Compiler Construction Instruction Selection and Global Register Allocation
CS 406/534 Compiler Construction Instruction Selection and Global Register Allocation Prof. Li Xu Dept. of Computer Science UMass Lowell Fall 2004 Part of the course lecture notes are based on Prof. Keith
More informationPresentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015
Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015 Quick-Sort 7 4 9 6 2 2 4 6 7 9 4 2 2 4 7 9 7 9 2 2 9 9 2015 Goodrich and Tamassia
More informationHow to efficiently use the address register? Address register = contains the address of the operand to fetch from memory.
Lesson 13 Storage Assignment Optimizations Sequence of accesses is very important Simple Offset Assignment This lesson will focus on: Code size and data segment size How to efficiently use the address
More informationBOBJ: A Quickstart for Software Engineers
BOBJ: A Quickstart for Software Engineers Lutz Hamel Dept. of Computer Science and Statistics University of Rhode Island Kingston, RI 02881 hamel@cs.uri.edu DRAFT 12/7/03 Getting Started BOBJ is a specification
More informationQuick-Sort fi fi fi 7 9. Quick-Sort Goodrich, Tamassia
Quick-Sort 7 4 9 6 2 fi 2 4 6 7 9 4 2 fi 2 4 7 9 fi 7 9 2 fi 2 9 fi 9 Quick-Sort 1 Quick-Sort ( 10.2 text book) Quick-sort is a randomized sorting algorithm based on the divide-and-conquer paradigm: x
More informationSorting Goodrich, Tamassia Sorting 1
Sorting Put array A of n numbers in increasing order. A core algorithm with many applications. Simple algorithms are O(n 2 ). Optimal algorithms are O(n log n). We will see O(n) for restricted input in
More informationRegister Allocation & Liveness Analysis
Department of Computer Sciences Register Allocation & Liveness Analysis CS502 Purdue University is an Equal Opportunity/Equal Access institution. Department of Computer Sciences In IR tree code generation,
More informationSorting. Divide-and-Conquer 1
Sorting Divide-and-Conquer 1 Divide-and-Conquer 7 2 9 4 2 4 7 9 7 2 2 7 9 4 4 9 7 7 2 2 9 9 4 4 Divide-and-Conquer 2 Divide-and-Conquer Divide-and conquer is a general algorithm design paradigm: Divide:
More informationAn Analysis of Graph Coloring Register Allocation
An Analysis of Graph Coloring Register Allocation David Koes Seth Copen Goldstein March 2006 CMU-CS-06-111 School of Computer Science Carnegie Mellon University Pittsburgh, PA 15213 Abstract Graph coloring
More informationECE 5745 Complex Digital ASIC Design Topic 13: Physical Design Automation Algorithms
ECE 7 Complex Digital ASIC Design Topic : Physical Design Automation Algorithms Christopher atten School of Electrical and Computer Engineering Cornell University http://www.csl.cornell.edu/courses/ece7
More informationRegister Allocation. Note by Baris Aktemur: Our slides are adapted from Cooper and Torczon s slides that they prepared for COMP 412 at Rice.
Register Allocation Note by Baris Aktemur: Our slides are adapted from Cooper and Torczon s slides that they prepared for COMP at Rice. Copyright 00, Keith D. Cooper & Linda Torczon, all rights reserved.
More informationCS5363 Final Review. cs5363 1
CS5363 Final Review cs5363 1 Programming language implementation Programming languages Tools for describing data and algorithms Instructing machines what to do Communicate between computers and programmers
More informationPROVE THEOREMS INVOLVING SIMILARITY
PROVE THEOREMS INVOLVING SIMILARITY KEY IDEAS 1. When proving that two triangles are similar, it is sufficient to show that two pairs of corresponding angles of the triangles are congruent. This is called
More informationCHAPTER 3. Register allocation
CHAPTER 3 Register allocation In chapter 1 we simplified the generation of x86 assembly by placing all variables on the stack. We can improve the performance of the generated code considerably if we instead
More informationRelational Model, Relational Algebra, and SQL
Relational Model, Relational Algebra, and SQL August 29, 2007 1 Relational Model Data model. constraints. Set of conceptual tools for describing of data, data semantics, data relationships, and data integrity
More informationNotes Formal Geometry Chapter 3 Parallel and Perpendicular Lines
Name Date Period Notes Formal Geometry Chapter 3 Parallel and Perpendicular Lines 3-1 Parallel Lines and Transversals and 3-2 Angles and Parallel Lines A. Definitions: 1. Parallel Lines: Coplanar lines
More informationObtaining Information from a Function s Graph.
Obtaining Information from a Function s Graph Summary about using closed dots, open dots, and arrows on the graphs 1 A closed dot indicate that the graph does not extend beyond this point and the point
More informationEnhancing Parallelism
CSC 255/455 Software Analysis and Improvement Enhancing Parallelism Instructor: Chen Ding Chapter 5,, Allen and Kennedy www.cs.rice.edu/~ken/comp515/lectures/ Where Does Vectorization Fail? procedure vectorize
More informationCSc 553. Principles of Compilation. 23 : Register Allocation. Department of Computer Science University of Arizona
CSc 553 Principles of Compilation 3 : egister Allocation Department of Computer Science University of Arizona collberg@gmail.com Copyright c 0 Christian Collberg Introduction Lexing, Parsing Semantic Analysis,
More informationChapter 7: Frequent Itemsets and Association Rules
Chapter 7: Frequent Itemsets and Association Rules Information Retrieval & Data Mining Universität des Saarlandes, Saarbrücken Winter Semester 2013/14 VII.1&2 1 Motivational Example Assume you run an on-line
More informationLecture Topic Projects 1 Intro, schedule, and logistics 2 Data Science components and tasks 3 Data types Project #1 out 4 Introduction to R,
Lecture Topic Projects 1 Intro, schedule, and logistics 2 Data Science components and tasks 3 Data types Project #1 out 4 Introduction to R, statistics foundations 5 Introduction to D3, visual analytics
More informationImprovements to Graph Coloring Register Allocation
Improvements to Graph Coloring Register Allocation PRESTON BRIGGS, KEITH D. COOPER, and LINDA TORCZON Rice University We describe two improvements to Chaitin-style graph coloring register allocators. The
More informationMultidimensional Indexes [14]
CMSC 661, Principles of Database Systems Multidimensional Indexes [14] Dr. Kalpakis http://www.csee.umbc.edu/~kalpakis/courses/661 Motivation Examined indexes when search keys are in 1-D space Many interesting
More informationSSA-Form Register Allocation
SSA-Form Register Allocation Foundations Sebastian Hack Compiler Construction Course Winter Term 2009/2010 saarland university computer science 2 Overview 1 Graph Theory Perfect Graphs Chordal Graphs 2
More informationQuick-Sort. Quick-sort is a randomized sorting algorithm based on the divide-and-conquer paradigm:
Presentation for use with the textbook Data Structures and Algorithms in Java, 6 th edition, by M. T. Goodrich, R. Tamassia, and M. H. Goldwasser, Wiley, 2014 Quick-Sort 7 4 9 6 2 2 4 6 7 9 4 2 2 4 7 9
More informationE3Z. The New Standard for Compact, Long-range Photoelectric Sensors Conserves Energy and Natural Resources, One Million Sold Yearly
Compact Photoelectric Sensor with Built-in Amplifier EZ The New Standard for Compact, Long-range Photoelectric Sensors Conserves Energy and Natural Resources, One Million Sold Yearly Long sensing distance
More informationQuality and Speed in Linear-Scan Register Allocation
Quality and Speed in Linear-Scan Register Allocation A Thesis presented by Omri Traub to Computer Science in partial fulfillment of the honors requirements for the degree of Bachelor of Arts Harvard College
More informationEECS 583 Class 6 Dataflow Analysis
EECS 583 Class 6 Dataflow Analysis University of Michigan September 24, 2012 Announcements & Reading Material Homework 1 due tonight at midnight» Remember, submit single.tgz file to andrew.eecs.umich.edu:/y/submit/uniquename_hw1.tgz
More informationChapter 12: Query Processing
Chapter 12: Query Processing Overview Catalog Information for Cost Estimation $ Measures of Query Cost Selection Operation Sorting Join Operation Other Operations Evaluation of Expressions Transformation
More informationEECS 583 Class 6 Dataflow Analysis
EECS 583 Class 6 Dataflow Analysis University of Michigan September 26, 2011 Announcements & Reading Material Today s class» Compilers: Principles, Techniques, and Tools, A. Aho, R. Sethi, and J. Ullman,
More information15.4 Longest common subsequence
15.4 Longest common subsequence Biological applications often need to compare the DNA of two (or more) different organisms A strand of DNA consists of a string of molecules called bases, where the possible
More informationTopic 12: Register Allocation
Topic 12: Register Allocation COS 320 Compiling Techniques Princeton University Spring 2016 Lennart Beringer 1 Structure of backend Register allocation assigns machine registers (finite supply!) to virtual
More informationCHAPTER 3. Register allocation
CHAPTER 3 Register allocation In chapter 1 we simplified the generation of x86 assembly by placing all variables on the stack. We can improve the performance of the generated code considerably if we instead
More informationWhy Global Dataflow Analysis?
Why Global Dataflow Analysis? Answer key questions at compile-time about the flow of values and other program properties over control-flow paths Compiler fundamentals What defs. of x reach a given use
More informationCMPUT 391 Database Management Systems. Query Processing: The Basics. Textbook: Chapter 10. (first edition: Chapter 13) University of Alberta 1
CMPUT 391 Database Management Systems Query Processing: The Basics Textbook: Chapter 10 (first edition: Chapter 13) Based on slides by Lewis, Bernstein and Kifer University of Alberta 1 External Sorting
More information4 slat adirondack. trade.com. back options: use with: 4 slat ottoman. collection: adirondack material: 100% recycled HDPE
4 slat adirondack black: color code BL cloud: color code CW leaf: color code LG chocolate: color code CB charcoal: color code CG back options: apple: color code AR sunset: color code OR flat curve sky:
More informationRouting protocols in Mobile Ad Hoc Network
Routing protocols in Mobile Ad Hoc Network Presented By :- Nitesh Jain Date:-26/10/2005 SCHOOL OF INFORMATION TECHNOLOGY INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR KHARAGPUR Types of Wireless Networks Infrastructure
More informationTowards an SSA based compiler back-end: some interesting properties of SSA and its extensions
Towards an SSA based compiler back-end: some interesting properties of SSA and its extensions Benoit Boissinot Équipe Compsys Laboratoire de l Informatique du Parallélisme (LIP) École normale supérieure
More informationImprovements to Graph Coloring Register Allocation
Improvements to Graph Coloring Register Allocation PRESTON BRIGGS, KEITH D. COOPER, and LINDA TORCZON Rice University We describe two improvements to Chaitin-style graph coloring register allocators. The
More informationArnab Bhattacharya, Shrikant Awate. Dept. of Computer Science and Engineering, Indian Institute of Technology, Kanpur
Arnab Bhattacharya, Shrikant Awate Dept. of Computer Science and Engineering, Indian Institute of Technology, Kanpur Motivation Flight from Kolkata to Los Angeles No direct flight Through Singapore or
More informationParallel DBMS. Parallel Database Systems. PDBS vs Distributed DBS. Types of Parallelism. Goals and Metrics Speedup. Types of Parallelism
Parallel DBMS Parallel Database Systems CS5225 Parallel DB 1 Uniprocessor technology has reached its limit Difficult to build machines powerful enough to meet the CPU and I/O demands of DBMS serving large
More informationCompiler Construction
Compiler Construction Exercises 1 Review of some Topics in Formal Languages 1. (a) Prove that two words x, y commute (i.e., satisfy xy = yx) if and only if there exists a word w such that x = w m, y =
More informationQuery Optimization. Query Optimization. Optimization considerations. Example. Interaction of algorithm choice and tree arrangement.
COS 597: Principles of Database and Information Systems Query Optimization Query Optimization Query as expression over relational algebraic operations Get evaluation (parse) tree Leaves: base relations
More informationCOP5621 Exam 4 - Spring 2005
COP5621 Exam 4 - Spring 2005 Name: (Please print) Put the answers on these sheets. Use additional sheets when necessary. Show how you derived your answer when applicable (this is required for full credit
More informationExample. program sort; var a : array[0..10] of integer; procedure readarray; : function partition (y, z :integer) :integer; var i, j,x, v :integer; :
Runtime Environment Relationship between names and data objects (of target machine) Allocation & de-allocation is managed by run time support package Each execution of a procedure is an activation of the
More informationCompilers and Code Optimization EDOARDO FUSELLA
Compilers and Code Optimization EDOARDO FUSELLA Contents Data memory layout Instruction selection Register allocation Data memory layout Memory Hierarchy Capacity vs access speed Main memory Classes of
More informationChapter 19 Query Optimization
Chapter 19 Query Optimization It is an activity conducted by the query optimizer to select the best available strategy for executing the query. 1. Query Trees and Heuristics for Query Optimization - Apply
More information