Motorola once sc140 Manuel D’Utilisation
Compiler Support on StarCore
Introduction to the SC140 Tools
9
3
Local Versus Global Optimization Exercise
The local versus global optimization exercise shows the difference between two C compiler options: local
optimization (the default) and global optimization. Local optimization compiles each file of the project
individually as represented in Figure 4. Global optimization acts as a global binder that links all the
intermediate representation (IR) files into one file before optimizing the application. Since all the
application code information is available, this approach enables further optimizations beyond those
achieved using local optimization alone. (Compilation takes longer when global optimization is enabled.)
Global optimization compilation flow is represented in Figure 5.
optimization (the default) and global optimization. Local optimization compiles each file of the project
individually as represented in Figure 4. Global optimization acts as a global binder that links all the
intermediate representation (IR) files into one file before optimizing the application. Since all the
application code information is available, this approach enables further optimizations beyond those
achieved using local optimization alone. (Compilation takes longer when global optimization is enabled.)
Global optimization compilation flow is represented in Figure 5.
Figure 4. StarCore Local Optimization
Linker
IR files
.obj
C compiler
Front End
StarCore C Compiler
IR files
.obj
C compiler
Front End
IR files
.obj
C compiler
Front End
Object library
files .elb
Local
Optimization
Optimizer
icode
Optimizer
icode
Optimizer
icode
Assembler
asmsc100
asmsc100
Assembler
asmsc100
asmsc100
Assembler
asmsc100
asmsc100
C files
.c, .h
C files
.c, .h
C files
.c, .h