Information Technology Reference
In-Depth Information
Loop0
Loop1
Loop1 exits: put in drowsy mode
Loop2
Loop2 exits: put in drowsy mode
Loop0 exits: turn off
FIGURE 5.17: Compiler-controlled leakage management. Adapted from [ 246 ].
this is also its Achilles' heel. Different input sets, different data layouts, alter the usefulness of
the profiling information. Profiling runs are also not desirable in many cases.
The situation, however, is more interesting when it comes to instruction caches. Compil-
ers have a better ability of understanding and handling code. Through compile-time analysis,
code can be enhanced with the ability to manage its leakage footprint in the instruction cache.
For example, a loop can shut itself off (i.e., its footprint in the instruction cache) once it exits.
Zhang, Hu, Degalahal, Kandemir, Vijaykrishnan, and Irwin first proposed compiler
leakage management for code [ 246 ]. They assume that loop instructions, as a group, can be
selectively put into a low leakage mode (either state-destroying or state-preserving). Regardless
of what happens to state this is referred to as “turning off” the instructions or cache lines. Finding
and turning off just the cache lines belonging to a specific loop is bound to cost energy whether
it is implemented in hardware or software. A simpler solution is proposed instead: all cache
lines of the cache are turned off, blindly, upon exiting a loop.
The compiler can follow two strategies to turn off loops. The first is a conservative strategy
in which instructions are turned off only if it is clear that they will not be accessed again. The
second is an optimistic strategy in which instructions are turned off even if they are accessed in
the future, as long as this is far enough in the future to produce a net gain.
In the example in Figure 5.17, the compiler cannot turn off loop1 or loop2 instructions
under the conservative policy since it knows that they will be used again as part of loop0's
execution. When loop0 exits, however, all code can be turned off. Under the optimistic strategy,
both loop1 and loop2 can be turned off since their execution is interleaved. This strategy assumes
that each one lasts long enough to warrant turning off the other.
The conservative strategy is combined with a state-destroying mechanism (e.g., gated-
V dd ) since it only takes action when it knows with certainty that instructions (loops) are dead.
Similarly, the optimistic strategy is combined with a state-preserving mechanism (e.g., drowsy
 
Search WWH ::




Custom Search