The effectiveness of the memory hierarchy is critical for the performance of current processors. The performance of the memory hierarchy can be improved by means of program transformations such as padding, which is a code transformation targeted to reduce conflict misses. This paper presents a novel approach to perform near-optimal padding based on Cache Miss Equations and genetic algorithms. The results show that it can remove practically all conflicts among
variables in the SPECfp95.