Skip to content

Conversation

@yuyichao
Copy link
Contributor

Remaining issues are the removal of EHFrameRegistrar class and manual locking interface for ThreadSafeContext. Some other deprecation warnings are also left as is for now.

vchuravy
vchuravy previously approved these changes Oct 24, 2025
@yuyichao
Copy link
Contributor Author

@yuyichao
Copy link
Contributor Author

For the eh frame registration issue, it seems that the ehframe register plugin doesn't have any customization hooks anymore so maybe we need to create our own plugin instead?

For the ThreadSafeContext issue, I currently worked around it by patching llvm. The usage patter is more restricted with the new API and I'm not 100% sure yet if the new API covers all the needs here.

@giordano giordano added external dependencies Involves LLVM, OpenBLAS, or other linked libraries compiler:llvm For issues that relate to LLVM labels Oct 24, 2025
@yuyichao yuyichao force-pushed the yyc/llvm21 branch 2 times, most recently from 30b9363 to ca8ce88 Compare October 24, 2025 22:09
@giordano giordano mentioned this pull request Oct 24, 2025
@yuyichao yuyichao force-pushed the yyc/llvm21 branch 2 times, most recently from c53adce to 2961412 Compare October 26, 2025 14:40
@yuyichao
Copy link
Contributor Author

EHFrame registrer should be fixed now and the only remaining issue is the API change for ThreadSafeContext. I'm convinced that it is not possible to support the new API as-is without getting rid of incompletemodules. All the other usages seems managable.

The comment suggests that incompletemodules is only necessary until jitlink can be used everywhere. Not sure if that can be done with LLVM 21 or if we need to carry a LLVM patch in the meantime.

@yuyichao
Copy link
Contributor Author

Here's the LLVM patch I used to get julia and LLVM.jl to build/load JuliaLang/llvm-project#51 .

@yuyichao
Copy link
Contributor Author

Actually I take that back. The incompletemodules usage isn't a problem, since the codegen param objects stored there are all unlocked. The early unlocking used in add_output, however, doesn't really work. It should be only an memory consumption issue though and I don't think it'll be a correctness issue.

@yuyichao
Copy link
Contributor Author

The early release of thread safe context in add_output is now fixed so this should be everything for dealing with C++ API change.

The implementation could probably be cleaner with C++20 co_routine since this is more-or-less a manual implementation of it...

@yuyichao yuyichao force-pushed the yyc/llvm21 branch 3 times, most recently from 22dec88 to bdc92a9 Compare October 27, 2025 19:45
@yuyichao
Copy link
Contributor Author

yuyichao commented Oct 27, 2025

I moved all the change that doesn't require a version check to other PR's. (#59965 is included due to otherwise merge conflict).

I assume the first few changes should be reasonably clear and uncontroversial (those are part of the original PR). I can split that out if needed as well.
The last two commits would need some review, including making the gc checker happy again...

Turn `add_output` into a manual co-routine
so that we can get out of the caller scope mid-call
to release the threadsafecontext lock early.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler:llvm For issues that relate to LLVM external dependencies Involves LLVM, OpenBLAS, or other linked libraries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants