recategorized
4,315 views
4 votes
4 votes

Which of the following comment about peep-hole optimization is true?

  1. It is applied to small part of the code and applied repeatedly
  2. It can be used to optimize intermediate code 
  3. It can be applied to a portion of the code that is not contiguous
  4. It is applied in symbol table to optimize the memory requirements.
recategorized

2 Answers

Best answer
8 votes
8 votes

Acc to Aho Ullman book, PeepHole Optimization is done by examining a sliding window of target instructions(called the peephole) and replacing instruction sequences within the peephole by a faster sequence. It can be applied directly after Intermediate Code Generation to improve the intermediate representation. The code in the peephole need not be contiguous , although some implementations do require this.

So, options A, B and C are true. Only D is false. (Possible typo in question) 

selected by
1 votes
1 votes

I think both (a) and (b) are true.

Refer

Answer:

Related questions

0 votes
0 votes
2 answers
1
2 votes
2 votes
1 answer
2
6 votes
6 votes
3 answers
3
Arjun asked Apr 22, 2018
5,743 views
A particular BNF definition for a "word is given by the following rules.<word :: = <letter I <letter <charpair I <letter <intpair <charpair :: = <letter <letter I <charpa...