ps8 - A[j+1][i] = B[i + 1][j - 1]; } } (a) Give the...

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

View Full Document Right Arrow Icon
ECE 468 Problem Set 8: Dependence analysis 1. Consider the following code: for (int i = 0; i < 6; i++) { for (int j = 0; j < 6; i++) { A[i][j] = A[i - 1][j + 1] + A[i + 1][j + 1]; } } (a) Draw the iteration space graph for this loop nest. Use solid arrows for flow dependences, dashed arrows for anti-dependences and dotted arrows for output dependences. (b) Give the distance and direction vectors for each type of dependence. (c) Can we perform loop interchange on this loop? Why or why not? 2. Consider the following code: for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { A[j][i] = A[j - 1][i - 1] + B[i][j];
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: A[j+1][i] = B[i + 1][j - 1]; } } (a) Give the distance and direction vectors for the dependences in this loop. Indicate which array the dependences are on. (b) Is loop interchange legal for this loop? Why or why not? (c) Assuming both the A and B arrays are stored in row-major order, do you expect loop interchange to be benecial for this code? Why or why not? Note that in modern processors, there are essentially no latency penalties for cache misses that occur during stores; it is mostly only cache misses during loads that aect performance. 1...
View Full Document

This note was uploaded on 02/19/2012 for the course ECE 468 taught by Professor Test during the Fall '08 term at Purdue University-West Lafayette.

Ask a homework question - tutors are online