Skip to content

GH-135379: Top of stack caching for the JIT. #135465

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
579b758
Tier 2 TOS caching. Work in progress
markshannon Jun 11, 2025
489e510
Tier 2 TOS caching, working for interpreter.
markshannon Jun 13, 2025
f603929
Get JIT working
markshannon Jun 13, 2025
cf1d7ab
Fix tool to support 3.11
markshannon Jun 13, 2025
efd7a0a
Add news
markshannon Jun 13, 2025
bb4e6b9
int arithmetic doesn't escape
markshannon Jun 13, 2025
e976b9b
Repair stats
markshannon Jun 13, 2025
11de93e
Add missing type annotation
markshannon Jun 13, 2025
4698695
Pacify mypy
markshannon Jun 13, 2025
33837a7
Add type annotation
markshannon Jun 13, 2025
8bb12ef
Avoid overflow gathering stats
markshannon Jun 13, 2025
920e6de
Reduce spilling
markshannon Jun 13, 2025
45e1abd
Merge branch 'main' into tier-2-tos-caching
markshannon Jun 16, 2025
3d72871
Merge branch 'main' into tier-2-tos-caching
markshannon Jun 17, 2025
0240115
Merge branch 'main' into tier-2-tos-caching
markshannon Jun 19, 2025
2850d72
Improve heuristics for stack caching
markshannon Jun 19, 2025
1c291f1
Merge branch 'main' into tier-2-tos-caching
markshannon Jun 20, 2025
ba2331a
Add news
markshannon Jun 20, 2025
cbee8d2
Fix uop execution stats
markshannon Jun 23, 2025
40988a0
Address review comments
markshannon Jun 23, 2025
76030e9
Address code review
markshannon Jun 26, 2025
991bbea
Merge branch 'main' into tier-2-tos-caching
markshannon Jun 26, 2025
51d4342
Remove blank line
markshannon Jun 26, 2025
9438c19
Zero out unused registers to reduce register pressure
markshannon Jul 21, 2025
53a50eb
Merge branch 'main' into tier-2-tos-caching
markshannon Jul 21, 2025
a4de1bf
Avoid spilling around DEOPT_IF
markshannon Jul 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into tier-2-tos-caching
  • Loading branch information
markshannon committed Jul 21, 2025
commit 53a50eb32e828e2d7946e0fb55498fa53189e7b8
12 changes: 1 addition & 11 deletions Python/executor_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Tools/jit/jit.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ typedef jit_func __attribute__((preserve_none)) jit_func_preserve_none;

#define DECLARE_TARGET(NAME) \
_Py_CODEUNIT *__attribute__((preserve_none, visibility("hidden"))) \
NAME(_PyInterpreterFrame *frame, _PyStackRef *stack_pointer, PyThreadState *tstate);
NAME(_PyInterpreterFrame *frame, _PyStackRef *stack_pointer, PyThreadState *tstate, \
_PyStackRef _tos_cache0, _PyStackRef _tos_cache1, _PyStackRef _tos_cache2);
4 changes: 2 additions & 2 deletions Tools/jit/shim.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ _JIT_ENTRY(
_PyStackRef _tos_cache0, _PyStackRef _tos_cache1, _PyStackRef _tos_cache2
) {
// Note that this is *not* a tail call:
PATCH_VALUE(jit_func_preserve_none, call, _JIT_CONTINUE);
return call(frame, stack_pointer, tstate, _tos_cache0, _tos_cache1, _tos_cache2);
DECLARE_TARGET(_JIT_CONTINUE);
return _JIT_CONTINUE(frame, stack_pointer, tstate, _tos_cache0, _tos_cache1, _tos_cache2);
}
8 changes: 4 additions & 4 deletions Tools/jit/template.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ do { \
do { \
} while (0)

#define PATCH_JUMP(ALIAS) \
do { \
PATCH_VALUE(jit_func_preserve_none, jump, ALIAS); \
__attribute__((musttail)) return jump(frame, stack_pointer, tstate, _tos_cache0, _tos_cache1, _tos_cache2); \
#define PATCH_JUMP(ALIAS) \
do { \
DECLARE_TARGET(ALIAS); \
__attribute__((musttail)) return ALIAS(frame, stack_pointer, tstate, _tos_cache0, _tos_cache1, _tos_cache2); \
} while (0)

#undef JUMP_TO_JUMP_TARGET
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy