IP Library Granted Patent US 12,530,193
Granted Patent B2
US 12,530,193 · App. 18/352,309 · Granted Jan 20, 2026

Trace cache techniques based on biased control transfer instructions

Inventors: Niket K. Choudhary (Santa Clara, CA); Muawya M. Al-Otoom (Lake Oswego, OR); Pruthivi Vuyyuru (Santa Clara, CA); Andrew H. Lin (Cupertino, CA); Ilhyun Kim (Portland, OR); Douglas C. Holman (San Francisco, CA); Samir Dutt (San Jose, CA); Ronald P. Hall (Cedar Park, TX)
Assignee: Apple Inc.
G06F9/30032G06F9/3808G06F9/3844
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,530,193
App. No.
18/352,309
Granted
Jan 20, 2026
Kind
B2
Abstract

Disclosed techniques relate to trace cache circuitry configured to identify and cache traces that satisfy certain criteria. Prediction circuitry may track directions of executed control transfer instructions, including a first category of control transfer instructions that meet a first threshold bias level toward a given direction (which may be referred to as “stable”) and a second category of control transfer instructions that do not meet the first threshold bias level (which may be referred to as “unstable”). Trace cache circuitry may identify traces of instructions that satisfy a set of criteria, including: only control transfer instructions of the first category are allowed as internal control transfer instructions and a control transfer instruction in the second category is allowed only at an end of a given trace. Disclosed techniques may advantageously provide performance and power advantages of trace caching with reduced complexity, relative to certain traditional trace caches.

Claims (73)

1 . An apparatus, comprising:

processor circuitry configured to execute control transfer instructions;

prediction circuitry configured to track directions of executed control transfer instructions, including to:

designate some control transfer instructions as being in a first category, including to designate, based a determination that execution of a first control transfer instruction in a first direction meets a threshold bias level, the first control transfer instruction as being in the first category; and

designate other control transfer instructions, that do not meet the threshold bias level in a given direction, as being in a second category;

trace cache circuitry configured to:

identify traces of instructions that satisfy a set of criteria, including:

a given trace includes at least one internal taken control transfer instruction;

a conditional control transfer instruction is allowed as an internal trace instruction only if it is designated as being in the first category; and

a control transfer instruction designated in the second category is allowed only as a last control transfer instruction of a given trace; and

store one or more identified traces; and

training circuitry for the trace cache circuitry, wherein the training circuitry is configured to:

buffer traces until they meet a usefulness threshold, including to implement rolling window buffering in which multiple partially-overlapping traces are buffered; and

validate entries in the trace cache circuitry for traces that meet the one or more criteria and the usefulness threshold, including to select one of the partially-overlapping traces for validation in the trace cache circuitry based on usefulness values of the partially-overlapping traces.

2 . The apparatus of claim 1 , wherein the first category includes only control transfer instructions that have always taken the given direction during execution over a time period.

3 . The apparatus of claim 1 , wherein the first category includes control transfer instructions that have taken the given direction at least a threshold ratio over a time period.

4 . The apparatus of claim 1 , further comprising:

filter control circuitry configured to handle a third category of control transfer instructions that correspond to a subset of the first category of control transfer instructions that do not meet a second threshold bias level, including to:

for a given internal control transfer instruction of the third category of in stored trace, adjust a counter in a first direction in response to the given internal control transfer instruction executing toward the next portion of the stored trace and adjust the counter in a second direction in response to the given internal control transfer instruction executing away from the next portion of the stored trace; and

prevent inclusion of the given internal control transfer instruction as an internal instruction of traces in the trace cache circuitry in response to the counter reaching a threshold in the second direction.

5 . The apparatus of claim 1 , wherein the prediction circuitry includes a biased predictor configured to generate predictions for the first category based on a bias table.

6 . The apparatus of claim 1 , further comprising:

stitch queue circuitry configured to generate traces for caching in the trace cache circuitry from multiple fetch groups retrieved from an instruction cache.

7 . The apparatus of claim 1 , wherein the prediction circuitry is configured to:

designate the first control transfer instruction as being in the first category in response to initial execution of the first control transfer instruction in the first direction; and

maintain the designation for the first instruction at least until the first control transfer instruction has executed away from the first direction.

8 . The apparatus of claim 7 , wherein the training circuitry is configured to buffer fetch groups retrieved from an instruction cache and is configured not to buffer fetch groups retrieved from the trace cache circuitry.

9 . The apparatus of claim 1 , wherein the trace cache circuitry is configured to identify traces of instructions that satisfy the set of criteria cache after a decode stage of the processor circuitry.

10 . The apparatus of claim 1 , further comprising:

trace cache control circuitry configured to:

evict a trace from the trace cache circuitry; and

replace a trace in the trace cache circuitry with another trace according to a replacement policy.

11 . The apparatus of claim 1 , further comprising:

single-cycle next fetch predictor circuitry configured to predict a next fetch address following a trace, in response to a hit in the trace cache circuitry.

12 . The apparatus of claim 1 , wherein the prediction circuitry includes:

shared table circuitry configured to store a prediction table;

CTI predictor lane circuitry configured to access the prediction table to predict directions of multiple control transfer instructions in a given fetch group; and

trace predictor lane circuitry configured to access the prediction table to predict a direction of a trace-ending control transfer instruction in a trace cached by the trace cache circuitry.

13 . The apparatus of claim 1 , wherein the apparatus is a computing device that further includes:

a central processing unit;

a display; and

network interface circuitry.

14 . A method, comprising:

tracking, by a processor, directions of executed control transfer instructions, including:

designating some control transfer instructions as being in a first category, including designating based on a determining that execution of a first control transfer instruction in a first direction meets a threshold bias level, the first control transfer instruction as being in the first category; and

designating other control transfer instructions, that do not meet the threshold bias level in a given direction, as being in a second category;

identifying, by the processor, traces of instructions that satisfy a set of criteria, including:

a given trace includes at least one internal taken control transfer instruction;

a conditional control transfer instruction is allowed as an internal trace instruction only if it is designated as being in the first category; and

a control transfer instruction designated in the second category is allowed as a last control transfer instruction of a given trace;

storing, by the processor, one or more identified traces;

buffering, by the processor, traces until they meet a usefulness threshold, using rolling window buffering in which multiple partially-overlapping traces are buffered; and

validating entries for traces that meet the one or more criteria and the usefulness threshold, including selecting one of the partially-overlapping traces for validation based on usefulness values of the partially-overlapping traces.

15 . The method of claim 14 , wherein the first category includes only control transfer instructions that have always taken the given direction during execution over a time period.

16 . The method of claim 14 , wherein:

the designating the first control transfer instruction as being in the first category is performed in response to initial execution of the first control transfer instruction in the first direction; and

the designation for the first instruction is maintained at least until the first control transfer instruction has executed away from the first direction.

17 . The method of claim 14 , wherein the identifying includes stitching traces for caching in a trace cache from multiple fetch groups retrieved from an instruction cache.

18 . A non-transitory computer-readable medium having instructions of a hardware description programming language stored thereon that, when processed by a computing system, program the computing system to generate a computer simulation model, wherein the model represents a hardware circuit that includes:

processor circuitry configured to execute control transfer instructions;

prediction circuitry configured to track directions of executed control transfer instructions, including to:

designate some control transfer instructions as being in a first category, including to designate, based a determination that execution of a first control transfer instruction in a first direction meets a threshold bias level, the first control transfer instruction as being in the first category; and

designate other control transfer instructions, that do not meet the threshold bias level in a given direction, as being in a second category;

trace cache circuitry configured to:

identify traces of instructions that satisfy a set of criteria, including:

a given trace includes at least one internal taken control transfer instruction;

a conditional control transfer instruction is allowed as an internal trace instruction only if it is designated as being in the first category; and

a control transfer instruction designated in the second category is allowed only as a last control transfer instruction of a given trace; and

store one or more identified traces; and

training circuitry for the trace cache circuitry, wherein the training circuitry is configured to:

buffer traces until they meet a usefulness threshold, including to implement rolling window buffering in which multiple partially-overlapping traces are buffered; and

validate entries in the trace cache circuitry for traces that meet the one or more criteria and the usefulness threshold, including to select one of the partially-overlapping traces for validation in the trace cache circuitry based on usefulness values of the partially-overlapping traces.

19 . The non-transitory computer-readable medium of claim 18 , wherein the first category includes only control transfer instructions that have always taken the given direction during execution over a time period.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 14, 2023
From: CHOUDHARY, NIKET K.; AL-OTOOM, MUAWYA M.; VUYYURU, PRUTHIVI; LIN, ANDREW H.; KIM, ILHYUN; HOLMAN, DOUGLAS C.; DUTT, SAMIR; HALL, RONALD P.
To: APPLE INC.
Reel/Frame 064253/0680 →
Continuity (1)
Related Publication 20250021332A1 · Jan 16, 2025
References Cited (34)
US 6014742A · Krick · 2000 [cited by examiner]
US 6055630A · D'Sa et al. · 2000 [cited by applicant]
US 6101577A · Tran · 2000 [cited by applicant]
US 6351844B1 · Bala · 2002 [cited by applicant]
US 6785801B2 · Duesterwald · 2004 [cited by examiner]
US 7406585B2 · Rose · 2008 [cited by examiner]
US 7949854B1 · Thaik · 2011 [cited by examiner]
US 7953933B1 · Thaik et al. · 2011 [cited by applicant]
US 10209993B2 · Wang · 2019 [cited by examiner]
US 10747539B1 · Hakewill et al. · 2020 [cited by applicant]
US 20010049782A1 · Hsu et al. · 2001 [cited by applicant]
US 20040154011A1 · Wang et al. · 2004 [cited by applicant]
US 20040193857A1 · Miller et al. · 2004 [cited by applicant]
US 20050125632A1 · Alsup et al. · 2005 [cited by applicant]
US 20050138341A1 · Maiyuran et al. · 2005 [cited by applicant]
US 20050149709A1 · Jourdan · 2005 [cited by applicant]
US 20070083735A1 · Glew · 2007 [cited by applicant]
US 20070162895A1 · Altman et al. · 2007 [cited by applicant]
US 20080086597A1 · Davis et al. · 2008 [cited by applicant]
US 20080114964A1 · Davis et al. · 2008 [cited by applicant]
US 20110078425A1 · Shah et al. · 2011 [cited by applicant]
US 20120117362A1 · Bhargava et al. · 2012 [cited by applicant]
US 20140075156A1 · Blasco-Allue et al. · 2014 [cited by applicant]
US 20140082327A1 · Ghose · 2014 [cited by applicant]
US 20150046682A1 · Heil et al. · 2015 [cited by applicant]
US 20150205725A1 · Al-Otoom et al. · 2015 [cited by applicant]
US 20170102949A1 · Khot et al. · 2017 [cited by applicant]
US 20170277538A1 · Friedmann et al. · 2017 [cited by applicant]
US 20180285114A1 · Shah et al. · 2018 [cited by applicant]
US 20200167164A1 · Jarvis et al. · 2020 [cited by applicant]
US 20210382718A1 · Agrawal et al. · 2021 [cited by applicant]
US 20230023860A1 · Holman et al. · 2023 [cited by applicant]
TW I450547B · 2014 [cited by applicant]
International Search Report and Written Opinion in PCT Appl. No. PCT/US2024/036352 mailed Oct. 23, 2024, 9 pages. [cited by applicant]