Optimizing Code Size through Procedural Abstraction

Memory size is an important economic factor in the development of embedded systems. It is therefore desirable to find compiler optimization techniques that reduce the size of the generated code. One such technique is procedural abstraction, where repeated occurrences of equivalent code fragments are factored out into new subroutines. Previously, procedural abstraction has been applied at the machine code level in optimizing linkers or binary rewriting tools. We investigate the prospects of applying procedural abstraction at the intermediate code level of a whole-program optimizing C compiler. Placing the optimization before register allocation makes it target indepentdent, and will allow us to take full advantage of powerful code selection, register allocation and code scheduling techniques.