• recategorized
6,325 views
5 5 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.

2 Answers

Best answer
12 12 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 1 vote

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

Refer

Answer:
Position:
Show:

Related questions

0 0 votes
2 2 answers
3.4k
3.4k views
Arjun asked Apr 22, 2018
3,394 views
DU-chains(Definition-Use) in compiler design:consist of a definition of a variable and all its uses, reachable from that definitionare created using a form static code an...
3 3 votes
1 answers 1 answer
3.0k
3.0k views
Arjun asked Apr 22, 2018
3,044 views
Incremental-Compiler is a compiler:which is written in a language that is different from the source languagecompiles the whole source code to generate object code afreshc...
9 9 votes
4 answers 4 answers
8.9k
8.9k views
Arjun asked Apr 22, 2018
8,871 views
A particular BNF definition for a "word is given by the following rules.<word :: = <letter | <letter <charpair | <letter <intpair <charpair :: = <letter <letter | <charpa...
42 42 votes
3 answers 3 answers
20.4k
20.4k views
Arjun asked Feb 18, 2021
20,421 views
​​​​​​Consider the following $\text{ANSI C}$ code segment:z=x + 3 + y->f1 + y->f2; for (i = 0; i < 200; i = i + 2) { if (z i) { p = p + x + 3; q = q + y->f1; } else { p ...