-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
GH-140479: Update JIT builds to use LLVM 21 #140973
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
Conversation
What about the Windows x86_64 image? Does it have llvm 20 as well? Also, in this PR we do 2 things: fix some logic and bump to 21. Wouldn't it be better to do 2 PRs? In case we need to revert to llvm 20 (for any reason) we will revert to a working fetching for version 20. |
|
@diegorusso Same deal with x86_64 - see https://github.com/actions/runner-images/blob/win22/20251021.76/images/windows/Windows2022-Readme.md#language-and-runtime Sure - see #141002 |
diegorusso
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Provided #141002 gets merged before, this can go in as well. Thanks for splitting them up.
Fidget-Spinner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks simple enough, let's do this!
|
I have tried to rebase https://github.com/pablogsal/cpython-unwind to check the unwinding. Looks like the function to test now needs to be more complicated beause the JIT refuses to call functions if there are branches now and requires tons of iterations to start jitting. I would love if someone can take a look at |
|
The main branch's JIT doesn't seem to want to compile the example due to trace stack underflow. So I reduced the side exit count on my tracing JIT example and tried. Seems like LLVM 21 doesn't fix the problem :( Notice the missing frames! However, I have made a very interesting discovery --- compiling the interpreter with a recent enough clang version (tested with clang-20/21) to the JIT restores the frames!!! So the solution to the stack unwinding seems to be to mandate compiilng CPython with the same clang as the JIT! |
We need to understand what the hell it's going on here because otherwise the risk it's that this breaks randomly in the future |
|
Another data point: old GCC (11) compiled with frame pointers with JIT also allows us to see the frames. |
|
Just to be clear, merely upgrading to LLVM 21 isn’t sufficient to get unwinding. We also need to do the reserved frame pointer thing, which isn’t in this branch. |
|
That can come after. |
|
Yeah, was chatting with Brandt earlier this weekend about this and will probably go investigate the unwinding piece after this gets merged. |
|
I think it would be good to merge this soon. The meta benchmarking runners don't have JIT results this week because they don't have LLVM 20. It would be a little bit of churn to request they upgrade twice (once for LLVM 20, once for LLVM 21), so I was thinking if I could ask them nicely to just upgrade to LLVM 21 once :). |
|
Discussed in our weekly sync, merging 🚀 ! |
Well, here's a fun treat...looks like the logic to fetch the LLVM binary as a release artifact from https://github.com/python/cpython-bin-deps/releases/tag/llvm-21.1.4.0 never actually worked 😓. CI only passed for Windows on #140329 because LLVM 20 is included in the base image we use for Windows builds (example: https://github.com/actions/partner-runner-images/blob/main/images/arm-windows-11-image.md#language-and-runtime).
As such, we should merge #141002 before this one (Windows CI will fail otherwise!).