next up previous
Next: Introduction

Eliminating Redundant Function Calls

A Project Final Report for 15-745, Fall 2003

Indrayana Rustandi
Computer Science Department
Carnegie Mellon University
indra+ at cs dot cmu dot edu

Jeffrey Stylos
Computer Science Department
Carnegie Mellon University
jsstylos at cs dot cmu dot edu

Abstract:

Multiple calls to the same function using the same argument values are often redundant, and the result of the earlier call can be reused. This is similar to the reuse of redundant arithmetic expressions in redundancy elimination. However, only calls that will return the same results and not produce side effects can be reused.

In this paper we present a static analysis that determines whether calls to a function can be reused. The results from this analysis are then used to create annotations that the GCC compiler can use to optimize the redundant calls. Using our analysis and compiling with GCC significantly speeds up microbenchmarks, and in many cases allows code to be written in a cleaner style without lost of performance.





Indrayana Rustandi 2003-12-04