Instruction Scheduling, Register Allocation, Partial Redundancy Removal

Similar documents
Instruction Scheduling

4.1 Interval Scheduling. Chapter 4. Greedy Algorithms. Interval Scheduling: Greedy Algorithms. Interval Scheduling. Interval scheduling.

Spanning Trees. BFS, DFS spanning tree Minimum spanning tree. March 28, 2018 Cinda Heeren / Geoffrey Tien 1

Lecture 20: Minimum Spanning Trees (CLRS 23)

(Minimum) Spanning Trees

Weighted Graphs. Weighted graphs may be either directed or undirected.

5/1/2018. Huffman Coding Trees. Huffman Coding Trees. Huffman Coding Trees. Huffman Coding Trees. Huffman Coding Trees. Huffman Coding Trees

Depth First Search. Yufei Tao. Department of Computer Science and Engineering Chinese University of Hong Kong

Improving Union. Implementation. Union-by-size Code. Union-by-Size Find Analysis. Path Compression! Improving Find find(e)

The University of Sydney MATH 2009

CMSC 451: Lecture 4 Bridges and 2-Edge Connectivity Thursday, Sep 7, 2017

Divided. diamonds. Mimic the look of facets in a bracelet that s deceptively deep RIGHT-ANGLE WEAVE. designed by Peggy Brinkman Matteliano

Graph Search (6A) Young Won Lim 5/18/18

COMP 250. Lecture 29. graph traversal. Nov. 15/16, 2017

Strongly connected components. Finding strongly-connected components

In which direction do compass needles always align? Why?

CMPS 2200 Fall Graphs. Carola Wenk. Slides courtesy of Charles Leiserson with changes and additions by Carola Wenk

d e c b a d c b a d e c b a a c a d c c e b

Lecture II: Minimium Spanning Tree Algorithms

CSE 332. Data Structures and Parallelism

CSE 332. Graphs 1: What is a Graph? DFS and BFS. Data Abstractions. CSE 332: Data Abstractions. A Graph is a Thingy... 2

learning objectives learn what graphs are in mathematical terms learn how to represent graphs in computers learn about typical graph algorithms

Minimum Spanning Trees (CLRS 23)

Having a glimpse of some of the possibilities for solutions of linear systems, we move to methods of finding these solutions. The basic idea we shall

Applications of trees

Single Source Shortest Paths (with Positive Weights)

Theorem 1. An undirected graph is a tree if and only if there is a unique simple path between any two of its vertices.

Platform Controls. 1-1 Joystick Controllers. Boom Up/Down Controller Adjustments

CS 103 BFS Alorithm. Mark Redekopp

SAMPLE CSc 340 EXAM QUESTIONS WITH SOLUTIONS: part 2

Minimum Spanning Trees (CLRS 23)

MATERIAL SEE BOM ANGLES = 2 FINISH N/A

Exam 2 Solutions. Jonathan Turner 4/2/2012. CS 542 Advanced Data Structures and Algorithms

Dental PBRN Study: Reasons for replacement or repair of dental restorations

CS553 Lecture Register Allocation I 3

L.3922 M.C. L.3922 M.C. L.2996 M.C. L.3909 M.C. L.5632 M.C. L M.C. L.5632 M.C. L M.C. DRIVE STAR NORTH STAR NORTH NORTH DRIVE

CSE 332. Graphs 1: What is a Graph? DFS and BFS. Data Abstractions. CSE 332: Data Abstractions. A Graph is a Thingy... 2

MATERIAL SEE BOM ANGLES = 2 > 2000 DATE MEDIUM FINISH

Cycles and Simple Cycles. Paths and Simple Paths. Trees. Problem: There is No Completely Standard Terminology!

b.) v d =? Example 2 l = 50 m, D = 1.0 mm, E = 6 V, " = 1.72 #10 $8 % & m, and r = 0.5 % a.) R =? c.) V ab =? a.) R eq =?

MINI POST SERIES BALUSTRADE SYSTEM INSTALLATION GUIDE PRODUCT CODE: MPS-RP

, each of which is a tree, and whose roots r 1. , respectively, are children of r. Data Structures & File Management

