Keil™, An ARM® Company

C166 User's Guide

Global Register Coloring

Global register coloring works across a complete application. When enabled, the linker generates a register definition file that contains a table of registers used by each function. The compiler uses this table to optimize register usage. Your project is re-compiled iteratively until no further register optimization is possible.

When global register coloring is enabled, compiler knows the registers used by each function. Registers that are not altered in external functions can be used to hold register variables. The code generated by the compiler requires less data and code space and executes faster.

To enable global register coloring, the REGFILE compiler directive and the REGFILE linker directive must be specified.