IP Library Granted Patent US 12,423,101
Granted Patent B1
US 12,423,101 · App. 18/654,249 · Granted Sep 23, 2025

Hardware guided software prefetch insertion

Inventors: Christopher Thomas Kennelly (Croton-on-Hudson, NY); Akanksha Jain (Mountain View, CA); Milad Olia Hashemi (San Francisco, CA); Hannah Lin (San Jose, CA)
Assignee: Google LLC
G06F9/30047G06F9/3802G06F11/3409
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,423,101
App. No.
18/654,249
Granted
Sep 23, 2025
Kind
B1
Abstract

Generally disclosed herein is an approach for identifying target code locations for software prefetching instructions based on hardware prefetching information. The target code locations can be identified based on the locations where the hardware prefetchers were designed to prefetch loads. Hardware cache events related to processor events for different caches can be monitored for cache misses in a system running when hardware prefetchers are active and inactive. Code locations that may benefit from the use of the hardware prefetchers may be determined based on an ablation study. The identified code locations may be treated as recognized memory access patterns. Software prefetchers can be configured to use these memory access patterns for prefetching data while avoiding an extended time required to identify memory access patterns (i.e. a warm-up period) and fetching in locations where hardware prefetching is beneficial.

Claims (34)

1. A system for hardware-guided software prefetch insertions, the system comprising:

one or more memories;

one or more processors in communication with the one or more memories, the one or more processors configured to:

receive first information related to a first hardware event while a hardware prefetcher is active;

disable the hardware prefetcher;

receive second information related to a second hardware event while the hardware prefetcher is disabled;

compare the first information with the second information;

determine one or more target code locations based on the comparison; and

generate software prefetching instructions for the target code locations.

2. The system of claim 1 , wherein the first hardware event and the second hardware event are monitored using telemetries.

3. The system of claim 1 , wherein the first hardware event and the second hardware event comprise memory bandwidth saturation, cache misses, and memory latency.

4. The system of claim 3 , wherein the first information and the second information are compared using metrics computed based on measurements of the memory bandwidth saturation, the cache misses, and the memory latency.

5. The system of claim 1 , wherein the one or more target code locations are identified based on target functions.

6. The system of claim 5 , wherein the target functions include prefetch-friendly functions and prefetch-unfriendly functions.

7. The system of claim 6 , wherein the prefetch-friendly functions include one or more functions that regress in performance due to an increase in last-level cache (LLC) misses in response to the hardware prefetcher being disabled.

8. The system of claim 6 , wherein the prefetch-unfriendly functions include one or more functions that gain performance and decrease CPU cycles due to a lower memory latency in response to the hardware prefetcher being disabled.

9. The system of claim 1 , wherein the software prefetch insertion is generated based on one or more parameters selected from a group comprising a prefetch address, a prefetch distance, and a prefetch degree.

10. The system of claim 1 , wherein the one or more target code locations are sent to a user for a manual modification of one or more codes associated with the one or more target code locations.

11. The system of claim 1 , wherein the one or more processors are configured to automatically modify one or more codes associated with the one or more target code locations.

12. A method for hardware-guided software prefetch insertions, the method comprising:

receiving, by one or more processors, first information related to a first hardware event while a hardware prefetcher is active;

disabling, by the one or more processors, the hardware prefetcher;

receiving, by the one or more processors, second information related to a second hardware event while the hardware prefetcher is disabled;

comparing, by the one or more processors, the first information with the second information;

determining, by the one or more processors, one or more target code locations based on the comparison; and

generating, by the one or more processors, software prefetch instructions for the target code locations.

13. The method of claim 12 , wherein the first hardware event and the second hardware event are monitored using telemetries.

14. The method of claim 12 , wherein the first hardware event and the second hardware event comprise memory bandwidth saturation, cache misses, and memory latency.

15. The method of claim 14 , wherein the first information and the second information are compared using metrics computed based on measurements of the memory bandwidth saturation, the cache misses, and the memory latency.

16. The method of claim 12 , wherein the one or more target code locations are identified based on target functions.

17. The method of claim 16 , wherein the target functions include prefetch-friendly functions and prefetch-unfriendly functions.

18. The method of claim 17 , wherein the prefetch-friendly functions include one or more functions that regress in performance due to an increase in last-level cache (LLC) misses in response to the hardware prefetcher being disabled.

19. The method of claim 17 , wherein the prefetch-unfriendly functions include one or more functions that gain performance and decrease CPU cycles due to a lower memory latency in response to the hardware prefetcher being disabled.

20. The method of claim 12 , wherein the software prefetch insertion is generated based on one or more parameters selected from a group comprising a prefetch address, a prefetch distance, and a prefetch degree.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 7, 2024
From: KENNELLY, CHRISTOPHER THOMAS; JAIN, AKANKSHA; HASHEMI, MILAD OLIA; LIN, HANNAH
To: GOOGLE LLC
Reel/Frame 067336/0423 →
Continuity (1)
Provisional Application 63639310 · Apr 26, 2024
References Cited (23)
US 6233645B1 · Chrysos · 2001 [cited by examiner]
US 7533242B1 · Moll · 2009 [cited by examiner]
US 7707359B2 · Mesard et al. · 2010 [cited by applicant]
US 7904661B2 · Fluhr et al. · 2011 [cited by applicant]
US 8285941B2 · Ekanadham et al. · 2012 [cited by applicant]
US 8490065B2 · Archambault et al. · 2013 [cited by applicant]
US 8533437B2 · Henry et al. · 2013 [cited by applicant]
US 8707282B2 · Joshi et al. · 2014 [cited by applicant]
US 9442727B2 · Chou · 2016 [cited by applicant]
US 10102134B2 · Chishti et al. · 2018 [cited by applicant]
US 11038984B2 · Cherubini et al. · 2021 [cited by applicant]
US 11080052B2 · Gschwind et al. · 2021 [cited by applicant]
US 20030145314A1 · Nguyen et al. · 2003 [cited by applicant]
US 20130179663A1 · Heisch · 2013 [cited by examiner]
US 20150089149A1 · Kimura · 2015 [cited by examiner]
US 20150106590A1 · Chou · 2015 [cited by examiner]
US 20180165204A1 · Venkatesh · 2018 [cited by examiner]
US 20200272474A1 · Gabor · 2020 [cited by examiner]
US 20210149805A1 · Pinho · 2021 [cited by examiner]
US 20210342155A1 · Homer · 2021 [cited by applicant]
US 20240111676A1 · Kalamatianos · 2024 [cited by examiner]
WO 2006130825A2 · 2006 [cited by applicant]
Srinath, S., et al., “Feedback Directed Prefetching: Improving the Performance and Bandwidth-Efficiency of Hardware Prefetchers”, 2007 IEEE 13th International Symposium on High Performance Computer Architecture, IEEE, F… [cited by applicant]