The R-Tree. Yufei Tao. ITEE University of Queensland. INFS4205/7205, Uni of Queensland

Math 166 Week in Review 2 Sections 1.1b, 1.2, 1.3, & 1.4

Minimum Spanning Trees

Graphs Depth First Search

Planar convex hulls (I)

OpenMx Matrices and Operators

CLKOUT CLKOUT VCC CLKOUT RESOUT OSCOUT ALE TEST AD0 66 AD2 INT0 INT0 AD INT1 AD INT2/INTA0 AD5 AD7 AD7 INT AD8 AD8 AD10

DOCUMENT STATUS: RELEASE

Paths. Connectivity. Euler and Hamilton Paths. Planar graphs.

2 Trees and Their Applications

16.unified Introduction to Computers and Programming. SOLUTIONS to Examination 4/30/04 9:05am - 10:00am

Grade 7/8 Math Circles March 4/5, Graph Theory I- Solutions

CSC Design and Analysis of Algorithms. Example: Change-Making Problem

CS553 Lecture Register Allocation 1

Copyright 2000, Kevin Wayne 1

Problem solving by search

Closed Monochromatic Bishops Tours

DOCUMENT STATUS: MINTP0 E-ST5080, BASE, NO DISPLAY VENDOR: 15.5 INCH MATERIAL SEE BOM FINISH REVISION HISTORY ITEM NO. PART NUMBER DESCRIPTION

DOCUMENT STATUS: CORE HEALTH & FITNESS, LLC IL-D2002-XXAAX IP,DUAL ADJUSTIBLE PULLEY MATERIAL SEE BOM FINISH N/A N/A SHEET SIZE: B SCALE: 1:33.

Priority Search Trees - Part I

V={A,B,C,D,E} E={ (A,D),(A,E),(B,D), (B,E),(C,D),(C,E)}

4 4 N v b r t, 20 xpr n f th ll f th p p l t n p pr d. H ndr d nd th nd f t v L th n n f th pr v n f V ln, r dn nd l r thr n nt pr n, h r th ff r d nd

V={A,B,C,D,E} E={ (A,D),(A,E),(B,D), (B,E),(C,D),(C,E)}

CS61B Lecture #33. Administrivia: Autograder will run this evening. Today s Readings: Graph Structures: DSIJ, Chapter 12

A Simple Code Generator. Code generation Algorithm. Register and Address Descriptors. Example 3/31/2008. Code Generation

MAT3707. Tutorial letter 201/1/2017 DISCRETE MATHEMATICS: COMBINATORICS. Semester 1. Department of Mathematical Sciences MAT3707/201/1/2017

Constructive Geometric Constraint Solving

DOCUMENT STATUS: LA-S5302-XXXXS LA, SSS, TRICEPS EXTENSION VERY

Computer Graphics. Viewing & Projections

Colby College Catalogue

CSE 373: AVL trees. Warmup: Warmup. Interlude: Exploring the balance invariant. AVL Trees: Invariants. AVL tree invariants review

EE1000 Project 4 Digital Volt Meter

23 Minimum Spanning Trees

ECE COMBINATIONAL BUILDING BLOCKS - INVEST 13 DECODERS AND ENCODERS

CS September 2018

a b c cat CAT A B C Aa Bb Cc cat cat Lesson 1 (Part 1) Verbal lesson: Capital Letters Make The Same Sound Lesson 1 (Part 1) continued...

Face Detection and Recognition. Linear Algebra and Face Recognition. Face Recognition. Face Recognition. Dimension reduction

FL/VAL ~RA1::1. Professor INTERVI of. Professor It Fr recru. sor Social,, first of all, was. Sys SDC? Yes, as a. was a. assumee.

4 8 N v btr 20, 20 th r l f ff nt f l t. r t pl n f r th n tr t n f h h v lr d b n r d t, rd n t h h th t b t f l rd n t f th rld ll b n tr t d n R th

Graph Search Algorithms

17 Basic Graph Properties

Register Allocation. Register Allocation. Principle Phases. Principle Phases. Example: Build. Spills 11/14/2012

