Enables the code factoring optimization. Code factoring is also commonly called common block subroutine packing, cross calling, and procedure abstraction. Code factoring finds common instruction sequences and replaces each common sequence with a subroutine call to one instance of that sequence.

Code factoring will always reduce the size of a program at the expense of execution speed as there is an overhead for the additional subroutine call and return instructions.

The option parameter n defines the number of bytes that must the common instruction sequence must contain before it is abstracted into a subroutine. Smaller values of n are likely to find more common sequences and will transform the code into a smaller, but slower, program. Larger values of n will find fewer common sequences, where each of those sequences are longer and will transform the code in to a slightly larger, and slightly faster, program.

The time complexity of the algorithm use depends upon n. Smaller values of n require more time for optimization to find and transform the small code sequences, whereas larger values of n requires less time to run as fewer common code sequences will be identified. You can also limit the number of code factoring passes using the -Oxcp option.

It is extremely difficult to debug a program which has been linked with code factoring enabled because parts of functions will be extracted and placed into their own subroutine.

Project properties

Code Generation Options > Code Factoring Optimization

Code Generation Options > Code Subroutine Size