{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lec12 - LECTURE 12 ILP Recall Improving ILP = reducing...

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

View Full Document Right Arrow Icon
LECTURE - 12
Background image of page 1

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

View Full Document Right Arrow Icon
ILP: Recall Improving ILP == reducing stalls Loop unrolling enlarges the basic block More parallelism More opportunity for better scheduling Dependences: Data dependence Name dependence Control dependence
Background image of page 2
Handling Control Dependence Control dependence need not be maintained We need to maintain: Exception behaviour do not caus e new exceptions Data flow ensur e the right data item is used Speculation and conditional instructions are techniques to get around control dependence
Background image of page 3

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

View Full Document Right Arrow Icon
Loop Unrolling: a Relook Our example: for(int i = 1000; i >= 1; i = i-1) { x[i] = x[i] + C; // FP } Consider: for(int i = 1000; i >= 1; i = i-1) { A[i-1] = A[i] + C[i]; // S1 B[i-1] = B[i] + A[i-1]; // S2 } S2 is dependent on S1 S1 is dependent on its previous iteration; same case with S2 Loop-carried dependence ==> loop iterations have to be in-order
Background image of page 4
Removing Loop-Carried Dependence Another example: for(int i = 1000; i >= 1; i = i-1) { A[i] = A[i] + B[i]; // S1 B[i-1] = C[i] + D[i]; // S2 } S1 depends on the prior iteration of S2 Can be removed (no cyclic dependence) A[1000] = A[1000] + B[1000]; for(int i = 1000; i >= 2; i = i-1) { B[i-1] = C[i] + D[i]; // S2 A[i-1] = A[i-1] + B[i-1]; // S1 } B[0] = C[1] + D[1];
Background image of page 5

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

View Full Document Right Arrow Icon
Static vs. Dynamic Scheduling
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}