During the course of a program’s execution, a processor performs many trivial computations; that is, computations that can be simplified or where the result is zero, one, or equal to one of the input operands. This study shows that, despite compiling a program with aggressive optimizations (-O3), approximately 30% of all arithmetic instructions, which account for 12% of all instructions executed, are trivial computations. Furthermore, our results show that the amount of trivial computation is not heavily dependent on the program’s specific input values. Since a significant percentage of all instructions are trivial computations, dynamically detecting and eliminating these trivial computations can greatly reduce the program’s execution time. Our results show that eliminating trivial computations dynamically at run-time yields an average speedup of 8% for a typical processor. Even for a very aggressive processor (i.e. one with no functional unit constraints), the average speedup i...
Joshua J. Yi, David J. Lilja