IP Library Granted Patent US 12,547,409
Granted Patent B2
US 12,547,409 · App. 18/627,001 · Granted Feb 10, 2026

Trace cache that supports multiple different trace lengths

Inventors: Muawya M. Al-Otoom (Lake Oswego, OR); Ilhyun Kim (Portland, OR); Niket K. Choudhary (Santa Clara, CA); Pruthivi Vuyyuru (Santa Clara, CA)
Assignee: Apple Inc.
G06F9/3808G06F9/3806
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,547,409
App. No.
18/627,001
Granted
Feb 10, 2026
Kind
B2
Abstract

Disclosed techniques relate to storing wide traces in a trace cache. In some embodiments, prediction circuitry predicts directions of control transfer instructions. Instruction cache circuitry may cache instructions sequentially in cache lines that store up to a first number of instructions. Trace cache circuitry may identify traces of instruction, store identified traces having up to the first number of instructions in first trace storage circuitry, and store identified traces having up to a second, greater number of instructions in second trace storage circuitry. This may advantageously allow longer traces to be executed from the second trace storage circuitry (without extensive changes to the instruction cache and processor front end, in some embodiments, due to the limited trace length for the first trace storage circuitry).

Claims (88)

1 . An apparatus, comprising:

processor circuitry configured to execute control transfer instructions;

prediction circuitry configured to predict directions of control transfer instructions;

instruction cache circuitry configured to cache instructions sequentially in cache lines that store up to a first number of instructions;

trace cache circuitry configured to:

identify traces of instructions that satisfy one or more criteria, wherein a given trace of the identified traces includes at least one internal taken control transfer instruction;

store first one or more of the identified traces having up to the first number of instructions in first trace storage circuitry, wherein the first trace storage circuitry is at a first level in a cache hierarchy; and

store second one or more of the identified traces having up to a second number of instructions, greater than the first number of instructions, in second trace storage circuitry, wherein the second trace storage circuitry is at a second level in the cache hierarchy that is further from the processor circuitry than the first level;

prefetch circuitry configured to:

predict that a trace will be executed by the processor circuitry; and

prefetch the predicted trace from the second trace storage circuitry to the first trace storage circuitry based on the prediction; and

prefetch buffer circuitry configured to store the prefetched predicted trace from the second trace storage circuitry and provide the prefetched predicted trace for execution, wherein the prefetch buffer circuitry supports traces having up to the second number of instructions.

2 . The apparatus of claim 1 , wherein the trace cache circuitry is configured to promote entries from the prefetch buffer circuitry, having up to the first number of instructions, to the first trace storage circuitry and is configured not to promote entries from the prefetch buffer circuitry having more than the first number of instructions.

3 . The apparatus of claim 1 , wherein:

the second trace storage circuitry includes:

overflow buffer circuitry; and

entries configured to store up to the first number of instructions and a pointer to an entry of the overflow buffer circuitry to store remaining instructions for a trace having more than the first number of instructions; and

the prefetch buffer circuitry includes entries configured to store up to the second number of instructions.

4 . The apparatus of claim 1 , wherein the second trace storage circuitry includes:

overflow buffer circuitry; and

entries configured to store up to the first number of instructions and information that indicates an entry of the overflow buffer circuitry to store remaining instructions for a trace having more than the first number of instructions.

5 . The apparatus of claim 1 , further comprising:

pipeline instruction buffer circuitry configured to buffer instructions from the instruction cache circuitry and instructions from the trace cache circuitry, including to store a trace from the second trace storage circuitry in multiple entries of the pipeline instruction buffer circuitry and store a trace from the first trace storage circuitry in a single entry of the pipeline instruction buffer circuitry.

6 . The apparatus of claim 1 , further comprising:

sequential fetch control circuitry configured to:

store a set of sequential instructions having up to the second number of instructions in the second trace storage circuitry, including up to a threshold number of predicted-not-taken control transfer instructions; and

fetch the set of sequential instructions from the second trace storage circuitry for execution in response to a hit.

