IP Library › Granted Patent US 12,282,778
Granted Patent B2
US 12,282,778 · App. 18/479,974 · Granted Apr 22, 2025

Selective use of branch prediction hints

Inventors: Jared W. Stark (Portland, OR); Ahmad Yasin (Kafr Manda, IL); Ajay Amarsingh Singh (Rancho Cordova, CA)
Assignee: Intel Corporation
G06F9/3842G06F9/30058G06F9/30145G06F9/3867G06F12/0804
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,282,778
App. No.
18/479,974
Granted
Apr 22, 2025
Kind
B2
Abstract

Embodiments of apparatuses, methods, and systems for selective use of branch prediction hints are described. In an embodiment, an apparatus includes an instruction decoder and a branch predictor. The instruction decoder is to decode a branch instruction having a hint. The branch predictor is to provide a prediction and a hint-override indicator. The hint-override indicator is to indicate whether the prediction is based on stored information about the branch instruction. The prediction is to override the hint if the hint-override indicator indicates that the prediction is based on stored information about the branch instruction.

Claims (29)

1. An apparatus comprising:

an instruction decoder to decode a branch instruction having a hint; and

a branch predictor to provide a prediction to override the hint if the prediction is based on stored information about the branch instruction.

2. The apparatus of claim 1 , further comprising a tagged structure to provide the stored information.

3. The apparatus of claim 1 , wherein the instruction decoder is to associate a branch hint override indicator to the decoded branch instruction.

4. The apparatus of claim 3 , wherein the branch hint override indicator is to be passed down an execution core pipeline from the instruction decoder.

5. The apparatus of claim 4 , wherein overriding the hint includes flushing of the execution pipeline of instructions following a hint path.

6. The apparatus of claim 1 , further comprising a counter to count conditional branch instructions for which the branch predictor has no stored information and for which the prediction is to not take a branch.

7. The apparatus of claim 1 , further comprising a counter to count correct predictions for conditional branch instructions for which the branch predictor has no stored information and for which the prediction is to not take a branch.

8. The apparatus of claim 1 , further comprising a counter to count mispredictions for conditional branch instructions for which the branch predictor has no stored information and for which the prediction is to not take a branch.

9. The apparatus of claim 1 , further comprising a counter to count conditional branch instructions for which the branch predictor has no stored information and for which the prediction is to take a branch.

10. The apparatus of claim 1 , further comprising a counter to count correct predictions for conditional branch instructions for which the branch predictor has no stored information and for which the prediction is to take a branch.

11. The apparatus of claim 1 , further comprising a counter to count mispredictions for conditional branch instructions for which the branch predictor has no stored information and for which the prediction is to take a branch.

12. A method comprising:

receiving, by a branch predictor, a branch instruction with a hint;

making a prediction;

determining whether the prediction was based on stored information about the branch instruction; and

overriding the hint if the prediction was based on stored information.

13. The method of claim 12 , further comprising using the hint if the prediction was not based on stored information.

14. The method of claim 12 , wherein overriding the hint includes flushing an execution pipeline of instructions following a hint path.

15. The method of claim 14 , further comprising counting conditional branch instructions for which the branch predictor had no stored information and for which the prediction was to not take a branch.

16. The method of claim 14 , further comprising counting correct predictions for conditional branch instructions for which the branch predictor had no stored information and for which the prediction was to not take a branch.

17. The method of claim 14 , further comprising counting mispredictions for conditional branch instructions for which the branch predictor had no stored information and for which the prediction was to not take a branch.

18. A method comprising:

executing code including branch instructions having hints on a processor having a branch predictor to provide a prediction;

overriding the hints if the prediction is based on stored information about the corresponding branch instruction; and

counting mispredictions for conditional branch instructions for which the branch predictor had no stored information and for which the prediction was to not take a branch.

19. The method of claim 18 , further comprising profiling the code based on the count of mispredictions.

20. The method of claim 19 , wherein profiling includes finding branch instructions to which to add hints.

Continuity (3)
Continuation 17033749 · Sep 26, 2020
Provisional Application 63017583 · Apr 29, 2020
Related Publication 20240118898A1 · Apr 11, 2024
References Cited (13)
US 6427206B1 · Yeh · 2002 [cited by examiner]
US 7673122B1 · Song · 2010 [cited by examiner]
US 11809873B2 · Stark · 2023 [cited by examiner]
US 20080059779A1 · Davis et al. · 2008 [cited by applicant]
US 20130007425A1 · Cantin · 2013 [cited by examiner]
US 20130198499A1 · Dice · 2013 [cited by examiner]
Briejer, M., et al., “Extending the Cell SPE with Energy Efficient Branch Prediction”, 16th European Conference—Computer Vision—ECCV, 2020. pp. 304-315. [cited by applicant]
European Search Report and Search Opinion, EP App. No. 20208858.9, May 17, 2021, 08 pages. [cited by applicant]
Notice of Allowance, U.S. Appl. No. 17/033,749, filed Sep. 20, 2023, 3 pages. [cited by applicant]
Notice of Allowance, U.S. Appl. No. 17/033,749, filed Jul. 3, 2023, 9 pages. [cited by applicant]
Office Action, EP App. No. 20208858.9, Jun. 23, 2023, 7 pages. [cited by applicant]
Office Action, EP App. No. 20208858.9, May 18, 2022, 5 pages. [cited by applicant]
Office Action, EP App. No. 20208858.9, Nov. 8, 2024, 6 pages. [cited by applicant]