An undirected graph G = (V, E) V a set of vertices E a set of unordered edges (v,w) where v, w in V

Outline. 1 Introduction. 2 Min-Cost Spanning Trees. 4 Example



Colby College Catalogue

Colby College Catalogue

CSE 373. Graphs 1: Concepts, Depth/Breadth-First Search reading: Weiss Ch. 9. slides created by Marty Stepp


(2) If we multiplied a row of B by λ, then the value is also multiplied by λ(here lambda could be 0). namely

n r t d n :4 T P bl D n, l d t z d th tr t. r pd l

Announcements. Not graphs. These are Graphs. Applications of Graphs. Graph Definitions. Graphs & Graph Algorithms. A6 released today: Risk

176 5 t h Fl oo r. 337 P o ly me r Ma te ri al s

46 D b r 4, 20 : p t n f r n b P l h tr p, pl t z r f r n. nd n th t n t d f t n th tr ht r t b f l n t, nd th ff r n b ttl t th r p rf l pp n nt n th

On Hamiltonian Tetrahedralizations Of Convex Polyhedra

Shortest Paths in Graphs. Paths in graphs. Shortest paths CS 445. Alon Efrat Slides courtesy of Erik Demaine and Carola Wenk

Using the Printable Sticker Function. Using the Edit Screen. Computer. Tablet. ScanNCutCanvas

Transcription:

CSC 255/455 Softwr Anlyss n Improvmnt Instruton Suln, Rstr Alloton, Prtl Runny Rmovl Lol Instruton Suln A Prmr for L 3 Comp 412 COMP 412 FALL 2008 Instrutor: Cn Dn Copyrt 2008, Kt D. Coopr & Ln Torzon, ll rts rsrv. Stunts nroll n Comp 412 t R Unvrsty v xplt prmsson to mk ops of ts mtrls for tr prsonl us. Fulty from otr utonl nsttutons my us ts mtrls for nonproft utonl purposs, prov ts opyrt not s prsrv. Wt Mks Co Run Fst?! Mny oprtons v non-zro ltns! Morn mns n ssu svrl oprtons pr yl! Exuton tm s orr-pnnt (n s n sn t 60 s) Assum ltns (onsrvtv) Oprton Cyls lo 3 stor 3 loi 1 1 mult 2 f 1 fmult 2 sft 1 rn 0 to 8! Los & stors my or my not lok >! Non-lokn!fll tos ssu slots! Brn osts vry wt pt tkn! Brns typlly v ly slots >! Fll slots wt unrlt oprtons >! Prolts rn upwr! Sulr soul t ltns L 3 wll ul lol sulr Comp 412, Fll 2008 1 Smpl sul 1 loai r0,@w! r1 4 r1,r1! r1 5 loai r0,@x! r2 8 mult r1,r2! r1 9 loai r0,@y! r2 12 mult r1,r2! r1 13 loai r0,@z! r2 16 mult r1,r2! r1 18 storai r1! r0,@w 21 r1 s fr w " w * 2 * x * y * z Sul los rly 1 loai r0,@w! r1 2 loai r0,@x! r2 3 loai r0,@y! r3 4 r1,r1! r1 5 mult r1,r2! r1 6 loai r0,@z! r2 7 mult r1,r3! r1 9 mult r1,r2! r1 11 storai r1! r0,@w 14 r1 s fr 2 rstrs, 20 yls 3 rstrs, 13 yls Rorrn oprtons for sp s ll nstruton suln Comp 412, Fll 2008 2 Instruton Suln (Ennr s Vw) T Prolm Gvn o frmnt for som trt mn n t ltns for nvul oprton, rorr t oprtons to mnmz xuton tm Instruton Suln (T Astrt Vw) To ptur proprts of t o, ul prn rp G! Nos n! G r oprtons wt typ(n) n ly(n)! An = (n 1,n 2 )! G f & only f n 2 uss t rsult of n 1 T Conpt Mn srpton slow Sulr o fst o T Tsk! Prou orrt o! Mnmz wst yls! Avo splln rstrs! Oprt ffntly f T Co T Prn Grp Comp 412, Fll 2008 3 Comp 412, Fll 2008 4

