closed by
2,808 views

1 Answer

Best answer
1 votes
1 votes

 strength reduction is a compiler optimization where expensive operations are replaced with equivalent but less expensive operations. 

Examples of strength reduction include:

  • replacing a multiplication within a loop with an addition
  • replacing an exponentiation within a loop with a multiplication
c = 7;
for (i = 0; i < N; i++)
{
    y[i] = c * i;
}

can be replaced with successive weaker additions

c = 7;
k = 0;
for (i = 0; i < N; i++)
{
    y[i] = k;
    k = k + c;
}
selected by

Related questions

0 votes
0 votes
1 answer
1
Nishu jindal asked Jun 25, 2016
620 views
0 votes
0 votes
1 answer
2
0 votes
0 votes
0 answers
3
Ebrahim asked Jan 11
106 views
Find the FIRST and FOLLOW of the grammar to check whether it is LL (1) parser or not. N → AB | BA A → a | CAC B → b | CBC C → a | b
0 votes
0 votes
0 answers
4