7 . The apparatus of claim 6 , wherein the set of sequential instructions includes up to the second number of stable not-taken control transfer instructions and up to the threshold number of unstable predicted-not-taken control transfer instructions.

8 . The apparatus of claim 6 , further comprising usefulness control circuitry configured to:

track use of cached traces and sets of sequential instructions in the second trace storage circuitry; and

select entries for eviction based on the tracked use.

9 . The apparatus of claim 6 , wherein:

for the set of sequential instructions stored in the second trace storage circuitry, the prediction circuitry is configured to maintain prediction information, wherein the prediction information encodes one of multiple states, including

two or more states that indicate which control transfer instruction was taken among control transfer instructions in the set of sequential instructions; and

a state that indicates that none of the control transfer instructions in the set of sequential instructions was taken.

10 . The apparatus of claim 9 , wherein the prediction information includes at least two states that encode the same predicted directions for control transfer instructions in the set of sequential instructions, wherein different states of the at least two states correspond to different prediction confidence levels.

11 . A method, comprising:

predicting, by a computing system, directions of control transfer instructions executed by a processor of the computing system;

caching, by the computing system in an instruction cache, sequences of instructions in instruction cache entries that store up to a first number of instructions;

identifying, by the computing system, traces of instructions that satisfy one or more criteria, wherein one or more of the identified traces include at least one internal taken control transfer instruction;

storing, by the computing system, first one or more identified traces having up to the first number of instructions in first trace storage circuitry, wherein the first trace storage circuitry is at a first level in a cache hierarchy;

storing, by the computing system, second one or more identified traces having up to a second number of instructions, greater than the first number of instructions, in second trace storage circuitry, wherein the second trace storage circuitry is at a second level in the cache hierarchy that is further from the processor than the first level;

predicting, by the computing system, that a first trace having the first number of instructions will be executed by the processor and that a second trace having the second number of instructions will be executed by the processor;

prefetching, by the computing system, the first trace from the second trace storage circuitry to the first trace storage circuitry and providing the first trace from the first trace storage circuitry for execution; and

prefetching, by the computing system, the second trace from the second trace storage circuitry to a prefetch buffer and providing the second trace from the prefetch buffer for execution, wherein the prefetch buffer supports traces having up to the second number of instructions.

12 . The method of claim 11 , further comprising:

storing, by the computing system, a first portion of the second trace in an entry of the second trace storage circuitry;

storing, by the computing system, a pointer to an overflow buffer entry in the entry of the second trace storage circuitry; and

storing, by the computing system, a second portion of the second trace in the overflow buffer entry.

13 . The method of claim 11 , further comprising:

buffering, by the computing system, instructions from an instruction cache entry in a single entry of a buffer;

buffering, by the computing system, a trace from the first trace storage circuitry in a single entry of the buffer; and

buffering, by the computing system, a trace from the second trace storage circuitry in multiple entries of the buffer.

14 . The method of claim 11 , further comprising:

storing, by the computing system, a set of sequential instructions having up to the second number of instructions in the second trace storage circuitry, including up to a threshold number of predicted-not-taken control transfer instructions; and

fetching, by the computing system, the set of sequential instructions from the second trace storage circuitry for execution in response to a hit.

15 . The method of claim 14 , wherein the set of sequential instructions includes up to the second number of stable not-taken control transfer instructions and up to the threshold number of unstable predicted-not-taken control transfer instructions.

16 . The method of claim 14 , further comprising:

for the set of sequential instructions stored in the second trace storage circuitry, the computing system maintaining prediction information, wherein the prediction information encodes one of multiple states, including:

two or more states that indicate which control transfer instruction was taken among control transfer instructions in the set of sequential instructions; and

a state that indicates that none of the control transfer instructions in the set of sequential instructions was taken.

17 . 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 predict directions of control transfer instructions;

instruction cache circuitry configured to cache instructions sequentially in cache lines that store up to a first number of instructions;

trace cache circuitry configured to:

identify traces of instructions that satisfy one or more criteria, wherein a given trace of the identified traces includes at least one internal taken control transfer instruction;

store first one or more of the identified traces having up to the first number of instructions in first trace storage circuitry, wherein the first trace storage circuitry is at a first level in a cache hierarchy; and

store second one or more of the identified traces having up to a second number of instructions, greater than the first number of instructions, in second trace storage circuitry, wherein the second trace storage circuitry is at a second level in the cache hierarchy that is further from the processor circuitry than the first level;

prefetch circuitry configured to:

predict that a trace will be executed by the processor circuitry; and

prefetch the predicted trace from the second trace storage circuitry to the first trace storage circuitry based on the prediction; and

prefetch buffer circuitry configured to store the prefetched predicted trace from the second trace storage circuitry and provide the prefetched predicted trace for execution, wherein the prefetch buffer circuitry supports traces having up to the second number of instructions.

18 . The non-transitory computer-readable medium of claim 17 , wherein the hardware circuit represented by the model further includes:

sequential fetch control circuitry configured to:

store a set of sequential instructions having up to the second number of instructions in the second trace storage circuitry, including up to a threshold number of predicted-not-taken control transfer instructions; and

fetch the set of sequential instructions from the second trace storage circuitry for execution in response to a hit.

19 . An apparatus, comprising:

processor circuitry configured to execute control transfer instructions;

prediction circuitry configured to predict directions of control transfer instructions;

instruction cache circuitry configured to cache instructions sequentially in cache lines that store up to a first number of instructions;

trace cache circuitry configured to:

identify traces of instructions that satisfy one or more criteria, wherein a given trace of the identified traces includes at least one internal taken control transfer instruction;

store first one or more of the identified traces having up to the first number of instructions in first trace storage circuitry; and

store second one or more of the identified traces having up to a second number of instructions, greater than the first number of instructions, in second trace storage circuitry;

sequential fetch control circuitry configured to:

store a set of sequential instructions having up to the second number of instructions in the second trace storage circuitry, including up to a threshold number of predicted-not-taken control transfer instructions; and

fetch the set of sequential instructions from the second trace storage circuitry for execution in response to a hit.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 4, 2024
From: AL-OTOOM, MUAWYA M.; KIM, ILHYUN; CHOUDHARY, NIKET K.; VUYYURU, PRUTHIVI
To: APPLE INC.
Reel/Frame 067010/0525 →
Continuity (1)
Related Publication 20250315264A1 · Oct 9, 2025
References Cited (35)
US 6055630A · D'Sa et al. · 2000 [cited by applicant]
US 6101577A · Tran · 2000 [cited by applicant]
US 7555633B1 · Smaus et al. · 2009 [cited by applicant]
US 7822925B2 · Morrow · 2010 [cited by applicant]
US 7949854B1 · Thaik · 2011 [cited by examiner]
US 7966479B1 · Thaik et al. · 2011 [cited by applicant]
US 8069336B2 · Alsup et al. · 2011 [cited by applicant]
US 8719806B2 · Wang et al. · 2014 [cited by applicant]
US 9965280B2 · Spear et al. · 2018 [cited by applicant]
US 10459824B2 · Mola · 2019 [cited by applicant]
US 10496537B2 · Mola · 2019 [cited by applicant]
US 10747539B1 · Hakewill et al. · 2020 [cited by applicant]
US 11288071B2 · Homer · 2022 [cited by applicant]
US 20010049782A1 · Hsu et al. · 2001 [cited by applicant]
US 20020095553A1 · Mendelson · 2002 [cited by examiner]
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 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 20170090935A1 · Falsafi · 2017 [cited by examiner]
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 20230222066A1 · Karve et al. · 2023 [cited by applicant]
Eric Rotenberg, Steve Bennett, and James E. Smith, “A Trace Cache Microarchitecture and Evaluation”, February, IEEE, pp. 111-119 (Year: 1999). [cited by examiner]