Memory hierarchy reconfiguration for energy and performance in general-purpose processor architectures