An apparatus, program product, and method utilize routine cloning to optimize
the performance of a compiled computer program. Within a compiled representation
of a computer program, an implementation of a called routine is generated that
has the same external response as the original routine, but is modified from the
original routine to calculate the result of an expression, which was originally
provided as an input parameter to the routine, within the body of the routine.
In addition, the signature of the new implementation of the routine is modified
to accept, in lieu of the input parameter that originally received the result of
the expression, one or more input parameters representative of the argument(s)
to be operated upon by the expression.