How to efficiently use the address register? Address register = contains the address of the operand to fetch from memory.
|
|
- Megan Spencer
- 5 years ago
- Views:
Transcription
1 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 register? Address register = contains the address of the operand to fetch from memory. If we store the operands in memory in the same order that they are called, we can just increment the address register. Auto increment mode get the operand and increment in same instruction. It reduces code size and improve efficiency. So we need to place the operands carefully to take full advantage of auto increment. In this example the program shown. The loads and stores are of interest to us here. The compiler puts the operands into the given order to increase the usage of auto increment. auto increment to get the data. And then we can use The final code created is very fast to execute and compact. Notice the dependence of the layout on the stack. Dependences must be maintained to take advantage of auto increment.
2 Access Sequence and Access Graph Access sequence = sequence in which the memory locations are accessed. Example: z = x op y The access sequence is x, y, z. Access graph == nodes are a unique variables Edge e(u,v) exists with weight w(e) if variables u and v are adjacent to each other w(e) times in the access sequence. The directions are not material in this graph. Example: Weight of a Graph and Cost of Assignment The weight of a graph G is the sum of the edges in G(V,E) The cost of a cover G is the sum of the weights of the edges in G but not in C. There can be multiple covers of a graph. We are looking for the one that maximizes the weight. cost(c) = weight(g) weight(c) the cost is edges that are not covered The cost of an assignment is equal to the number of adjacent accesses of variables that are not assigned to adjacent locations.
3 Weight of a Graph and Cost of Assignment Example: Each variable gets a node. An edge is added for each access (regardless of direction A B == B A) Now pick the highest cost edges to cover the graph Cover = there should be no cycles and we can remove uncovered edges and the graph will still be connected. MWPC = maximum weight per cover Pick the cover so that the weight is maximum of all covers. The weight of this cover is 9. The cost is 4. (total of the uncovered edges)
4 What is the layout of the max cover? Heaviest edges are put next to each. So the most used edges are next to each other. The layout can be found by starting at one end of the cover and stepping through it. e f a d c b Or b c d a f e The goal is to put transitions next to each other to take advantage of auto increment. Assumptions in Single Offset Assignment Every data object has a size of one word A single address register AR) is used to address all variables. Auto increment and decrement are used to transition One to one mapping of variables to locations The basic block has a fixed evaluation order (schedule). General Offset Assignment Problem K address registers Ar0 AR(k 1) Given access sequence L, set of variables V number of address registers k Find a partition of V, where m <= k. Such that the total cost of the optimal SOA of the corresponding access subsequences plus the setup cost for using the m register is minimal. General offset Assignment Problem: Assumptions: Fixed setup cost of each additional register Each address register is used to point to a disjoint subset of variables So variables are divided into the address registers, some variables under each register.
5 GOA Example Using SOA the cost is 6, meaning we are using only one address register, it is getting incremented as we move through the graph. Now do with two address registers to reduce the cost. Using 2 address register: AR1 a d e AR2 b c Now determine the cost. For the first address register we get this access sequence: When we focus on the a d e edges, we get a cost of 1. There is a cost of 1 because we will have to do an explicit load of the address register for the transition that is not covered.
6 The cost here is 0. We have no uncovered edges. We use auto increment and decrement to move between variables. Algorithm for GOA Solve the SOA problem If we only have one register, then we are done Otherwise, divide the registers into 2 subsets. Solve the SAO for each group Compare the solutions Choose the solution that is the lower cost The do it again, reducing the remaining subset into subsets. Repeat until we have reached the lowest cost or all the registers. KEY which variables in which subset? Benchmarks show there is increased performance when using GOA.
7 Relax Fixed Evaluation Order Assumption In addition to GOA, what else can be done? The previous solutions were dependent upon the access sequence. While good, it makes the assumption of a fixed evaluation order. To relax the access sequence: We will transform the access sequence Algebraic properties to change access order: Commutativity Associativity A review of using fixed access sequence: Now we can get the code using the AR0 register:
8 Access Graph Algebraic Transformations Commutative transformation on Expression Tree We can change the access sequence using the commutative property: Associative transformation on Expression tree The access order is changed from yzx to xyz.
9 New assignment: The code will now be:
10 The access graph is now: Least Cost Access Sequence This means: Find the MWPC The do algebraic transformations Determine the new cost, if less than the SAO cost, keep the transformation We are looking for the least cost access sequence (LCAS)
11 To find the LCAS : Focus on distinct access transitions which is a new edge that is being added to the access graph. So increase the number of consecutive accesses to a variable to reduce the number of distinct transitions. Reducing the number of distinct transitions means we are reducing the number of edges We also want to increase the occurrences of identical access transitions. Which will increase the weight of covered edges. So we are building candidate access sequences incrementally while pruning the candidate set by retaining those with minimum number of edges. Understand the relationship between the access sequence and the access graph Now we have done some transformations to the access sequence and gotten a new graph
12 The transformations specifically instructions 3 and 4. We used the comm. Property to change the order of access. This transformation simplifies the graph. Pruning Example Goal: to prune the graph through algebraic transformations Focus on statement 1: c = a +b swap to c = b + a Both have same cost, so both are retained. If one had a lower cost, it would be kept and the higher cost one would be pruned. Continue example: f= d + e we can do f = d + e or f = e + d In one case we will get this access sequence. In another case we will get this access sequence.
13 In another case we will get this access sequence. We must also note the frequency of the transitions, we want to keep the edges with the most transitions. Pruning does partial access graphs. Keeps the lowest cost with the highest weights at each step.
14 Some of the possible sequences are shown above. Anytime an access graph is more expensive than the others, it will be pruned from the set. So by the time we are done, only the best sequences are left. Working through the access sequences we get: We can see that one of the sequences has a lower cost than the other, so this is the one we will keep.
15 There is no correlation between cost and access graph topology. Most important at each step prune the high cost sequences. This is no guarantee that you will have the least cost solution using this method, that problem is NP complete. Our goal is to reduce the cost. Benchmark results show us that commutative transformation can lead to significant improvements, up to 13%. Variable Coalescence and Separation Now we will look at different way of simplifying the access graph by putting two variables in the same memory location. Recall from reg. allocation: Basic unit that must be put into the same memory location: web maximal d u chains Variables in the memory can be coalesced (put in the same memory location) When can we co locate two variables in the same location? Wehn the webs do not overlap or they do not interfere with each other So we must make sure the live ranges of the two variables do not overlap This will make it easier to make a better layout. In the above example, the last access of b occurs before the first access of d, so the two variables can share a location. To do this we must know the webs used. This is important because we can now coalesce parts of webs. The smaller the web, the more freedom for the code generator.
16 Fact and assumptions: Alias analysis is nec. To determine the variable that might be referenced via pointers. We have to make sure we know if a variable is referenced by a pointer. Multiple aliased variables cannot be tackled. Statically we don t know where the variable is being referenced. These variables will not be coalesced. We need to work on two graphs: access graph (AG) and interference graph (IG). The IG will show us the disjointed webs that can be colocated in the same memory location. So we pick webs that have a high degree on AG and a low degree on IG. Because if we coalesce a web with a high degree AG will mean we can remove a lot of edges from the AG. A low degree in IG will mean we have lots of choices on which webs to coalesce. The weights on the AG can be calculated statically or with profiling information. Variable Coalescence and Separation Example Begin with the following: We will need to insert 6 instructions to load the register. Let s convert the program into a web:
17 The cost has gone up. This is a temporary situation. Now we will coalesce b 2 and c 2 into a new node called X. Coalescing has reduced the cost back to 6. Now do even more coalescing and we get the following:
18 You can see we have a high weight and a low cost. This example shows the benefit of coalescing. Issues on Applying Coalescence What are the difficulties, why is this work novel? Coalescence is not a new technique. But now we are coalescing disjointed webs to the same location. Maximal coalescence may not lead to the best storage assignment. In fact it may worsen it. This happens because coalescence increases the number of neighbors for coalesced nodes. Only two neighbors are allowed for each node on the path cover. Increasing the degree of the nodes, MWPC must work harder to find a node pair. Coalescing is not the best for generating the best access sequence.
19 Example: The nodes c and h were coalesced together, with the resulting edge weights. Note: the weights around c h have gone up. Let s do different coalescing and see the effect on the MWPC: Note: some coalescing leads to a higher MWPC. Coalescence does not change the cost of the graph, it just changes it to different edges. The rightmost solution is the best, it has the least cost among the choices. Coalescence leads to higher degree nodes. Path covers prefer to have only 2 neighbors.
20 Framework for SOA Pre Iteration Rules If we apply pre iteration rules before the coalescence iteration loop, the profitability is always guaranteed. Rule 1: coalesce all degree 0 nodes with any other node. Doing so will not affect the SOA cost. Rule 2: coalesce all degree 1 nodes with it neighbor. If its edge is already on the PC, the SOA cost is not affected. Otherwise we reduce the SOA cost by the weight of this edge. Rule 3: coalesce all degree 2 nodes with the neighbor having a higher weight edge connected to it. The Main SOA Algorithm At each stage the cost is calculated.
21 Benchmark Results Benchmarks show the costs of doing coalescing and program transformations. The combination of the two leads to the best performance improvements.
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 informationCode Compaction Using Post-Increment/Decrement Addressing Modes
Code Compaction Using Post-Increment/Decrement Addressing Modes Daniel Golovin and Michael De Rosa {dgolovin, mderosa}@cs.cmu.edu Abstract During computation, locality of reference is often observed, and
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 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 informationCode generation and local optimization
Code generation and local optimization Generating assembly How do we convert from three-address code to assembly? Seems easy! But easy solutions may not be the best option What we will cover: Instruction
More informationCode generation and local optimization
Code generation and local optimization Generating assembly How do we convert from three-address code to assembly? Seems easy! But easy solutions may not be the best option What we will cover: Instruction
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 & 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 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 informationRegister Allocation. Stanford University CS243 Winter 2006 Wei Li 1
Register Allocation Wei Li 1 Register Allocation Introduction Problem Formulation Algorithm 2 Register Allocation Goal Allocation of variables (pseudo-registers) in a procedure to hardware registers Directly
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 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 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 informationOn the Phase Coupling Problem between Data Memory Layout Generation and Address Pointer Assignment
On the Phase Coupling Problem between Data Memory Layout Generation and Address Pointer Assignment Bernhard Wess and Thomas Zeitlhofer Institute of Communications and Radio-Frequency Engineering INSTITUT
More informationCS399 New Beginnings. Jonathan Walpole
CS399 New Beginnings Jonathan Walpole Memory Management Memory Management Memory a linear array of bytes - Holds O.S. and programs (processes) - Each cell (byte) is named by a unique memory address Recall,
More informationSimple Machine Model. Lectures 14 & 15: Instruction Scheduling. Simple Execution Model. Simple Execution Model
Simple Machine Model Fall 005 Lectures & 5: Instruction Scheduling Instructions are executed in sequence Fetch, decode, execute, store results One instruction at a time For branch instructions, start fetching
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 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 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 informationCS 31: Intro to Systems Virtual Memory. Kevin Webb Swarthmore College November 15, 2018
CS 31: Intro to Systems Virtual Memory Kevin Webb Swarthmore College November 15, 2018 Reading Quiz Memory Abstraction goal: make every process think it has the same memory layout. MUCH simpler for compiler
More informationCS Operating Systems
CS 4500 - Operating Systems Module 9: Memory Management - Part 1 Stanley Wileman Department of Computer Science University of Nebraska at Omaha Omaha, NE 68182-0500, USA June 9, 2017 In This Module...
More informationCS Operating Systems
CS 4500 - Operating Systems Module 9: Memory Management - Part 1 Stanley Wileman Department of Computer Science University of Nebraska at Omaha Omaha, NE 68182-0500, USA June 9, 2017 In This Module...
More informationIntermediate Representations Part II
Intermediate Representations Part II Types of Intermediate Representations Three major categories Structural Linear Hybrid Directed Acyclic Graph A directed acyclic graph (DAG) is an AST with a unique
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 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 informationCode generation and optimization
Code generation and timization Generating assembly How do we convert from three-address code to assembly? Seems easy! But easy solutions may not be the best tion What we will cover: Peephole timizations
More informationA Bad Name. CS 2210: Optimization. Register Allocation. Optimization. Reaching Definitions. Dataflow Analyses 4/10/2013
A Bad Name Optimization is the process by which we turn a program into a better one, for some definition of better. CS 2210: Optimization This is impossible in the general case. For instance, a fully optimizing
More informationIntermediate Representations
Intermediate Representations Intermediate Representations (EaC Chaper 5) Source Code Front End IR Middle End IR Back End Target Code Front end - produces an intermediate representation (IR) Middle end
More informationCPE 426/526 Chapter 12 - Synthesis Algorithms for Design Automation (Supplement) Dr. Rhonda Kay Gaede UAH
CPE 426/526 Chapter 12 - Synthesis Algorithms for Design Automation (Supplement) Dr. Rhonda Kay Gaede UAH 1 12.4.5 Analysis of the Allocation Problem - Terminology Allocation is needed for,, and Two items
More informationMemory Bank and Register Allocation in Software Synthesis for ASIPs
Memory Bank and Register Allocation in Software Synthesis for ASIPs Ashok Sudarsanam Sharad Malik Department of Electrical Engineering Princeton University Abstract An architectural feature commonly found
More informationSearch Algorithms. IE 496 Lecture 17
Search Algorithms IE 496 Lecture 17 Reading for This Lecture Primary Horowitz and Sahni, Chapter 8 Basic Search Algorithms Search Algorithms Search algorithms are fundamental techniques applied to solve
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 informationCSE 504: Compiler Design. Instruction Selection
Instruction Selection Pradipta De pradipta.de@sunykorea.ac.kr Current Topic Instruction Selection techniques Tree Walk Tiling based approach Peephole Optimization Instruction Selection Difficulty of Instruction
More information12: Memory Management
12: Memory Management Mark Handley Address Binding Program goes through multiple steps from compilation to execution. At some stage, addresses in the program must be bound to physical memory addresses:
More informationCODE GENERATION Monday, May 31, 2010
CODE GENERATION memory management returned value actual parameters commonly placed in registers (when possible) optional control link optional access link saved machine status local data temporaries A.R.
More informationARSITEKTUR SISTEM KOMPUTER. Wayan Suparta, PhD 17 April 2018
ARSITEKTUR SISTEM KOMPUTER Wayan Suparta, PhD https://wayansuparta.wordpress.com/ 17 April 2018 Reduced Instruction Set Computers (RISC) CISC Complex Instruction Set Computer RISC Reduced Instruction Set
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 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 informationChapter 2 Instruction Set Architecture
Chapter 2 Instruction Set Architecture Course Outcome (CO) - CO2 Describe the architecture and organization of computer systems Program Outcome (PO) PO1 Apply knowledge of mathematics, science and engineering
More informationConcepts Introduced in Chapter 3
Concepts Introduced in Chapter 3 basic instruction set design principles subset of the MIPS assembly language correspondence between high-level language constructs and MIPS assembly code how MIPS assembly
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 informationAdvanced Database Systems
Lecture IV Query Processing Kyumars Sheykh Esmaili Basic Steps in Query Processing 2 Query Optimization Many equivalent execution plans Choosing the best one Based on Heuristics, Cost Will be discussed
More informationLecture 4: MIPS Instruction Set
Lecture 4: MIPS Instruction Set No class on Tuesday Today s topic: MIPS instructions Code examples 1 Instruction Set Understanding the language of the hardware is key to understanding the hardware/software
More informationComputer Architecture and Organization. Instruction Sets: Addressing Modes and Formats
Computer Architecture and Organization Instruction Sets: Addressing Modes and Formats Addressing Modes Immediate Direct Indirect Register Register Indirect Displacement (Indexed) Stack Immediate Addressing
More informationCompilers. 8. Run-time Support. Laszlo Böszörmenyi Compilers Run-time - 1
Compilers 8. Run-time Support Laszlo Böszörmenyi Compilers Run-time - 1 Run-Time Environment A compiler needs an abstract model of the runtime environment of the compiled code It must generate code for
More informationRegister Allocation. Introduction Local Register Allocators
Register Allocation Introduction Local Register Allocators Copyright 2015, Pedro C. Diniz, all rights reserved. Students enrolled in the Compilers class at the University of Southern California have explicit
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 informationWhat Compilers Can and Cannot Do. Saman Amarasinghe Fall 2009
What Compilers Can and Cannot Do Saman Amarasinghe Fall 009 Optimization Continuum Many examples across the compilation pipeline Static Dynamic Program Compiler Linker Loader Runtime System Optimization
More informationQuery Processing & Optimization
Query Processing & Optimization 1 Roadmap of This Lecture Overview of query processing Measures of Query Cost Selection Operation Sorting Join Operation Other Operations Evaluation of Expressions Introduction
More informationChapter 11. Instruction Sets: Addressing Modes and Formats. Yonsei University
Chapter 11 Instruction Sets: Addressing Modes and Formats Contents Addressing Pentium and PowerPC Addressing Modes Instruction Formats Pentium and PowerPC Instruction Formats 11-2 Common Addressing Techniques
More informationProgramming Languages Third Edition. Chapter 10 Control II Procedures and Environments
Programming Languages Third Edition Chapter 10 Control II Procedures and Environments Objectives Understand the nature of procedure definition and activation Understand procedure semantics Learn parameter-passing
More informationVirtual Memory 1. To do. q Segmentation q Paging q A hybrid system
Virtual Memory 1 To do q Segmentation q Paging q A hybrid system Address spaces and multiple processes IBM OS/360 Split memory in n parts (possible!= sizes) A process per partition Program Code Heap Operating
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 informationtokens parser 1. postfix notation, 2. graphical representation (such as syntax tree or dag), 3. three address code
Intermediate generation source program lexical analyzer tokens parser parse tree generation intermediate language The intermediate language can be one of the following: 1. postfix notation, 2. graphical
More informationAddressing Modes. Immediate Direct Indirect Register Register Indirect Displacement (Indexed) Stack
Addressing Modes Addressing Modes and Formats Nizamettin AYDIN naydin@yildiz.edu.tr http://www.yildiz.edu.tr/~naydin http://akademik.bahcesehir.edu.tr/~naydin Immediate Direct Indirect Register Register
More informationCSE 504: Compiler Design. Code Generation
Code Generation Pradipta De pradipta.de@sunykorea.ac.kr Current Topic Introducing basic concepts in code generation phase Code Generation Detailed Steps The problem of generating an optimal target program
More informationFORTH SEMESTER DIPLOMA EXAMINATION IN ENGINEERING/ TECHNOLIGY- MARCH, 2012 DATA STRUCTURE (Common to CT and IF) [Time: 3 hours
TED (10)-3071 Reg. No.. (REVISION-2010) (Maximum marks: 100) Signature. FORTH SEMESTER DIPLOMA EXAMINATION IN ENGINEERING/ TECHNOLIGY- MARCH, 2012 DATA STRUCTURE (Common to CT and IF) [Time: 3 hours PART
More informationCSE 120. Translation Lookaside Buffer (TLB) Implemented in Hardware. July 18, Day 5 Memory. Instructor: Neil Rhodes. Software TLB Management
CSE 120 July 18, 2006 Day 5 Memory Instructor: Neil Rhodes Translation Lookaside Buffer (TLB) Implemented in Hardware Cache to map virtual page numbers to page frame Associative memory: HW looks up in
More informationChapter 12: Query Processing. Chapter 12: Query Processing
Chapter 12: Query Processing Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 12: Query Processing Overview Measures of Query Cost Selection Operation Sorting Join
More informationAlgorithm Design (4) Metaheuristics
Algorithm Design (4) Metaheuristics Takashi Chikayama School of Engineering The University of Tokyo Formalization of Constraint Optimization Minimize (or maximize) the objective function f(x 0,, x n )
More informationAbstract Interpretation Continued
Abstract Interpretation Continued Height of Lattice: Length of Max. Chain height=5 size=14 T height=2 size = T -2-1 0 1 2 Chain of Length n A set of elements x 0,x 1,..., x n in D that are linearly ordered,
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 informationPreview. Memory Management
Preview Memory Management With Mono-Process With Multi-Processes Multi-process with Fixed Partitions Modeling Multiprogramming Swapping Memory Management with Bitmaps Memory Management with Free-List Virtual
More informationMinimum spanning trees
Carlos Moreno cmoreno @ uwaterloo.ca EI-3 https://ece.uwaterloo.ca/~cmoreno/ece5 Standard reminder to set phones to silent/vibrate mode, please! During today's lesson: Introduce the notion of spanning
More informationCOMPUTER SCIENCE 4500 OPERATING SYSTEMS
Last update: 3/28/2017 COMPUTER SCIENCE 4500 OPERATING SYSTEMS 2017 Stanley Wileman Module 9: Memory Management Part 1 In This Module 2! Memory management functions! Types of memory and typical uses! Simple
More informationCSE 504. Expression evaluation. Expression Evaluation, Runtime Environments. One possible semantics: Problem:
Expression evaluation CSE 504 Order of evaluation For the abstract syntax tree + + 5 Expression Evaluation, Runtime Environments + + x 3 2 4 the equivalent expression is (x + 3) + (2 + 4) + 5 1 2 (. Contd
More informationModule 27 Switch-case statements and Run-time storage management
Module 27 Switch-case statements and Run-time storage management In this module we will discuss the pending constructs in generating three-address code namely switch-case statements. We will also discuss
More informationCS Programming In C
CS 24000 - Programming In C Week 16: Review Zhiyuan Li Department of Computer Science Purdue University, USA This has been quite a journey Congratulation to all students who have worked hard in honest
More informationThe Processor Memory Hierarchy
Corrected COMP 506 Rice University Spring 2018 The Processor Memory Hierarchy source code IR Front End Optimizer Back End IR target code Copyright 2018, Keith D. Cooper & Linda Torczon, all rights reserved.
More information[07] SEGMENTATION 1. 1
[07] SEGMENTATION 1. 1 OUTLINE Segmentation An Alternative to Paging Implementing Segments Segment Table Lookup Algorithm Protection and Sharing Sharing Subtleties External Fragmentation Segmentation vs
More informationVirtual Memory. Today. Segmentation Paging A good, if common example
Virtual Memory Today Segmentation Paging A good, if common example Virtual memory system Goals Transparency Programs should not know that memory is virtualized; the OS +HW multiplex memory among processes
More informationCS415 Compilers. Intermediate Represeation & Code Generation
CS415 Compilers Intermediate Represeation & Code Generation These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University Review - Types of Intermediate Representations
More informationFORTH SEMESTER DIPLOMA EXAMINATION IN ENGINEERING/ TECHNOLIGY- OCTOBER, 2012 DATA STRUCTURE
TED (10)-3071 Reg. No.. (REVISION-2010) Signature. FORTH SEMESTER DIPLOMA EXAMINATION IN ENGINEERING/ TECHNOLIGY- OCTOBER, 2012 DATA STRUCTURE (Common to CT and IF) [Time: 3 hours (Maximum marks: 100)
More informationPractice Problems for the Final
ECE-250 Algorithms and Data Structures (Winter 2012) Practice Problems for the Final Disclaimer: Please do keep in mind that this problem set does not reflect the exact topics or the fractions of each
More informationLecture Compiler Backend
Lecture 19-23 Compiler Backend Jianwen Zhu Electrical and Computer Engineering University of Toronto Jianwen Zhu 2009 - P. 1 Backend Tasks Instruction selection Map virtual instructions To machine instructions
More informationCSCI Compiler Design
CSCI 565 - Compiler Design Spring 2010 Final Exam - Solution May 07, 2010 at 1.30 PM in Room RTH 115 Duration: 2h 30 min. Please label all pages you turn in with your name and student number. Name: Number:
More informationIntermediate Representations
Intermediate Representations Where In The Course Are We? Rest of the course: compiler writer needs to choose among alternatives Choices affect the quality of compiled code time to compile There may be
More informationGraphs: Introduction. Ali Shokoufandeh, Department of Computer Science, Drexel University
Graphs: Introduction Ali Shokoufandeh, Department of Computer Science, Drexel University Overview of this talk Introduction: Notations and Definitions Graphs and Modeling Algorithmic Graph Theory and Combinatorial
More informationIntroduction to Code Optimization. Lecture 36: Local Optimization. Basic Blocks. Basic-Block Example
Lecture 36: Local Optimization [Adapted from notes by R. Bodik and G. Necula] Introduction to Code Optimization Code optimization is the usual term, but is grossly misnamed, since code produced by optimizers
More informationChapter 13: Query Processing
Chapter 13: Query Processing! Overview! Measures of Query Cost! Selection Operation! Sorting! Join Operation! Other Operations! Evaluation of Expressions 13.1 Basic Steps in Query Processing 1. Parsing
More informationRegister allocation. CS Compiler Design. Liveness analysis. Register allocation. Liveness analysis and Register allocation. V.
Register allocation CS3300 - Compiler Design Liveness analysis and Register allocation V. Krishna Nandivada IIT Madras Copyright c 2014 by Antony L. Hosking. Permission to make digital or hard copies of
More informationWilliam Stallings Computer Organization and Architecture 8 th Edition. Chapter 11 Instruction Sets: Addressing Modes and Formats
William Stallings Computer Organization and Architecture 8 th Edition Chapter 11 Instruction Sets: Addressing Modes and Formats Addressing Modes Immediate Direct Indirect Register Register Indirect Displacement
More informationRun-time Environments. Lecture 13. Prof. Alex Aiken Original Slides (Modified by Prof. Vijay Ganesh) Lecture 13
Run-time Environments Lecture 13 by Prof. Vijay Ganesh) Lecture 13 1 What have we covered so far? We have covered the front-end phases Lexical analysis (Lexer, regular expressions,...) Parsing (CFG, Top-down,
More informationRun-time Environments
Run-time Environments Status We have so far covered the front-end phases Lexical analysis Parsing Semantic analysis Next come the back-end phases Code generation Optimization Register allocation Instruction
More informationSystems I. Machine-Level Programming V: Procedures
Systems I Machine-Level Programming V: Procedures Topics abstraction and implementation IA32 stack discipline Procedural Memory Usage void swap(int *xp, int *yp) int t0 = *xp; int t1 = *yp; *xp = t1; *yp
More informationRun-time Environments
Run-time Environments Status We have so far covered the front-end phases Lexical analysis Parsing Semantic analysis Next come the back-end phases Code generation Optimization Register allocation Instruction
More informationG Compiler Construction Lecture 12: Code Generation I. Mohamed Zahran (aka Z)
G22.2130-001 Compiler Construction Lecture 12: Code Generation I Mohamed Zahran (aka Z) mzahran@cs.nyu.edu semantically equivalent + symbol table Requirements Preserve semantic meaning of source program
More informationCompiler Architecture
Code Generation 1 Compiler Architecture Source language Scanner (lexical analysis) Tokens Parser (syntax analysis) Syntactic structure Semantic Analysis (IC generator) Intermediate Language Code Optimizer
More informationName :. Roll No. :... Invigilator s Signature : INTRODUCTION TO PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70
Name :. Roll No. :..... Invigilator s Signature :.. 2011 INTRODUCTION TO PROGRAMMING Time Allotted : 3 Hours Full Marks : 70 The figures in the margin indicate full marks. Candidates are required to give
More informationLesson 2 7 Graph Partitioning
Lesson 2 7 Graph Partitioning The Graph Partitioning Problem Look at the problem from a different angle: Let s multiply a sparse matrix A by a vector X. Recall the duality between matrices and graphs:
More informationComputer Science 246 Computer Architecture
Computer Architecture Spring 2009 Harvard University Instructor: Prof. dbrooks@eecs.harvard.edu Compiler ILP Static ILP Overview Have discussed methods to extract ILP from hardware Why can t some of these
More informationMemory Allocation. Static Allocation. Dynamic Allocation. Dynamic Storage Allocation. CS 414: Operating Systems Spring 2008
Dynamic Storage Allocation CS 44: Operating Systems Spring 2 Memory Allocation Static Allocation (fixed in size) Sometimes we create data structures that are fixed and don t need to grow or shrink. Dynamic
More informationEECS 150 Homework 11 Solutions Fall 2008
The first three questions concern 8, 16, and 32 bit microcontroller chips that all have family members available for under $1. The files referenced are available at: http://www.eecs.berkeley.edu/~pister/150fa08
More informationChapter 12: Query Processing
Chapter 12: Query Processing Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Overview Chapter 12: Query Processing Measures of Query Cost Selection Operation Sorting Join
More informationWilliam Stallings Computer Organization and Architecture. Chapter 12 Reduced Instruction Set Computers
William Stallings Computer Organization and Architecture Chapter 12 Reduced Instruction Set Computers Major Advances in Computers(1) The family concept IBM System/360 1964 DEC PDP-8 Separates architecture
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 informationEmbedded Systems Development
Embedded Systems Development Lecture 8 Code Generation for Embedded Processors Daniel Kästner AbsInt Angewandte Informatik GmbH kaestner@absint.com 2 Life Range and Register Interference A symbolic register
More informationCommunity Detection. Community
Community Detection Community In social sciences: Community is formed by individuals such that those within a group interact with each other more frequently than with those outside the group a.k.a. group,
More informationGraph Theory for Modelling a Survey Questionnaire Pierpaolo Massoli, ISTAT via Adolfo Ravà 150, Roma, Italy
Graph Theory for Modelling a Survey Questionnaire Pierpaolo Massoli, ISTAT via Adolfo Ravà 150, 00142 Roma, Italy e-mail: pimassol@istat.it 1. Introduction Questions can be usually asked following specific
More information