Question: List the compiler optimization techniques and code optimization techniques Use the appropriate optimization technique for optimizing the following codes int add ( int x ,

List the compiler optimization techniques and code optimization techniques
Use the appropriate optimization technique for optimizing the following codes
int add (int x, int y)
{
return x + y;
}
int sub (int x, int y)
{
return add (x,-y);
}
int global;
void f ()
l
int i;
i =1; /* dead store */
global =1; /* dead store */
global =2;
return;
global =3; /* unreachable */
}
i =0;
j =0;
for (i=0;i45;i++)
l
arr[j]= j;
j++
for (i=0; i45; i++)
{
arr2[j]= j;
j++;
} solve and optimize with proper steps and reason no ai or chat gpt otherwise dislike
List the compiler optimization techniques and

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 Programming Questions!