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];

}

  1. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!