Graph coloring. Kempe s algorithm removes nodes with < K edges

Similar documents
Main idea. Register Allocation. Interference graph. Register allocation. Interference graph. Interference graph

Global Register Allocation

Register Allocation. Xiao Jia April 25 th, 2012

More Fun with D/A Converters

Logic Design 2013/9/26. Outline. Implementation Technology. Transistor as a Switch. Transistor as a Switch. Transistor as a Switch

Register Allocation. Goal: replace temporary variable accesses by register accesses Why? Constraints:

In this project you ll learn how to create a game in which you have to save the Earth from space monsters.

4.5 COLLEGE ALGEBRA 11/5/2015. Property of Logarithms. Solution. If x > 0, y > 0, a > 0, and a 1, then. x = y if and only if log a x = log a y.

1/24/2017. Electrical resistance

Common Collector & Common Base Amplifier Circuits

Introduction to Digital Signal Processing

CSE 554 Lecture 1: Binary Pictures

Red Room Poetry. Find out more at redroomcompany.org

Introduction to Medical Imaging. Signal Processing Basics. Strange Effects. Ever tried to reduce the size of an image and you got this?

3G Evolution. OFDM Transmission. Outline. Chapter: Subcarriers in Time Domain. Outline

Defeating a Scarcity Mindset

Assembly Instructions for Model: VMDD26

Engagement Schedule. Schedule M-3 Tutorial. December 07 United States

Migration ATV11 - ATV12

Engineering 1620: High Frequency Effects in BJT Circuits an Introduction Especially for the Friday before Spring Break

Signals and Systems Fourier Series Representation of Periodic Signals

Assembly Instructions for Model: VMAA18

RETURN TO MAIN MENU ver-increasing computer calculation speed used for games such as Tomb Raider

IEEE Broadband Wireless Access Working Group <

Pip Ahoy! Song Lyrics

Package: H: TO-252 P: TO-220 S: TO-263. Output Voltage : Blank = Adj 12 = 1.2V 15 = 1.5V 18 = 1.8V 25 = 2.5V 33 = 3.3V 50 = 5.0V 3.3V/3A.

DETERMINATION OF ELECTRONIC DISTANCE MEASUREMENT ZERO ERROR USING KALMAN FILTER

Lab 12. Speed Control of a D.C. motor. Controller Design

Lecture 19: Common Emitter Amplifier with Emitter Degeneration.

ESCI 241 Meteorology Lesson 6 Humidity

EECE 301 Signals & Systems Prof. Mark Fowler

m., r». I 11I 411.1ME

3-Dimensions. 3-Dimensions. 3D Shapes. Recognise 3-D Shapes and know their properties. 2 Dimensional. 3 Dimensional. Exercise 1

4-H Action Exhibits. All participants take an equal role in planning and doing the Action Exhibit.

FAN A, 1.2V Low Dropout Linear Regulator for VRM8.5. Features. Description. Applications. Typical Application.

x(at) 1 x(t t d ) e jωt d X( jω ) x(t)e jω 0t X( j(ω ω 0 )) READING ASSIGNMENTS Table of Easy FT Properties LECTURE OBJECTIVES

The Trouton Rankine Experiment and the End of the FitzGerald Contraction

Characteristics of BJT-2

CH 7. Synchronization Techniques for OFDM Systems

Digital Signal Processing, Fall 2009

Prototype based languages

cos The points in an Argand diagram which represent the numbers (iii) Write down a polynomial equation of degree 5 which is satisfied by w.

HSMS-2823 RF mixer/detector diode

CATTLE FINISHING RETURN

Memory Management. Memory Management. Chapter 11. Memory Management Techniques. I. Single Contiguous. II. Overlays. Advantages: Disadvantages:

Pacing Guide for Kindergarten Version GLE Checks for Understanding Vocabulary Envision Textbook Materials

CAUTION: Do not install damaged parts!!!

AN MIP APPROACH TO THE U-LINE BALANCING PROBLEM WITH PROPORTIONAL WORKER THROUGHPUT. Reyhan Erin Magna PowerTrain Troy, Michigan

7.1 Amplitude Modulation

xxxxxxxxx Mil-HDBK-217F Notice 2 MTBF Prediction Report Issue 1.0 / July 2016 This report has been prepared for:

SITE DATA INFORMATION T DRAWING INDEX

The entire devices are built in housings that are protected against liquids and dust without need to be installed in hazloc certified cabinets.

