InstructionScheduling - Instruction Scheduling cs5363 1...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
cs5363 1 Instruction Scheduling
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
cs5363 2 Instruction scheduling Reorder operations to reduce running time Different operations take different number of cycles Referencing values not yet ready causes operation pipeline to stall Processors can issue multiple instructions every cycle VLIW processors: can issue one operation per functional unit in each cycle Superscalar processors: tries to issue the next k instructions if possible Instruction Scheduler Original code Reordered code
Background image of page 2
cs5363 3 Instruction Scheduling Example loadAI rarp, @w r1 add r1, r1 r1 loadAI rarp, @x r2 mult r1, r2 r1 loadAi rarp, @y r2 mult r1, r2 r1 loadAI rarp, @z r2 mult r1, r2 r1 storeAI r1 rarp, 0 loadAI rarp, @w r1 loadAI rarp, @x r2 loadAi rarp, @y r3 add r1, r1 r1 mult r1, r2 r1 loadAI rarp, @z r2 mult r1, r3 r1 mult r1, r2 r1 storeAI r1 rarp, 0 start start 1 4 5 8 9 12 13 16 18 1 2 3 4 5 6 7 9 11 Instruction level parallelism (ILP) Independent operations can be evaluated in parallel Given enough ILP, a scheduler can hide memory and functional-unit latency Must not violate original semantics of input code Assumptions: memory load: 3 cycles; mult: 2 cycles; other: 1 cycle
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
cs5363 4 Dependence Graph Dependence/precedence graph G = (N,E) Each node n N is a single operation type(n) : type of functional-unit that can execute n delay(n): number of cycles required to complete n Edge (n1,n2) N indicates n2 uses result of n1 as operand G is acyclic within each basic block a: loadAI rarp, @w r1 b: add r1, r1 r1 c: loadAI rarp, @x r2 d: mult r1, r2 r1 e: loadAi rarp, @y r2 f: mult r1, r2 r1 g: loadAI rarp, @z r2 h: mult r1, r2 r1 i: storeAI r1 rarp, 0 a b c d e f g h i Dependence graph
Background image of page 4
cs5363 5 Anti Dependences e cannot be issued before d even if e does not use result of d e overwrites the value of r2 that d uses There is an anti-dependence from d to e To handle anti-dependences, schedulers can Add anti-dependences as new edges in dependence graph; or
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/29/2012 for the course CS 5363 taught by Professor Staff during the Spring '08 term at The University of Texas at San Antonio- San Antonio.

Page1 / 17

InstructionScheduling - Instruction Scheduling cs5363 1...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online