Applying Compiler Techniques to Cache Behavior Prediction