IP Library Granted Patent US 12,373,218
Granted Patent B2
US 12,373,218 · App. 18/454,158 · Granted Jul 29, 2025

Technique for predicting behaviour of control flow instructions

Inventors: Houdhaifa Bouzguarrou (Austin, TX); Alexander Cole Shulyak (Austin, TX); Rami Mohammad Al Sheikh (Austin, TX)
Assignee: Arm Limited
G06F9/3844G06F9/30047G06F9/30145
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,373,218
App. No.
18/454,158
Granted
Jul 29, 2025
Kind
B2
Abstract

An apparatus has pointer storage to store pointer values for a plurality of pointers and increment circuitry, responsive to a series of increment events, to differentially increment the pointer values of the pointers. Training circuitry comprises tracker circuitry to maintain a plurality of tracker entries and cache circuitry to maintain a plurality of cache entries. Each tracker entry identifies a control flow instruction, and each cache entry stores a resolved behaviour of an instance of a control flow instruction identified by a tracker entry. For a given control flow instruction identified in a given tracker entry, the training circuitry performs a training process to seek to determine, as an associated pointer for the given control flow instruction, a pointer from amongst the plurality of pointers whose pointer value increments in a manner that meets a correlation threshold with occurrence of instances of the given control flow instruction. Promotion circuitry, responsive to detection of the correlation threshold being met for the given control flow instruction, allocates a prediction entry within prediction circuitry to identify the given control flow instruction and the associated pointer, and a behaviour record is established within the prediction entry identifying the resolved behaviour for one or more instances of the given control flow instruction. The behaviour record is arranged such that each resolved behaviour is associated with the pointer value of the associated pointer at the time that resolved behaviour was observed. Responsive to a prediction trigger associated with a replay of a given instance of the given control flow instruction, the prediction circuitry determines, in dependence on a current pointer value of the associated pointer, a predicted behaviour of the given instance of the given control flow instruction from the behaviour record within the prediction entry.

Claims (57)

1. An apparatus comprising:

pointer storage to store pointer values for a plurality of pointers;

increment circuitry, responsive to a series of increment events, to differentially increment the pointer values of the pointers;

training circuitry comprising tracker circuitry to maintain a plurality of tracker entries and cache circuitry to maintain a plurality of cache entries, each tracker entry to identify a control flow instruction, and each cache entry to store a resolved behaviour of an instance of a control flow instruction identified by a tracker entry of the tracker circuitry;

wherein the training circuitry is arranged, for a given control flow instruction identified in a given tracker entry, to perform a training process to seek to determine, as an associated pointer for the given control flow instruction, a pointer from amongst the plurality of pointers whose pointer value increments in a manner that meets a correlation threshold with occurrence of instances of the given control flow instruction;

prediction circuitry; and

promotion circuitry, responsive to detection of the correlation threshold being met for the given control flow instruction, to allocate a prediction entry within the prediction circuitry to identify the given control flow instruction and the associated pointer, and to establish within the prediction entry a behaviour record identifying the resolved behaviour for one or more instances of the given control flow instruction, where the behaviour record is arranged such that each resolved behaviour is associated with the pointer value of the associated pointer at the time that resolved behaviour was observed;

wherein the prediction circuitry, responsive to a prediction trigger associated with a replay of a given instance of the given control flow instruction, is arranged to determine, in dependence on a current pointer value of the associated pointer, a predicted behaviour of the given instance of the given control flow instruction from the behaviour record within the prediction entry.

2. An apparatus as claimed in claim 1 , wherein:

each cache entry is arranged to store a resolved behaviour of an instance of a control flow instruction identified by a tracker entry of the tracker circuitry along with an associated tag value generated in dependence on a chosen pointer when the resolved behaviour was allocated into that cache entry; and

the training circuitry is arranged to store the resolved behaviour of an instance of the given control flow instruction in multiple cache entries using associated tag values generated using different chosen pointers from the plurality of pointers, and to reference the multiple cache entries during the training process when seeking to determine whether there is a pointer whose pointer value increments in a manner that meets the correlation threshold.

3. An apparatus as claimed in claim 1 , wherein the behaviour record provides a vector of elements, where each element is for storing a resolved behaviour, and during access to the behaviour record a pointer value of the associated pointer is used to identify one of the elements in the vector of elements.

4. An apparatus as claimed in claim 1 , wherein the behaviour record is populated when the prediction entry is allocated, by retrieving from the cache circuitry the resolved behaviour for one or more instances of the given control flow instruction.

5. An apparatus as claimed in claim 1 , wherein the behaviour record is populated after the prediction entry has been allocated, using the resolved behaviour for one or more subsequently observed instances of the given control flow instruction.

6. An apparatus as claimed in claim 1 , wherein the prediction entry maintains a confidence value, and generation by the prediction circuitry of the predicted behaviour of the given instance of the given control flow instruction in response to the prediction trigger requires the confidence value to exceed a confidence threshold.

7. An apparatus as claimed in claim 6 , wherein the prediction circuitry is arranged to update the confidence value and the behaviour record based on the resolved behaviour for one or more subsequently observed instances of the given control flow instruction.

