Method and apparatus for using static branch predictions hints with dynamically translated code traces to improve performance
Abstract
A run-time optimization strategy uses a trace picker to identify traces of program code in a native code pool, and a translator to translate the traces into a code cache where the traces are executed natively. Static branch prediction hints are encoded in branch instruction in the translated traces. A program module implementing the present invention is initialized with an empty code cache and a pool of instruction in a native code pool. The trace picker analyzes the instructions in the native code pool and identifies traces of instructions that tend to be executed as a group. When a trace is identified, basic blocks lying along the trace path are translated into a code cache, with static branch predictions encoded into the branch instructions of the basic blocks based on branching behavior observed when the trace is identified. Control then passes to the basic blocks in the code cache, and the basic blocks in the code cache are executed natively using the static branch prediction hints encoded into the branch instructions.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 2 · Forward citations: 111.
Claims (1 — 1 Independent, 0 Dependent)
- Claim 1Independent Claim
A method of optimizing native code instructions at run time comprising: executing native code instructions contained in a native code pool; identifying a hot trace of basic blocks of instructions from the native code instructions based on executing native code instructions contained in the native code pool, wherein each basic block of instructions includes a branch instruction; translating the hot trace; storing the basic blocks of instructions of the translated hot trace in a trace order in a code cache wherein the translated hot trace includes first and last basic blocks of instructions; ass
Technical Overview & Description
Full multi-page specification text is archived at the issuing office. Read complete official specification ↗