Question: 1. Does the following loop have a loop-carried dependency? for (i = 0; i < 100; i++) { A[i] = B[2*i+4]; B[4*i+5] = A[i]; }
1. Does the following loop have a loop-carried dependency?
for (i = 0; i < 100; i++) {
A[i] = B[2*i+4];
B[4*i+5] = A[i];
}
- Find all the true dependency, output dependency, and anti dependency in the following loop, indicating which is which.
for (i = 0; i < 100; i++) {
A[i] = A[i] * B[i]; //S1
B[i] = A[i] + c; //S2
A[i] = C[i] * c; //S3
C[i] = D[i] * A[i]; //S4
}
Eliminate the output dependency in the above loop with renaming.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
