Use app×
QUIZARD
QUIZARD
JEE MAIN 2026 Crash Course
NEET 2026 Crash Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
485 views
in General by (98.6k points)
closed by
Peephole optimization is a:
1. Loop optimization
2. Local optimization
3. Constant folding
4. Data flow analysis

1 Answer

0 votes
by (95.6k points)
selected by
 
Best answer
Correct Answer - Option 2 : Local optimization

Concept:

Peephole optimization is a technique for locally improving the target code which is done by examining a sliding window of target instructions and replacing the instruction sequences within the peephole by shorter or faster sequences wherever possible.

Constant folding is a peephole optimization.

int a = 3 + 9;

int a = 12 \\constant folding

Important Point:

The code in the peephole need not be contiguous although some implementations do require this. Some characteristics of peephole optimization are:

  • Redundant instruction elimination
  • Elimination of unreachable code
  • Reduction in strength
  • Algebraic simplifications
  • Use of machine idioms

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...