8. An apparatus as claimed in claim 2 , further comprising:

tag value generation circuitry to generate the associated tag value in dependence on an identifier of the chosen pointer, a current pointer value of the chosen pointer, and an identifier for the control flow instruction for which the associated tag value is being generated.

9. An apparatus as claimed in claim 8 , wherein the identifier for the control flow instruction for which the associated tag value is being generated comprises an identifier of the tracker entry used to identify the control flow instruction.

10. An apparatus as claimed in claim 1 , wherein:

each tracker entry is arranged to identify a current active pointer to be associated with the control flow instruction identified by that tracker entry and an active pointer confidence indication for the current active pointer, wherein the current active pointer is selected from amongst the plurality of pointers; and

the correlation threshold is determined to be met when the active pointer confidence indication indicates that a given threshold confidence level has been met for the current active pointer.

11. An apparatus as claimed in claim 10 , wherein:

each tracker entry is further arranged to identify a current training pointer to be associated with the control flow instruction identified by that tracker entry and a training pointer confidence indication for the current training pointer, wherein the current training pointer is selected from amongst the plurality of pointers; and

for the given control flow instruction, the resolved behaviour of a given instance of that given control flow instruction is allocated into a first cache entry along with a first associated tag value generated in dependence on the current active pointer and into a second cache entry along with a second associated tag value generated in dependence on the current training pointer.

12. An apparatus as claimed in claim 11 , wherein following elapse of a training period, the tracker circuitry is arranged to determine whether the training pointer confidence indication indicates a confidence that is greater by a given margin than is indicated by the active pointer confidence indication, and in that event to update the given tracker entry to identify the current training pointer as being a new current active pointer.

13. An apparatus as claimed in claim 12 , wherein the promotion circuitry is arranged, responsive to the tracker circuitry updating the given tracker entry to identify the new current active pointer, to perform an update evaluation process in order to determine whether to update the prediction circuitry.

14. An apparatus as claimed in claim 13 , wherein the update evaluation process comprises:

determining whether the confidence indication associated with the new current active pointer indicates that the correlation threshold has been met;

when the correlation threshold is determined to have been met, determining whether a prediction entry has already been allocated for the given control flow instruction, and

when a prediction entry has already been allocated for the given control flow instruction, updating the allocated prediction entry to identify the new current active pointer for the given control flow instruction;

when the prediction entry has not yet been allocated for the given control flow instruction, allocating a prediction entry to identify the given control flow instruction and the new current active pointer.

15. An apparatus as claimed in claim 1 , further comprising power control circuitry to selectively switch the apparatus between different power modes of operation in response to at least one power mode transition trigger.

16. An apparatus as claimed in claim 15 , wherein the different power modes of operation comprise at least two of the following power modes:

a full power mode where the training circuitry is arranged to perform the training process with reference to all of the plurality of pointers;

a reduced power mode where the training circuitry is arranged to perform the training process with reference to only a subset of the plurality of pointers; and

a low power mode where the training circuitry is not used, the prediction circuitry is arranged to allocate a prediction entry for the given control flow instruction in response to a misprediction level being detected for the given control flow instruction using a default prediction mechanism, and the prediction circuitry is arranged to select a predetermined pointer as the associated pointer identified in the prediction entry.

17. A method of predicting behaviour of control flow instructions, comprising:

maintaining pointer values for a plurality of pointers and, responsive to a series of increment events, differentially increment the pointer values of the pointers;

employing training circuitry comprising tracker circuitry to maintain a plurality of tracker entries and cache circuitry to maintain a plurality of cache entries, each tracker entry for identifying a control flow instruction, and each cache entry for storing a resolved behaviour of an instance of a control flow instruction identified by a tracker entry of the tracker circuitry;

performing a training process, for a given control flow instruction identified in a given tracker entry, to seek to determine, as an associated pointer for the given control flow instruction, a pointer from amongst the plurality of pointers whose pointer value increments in a manner that meets a correlation threshold with occurrence of instances of the given control flow instruction;

responsive to detection of the correlation threshold being met for the given control flow instruction, allocating a prediction entry within prediction circuitry to identify the given control flow instruction and the associated pointer, and establishing within the prediction entry a behaviour record identifying the resolved behaviour for one or more instances of the given control flow instruction, where the behaviour record is arranged such that each resolved behaviour is associated with the pointer value of the associated pointer at the time that resolved behaviour was observed; and

employing the prediction circuitry, responsive to a prediction trigger associated with a replay of a given instance of the given control flow instruction, to determine, in dependence on a current pointer value of the associated pointer, a predicted behaviour of the given instance of the given control flow instruction from the behaviour record within the prediction entry.

18. A non-transitory computer-readable medium to store computer-readable code for fabrication of a data processing apparatus comprising:

pointer storage to store pointer values for a plurality of pointers;

increment circuitry, responsive to a series of increment events, to differentially increment the pointer values of the pointers;

training circuitry comprising tracker circuitry to maintain a plurality of tracker entries and cache circuitry to maintain a plurality of cache entries, each tracker entry to identify a control flow instruction, and each cache entry to store a resolved behaviour of an instance of a control flow instruction identified by a tracker entry of the tracker circuitry;

