One embodiment of the present invention provides a system for controlling cache
line eviction. The system operates by first receiving a sequence of instructions
at a processor during execution of a program, wherein the sequence of instructions
causes a cache line to be loaded into the cache. Next, the system examines the
sequence of instructions to determine if an associated cache line includes only
scratch data that will not be reused. If so, upon loading the cache line into the
cache, the system marks the cache line as containing only scratch data, which allows
the cache line to be evicted next from the cache.