{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

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

LECTURE - 12

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

View Full Document
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
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

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

View Full Document
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
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];

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

View Full Document
Static vs. Dynamic Scheduling
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}