Docsity

Instruction Scheduling: Start Time, Slack, Priority and List Scheduling - Prof. Nathan Cla, Study notes of Computer Science

Partial preview of the text

Download Instruction Scheduling: Start Time, Slack, Priority and List Scheduling - Prof. Nathan Cla and more Study notes Computer Science in PDF only on Docsity!

Instruction Scheduling

Dependence Graph Properties - Estart^ Ā™

Estart = earliest start time (as soon as possible - ASAP)Ā™ Estart

earliest start time, (as soon as possible

ASAP)

Ā»^

Schedule length with infinite resources (dependence height)

Ā»^

Estart = 0 if node has no predecessors

Ā»^

Estart = MAX(Estart(pred) + latency) for each predecessor node

Ā»^

Example

2

3

2 3

3

1 2

  • 1 -

Slack^ Ā™

Slack = measure of the scheduling freedomĀ™ Slack

measure of the scheduling freedom

Ā»^

Slack = Lstart – Estart for each node

Ā»^

Larger slack means more mobility

Ā»^

Example

2

3

2 3

3

1 2

  • 3 -

Critical Path^ Ā™

Critical operations = Operations with slack = 0Ā™ Critical operations

Operations with slack

Ā»^

No mobility, cannot be delayed without extending the schedulelength of the blockC iti

l^

th^

f^

iti^

l^

ti^

f^

d^

ith

Ā»^

Critical path = sequence of critical operations from node with nopredecessors to exit node, can be multiple crit paths

2

3

2 3

3

1 2

  • 4 -

Operation Priority^ Ā™

Priority – Need a mechanism to decide which ops toĀ™ Priority

Need a mechanism to decide which ops to

schedule first (when you have multiple choices)

Ā™^

Common priority functionsĀ»

Height – Distance from exit node

y^
Give priority to amount of work left to do

Ā»^

Slackness – inversely proportional to slack

y p

p

y^
Give priority to ops on the critical path

Ā»^

Register use – priority to nodes with more source operands andfewer destination operandsfewer destination operands^ y

Reduces number of live registers

Ā»^

Uncover – high priority to nodes with many children^ y

Frees up more nodesy Frees up more nodes

Ā»^

Original order – when all else fails

  • 6 -

Height-Based Priority^ Ā™

Height-based is the most commonĀ™ Height based is the most common

Ā»^

priority(op) = MaxLstart – Lstart(op) + 1

0, 1

2

2 2

2, 2

2, 3

op
priority

1

2 2

1 4, 4^2

6, 6 1

4, 7

7, 7

0, 5 2

(^1) 8, 8 - 7 -

Operation Scheduling Example (1)

Machine: 2 issue, 1 memory port, 1 ALUM^
t^
l^
i^
li^
d
RU_map
time ALU MEM

0, 0

1 0, 1

Schedule
time Ready
Placed
Memory port = 2 cycles, non-pipelinedALU = 1 cycle
time ALU MEM 0 1 2 3

op^

pr 1

8 2

9

2m 3m

4 2

2 2

,

2, 2

2, 3

1 1

time Ready
Placed

2

9 3

7 4

6 5

5 6

3

5m 2

2

2

1 4, 4^2

7

4 8

2 9

2 10

1

6

9

8

6, 6 1

4 7

7m 7 7 0, 5 2

9

8 4, 7

7, 7

1 10

(^1) 8, 8

  • 9 -

Operation Scheduling Example (2)

2m 2

0, 0 2

1 0, 1

1

Schedule

op^

pr 1

8 2

9 3

7 4

6

3m

(^4) 5m 2

1

2, 2

2, 3 4, 4

time Placed 0

4

6 5

5 6

3 7

4 8

2 9

2

5m^6

1 2 2

, 2 6, 6

7

0 5

9

2 10

1

9

8

1

4, 7

7, 7

1

1

7m 0, 5 2

10

8, 8

  • 10 -

Course Review

Feedback^ Ā™

https://gtwebapps gatech edu/cfeis/cios new/Ā™ https://gtwebapps.gatech.edu/cfeis/cios_new/

  • 13 -

Language trends, tradeoffs

i^

d i t

t^

Ɔ

t^

d^

(^

N

Ā™

wired interconnects

Ɔ

stored program (von Neuman

machines) Ā™

lots of common bugs in repeated code

Ɔ

p

rocedures

g^

p^

p

Ā™

machine code

Ɔ

symbolic assembly (compiled by

hand)

di

il^

i^

Ɔ

bl

( h

bl

Ā™

tedious compilation

Ɔ

assembler (the assembly

compiler) Ā™

assembly

Ɔ

FORTRAN I

Ā™

assembly

Ɔ

FORTRAN I

Ā™

gotos

Ɔ

structured programming

Ā™

hardcoded ā€œOOā€ programming

Ɔ

inheritance, virtual

ll calls

Do you see a trend?

  • 15 -

HLL Compiler Structure

Source code(character stream)

Lexical Analysis

(character

stream)

Token stream

F^

t E d

Parsing

Abstract syntax tree

Front End

Machine independent
Intermediate Code Generation

Intermediate code

Back End

Machine dependent
Code Optimization

IR

Code Generation

Assembly code(character stream)

Machine
dependent
  • 16 -

(^

Logistics^ Ā™

When Where:Ā™ When, Where:

Ā»^

Monday, Dec 12, 2:50 – 5:40pm^ y

Shouldn’t take that long

R^

102 CCB (I thi k)

Ā»^

Room: 102 CCB (I think)

Ā™^

What to bring:

g

Ā»^

Up to two 8.5x11ā€ pages of notes

Ā»^

Writing utensils

Ā»^

No laptops or cell phones

Ā»^

No laptops or cell phones

  • 18 -

Topics Covered (1)^ Ā™

Intermediate representationĀ™ Intermediate representation

Ā»^

Translating high-level constructs to assembly

Ā»^

Storage management

S^
k f
y^
Stack frame
y^
Data layout
Ā™^

Control flow analysisĀ»

CFGs, dominator / post dominator analysis, immediatedom/pdomĀ» Loop detection, trip count, induction variablesĀ» Loop detection, trip count, induction variables

  • 19 -