11,693 views

2 Answers

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

It is Local Optimization (b)
selected by
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

Answer:

Related questions

8 votes
8 votes
2 answers
1
Arjun asked Jul 6, 2016
3,875 views
A simple two-pass assembler does which of the following in the first pass:Checks to see if the instructions are legal in the current assembly modeIt allocates space for t...
12 votes
12 votes
5 answers
2
go_editor asked Jul 6, 2016
10,441 views
Recursive descent parsing is an example ofTop-down parsersBottom-up parsersPredictive parsersNone of the above
5 votes
5 votes
3 answers
3
habedo007 asked Jul 5, 2016
11,955 views
A top-down parser generatesRightmost DerivationRightmost derivation in reverseLeftmost derivationLeftmost derivation in reverse