LLVM 19 for JIT on 3.13? Maybe >= 19 for 3.14+?

I’m just messing around, but was curious why LLVM_VERSION is fixed at v18 for Python 3.13 instead of the equivalent of >=18 I imagine when the JIT work started for 3.13, LLVM 18 was the current stable version, so a fixed version requirement didn’t really cost anything.

I just bumped LLVM_VERSION in Tools/jit/_llvm.py to 19 and built from scratch. Everything worked fine (the only test failure was test_ssl which fails frequently). Maybe the version requirement should be loosened for 3.14 to be at least 19? OTOH, maybe LLVM 20 won’t have been released by the time 3.14 is, so it will be an unknown quantity.

Again, just messing around…

Good question! In 3.13 (and early 3.14), we used an ugly performance hack that involved textual manipulation of LLVM IR. It worked fine for our purposes, but it felt like it might be too fragile to survive unknown LLVM upgrades.

Thankfully, we don’t do anything like that anymore. I’d probably be okay with only enforcing a lower bound on the LLVM version (or perhaps a range of versions) if that would make things easier for people. We might only want to test with the lowest version, though, and maybe print a warning if untested newer versions are used instead.

I could see a future LLVM using new relocations or something that our build scripts can’t handle. Printing “That didn’t work… try LLVM 19!” would probably be a good enough fallback.

4 Likes