IP Library Granted Patent US 12,468,532
Granted Patent B1
US 12,468,532 · App. 18/525,256 · Granted Nov 11, 2025

Prefetcher circuit with dynamic trigger point

Inventors: Rustam Miftakhutdinov (Hillsboro, OR); Douglas C. Holman (San Francisco, CA)
Assignee: Apple Inc.
G06F9/30047
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,468,532
App. No.
18/525,256
Granted
Nov 11, 2025
Kind
B1
Abstract

A prefetcher circuit with dynamic, root function-based trigger point selection is disclosed. A processor includes an instruction cache and a call stack having entries that store indications of functions called in an instruction stream. A prefetcher is configured to, in response to detection of an instruction cache miss, determine, based on entries in the call stack, a depth of a deepest function of the sequence of functions that remains in the call stack over an interval preceding the instruction cache miss. The prefetcher is further configured to select a trigger point based on the determined depth, and select a training signature based on the selected trigger point. In response to subsequently detecting the training signature, the prefetcher is configured to generate a prefetch request to prefetch instructions into the instruction cache.

Claims (50)

1 . An apparatus, comprising:

a processor circuit configured to execute an instruction stream, the processor circuit including:

an instruction cache;

a call stack having entries configured to store an indication of functions that are called within the instruction stream; and

a correlation prefetcher circuit configured to:

in response to detection of an instruction cache miss at a particular point in the instruction stream, determine a depth of a deepest function, of a sequence of functions, that remains in the call stack over an interval preceding the instruction cache miss, the depth being measured based on a position of entries stored in the call stack;

select a trigger point based on the determined depth;

select a training signature based on the selected trigger point; and

in response to subsequently detecting the training signature, generate a prefetch request to prefetch instructions into the instruction cache.

2 . The apparatus of claim 1 , wherein a length of the interval is based on a refill time of the instruction cache.

3 . The apparatus of claim 1 , wherein the correlation prefetcher circuit is configured to determine the depth based on a first function depth between a baseline trigger point and a retire point, a second function depth between the retire point and a cache miss point, and further configured to determine a third function depth at the baseline trigger point.

4 . The apparatus of claim 3 , wherein the correlation prefetcher circuit includes a signature stack configured to store training signature values corresponding to function calls and further configured to remove training signature values in response to returns executed by their corresponding functions.

5 . The apparatus of claim 4 , wherein the correlation prefetcher circuit is configured to select the training signature from the signature stack in response to determining that at least one of the first and second function depths is less than the third function depth.

6 . The apparatus of claim 3 , wherein the correlation prefetcher circuit is configured to select the training signature based on the baseline trigger point if the baseline trigger point falls within the deepest function, of the sequence of functions, that remains in the call stack over the interval preceding the instruction cache miss between the baseline trigger point and the cache miss point.

7 . The apparatus of claim 3 , wherein the correlation prefetcher circuit includes a delay queue having a plurality of entries and is implemented as a first-in, first-out structure, wherein the delay queue is configured to store program counter values for retired branch instructions, the branch instructions including retired function calls and retired function returns.

8 . The apparatus of claim 7 , wherein the correlation prefetcher circuit is configured to determine the first function depth based on a minimum function depth of the plurality of entries in the delay queue.

9 . The apparatus of claim 7 , wherein a number of entries of the plurality of entries is based on a refill time of the instruction cache.

10 . The apparatus of claim 7 , wherein the correlation prefetcher circuit further comprises:

a retire depth tracker circuit configured to store a value indicative, at a given time, of a number of retired function calls and retired function returns; and

a return address stack configured to store information correlating retired function calls with corresponding speculative function returns; and

a difference circuit configured to determine the second function depth based on retired depth, a number of retired function calls, and a number of speculative function calls.

11 . The apparatus of claim 7 , further comprising a baseline trigger point depth tracker coupled to an output of the delay queue and configured to determine the third function depth based on a number or retired function calls and retired function returns at the baseline trigger point.

12 . A method comprising:

executing, in a processor circuit, an instruction stream;

storing, in a call stack, an indication of functions that are called within the instruction stream;

determining, in a correlation prefetcher circuit and in response to detection of an instruction cache miss at a particular point in the instruction stream, a depth of a deepest function, of a sequence of functions, that remains in the call stack over an interval preceding the instruction cache miss, the depth being measured based on a position of entries stored in the call stack;

selecting a trigger point based on the determined depth;

selecting a training signature based on the selected trigger point; and

generating, in response to subsequently detecting the training signature, a prefetch request to prefetch instructions into the instruction cache.

13 . The method of claim 12 , wherein a length of the interval is based on a refill time of the instruction cache.

14 . The method of claim 12 , further comprising determining, using the correlation prefetcher circuit, a first function depth between a baseline trigger point and a retire point, a second function depth between the retire point and a cache miss point, and a third function depth at the baseline trigger point.

15 . The method of claim 14 , further comprising:

storing, in a signature stack, training signature values corresponding to function calls;

removing, from the signature stack, a training signature value corresponding to a function from which a return has been executed.

16 . The method of claim 15 , further comprising selecting the training signature from the signature stack in response to determining that at least one of the first and second function depths is less than the third function depth.

17 . The method of claim 14 , further comprising selecting the training signature based on the baseline trigger point if the baseline trigger point falls within the deepest function, of the sequence of functions, that remains in the call stack over the interval preceding the instruction cache miss between the baseline trigger point and the cache miss point.

18 . A system comprising:

a processor circuit configured to execute an instruction stream, the processor circuit including:

an instruction cache;

a call stack having entries configured to store an indication of functions that are called within the instruction stream; and

a correlation prefetcher circuit configured to, in response to detection of an instruction cache miss at a particular point in the instruction stream, determine a depth of a deepest function, of a sequence of functions, that remains in the call stack over an interval preceding the instruction cache miss, wherein the correlation prefetcher circuit includes circuitry configured to determine the deepest function based on:

a first function depth in the instruction stream between a baseline trigger point and a retire point;

a second function depth in the instruction stream between the retire point and a point of the instruction cache miss; and

a third function depth in the instruction stream at the baseline trigger point;

wherein the correlation prefetcher circuit is further configured to:

select a trigger point based on the determined depth;

select a training signature based on the selected trigger point; and

in response to subsequently detecting the training signature, generate a prefetch request to prefetch instructions into the instruction cache.

19 . The system of claim 18 , wherein the correlation prefetcher circuit includes a delay queue having a plurality of entries and is implemented as a first-in, first-out structure, wherein the delay queue is configured to store program counter values for retired branch instructions, the branch instructions including retired function calls and retired function returns, wherein a number of the plurality of entries corresponds to a length of the interval, and wherein the length of the interval is based on a refill time of the instruction cache.

20 . The system of claim 18 , wherein the correlation prefetcher circuit includes a signature stack configured to store training signature values corresponding to function calls, wherein the signature stack is configured to evict a particular training signature in response to a return of its corresponding function.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 30, 2023
From: MIFTAKHUTDINOV, RUSTAM; HOLMAN, DOUGLAS C.
To: APPLE INC.
Reel/Frame 066117/0371 →
Continuity (1)
Provisional Application 63585850 · Sep 27, 2023
References Cited (8)
US 5809566A · Charney · 1998 [cited by examiner]
US 6560693B1 · Puzak · 2003 [cited by examiner]
US 7457923B1 · Chou · 2008 [cited by examiner]
US 8146064B2 · Chen et al. · 2012 [cited by applicant]
US 9875106B2 · Godard et al. · 2018 [cited by applicant]
US 10642618B1 · Hakewill · 2020 [cited by examiner]
US 20070118696A1 · McCauley et al. · 2007 [cited by applicant]
US 20170031823A1 · Ross · 2017 [cited by examiner]