Question: Consider a loop like this one: for(i=0; i <100; i++){ A[i] = B[i] + C[i]; C[i] = B[i] + D[i]; C[i+1] = B[i] * D[i];
Consider a loop like this one:
for(i=0; i<100; i++){
A[i] = B[i] + C[i];
C[i] = B[i] + D[i];
C[i+1] = B[i] * D[i];
}
1). Unroll the loop by a factor of 2, write out the code for the new loop
2). What kind of dependences are there in the code of your answer to 1
3). Rewrite the code to eliminate as many dependences as possible.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
