Dynamic Optimization of Micro-Operations

Dynamic Optimization of Micro-Operations

Dynamic Optimization of Micro-Operations Brian Slechta David Crowe Brian Fahs Michael Fertig Gregory Muthler Justin Quek Francesco Spadini Sanjay J. Patel Steven S. Lumetta Center for Reliable and High-Performance Computing Department of Electrical and Computer Engineering University of Illinois at Urbana-Champaign Abstract As complex instructions are individually decoded into constituent micro-operations, an opportunity is created to Inherent within complex instruction set architectures such globally optimize their constituent micro-operations. For ex- as x86 are inefficiencies that do not exist in a simpler ISAs. ample, a basic block’s micro-operations, optimized as a unit, Modern x86 implementations decode instructions into one or can be more efficient than micro-operations generated one more micro-operations in order to deal with the complexity instruction at a time. For simpler ISAs, such as PowerPC, of the ISA. Since these micro-operations are not visible to the SPARC, and MIPS, this type of optimization is performed compiler, the stream of micro-operations can contain redun- during compilation, as the emitted code is effectively at the dancies even in statically optimized x86 code. Within a pro- same level as the micro-operations of a complex ISA. This cessor implementation, however, barriers at the ISA level do optimization opportunity thus exists with complex ISAs, even not apply, and these redundancies can be removed by opti- when basic blocks are statically optimized. Leveraging this mizing the micro-operation stream. opportunity, of course, requires raising the architectural state In this paper, we explore the opportunities to optimize code boundaries to the basic block level. That is, architectural state at the micro-operation granularity. We execute these micro- is only guaranteed to correspond at basic block boundaries. operation optimizations using the rePLay Framework as a mi- The x86 instruction set architecture in particular can ben- croarchitectural substrate. Using a simple set of seven opti- efit from optimizations at the micro-operation level. The mizations, including two that aggressively and speculatively x86 ISA provides only a few 32-bit registers for storing tem- attempt to remove redundant load instructions, we examine porary values, which constrains optimization at compile time. the effects of dynamic optimization of micro-operations using The ISA’s two-address instruction format, along with the a trace-driven simulation environment. high-granularity of some common instructions, also increase Simulation reveals that across a sampling of the opportunity for micro-operation optimization. Further- SPECint 2000 and real x86 applications, rePLay is able to more, non-uniform instruction semantics, such as opcodes reduce micro-operation count by 21% and, in particular, that requires specific source registers (e.g., the x86 DIV in- load micro-operation count by 22%. These reductions cor- struction), limit a compiler’s ability to efficiently allocate reg- respond to a boost in observed instruction-level parallelism isters. Optimization at the micro-operation level partially al- on an 8-wide optimizing rePLay processor by 17% over a leviates these problems because the register assignment is not non-optimizing configuration. restricted to the architectural register space. In this paper, we evaluate the potential of performing opti- 1 Introduction mizations on regions of x86 micro-operations, where the re- gions are larger than basic blocks. Using the rePLay Frame- work as our microarchitectural substrate, we evaluate a pro- Complex instruction set architectures present significant cessor architecture that performs micro-operation optimiza- design challenges for high-performance implementations. tion on atomic dynamic instruction traces, or frames.rePLay Variable-length instruction formats and high-granularity in- contains hardware support for performing optimizations (via structions complicate the decoding and execution processes. an optimization engine) and hardware support for specula- In order to deal with ISA complexities, current implemen- tion recovery (enabling speculative optimization). The op- tations decode instructions into simpler micro-operations. timizer performs simple optimizations on each frame, such These micro-operations are essentially control words that as dead code elimination, reassociation, and store forward- traverse the processor pipeline and perform an equivalent ing. We study the effect of optimization using trace-driven amount of processing to the instructions of a simple ISA. simulation on both SPECint 2000 benchmarks and commer- Fetch Engine Frame Sequencer cial x86 applications. On average across this spectrum of Cache applications, we observe that optimization with rePLay re- duces micro-operation count by 21% and, in particular, load Optimization Engine micro-operation count by 22%. These reductions boost the Recovery instruction-level parallelism of a deeply-pipelined 8-wide op- Mechanism timizing rePLay processor by 17% over a non-optimizing Execution Engine configuration across the applications. In this paper, we provide two major contributions over the Frame Completing instructions previous work on rePLay [4, 13]. First, we evaluate the im- Constructor pact of micro-operation-level optimization in the context of the x86 ISA. Previous work examined hardware-based dy- namic optimization of Alpha instructions. This distinction is Figure 1. The rePLay mechanism coupled to a important: the granularity of the x86 instruction set and its processor architecture. limited register set create inefficiencies that are more preva- lent than in binaries of simpler ISAs. The full benefit of region, or frame. A frame is similar to a trace in a trace- x86 optimization requires dealing with memory dependen- scheduling compiler [5] or a block in the Block-Structured cies, and we describe our scheme for speculatively optimiz- ISA [8, 11]. All control dependencies within a frame are ing around them. We present our evaluation on continuous removed, ensuring that all instructions within the frame are traces (i.e., including DLL calls and system code) of SPECint mutually control independent. In particular, either all instruc- benchmarks and real applications. tions in a frame commit their results, or none of them do. Second, we describe the high-level microarchitecture of a This atomicity simplifies the optimization algorithms used programmable optimization engine datapath that can be used and allows high-bandwidth instruction fetch. To remove con- to perform micro-operation optimizations. The complexity trol flow, rePLay’s frame constructor converts dynamically of the optimization datapath and the optimization software biased branches into assertions, then merges sequences of is reduced by utilizing three properties of frames: (1) they constituent basic blocks into frames. Using frames as an op- are atomic, (2) they embody a single control path, and (3) timization entity is of particular importance because precise the register renaming process renders the frames into a form architectural state need only be maintained at frame bound- amenable to optimizations by guaranteeing that each opera- aries, thus allowing the optimizer more leeway in performing tion writes to a unique physical register. optimizations. We demonstrate this in Section 3 with an ex- The remainder of the paper is organized as follows. The ample. next section provides an overview of the rePLay microarchi- An assertion whose condition is not true triggers a hard- tectural substrate. Section 3 contains examples of the micro- ware recovery event that rolls back architectural state to the operation optimizations that we evaluate in this paper. Sec- beginning of the frame. A rollback mechanism of this type is tion 4 introduces the primitive operations and structure of the already present in most modern processors to support out-of- optimization datapath. The experimental infrastructure is de- order, speculative execution. This restoration capability im- scribed in Section 5, and experimental results are presented plies that any state generated during frame execution must be in Section 6. Section 7 contains related work. Section 8 pro- buffered until all assertions within the frame have executed vides conclusions. successfully (not fired). Once all assertions within a frame have been checked and all micro-operations have been exe- 2 The rePLay Microarchitecture cuted, state changes generated within the frame can be com- mitted. This atomicity enables the optimizer to make specu- lative optimizations safely, with the speculative assumptions In this section we provide an overview of the rePLay enforced by assertions. Framework, which is designed to facilitate aggressive dy- With this general design, frame construction can be done namic optimization with low overhead. To this end, the in hardware or by the compiler as a specification of the ISA. framework consists of five key components: (1) a frame con- All of our current work has focused on hardware-level frame structor for creating candidate optimization regions, (2) a pro- construction, but this property is not inherent to rePLay. grammable engine for optimizing these regions, (3) a frame cache for storing these regions on-chip, (4) a component for sequencing between regions, and (5) a mechanism to recover 3 Micro-operation Optimization architectural state when speculative optimizations prove in- correct. These components are integrated into a processor’s Processors that implement complex

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    12 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us