Architecture and Compiler Support for Leakage Reduction Using Power Gating in Microprocessors