-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Remove literal_static_pointer_val from literal_pointer_val implementation #50632
Conversation
c714b17
to
5d209a2
Compare
Co-authored-by: Jameson Nash <vtjnash@gmail.com>
cc: @maleadt Have you tested GPUCompiler against this? |
Have not tested GPUCompiler, though whatever method GPUCompiler is currently using to handle global_targets should still apply here. |
It's failing the literal string comparison tests but it seems to work . |
This broke RuntimeGeneratedFunctions.jl: https://s3.amazonaws.com/julialang-reports/nanosoldier/pkgeval/by_date/2023-07/26/RuntimeGeneratedFunctions.primary.log
Maybe related to opaque closures? I'll see if I can come up with a minimal reproducer. EDIT: Diffractor.jl has the same issue (cc @oxinabox). |
MWE: @generated function foo()
quote
$(Symbol("wat"))
$(Expr(:opaque_closure, :(() -> bar)))
end
end
foo() Requires Julia#master with LLVM assertions. |
Doesn't reproduce on very latest master though, I guess #50650 may have fixed this? |
This is unfortunately not a convenient missing symbol, but is a memory corruption somewhere. We seem to be allocating two llvm::GlobalVariable objects at the same address (testing on master before #50650 with the MWE), and I can't debug further because GlobalVariable overrides |
Are we freeing the |
No, hardware watch doesn't detect an intervening destructor call. |
Possibly the same issue as #48742? |
That does seem likely, since we'd be freeing the associated module and potentially the globalvariable there too. @vtjnash the WeakVH is too expensive, but can we just make global_targets a map of |
That code really just should not call |
I'm also getting the following error on master with Metal.jl:
Reverting to before this PR fixes that, although another PR may be the actual cause of course. |
Does it still fail on #50724 ? |
Yeah. EDIT: this is when GPUCompiler invokes the linker; I'll have a closer look myself first. |
This eliminates most of the literal pointers outside of ccalls and directly JIT-ted code, except instead of adding names we instead just use imaging mode and fix up the visualization in
jl_get_llvmf_defn
.Depends on #50631