WPCA AMEREN ESP. SEMINAR Understanding ESP Controls. By John Knapik. 2004, General Electric Company

ECEN3250 Lab 8 Audio Power Amplifier

TM RULEBOOK 300_ _001_WrathRules_REV.indd 1 300_ _001_WrathRules_REV.indd 1 10/12/10 2:01 PM 10/12/10 2:01 PM

ANALYSIS ON THE COVERAGE CHARACTERISTICS OF GLONASS CONSTELLATION

2. Doodle-Offs: This is everything you ll need to kit out your 3Doodler workshop and facilitate some great. 2 x power strips and extension cords

On parameters determination of multi-port equivalent scheme for multi-winding traction transformers

Transcript from Malcolm-France

GV60 VALORSTAT PLUS OPERATING INSTRUCTIONS. VALORSTAT PLUS GV60 Electronic Ignition Remote Control

Theory and Proposed Method for Determining Large Signal Return Loss or Hot S22 for Power Amplifiers Using Phase Information

4NPA. Low Frequency Interface Module for Intercom and Public Address Systems. Fig. 4NPA (L- No )

3A High Current, Low Dropout Voltage Regulator Adjustable & Fixed Output, Fast Response Time

NHS Ayrshire & Arran

Hardware Manual. STR4 & STR8 Step Motor Drives

3A High Current, Low Dropout Voltage Regulator

RECOMMENDATION ITU-R M.1828

TEACHER INTERVIEW: MR. DINUBILA

IMP528 IMP528. High-Volt 220 V PP Driv. ive. Key Features. Applications. Block Diagram

Determination of Antenna Q from the Reflection-Coefficient Data

TALLINN UNIVERSITY OF TECHNOLOGY. IRO0140 Advanced Space Time-Frequency Signal Processing. Individual Work

student finance wales EMA Education Maintenance Allowance Application Notes for 2014/15 SFW/EMA/N/1314

3A High Current, Low Dropout Voltage Regulator Adjustable, Fast Response Time

Impact Analysis of Damping Resistors in Damped Type Double Tuned Filter on Network Harmonic Impedance

1.1 Transmission line basic concepts: Introduction to narrow-band matching networks

Intro to Screen Printing

A Timing-constrained Algorithm for Simultaneous Global Routing of Multiple Nets

Enhancing the Performance of Ultra-Tight Integration of GPS/PL/INS: A Federated Filter Approach

HVQFN16 HVQFN (thermal enhanced very thin quad flatpack; no leads) NA (not applicable) P (plastic) MO-220 S (surface mount) Issue date

Using SigLab for Production Line Audio Test

j e c t s A m P r o a z i n g P h o t o A guide to running your own 10 week after-school photography club

Optimal Spacing Design for Pilots in OFDM Systems over Multipath Fading Channels

Topic 8 Integration. Exercise 8.2 The fundamental theorem of integral calculus. TOPIC 8 Integration EXERCISE

SPX mA Low Drop Out Voltage Regulator with Shutdown FEATURES Output 3.3V, 5.0V, at 400mA Output Very Low Quiescent Current Low Dropout Voltage

Motor Control Center with DIN Rail Industrial patch panel mounted in wireway, enabling Ethernet/IP devices across multiple sections

32-Kb SPI Serial CMOS EEPROM

Autonomous Systems (AS) Introduction and Topology Bradley Huffaker CAIDA SDSC/UCSD

Tries. nimize. mize nimize ze. 4/18/2016 6:48 AM Tries 1

Integration of PV based DG Source in AC Microgrid with Interconnection to Grid

ONEWAY. Owner s Manual. Manufacturers Limited Warranty Lathe POWER AND PRECISION FOR TODAY S WOODTURNER

Performance Analysis of BLDC Motor for Sinusoidal and Trapezoidal Back-Emf using MATLAB/SIMULINK Environment

Making the Leap: Achieving Centimeter-Range Accuracy with UAVs. Francois Gervaix Product Manager, Surveying

Migração de Empresas. Offices Market Study

Switches- and Indicators. Switches Unlimited Contact: Phone: * Fax:

Chapter 2 Fundamentals of OFDM

Double-sided main board. 6 double-sided Player Boards. First Player marker. Round marker Dice. 48 double-sided Building tiles.

Exploring Handbells. Techniques & Repertoire for Handbells and Handchimes

Ultra-Fast ECL-Output Comparator with Latch Enable MAX9685. Features

