Repository navigation
Keep inferred sources on Julia < 1.12 - #947
Merged
Merged
Conversation
Before Julia 1.12, codegen itself looks up callees in our cache. If Julia discarded a callee's inferred source (for example, a non-inlineable `@nospecialize` helper with a non-compileable signature), `jl_compile_workqueue` re-inferred it with Julia's native interpreter, bypassing our method tables. Keep inferred sources on those versions. This also lets Julia 1.10 compile `@nospecialize` calls without a dynamic `jl_invoke`, as 1.11 and later already do.
This was referenced Sep 25, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #947 +/- ##
==========================================
+ Coverage 86.32% 86.39% +0.06%
==========================================
Files 29 29
Lines 5756 5756
==========================================
+ Hits 4969 4973 +4
+ Misses 787 783 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before Julia 1.12, codegen itself looks up callees in our cache. If Julia discarded a callee's inferred source (for example, a non-inlineable
@nospecializehelper with a non-compileable signature),jl_compile_workqueuere-inferred it with the native interpreter, bypassing our method tables. This PR keeps inferred sources on those versions by settingmay_discard_treesto false before 1.12.0-DEV.1823. Later versions already recover discarded sources with our interpreter.As a result, Julia 1.10 now compiles
@nospecializecalls without a dynamicjl_invoke, as 1.11 and later already do. The test that expected a dynamic invoke on 1.10 now checks the same behavior on all versions.Split from #940. Before Julia 1.12, the Julia IR passes added there (#948) don't see callees re-inferred by the native interpreter. Without this PR, such callees stay dynamic calls on 1.10, as on
main, so the stack doesn't depend on it.GPUCompiler's
nativetests pass on Julia 1.10 and 1.11. The full suite passes on 1.10 and 1.11 together with the #940 stack.