Indirect Branch Predictor Using Register Operands

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Dynamic indirect branch instructions in processors are difficult to predict, leading to significant performance impacts due to frequent mispredictions, especially when they have numerous target addresses and frequently switch among them.

Innovation Solution

An indirect branch predictor that uses register values, in addition to the traditional fetch address-based predictor, to generate more accurate predictions by redirecting the fetch and flushing instructions earlier, thereby improving performance when the predicted target address is correct.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If traditional fetch address-based indirect branch prediction is used, then the prediction mechanism is simple and easy to implement, but prediction accuracy deteriorates significantly for dynamic indirect branches with numerous target addresses

Engineering Contradiction:
Improveprediction accuracyVSAvoidpredictor complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent divides the prediction system into two independent predictors: a first indirect branch predictor based on fetch address and a second indirect branch predictor based on register values. Each predictor handles specific aspects of the prediction task, allowing the system to leverage both simple PC-based prediction and register-value-based prediction without requiring a single complex predictor to handle all cases.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent transitions from one-dimensional prediction (using only fetch address/PC) to two-dimensional prediction by adding register values as another dimension. The second predictor uses register values that are sources for load instructions on which the indirect branch is dependent, providing an additional feature space for more accurate prediction of dynamic branches.

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

2Reliability

If register-based indirect branch prediction is implemented, then prediction accuracy improves for dynamic indirect branches, but the complexity of the prediction system increases

Engineering Contradiction:
Improveprediction reliabilityVSAvoidpredictor structure complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The prediction system is segmented into two separate predictors with distinct functions: the first predictor handles basic fetch address-based prediction, while the second predictor专门 handles register-value-based prediction for dynamic branches. This segmentation allows each predictor to be optimized for its specific purpose and simplifies the overall system architecture compared to a single complex predictor.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces an intermediary mechanism (the second indirect branch predictor) that mediates between the simple fetch address-based prediction and the actual execution. This intermediary predictor uses register values as an intermediate representation to enable more accurate prediction without directly complicating the basic prediction mechanism.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Productivity

If misprediction detection waits until instruction execution, then the prediction mechanism is simple, but performance deteriorates due to later detection of incorrect target addresses

Engineering Contradiction:
Improveprocessor performanceVSAvoidmisprediction detection time
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The patent performs preliminary prediction actions by generating predicted target addresses before the indirect branch instruction executes. The second indirect branch predictor generates predictions based on register values that become available during the execution stage, enabling early prediction of dynamic branches before their actual execution occurs.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent implements feedback mechanisms where the actual target address from instruction execution is fed back to update the prediction systems. The training queue stores mispredicted branches and their correct targets, allowing the system to learn from past errors and improve future predictions, thereby reducing misprediction detection time in the long run.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS11379240B2Indirect branch predictor based on register operands
Publication Date: 2022.07.05 APPLE INC
  • US11379240B2 patent drawing
  • US11379240B2 patent drawing
  • US11379240B2 patent drawing

AI summary

In an embodiment, an indirect branch predictor generates indirect branch predictions based on one or more register values. The register values may be the contents of registers on which the indirect branch instruction is directly or indirectly dependent for generating the branch target address, for example. In an embodiment, at least one of the registers may be a source for a load instruction, and the indirect branch may be dependent (directly or indirectly) on the target of the load. In an embodiment, the indirect branch predictor may be one of at least two indirect branch predictors in a processor. The other indirect branch predictor may be based on a fetch address, or PC, associated with the indirect branch instruction. The other indirect branch predictor may generate a first predicted target address, and the indirect branch predictor may generate a second predicted target address for the same indirect branch instruction.