Compiler Support on StarCore
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.
StarCore C Compiler
C files
.c, .h
Cfiles
.c, .h
Cfiles
.c, .h
Local
Optimization
Ccompiler Front End
IR files
.obj
Optimizer icode
Ccompiler Front End
IR files
.obj
Optimizer icode
Ccompiler Front End
IR files |
.obj |
Optimizer |
icode |
Assembler asmsc100
Assembler asmsc100
Assembler asmsc100
Object library files .elb
Linker
Figure 4. StarCore Local Optimization
Introduction to the SC140 Tools | 9 |