Instruton Suln (Dfntons) A orrt sul S mps n! N nto non-ntv ntr rprsntn ts yl numr, n 1. S(n)! 0, for ll n! N, ovously 2. If (n 1,n 2 )! E, S(n 1 ) + ly(n 1 )! S(n 2 ) 3. For typ t, tr r no mor oprtons of typ t n ny yl tn t trt mn n ssu T lnt of sul S, not L(S), s L(S) = mx n! N (S(n) + ly(n)) T ol s to fn t sortst possl orrt sul. S s tm-optml f L(S)! L(S 1 ), for ll otr suls S 1 A sul mt lso optml n trms of rstrs, powr, or sp. Instruton Suln (Wt s so ffult?) Crtl Ponts! All oprns must vll! Multpl oprtons n ry! Movn oprtons n lntn rstr lftms! Pln uss nr fntons n sortn rstr lftms! Oprns n v multpl prssors Totr, ts ssus mk suln r (NP-Complt) Lol suln s t smpl s! Rstrt to strt-ln o! Consstnt n prtl ltns Comp 412, Fll 2008 5 Comp 412, Fll 2008 6 Instruton Suln: T B Ptur 1. Bul prn rp, P 2. Comput prorty funton ovr t nos n P 3. Us lst suln to onstrut sul, on yl t tm. Us quu of oprtons tt r ry. At yl I. Coos t st prorty ry oprton n sul t II. Upt t ry quu Lol lst suln! T omnnt lortm for twnty yrs! A ry, urst, lol tnqu Lol Lst Suln Cyl " 1 Ry " lvs of P Atv " Ø wl (Ry # Atv $ Ø) f (Ry $ Ø) tn rmov n op from Ry S(op) " Cyl Atv Atv # op Cyl " Cyl + 1 for op % Atv f (S(op) + ly(op)! Cyl) tn rmov op from Atv for sussor s of op n P f (s s ry) tn Ry " Ry # s Rmovl n prorty orr op s omplt xuton If sussor s oprns r ry, put t on Ry Comp 412, Fll 2008 7 Comp 412, Fll 2008 8 Suln 1.! Bul t prn rp Suln 1.! Bul t prn rp 2.! Dtrmn prorts: lonst ltny-wt pt f 13 12 9 8 7 f 5 3 T Co T Prn Grp T Co T Prn Grp Comp 412, Fll 2008 9 Comp 412, Fll 2008

Suln 1.! Bul t prn rp 2.! Dtrmn prorts: lonst ltny-wt pt 3.! Prform lst suln 1) : l o A I r 0, @w! r 1 2) : l o A I r 0, @ x! r 2 3) : l o A I r 0, @ y! r 3 4) : r 1, r 1! r 1 5) : m ul t r 1, r 2! r 1 6) : l o A I r 0, @z! r 2 7) f: m ul t r 1, r 3! r 1 9) : m ul t r 1, r 2! r 1 11) : s t o r A I r 1! r 0, @w T Co Nw rstr nm us 13 12 9 8 7 f 5 3 T Prn Grp Mor Lst Suln Lst suln rks own nto two stnt lsss Forwr lst suln Bkwr lst suln! Strt wt vll oprtons! Strt wt no sussors! Work forwr n tm! Work kwr n tm! Ry! ll oprns vll! Ry! ltny ovrs uss Vrtons on lst suln! Prortz rtl pt(s)! Sul lst us s soon s possl! Dpt frst n prn rp (mnmz rstrs)! Brt frst n prn rp (mnmz ntrloks)! Prfr oprton wt most sussors Comp 412, Fll 2008 11 Comp 412, Fll 2008 14 Slk s Suln Stuy 3 omput monts of work Non-optml lst suls (%) vrsus vll prlllsm 1 funtonl unt, rnomly nrt loks of, 20, 50 ops Rstr Alloton Prt of t omplr s k n IR Instruton Slton m rstr sm Instruton Suln m rstr sm Rstr Alloton k rstr sm! 85,000 rnomly nrt loks! RBF foun optml suls for > 80% T-rkn mttrs us t ffts t o wn quu s > 1 lmnt Comp! Pk 412, ffulty Fll 2008 (for RBF) s roun 2.8 15 Errors Crtl proprts! Prou orrt o tt uss k (or fwr) rstrs! Mnmz los n stors! Mnmz sp us to ol spll vlus! Oprt ffntly O(n), O(n lo 2 n), my O(n 2 ), ut not O(2 n ) Comp 412, Fll 2008 1 An : Bottom-up! Lv Rns Co to Intrfrn Grp 1 loi 28! r1 // r1 2 lo r1! r2 // r1 r2 3 mult r1, r2! r3 // r1 r2 r3 4 loi 5! r4 // r1 r2 r3 r4 5 su r4, r2! r5 // r1 r3 r5 6 loi 8! r6 // r1 r3 r5 r6 7 mult r5, r6! r7 // r1 r3 r7 8 su r7, r3! r8 // r1 r8 9 stor r8! r1 // NOTE: lv sts on xt of nstruton s415, sprn 09 y Ul Krmr Ltur 1 47

