in Compiler Design
10,059 views
10 votes
10 votes

Peephole optimization is form of

  1. Loop optimization
  2. Local optimization
  3. Constant folding
  4. Data flow analysis
in Compiler Design
by
10.1k views

1 comment

0
0

2 Answers

11 votes
11 votes
Best answer
It is a form of optimization that is done on a segment of generated code.

It is Local Optimization (b)
selected by

4 Comments

Okay, so finaly we can conclude that if any answer selected(only 1) by you or any other Veteran, is final answer.
Right Arjun Sir ?

And please provide me a reference(for study purpose) for these type of questions.
0
0
yes, but except on really confusing questions I do not want anyone to rely on answer being selected. Ideally one should know which is the correct answer. The whole point of answer being given is for verification and may be to give missing points. This one for example can be answered not by even reading the text boo but by going through the "contents page" of compiler text book. For compilers there is only 1 standard book - the Dragon book.
1
1
Okay. Thank You Arjun Sir
0
0
6 votes
6 votes

Common techniques applied in peephole optimization:

  • Constant folding – Evaluate constant subexpressions in advance.
  • Strength reduction – Replace slow operations with faster equivalents.
  • Null sequences – Delete useless operations.
  • Combine operations – Replace several operations with one equivalent.
  • Algebraic laws – Use algebraic laws to simplify or reorder instructions.
  • Special case instructions – Use instructions designed for special operand cases.
  • Address mode operations – Use address modes to simplify code.

https://en.wikipedia.org/wiki/Peephole_optimization

3 Comments

Peephole optimization is form of optimization which is performed to a code which is local.

hence final answer is B)Local Optimization

final answer:)

1
1
according to ur answer option c would have been answer but b is given
0
0
Answer:

Related questions