






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Code optimizations in compiler construction, specifically dead code elimination. Dead code refers to code that is never executed or whose result is never used. Techniques such as partial dead code elimination, dead code examples, code motion, and second order effects. It also explains how to perform dead and faint variable analysis to identify and eliminate dead and faint code.
Typology: Study notes
1 / 10
This page cannot be seen from the preview
Don't miss anything!







1
Dead Code is code that is either never executed or, if it is executed, its result is never used by the program. Therefore dead code can be eliminated from the program. 2 dead code dead code
3
4
7 = x = x
8
9 a=c+d cannot be moved till x=a+b is moved
10
13
14
15 N-FAINTS(x) is false if any of the following conditions is true:
Following dead/faint variable analysis we can eliminate dead/faint code Eliminate n: x= .. assignment x = .. If x is dead/faint at exit of n. The above elimination rule eliminates fully dead/faint code. To eliminate partially dead code, we develop delayability analysis using this analysis partially dead statement is moved to program points where it is fully dead or fully live. Iterative application of dead/faint code elimination and delaying partially dead assignments leads to optimization. 16
19 Placing at its new positions. If N-INSERTn( )/X-INSERTn( ) is true then place at n’s entry/exit point. Essentially we are moving to the latest points to which it can be delayed.