An : Bottom-up! Lv Rns 1 loi 28! r1 // r1 2 lo r1! r2 // r1 r2 3 mult r1, r2! r3 // r1 r2 r3 4 loi 5! r4 // r1 r2 r3 r4 5 su r4, r2! r5 // r1 r3 r5 6 loi 8! r6 // r1 r3 r5 r6 7 mult r5, r6! r7 // r1 r3 r7 8 su r7, r3! r8 // r1 r8 9 stor r8! r1 // Intrfrn Grp to Colorn NOTE: lv sts on xt of nstruton s415, sprn 09 y Ul Krmr Ltur 1 47 Grp Colorn (A Bkroun Drsson) T prolm A rp G s s to k-olorl ff t nos n ll wt ntrs 1 k so tt no n G onnts two nos wt t sm ll s 2-olorl 3-olorl E olor n mpp to stnt pysl rstr Glol Rstr Alloton Tkn lol ppro! Anon t stnton twn lol & lol! Mk systmt us of rstrs or mmory! Aopt nrl sm to pproxmt oo lloton Grp olorn prm (Lvrov & (ltr) Ctn ) 1! Bul n ntrfrn rp G I for t prour! Computn LIVE s rr tn n t lol s! G I s not n ntrvl rp 2! (try to) onstrut k-olorn! Mnml olorn s NP-Complt! Spll plmnt oms rtl ssu 3! Mp olors onto pysl rstrs Comp 412, Fll 2008 6 Comp 412, Fll 2008 5 Improvmnt n Colorn Sm Optmst Colorn (Brs, Coopr, Knny, n Torzon)! If Ctn s lortm rs stt wr vry no s k or mor nors, t ooss no to spll.! Brs s, tk tt sm no n pus t on t stk! Wn you pop t off, olor mt vll for t! 2 Rstrs: Ctn s lortm mmtly splls on of ts nos Lzy Co Moton (Prtl Runny Elmnton)! For xmpl, no n mt v k+2 nors, ut tos nors mt only us 3 (<k) olors!!dr s loos uppr oun on olorlty Comp 412, Fll 2008 21

Prtlly Runnt Exprsson An xprsson s prtlly runnt t p f t s runnt lon som, ut not ll, pts rn p Prtlly Runnt Exprsson An xprsson s prtlly runnt t p f t s runnt lon som, ut not ll, pts rn p! + 1! +! + 1! +! +! + 1! +! + 1! +! +! +! +! +! + Insrtn opy of! + ftr t fnton of n mk t runnt fully runnt? Insrtn opy of! + ftr t fnton of n mk t runnt fully runnt? COMP 512, Sprn 2009! * 3! COMP 512, Sprn 2009! * 3! Lzy Co Moton Sours Knoop, Rutn, Stffn, PLDI 1992 Drsslr n Stl, SIGPLAN 1993 Cptr, Ennrn omplr Intuton omputr vll n ntpl xprssons omput t rlst plmnt for xprsson pus xprssons own t CFG to t lst pont wt no runny Solvn st of t flow qutons vllty, ntpl, rlst plmnt, ltr plmnt, nsrt, lt 27