Fast just-in-time (JIT) scheduler
First Claim
1. A fast scheduler for operating on a processor, the fast scheduler comprising:
- a computer usable medium product having computable readable code embodied therein including;
a routine for acquiring a sliding window including three consecutive instruction from a memory which is coupled to the processor;
a routine for analyzing the tree-instruction sliding window in two successive examination operations; and
a routine for applying a plurality of rules to the three instructions within the sliding window to determine when to reorder scheduling of the instructions within the sliding window.
2 Assignments
0 Petitions
Accused Products
Abstract
A just-in-time (JIT) compiler typically generates code from bytecodes that have a sequence of assembly instructions forming a "template". It has been discovered that a just-in-time (JIT) compiler generates a small number, approximately 2.3, assembly instructions per bytecode. It has also been discovered that, within a template, the assembly instructions are almost always dependent on the next assembly instruction. The absence of a dependence between instructions of different templates is exploited to increase the size of issue groups using scheduling. A fast method for scheduling program instructions is useful in just-in-time (JIT) compilers. Scheduling of instructions is generally useful for just-in-time (JIT) compilers that are targeted to in-order superscalar processors because the code generated by the JIT compilers is often sequential in nature. The disclosed fast scheduling method has a complexity, and therefore an execution time, that is proportional to the number of instructions in an instruction block (N complexity), a substantial improvement in comparison to the N2 complexity of conventional compiler schedulers. The described fast scheduler advantageously reorders instructions with a single pass, or few passes, through a basic instruction block while a conventional compiler scheduler such as the DAG scheduler must iterate over an instruction basic block many times. A fast scheduler operates using an analysis of a sliding window of three instructions, applying two rules within the three instruction window to determine when to reorder instructions. The analysis includes acquiring the opcodes and operands of each instruction in the three instruction window, and determining register usage and definition of the operands of each instruction with respect to the other instructions within the window. The rules are applied to determine ordering of the instructions within the window.
89 Citations
36 Claims
-
1. A fast scheduler for operating on a processor, the fast scheduler comprising:
a computer usable medium product having computable readable code embodied therein including; a routine for acquiring a sliding window including three consecutive instruction from a memory which is coupled to the processor; a routine for analyzing the tree-instruction sliding window in two successive examination operations; and a routine for applying a plurality of rules to the three instructions within the sliding window to determine when to reorder scheduling of the instructions within the sliding window. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
-
13. A computer system that executes instructions and prepares for instruction execution by fast scheduling the instructions, the computer system comprising:
-
a processor that fast schedules the instructions and executes the scheduled instructions; a memory coupled to the processor, the memory including a computable readable code embodied therein for usage by a fast scheduler including; code for acquiring a sliding window including three consecutive instruction from the memory; code for analyzing the three instructions sliding window in two successive examination operations; and code for applying a plurality of rules to the three instructions within the sliding window to determine when to reorder scheduling of the instructions within the sliding window.
-
-
14. A method of scheduling instructions for usage in a compiler comprising:
-
defining a first instruction pointer, a second instruction pointer, and a third instruction pointer designating a three instruction sliding window and identifying a first instruction, a second instruction, and a third instruction as a consecutive sequence of instructions; in the sliding instruction window, determining whether the second instruction is dependent on the first instruction and whether the third instruction is dependent on the second instruction; switching the second instruction and the third instruction when the second instruction is dependent on the first instruction and the third instruction is not dependent on the second instruction; incrementing by two the first instruction pointer, the second instruction pointer, and the third instruction pointer if the second and third instructions are switched in the switching operation; and incrementing by one the first instruction pointer, the second instruction pointer, and the third instruction pointer otherwise. - View Dependent Claims (15, 16, 17, 18, 19, 20, 21, 22)
-
-
23. A computer system that executes instruction and prepares for instruction execution by fast scheduling the instructions, the computer system comprising:
-
a processor that fast schedules the instructions and executes the scheduled instruction; a memory coupled to the processor, the memory including a computable readable code embodied therein for usage by a fast scheduler including; code for defining a first instruction pointer, a second instruction pointer, and a third instruction pointer designating a three instruction sliding window and identifying a first instruction, a second instruction, and a third instruction as a consecutive sequence of instruction; code operative in the sliding instruction window for determining whether the second instruction is dependent on the first instruction and whether the third instruction is dependent on the second instruction; code for switching the second instruction and the third instruction when the second instruction is dependent on the first instruction and the third instruction is not dependent on the second instruction; code for incrementing by two first instruction pointer, the second instruction pointer and the third instruction pointer if the second and third instruction are switched in the switching operation; and code for incrementing by one the first instruction pointer, the second instruction pointer, and the third instruction pointer otherwise.
-
-
24. A method of scheduling instructions for execution in a superscalar processor comprising:
-
acquiring a sliding window including three consecutive instructions from a memory which is coupled to the processor; analyzing the sliding window of three instructions in two successive examination operations; and applying a plurality of rules to the three instructions within the sliding window to determine when to reorder scheduling of the instructions within the sliding window. - View Dependent Claims (25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35)
-
-
36. A computer system that executes instructions and prepares for instruction execution by fast scheduling the instructions the computer system comprising:
-
a superscalar processor that fast schedules the instructions and executes the scheduled instructions; a memory coupled to the superscalar processor, the memory including a computable readable code embodied therein for usage by a fast scheduler including; code for acquiring a sliding window including three consecutive instructions from the memory; code for analyzing the three instruction sliding window in two successive examination operation; and code for applying a plurality of rules to the three instructions within the sliding window to determine when to reorder scheduling of the instructions within the sliding window.
-
Specification