Chapter 6 Code Optimization and Code Generation Compress.pdf (4)
Chapter 6 Code Optimization and Code Generation Compress.pdf (4)
Design
Chapter 6: Code optimization and code
generation
Contents
• • Introduction to code optimization
•It must be worth with the effort, i.e., the effort put
on optimization must be worthy when compared
Introduction to code optimization
Types of Optimization:
• There are two types of optimization:
1.Machine dependent optimization – run only in
particular machine.
b)Global optimization
–Transformations are applied over a large
segment of the program like loop, procedures,
functions etc.
Types of Optimization - Basic Block
2. Algebraic transformations
Principle Sources of Optimization
Principle Sources of Optimization
Example-
Directed Acyclic Graph
Directed Acyclic Graph
Directed Acyclic Graph
CODE GENERATION
Issues in the Design of a Code Generator:
Input to Code Generator