Compact code generation through custom instruction sets
This report describes the use of a custom instruction set to optimize for code size. A compiler is described that accepts a C program as input and generates a custom instruction set for that program that minimizes the resulting code size when compiling with this instruction set. The method uses a greedy heuristic that tries different instruction sets. The chosen instruction set defines a virtual machine. The input program is translated for this virtual machine, and an interpreter is generated...