chapter3-m1-ziavras

Example for i1 i1000 ii1 xi xi yi loop

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: unrolling • Statically (compiler) • Dynamically (branch prediction by hardware) – Vector instrs. • Example: for (i=1; i<=1000; i=i+1) x[i]= x[i] + y[i]; » Loop iterations may overlap iterations may overlap » Little to no opportunity for overlap within a single iteration S. Ziavras Types of Data-Related Dependences • 3 types of dependence – Data dependence (often called true data dependences) – Name dependence • Anti-dependence • Output dependence – Control dependence S. Ziavras Data Dependence • Definition: Instr. j is data dependent on instr. i if – i produces a result that may be used by j, OR i: add r1, r2, r3; r1 (r2) + (r3) j: sub r4, r1, r5; r4 (r1) + (r5) – j is data dependent on instr. k, & k is data dependent on i • Chain of dependences: i k j (length varies) If 2 instructions are data dependent, they cannot instructions are data dependent, they cannot execute simultaneously or be completely overlapped S. Ziavras Data Dependence (2) • • • • Execu...
View Full Document

Ask a homework question - tutors are online