Browse Prior Art Database

Method for thread-specific branch hints

IP.com Disclosure Number: IPCOM000005515D
Publication Date: 2001-Oct-10
Document File: 4 page(s) / 40K

Publishing Venue

The IP.com Prior Art Database

Abstract

Disclosed is a method for thread-specific branch hints. Benefits include improved microprocessor performance.

This text was extracted from a Microsoft Word document.
This is the abbreviated version, containing approximately 50% of the total text.

Method for thread-specific branch hints

Disclosed is a method for thread-specific branch hints. Benefits include improved microprocessor performance.

Description

              Microprocessor architecture uses branch prediction tables in hardware to predict which branch would be taken by condition or loop instructions as shown in Figure 1.

              The branch prediction table maintains a history of branches taken for each condition statement. Then, the processor makes a prediction about the branch that would be taken when the condition instruction is executed next.

              The branch prediction table in the microprocessor may have contents as shown in Figure 2.

              For the If-Then-Else statement, the hardware may predict that the code at branch L1 would be executed the next time around and may fetch the instruction block at label L1. For the For loop the prediction would always be instructions at label L3.

              If the prediction is incorrect, the instruction pipeline must be flushed, and instructions at the correct branch destination must be retrieved. This procedure results in a significant amount of wasted processing and poor software performance.

              Based on execution profiles and static analysis, the compiler can generate branch hints that can be used by the microprocessor in predicting the branches. The microprocessor makes a better prediction using the branch table information and the compiler generated branch hints. Better prediction reduces the number of times the pipeline must be flushed and improves software execution performance.

              Typically, branch hints are special instructions in the code stream. The disclosed method requires that the branch hint instruction de-reference a variable to get the branch hint. For example, a branch hit would be “Branch Hint: Take Label L1” instead of “Branch Hint: Take@Variable V1” where @ stands for de-reference, and V1 stores an address of a branch taken and is thread specific. By changing the contents in variable V1, the branch hint can be changed dynamically.

              In a typical program, user input or data read from storage/database determines the subsequent execution flow. That is, the branches taken by condition...