Program specialization has a distinguished history. Under the name of self-modifying code it has been used in the past for performance improvements. Under the name of partial evaluation it has been used as a transformation to automatically generate compilers from interpreters for declarative languages. Recently, a number of research groups have applied run-time partial evaluation to do run-time code generation (RTCG) as a performance optimization, but they require extensive programmer annotations to determine where to apply the transformation. Transformations do not always yield good optimizations, particularly where the cost/benefit tradeoffs are not highly obvious. This project is developing automatic methods (algorithms and heuristics) for selecting where to apply run-time code generation (RTCG), and examining the interaction between RTCG and scalar and memory-hierarchy optimizations. The project is applying RTCG to a large number of complete scientific applications to determine its applicability. Heretofore RTCG has been applied to benchmark kernels and language interpreters, but not to any wider domains. This project aims to demonstrate that RTCG is ready for production use and that it can be deployed in compilers without requiring extensive reprogramming of applications to make use of its performance improvements.