wherein the training circuitry is arranged, for a given control flow instruction identified in a given tracker entry, to perform a training process to seek to determine, as an associated pointer for the given control flow instruction, a pointer from amongst the plurality of pointers whose pointer value increments in a manner that meets a correlation threshold with occurrence of instances of the given control flow instruction;

prediction circuitry; and

promotion circuitry, responsive to detection of the correlation threshold being met for the given control flow instruction, to allocate a prediction entry within the prediction circuitry to identify the given control flow instruction and the associated pointer, and to establish within the prediction entry a behaviour record identifying the resolved behaviour for one or more instances of the given control flow instruction, where the behaviour record is arranged such that each resolved behaviour is associated with the pointer value of the associated pointer at the time that resolved behaviour was observed;

wherein the prediction circuitry, responsive to a prediction trigger associated with a replay of a given instance of the given control flow instruction, is arranged to determine, in dependence on a current pointer value of the associated pointer, a predicted behaviour of the given instance of the given control flow instruction from the behaviour record within the prediction entry.

19. A system comprising:

the apparatus according to claim 1 , implemented in at least one packaged chip;

at least one system component; and

a board,

wherein the at least one packaged chip and the at least one system component are assembled on the board.

20. A chip-containing product comprising the system according to claim 19 , assembled on a further board with at least one other product component.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 9, 2023
From: BOUZGUARROU, HOUDHAIFA; SHULYAK, ALEXANDER COLE; AL SHEIKH, RAMI MOHAMMAD
To: ARM LIMITED
Reel/Frame 065532/0123 →
Continuity (1)
Related Publication 20250068427A1 · Feb 27, 2025
References Cited (36)
US 6006317A · Ramagopal et al. · 1999 [cited by applicant]
US 6694425B1 · Eickemeyer · 2004 [cited by applicant]
US 8751776B2 · Ukai · 2014 [cited by applicant]
US 9891918B2 · Hooker et al. · 2018 [cited by applicant]
US 9973187B1 · Pant et al. · 2018 [cited by applicant]
US 10223123B1 · Blasco et al. · 2019 [cited by applicant]
US 10846097B2 · Jumani et al. · 2020 [cited by applicant]
US 11334361B2 · Ishii et al. · 2022 [cited by applicant]
US 20040255104A1 · Akkary et al. · 2004 [cited by applicant]
US 20050138480A1 · Srinivasan et al. · 2005 [cited by applicant]
US 20110238917A1 · Lin · 2011 [cited by applicant]
US 20150095627A1 · Dechene · 2015 [cited by examiner]
US 20160092230A1 · Chen · 2016 [cited by applicant]
US 20160350116A1 · Reddy et al. · 2016 [cited by applicant]
US 20160371089A1 · Ma · 2016 [cited by examiner]
US 20170010820A1 · Day · 2017 [cited by applicant]
US 20180088953A1 · Lin · 2018 [cited by applicant]
US 20200050459A1 · Palivela · 2020 [cited by applicant]
US 20200104137A1 · Natarajan · 2020 [cited by applicant]
US 20200110615A1 · Ishii · 2020 [cited by examiner]
US 20200174794A1 · Golla · 2020 [cited by applicant]
US 20210081575A1 · Saileshwar · 2021 [cited by applicant]
US 20210124586A1 · Bouzguarrou · 2021 [cited by applicant]
US 20210240476A1 · Kountanis · 2021 [cited by applicant]
US 20220197650A1 · Soundararajan · 2022 [cited by applicant]
US 20230057600A1 · Malley · 2023 [cited by applicant]
Notice of Allowance dated Aug. 22, 2024 for U.S. Appl. No. 18/312,052, 15 pages. [cited by applicant]
U.S. Appl. No. 17/851,266, filed Jun. 28, 2022, Shul Yak et al. [cited by applicant]
U.S. Appl. No. 18/312,052, filed May 4, 2023, Shul Yak et al. [cited by applicant]
U.S. Appl. No. 18/454,165, filed Aug. 23, 2023, Bouzguarrou et al. [cited by applicant]
U.S. Appl. No. 18/462,742, filed Sep. 7, 2023, Bouzguarrou et al. [cited by applicant]
Office Action dated Aug. 9, 2023 for U.S. Appl. No. 17/851,266, 11 pages. [cited by applicant]
Akkary, H et al. “Recycling Waste: Exploiting Wrong-Path Execution to Improve Branch Prediction” ICS'03, Jun. 23-26, 2003, pp. 12-21 (10 pages). [cited by applicant]
Mutlu, O. et al. “On Reusing the Results of Pre-Executed Instructions in a Runahead Execution Processor” IEEE Computer Architecture Letters, 2005, vol. 4 (4 pages). [cited by applicant]
Office Action dated May 6, 2025 for U.S. Appl. No. 18/454,165. [cited by applicant]
Zi-Chao Xie et al, “SWIP Prediction: Complexity-Effective Indirect-Branch Prediction Using Pointers” Journal of Computer Science and Technology, vol. 27, No. 4, Jul. 2012, pp. 754-768. [cited by applicant]