The code emitted for path macros increments the frequency counter indexed by the SPS, updates the SPS to reflect that the lines of the current path are now cached, and updates any other SPS of conflicting paths. If a different path shares a line (but not the SPS) with the current path, the line is marked as cached in the SPS of the conflicting path. Conversely, if a different path conflicts with the current SPS in a line, the line is marked as uncached in the SPS of the conflicting path, as discussed before in Figure 4.
Alternately, code is emitted to increment a general frequency counter
for large SPSs. Since no counter array is generated for large SPSs,
indexing into an array becomes obsolete. Rather, the SPS is first
combined with an AND mask to single out the conflict lines of only the
current path. Then, the number of remaining on-bits is counted and
added to a second counter, which accumulates references to conflicting
lines resulting in misses. This alternate method requires less counter
space but increases execution time by determining the number of set
bits in a loop
. In
general, alternate methods of code instrumentation optimize special
cases to reduce the instrumentation overhead.