Code specialization is a well-known technique used to produce more efficient code from a generic one. This technique is widely used, from high level languages to optimized libraries like FFTW. It works by substituting a formal input value by an effective value, and can be done either statically or dynamically. Static specialization makes use of data that is expected to be frequently used, whereas, dynamic specialization uses the actual values at run-time.
Citation:
Minhaj Ahmad Khan, Henri-Pierre Charles, Denis Barthou, "Hybrid Specialization: A Trade-off Between Static and Dynamic Specialization," pact, pp.415, 16th International Conference on Parallel Architecture and Compilation Techniques (PACT 2007), 2007