All Exams Test series for 1 year @ ₹349 only
Question

Regarding the code optimization, choose the correct sequence

A. Algebraic Simplification

B. Use of machine idioms

C. Redundant - instruction elimination

D. Flow of control optimization

E. Improved target code

Choose the correct answer from the options given below:

This question was previously asked in
UGC NET 2024 Computer Science and Applications Question Paper (23-Aug-2024) (Shift 1)
The correct answer is

C, D, A, B, E

Peephole optimization (Aho, Lam, Sethi and Ullman, section on peephole optimization) examines a short sliding window of target instructions and replaces it with a shorter or faster sequence. The textbook presents its characteristic transformations in this order, and their combined result is improved target code.

1. Redundant-instruction elimination (C) — e.g. removing a LD that reloads a value just stored by ST, and deleting unreachable code.

2. Flow-of-control optimization (D) — replacing jumps to jumps (goto L1; L1: goto L2) by a direct jump to L2.

3. Algebraic simplification (A) — deleting x = x + 0 or x = x * 1 and applying strength reduction such as x2 → x*x.

4. Use of machine idioms (B) — using special instructions such as auto-increment addressing or INC instead of a general add.

5. The outcome is improved target code (E).

So the sequence is C, D, A, B, E. The other orders start with algebraic simplification, machine idioms or flow-of-control optimization and do not follow this progression.

C, D, A, B, E option is correct.

Was this answer helpful?
Need Expert Advice?
Upcoming Exams
CTET
December 12, 2026
CBSE UGC NET
December 14, 2026
CSIR UGC NET
December 19, 2026
Test Series
UGC NET img
Teaching
UGC NET (Paper 2) 2026 Mock Test Series
796 Tests 2 Tests Free
219 Attempts
4.4(46)
English
More Questions from UGC NET

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App