A method and structure for replacing cache lines in a computer system having a
set associative cache memory is disclosed. The method establishes ranking guidelines
utilizing a writable cache replacement control array, wherein the guidelines can
be dynamically changed by writing data to the cache replacement control array.
The invention ranks states of different cache lines according to the ranking guidelines
and replaces, upon a cache miss, a cache line having a highest rank of the rankings.