Compiler: abstract calls: type assert to help stability#57582
Merged
aviatesk merged 3 commits intoJuliaLang:masterfrom Mar 12, 2025
Merged
Compiler: abstract calls: type assert to help stability#57582aviatesk merged 3 commits intoJuliaLang:masterfrom
aviatesk merged 3 commits intoJuliaLang:masterfrom
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Member
|
Huh, this is strange. It's just a |
Member
|
|
Member
|
So I'd suggest diff --git a/Compiler/src/abstractinterpretation.jl b/Compiler/src/abstractinterpretation.jl
index 8035216f1e..2a904e5688 100644
--- a/Compiler/src/abstractinterpretation.jl
+++ b/Compiler/src/abstractinterpretation.jl
@@ -2621,7 +2621,8 @@ end
function abstract_call_known(interp::AbstractInterpreter, @nospecialize(f),
arginfo::ArgInfo, si::StmtInfo, sv::AbsIntState,
max_methods::Int = get_max_methods(interp, f, sv))
- (; fargs, argtypes) = arginfo
+ argtypes::Vector{Any} = arginfo.argtypes
+ fargs = arginfo.fargs
la = length(argtypes)
𝕃ᵢ = typeinf_lattice(interp)
if isa(f, Builtin)for now. |
It seems `la` is getting inferred as `Integer` instead of as `Int` for some reason. This reduces the number of invalidations from 2061 to 2046 on running this code: ```julia struct I <: Integer end Base.Int64(::I) = 7 ```
e041bb0 to
6139d7c
Compare
nsajko
commented
Mar 12, 2025
aviatesk
approved these changes
Mar 12, 2025
serenity4
pushed a commit
to serenity4/julia
that referenced
this pull request
May 1, 2025
Member
|
(I took the liberty of adding the backport label since it helps with invalidations: #60807) |
KristofferC
pushed a commit
that referenced
this pull request
Mar 3, 2026
(cherry picked from commit ce747fe)
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.
It seems
lais getting inferred asIntegerinstead of asIntfor some reason.This reduces the number of invalidations on running this code from 456 to 219: