Commit graph

39 commits

Author SHA1 Message Date
sobolevn
3a130c1786
[3.13] Update pre-commit repos (GH-132792) (#132804)
(cherry picked from commit 87b1ea016b)
2025-04-22 15:57:34 +00:00
Donghee Na
793293dcb9
[3.13] gh-130834: Fix free-threaded build with JIT for aarch64 linux (#132368)
* [3.13] gh-130834: Fix free-threaded build with JIT for arm

* lint
2025-04-11 06:52:46 -07:00
Miss Islington (bot)
bde72839d7
[3.13] GH-130673: Gracefully handle missing sections in JIT build (GH-131749)
(cherry picked from commit a26a301f8b)
Co-authored-by: Bojun Ren <bj.ren.coding@outlook.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-04-07 19:16:23 -07:00
sobolevn
4d941d3fd1
[3.13] gh-129805: Fix bytes annotation in Tools/jit (GH-129806) (#130216)
(cherry picked from commit 422f8e9e02)
2025-02-17 08:21:47 +00:00
Miss Islington (bot)
fcb265671c
[3.13] gh-129438: Update `--enable-experimental-jit` section with install requirements (GH-129450) (#129472)
gh-129438: Update ``--enable-experimental-jit`` section with install requirements (GH-129450)

Add a note to the `JIT` docs that building CPython with `JIT` requires Python 3.11 or newer.

(cherry picked from commit 652f66ac38)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2025-01-30 10:22:05 +00:00
Miss Islington (bot)
5148e03f0f
[3.13] GH-121723: Skip test_config_queue_handler_multiprocessing_context in emulated JIT CI (GH-122991)
(cherry picked from commit 7b8328b6b3)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-08-22 13:16:52 -07:00
Miss Islington (bot)
27a5292774
[3.13] GH-118943: Handle races when moving jit_stencils.h (GH-122709)
(cherry picked from commit 44659d3927)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-08-08 13:37:49 -07:00
Miss Islington (bot)
a12c105908
[3.13] Add note about PYTHON_JIT environment variable to JIT README (GH-121942)
(cherry picked from commit f113c1a2a9)
Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
2024-07-17 22:18:39 +00:00
Miss Islington (bot)
7db14f1eba
[3.13] Ignore some failing tests in emulated JIT CI (GH-120977)
(cherry picked from commit 07daaf1ce1)
Co-authored-by: Diego Russo <diego.russo@arm.com>
2024-06-26 06:56:15 -07:00
Miss Islington (bot)
6b714d545f
[3.13] GH-120602: Support LLVM_VERSION_SUFFIX for JIT builds (GH-120768)
(cherry picked from commit 285f42c850)

Co-authored-by: Xarblu <xarblu@protonmail.com>
2024-06-20 01:13:23 +00:00
Miss Islington (bot)
f7ba3233a2
[3.13] gh-120433: Mention `chocolatey` for installing llvm on Windows as an alternative option (GH-120434) (#120651)
gh-120433: Mention ``chocolatey`` for installing llvm on Windows as an alternative option (GH-120434)
(cherry picked from commit 95737bbf18)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-06-17 19:18:07 +03:00
Miss Islington (bot)
acffe20683
[3.13] GH-118943: Fix a race condition when generating jit_stencils.h (GH-119101)
(cherry picked from commit 4702b7b5bd)
2024-05-16 14:37:56 -04:00
Miss Islington (bot)
45fbca983c
[3.13] Explain how to install LLVM on Fedora (GH-119100)
(cherry picked from commit ab73bcdf73)
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2024-05-16 16:57:40 +00:00
Miss Islington (bot)
29a2f9cc28
[3.13] GH-118836: Fix JIT build error when SHT_NOTE section is present (GH-119020)
(cherry picked from commit e04cd964eb)

Co-authored-by: Michał Górny <mgorny@gentoo.org>
2024-05-13 22:17:34 +00:00
Brandt Bucher
1b7e5e6e60
GH-113464: Generate a more efficient JIT (GH-118512) 2024-05-03 16:41:07 -07:00
Savannah Ostrowski
5248596781
GH-118251: Skip fewer test in emulated JIT CI (GH-118536) 2024-05-03 19:07:10 +00:00
Savannah Ostrowski
cb57a52a85
GH-118487: Add Black to .pre-commit-config.yaml for JIT files (GH-118537) 2024-05-03 10:49:51 -07:00
Mark Shannon
67bba9dd0f
GH-117442: Check eval-breaker at start (rather than end) of tier 2 loops (GH-118482) 2024-05-02 13:10:31 +01:00
Brandt Bucher
424438b11e
GH-113464: Display a warning when building the JIT (GH-118481) 2024-05-01 21:35:49 +00:00
Brandt Bucher
49baa656cb
GH-115802: Use the GHC calling convention in JIT code (GH-118287) 2024-05-01 08:05:53 -07:00
Guido van Rossum
7d83f7bcc4
gh-118335: Configure Tier 2 interpreter at build time (#118339)
The code for Tier 2 is now only compiled when configured
with `--enable-experimental-jit[=yes|interpreter]`.

We drop support for `PYTHON_UOPS` and -`Xuops`,
but you can disable the interpreter or JIT
at runtime by setting `PYTHON_JIT=0`.
You can also build it without enabling it by default
using `--enable-experimental-jit=yes-off`;
enable with `PYTHON_JIT=1`.

On Windows, the `build.bat` script supports
`--experimental-jit`, `--experimental-jit-off`,
`--experimental-interpreter`.

In the C code, `_Py_JIT` is defined as before
when the JIT is enabled; the new variable
`_Py_TIER2` is defined when the JIT *or* the
interpreter is enabled. It is actually a bitmask:
1: JIT; 2: default-off; 4: interpreter.
2024-04-30 18:26:34 -07:00
Savannah Ostrowski
8b56d82c59
GH-118306: Update JIT to use LLVM 18 (GH-118307) 2024-04-29 21:09:16 +00:00
Mark Shannon
3e06c7f719
GH-118095: Add dynamic exit support and FOR_ITER_GEN support to tier 2 (GH-118279) 2024-04-26 18:08:50 +01:00
Dino Viehland
07525c9a85
gh-116818: Make sys.settrace, sys.setprofile, and monitoring thread-safe (#116775)
Makes sys.settrace, sys.setprofile, and monitoring generally thread-safe.

Mostly uses a stop-the-world approach and synchronization around the code object's _co_instrumentation_version.  There may be a little bit of extra synchronization around the monitoring data that's required to be TSAN clean.
2024-04-19 14:47:42 -07:00
Brandt Bucher
62aeb0ee69
GH-117512: Allow 64-bit JIT operands on 32-bit platforms (GH-117527) 2024-04-06 08:26:43 -07:00
Michael Droettboom
0edde64a41
GH-117457: Correct pystats uop "miss" counts (GH-117477) 2024-04-04 15:49:18 -07:00
Guido van Rossum
060a96f1a9
gh-116968: Reimplement Tier 2 counters (#117144)
Introduce a unified 16-bit backoff counter type (``_Py_BackoffCounter``),
shared between the Tier 1 adaptive specializer and the Tier 2 optimizer. The
API used for adaptive specialization counters is changed but the behavior is
(supposed to be) identical.

The behavior of the Tier 2 counters is changed:
- There are no longer dynamic thresholds (we never varied these).
- All counters now use the same exponential backoff.
- The counter for ``JUMP_BACKWARD`` starts counting down from 16.
- The ``temperature`` in side exits starts counting down from 64.
2024-04-04 15:03:27 +00:00
Sam Gross
19c1dd60c5
gh-117323: Make cell thread-safe in free-threaded builds (#117330)
Use critical sections to lock around accesses to cell contents. The critical sections are no-ops in the default (with GIL) build.
2024-03-29 13:35:43 -04:00
Michael Droettboom
26d328b2ba
GH-117121: Add pystats to JIT builds (GH-117346) 2024-03-28 15:23:08 -07:00
Mark Shannon
bf82f77957
GH-116422: Tier2 hot/cold splitting (GH-116813)
Splits the "cold" path, deopts and exits, from the "hot" path, reducing the size of most jitted instructions, at the cost of slower exits.
2024-03-26 09:35:11 +00:00
Brandt Bucher
2c82592ab4
GH-116017: Put JIT code and data on the same page (GH-116845) 2024-03-19 08:47:28 -07:00
Ken Jin
41457c7fdb
gh-116381: Remove bad specializations, add fail stats (GH-116464)
* Remove bad specializations, add fail stats
2024-03-08 00:21:21 +08:00
Brandt Bucher
ffed8d985b
GH-116134: JIT aarch64-pc-windows-msvc (GH-116130) 2024-03-04 10:16:56 -08:00
Brandt Bucher
981f27dcc4
GH-115802: Don't JIT zero-length jumps (GH-116177) 2024-03-04 10:13:10 -08:00
Brandt Bucher
f0df35eeca
GH-115802: JIT "small" code for Windows (GH-115964) 2024-02-29 08:11:28 -08:00
Brandt Bucher
7259480957
GH-115802: JIT "small" code for macOS and Linux (GH-115826) 2024-02-26 08:32:44 -08:00
Brandt Bucher
17dab2e572
GH-113464: Clean up JIT stencil generation (GH-115800) 2024-02-22 10:22:23 -08:00
Mark Shannon
7b21403ccd
GH-112354: Initial implementation of warm up on exits and trace-stitching (GH-114142) 2024-02-20 09:39:55 +00:00
Brandt Bucher
f6d9e5926b
GH-113464: Add a JIT backend for tier 2 (GH-113465)
Add an option (--enable-experimental-jit for configure-based builds
or --experimental-jit for PCbuild-based ones) to build an
*experimental* just-in-time compiler, based on copy-and-patch (https://fredrikbk.com/publications/copy-and-patch.pdf).

See Tools/jit/README.md for more information on how to install the required build-time tooling.
2024-01-28 18:48:48 -08:00