Study on the Problem of VLF Underwater Emission

Safety Technique. Multi-Function Safety System SAFEMASTER M Output Module With Output Contacts BG 5912

Transcription:

Graph oloring Kmp s algorithm rmovs nods with < K dgs Fin This stp is alld simpliia1on Simpliia9on ithr nds with an mpty graph or a graph suh that ah nod has K dgs Now w hav to do somthing Eithr try out all possibl K-olorings Graph surgry 22

Spilling Givn a graph that has bn simpliid (but is not mpty) Pik a nod and rmov this nod and all its dgs rom th graph Th liv rang rprsntd by this nod is not alloatd a rgistr It is spilld th hom loa1on is in mmory W disuss latr how to pik a nod 23

Graph oloring, rvisd Rmov a nod i it has K-1 or wr nighbors Push on a stak whn rmoving Rmov un1l all nods hav K nighbors or th graph is mpty (All nods hav K nighbors): Pik a nod and rmov it with all its dgs Con1nu simpliia1on Can t on1nu as all nods hav K nighbors: Pik a nod and rmov it (Graph is mpty): Color graph Pop nod rom stak Assign olor 24

Spilld liv rangs A spilld liv rang rsids in mmory Crat tmporary, usually stord in th a1va1on rord What should w do with a spilld liv rang whn gnra9ng od? v1 = a + b = v1 + d v2 = b * 2 v1 v2 v3 a b d b, ar spilld 25

Spilld liv rangs Targt mahin (x86) rquirs that at last on oprand rsids in a rgistr Th othr on an by supplid by mmory Spilld liv rang oprand in mmory v1 = a + b : onstraint that b must b in mmory OUCH Now th rgistr alloator dtrmins instru1on sl1on Must run rgistr alloa1on prior to instru1on sl1on 26

Phas oupling Cod sl9on Rgistr alloa9on Cod shduling Cod sl9on dpnds on od shduling Cod shduling dpnds on rgistr alloa9on Rgistr alloa9on dpnds on od sl9on Clos oupling o dirnt od gnrator phass 27

Spilld liv rangs Targt mahin (x86) rquirs that at last on oprand rsids in a rgistr Th othr on an by supplid by mmory Spilld liv rang oprand in mmory v1 = a + b : onstraint that b must b in mmory OUCH Now th rgistr alloator dtrmins instru1on sl1on Must run rgistr alloa1on prior to instru1on sl1on And what i a is spilld as wll? Sam problm or RISC mahin: All oprands must b in a rgistr 28

Spilld liv rangs Cod gnrator may nd a rgistr or a spilld liv rang ( or or two liv rangs, or or ds9na9on i ds9na9on liv rang is spilld) Op9on 1: spar rgistrs Cod gnrator kps spar rgistrs that ar not alloatd by rgistr alloator 1 rgistr nough on IA32, 2 on RISC mahin Dpnds not all rgistrs may b ratd qual Rgistr alloator inds (K-2)-oloring or (K-1)-oloring!) Mayb OK on a RISC with 32 or 64 rgistrs 29

Mor graph surgry Whn spilling a nod, introdu a nw tmporary, rwrit th IR and start ovr Exampl v1 = a + b with b spilld. Introdu a tmporary tmp101, stord at (say) bp+40 Rwrit to tmp101 = * (bp + 40) v1 = a + tmp101 *(bp+40): shorthand or load tmporary 30

Tmporary liv rangs Liv rang o tmporaris is vry small Just on instru1on Graph should b asir to olor Tmporary has smallr numbr o dgs than spilld liv rang A dirnt tmporary is usd or ah us o th spilld variabl Rbuild intrrn graph and start ovr And i th graph s1ll annot b K-olord: Pik anothr nod or spilling As long as numbr o rgistrs > numbr o (asm) oprands th pross trminats with a lgal K-oloring 31

Exampl Considr an intrrn graph with 5 variabls v3 v1 v5 v2 v4 v1 v2 v3 v4 v5 32

Exampl with 3 rgistrs v3 v4 is rmovd by simpliia9on All rmaining nods 3 dgs v1 v5 Lt v5 b spilld v2 v4 33

Intrrn graph ronstru9on Introdu9on o tmporaris adds nods to intrrn graph v3 v1 t4 t1 v2 v4 t6 v1 v2 v3 v4 t1 t6 t2 t3 t5 34

Mor graph surgry A (bar?) approah is to split th liv rang v1 v2 v3 v4 v5 v1 v2 v3 v4 v5-1 v5-4 35

A nw intrrn graph v5-2 v3 v1 v5-3 v5-1 v2 v4 v5-4 v1 v2 v3 v4 v5-1 v5-4 36

Splibng Splibng rdus numbr o instru9ons that ar ndd to load (stor) tmporary variabls Variabls that ar spilld to mmory Whih liv rangs to split? Whr to split thm? 37

Nd to disuss spilling disions bor splibng 38

Graph oloring, rvisd Rmov a nod i it has K-1 or wr nighbors Push on a stak whn rmoving Rmov un1l all nods hav K nighbors or th graph is mpty (All nods hav K nighbors): Pik a nod and rmov it with all its dgs Con1nu simpliia1on Can t on1nu as all nods hav K nighbors: Pik a nod and rmov it (Graph is mpty): Color graph Pop nod rom stak Assign olor 39

Piking th spill vi9m A numbr o huris9s hav bn trid. Pik a nod at random (Chai9n, 1982) Pik nod with lowst spill ost s9mat (Chow, 1983) How do w s1mat spill ost Pik nod with lowst us ount 40

Es9ma9ng spill ost Nd to s9mat how on a basi blok is xutd Us proil rom past xu9on o program Input dpndnt? Us proil o urrnt xu9on Can b don in JIT (Just-in-1m ompilr) Guss: past prdits th utur Guss by rul-o-tn: loops xut 10 9ms 41

Es9ma9ng spill ost 42

Es9ma9ng spill ost 10 100 1000 10000 100 1000 10 100 43

Extnsions Spill ost s9mat an b xtndd to idn9y splibng andidats Don t orgt: intrrn graph rbuilt ar ah spill (split) dision Rquirs omputa1on o liv rangs! 44

Graph oloring Som spills may not vn b nssary. 45

Exampl 2 rgistrs Color Rgistr ax bx a b Stak: d

Exampl 2 rgistrs Color Rgistr ax bx a b Stak: d

Exampl 2 rgistrs Color Rgistr ax bx a b Stak: d

Exampl 2 rgistrs Color Rgistr ax bx a b Stak: d

Exampl 2 rgistrs Color Rgistr ax bx a b Stak: d

Exampl 2 rgistrs Color Rgistr ax bx a b Stak: d d

Exampl 2 rgistrs Color Rgistr ax bx a Stak: b d b d

Exampl 2 rgistrs Color Rgistr ax bx a b d Stak: a b d

Exampl 2 rgistrs Color Rgistr ax bx a Stak: b d b d

Exampl 2 rgistrs Color Rgistr ax bx a b Stak: d d

Exampl 2 rgistrs Color Rgistr ax bx a b Stak: d

Exampl 2 rgistrs Color Rgistr ax bx a b Stak: d

Exampl 2 rgistrs Color Rgistr ax bx a b Stak: d

Exampl 2 rgistrs Color Rgistr ax bx a b Stak: d

Exampl Although ah nod (ar rmoving, ) has 2 dgs, w ind a 2-oloring. Can w xploit this insight in th rgistr alloator? 60

Coalsing Cod ontains on a numbr o opy assignmnts Dspit opy propaga1on Liv rang spliing may introdu nw opis Som1ms spliing is too aggrssiv Gnral problm: two variabls v1, v2 onntd by opy No dg btwn nods or v1, v2 in intrrn graph v2 v1 61

W an oals ths liv rangs Rmovs th nd to hav a opy assignmnt May mak liv hardr or rgistr alloator as ombind nod (v1/v2) may hav not b rmovd by simpliia1on v1/v2 Huris1s to did whn to oals 62

Mahin aturs Som instru9ons work with spii rgistrs mul on x86: rads ax, dins ax and dx Must mak sur oprands ar in ths rgistrs Othr rgistrs not allowd Pr-olor ths oprands Assurs that oprand is assignd to this rgistr Color nod or oprand in intrrn graph Pr-olord nods ar not rmovd during simpliia1on Coloring starts whn all othr nods ar rmovd 63

Commnt Many itra9ons may b ndd Various huris1s rat many op1ons Major stps Livnss analysis, intrrn graph onstru1on Coloring Simpliia1on Spill/split disions Rwrit od Atual oloring Good rsults in many ass Som ompilrs produ mul1pl olor assignmnts and thn pik th bst What ould b wrong? 64