Hardware/software system for profiling instructions and selecting a trace using branch history information for branch predictions
AssigneeHewlett-Packard Development Company, L.P.
InventorsWei C. Hsu, Manuel Benitez
Life of this patent
Estimating the term…
Abstract
The inventive mechanism provides fast profiling and effective trace selection. The inventive mechanism partitions the work between hardware and software. The hardware automatically detects which code is executed very frequently, e.g. which code is hot code. The hardware also maintains the branch history information. When the hardware determines that a section or block of code is hot code, the hardware sends a signal to the software. The software then forms the trace from the hot code, and uses the branch history information in making branch predictions.
Claims20
A system for profiling instructions of a program and for selecting a trace of a portion of the instructions of the program, the system comprising:
- a hardware portion for detecting which instructions of the program are more frequently executed and for maintaining a history of targets chosen by branch instructions of the program;
- and
- a software portion for forming the trace of the most frequently executed instructions and using the history in making branch predictions for branch instructions encountered in forming the trace.
A method for profiling instructions of a program and for selecting a trace of a portion of the instructions of the program, the method comprising the steps of:
- detecting, via hardware which instructions of the program are more frequently executed;
- maintaining, via hardware, a history of targets chosen by branch instructions of the program;
- and
- forming the trace, via software, from the most frequently executed instructions, including the step of making branch predictions from the history for branch instructions encountered during the operation of the step of forming the trace.
A system for profiling instructions of a program and for selecting a trace of a portion of the instructions of the program, the system comprising:
- a plurality of hardware counters, located on an instruction cache, for detecting which instructions of the program are more frequently executed, with one counter associated with at least one instruction of the program, wherein a particular counter is changed each time its associated one instruction is executed;
- a plurality of hardware memory portions, located on the instruction cache, for maintaining a history of targets chosen by branch instructions of the program, with one memory portion associated with each branch instruction of the program, wherein each memory portion maintains information on performance of the associated branch instruction, and the information is maintained for a predetermined number of times of execution of the associated branch instruction;
- and
- a software trace selector that forms the trace of the most frequently executed instructions and is invoked when the one counter reaches a predetermined value, wherein the trace selector uses the history in making branch predictions for branch instructions encountered in forming the trace.
Dependencies are inferred from the claim text.