Skip to content
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

hunt type instabilities within the compiler #45095

Merged
merged 1 commit into from
May 3, 2022
Merged

hunt type instabilities within the compiler #45095

merged 1 commit into from
May 3, 2022

Conversation

aviatesk
Copy link
Sponsor Member

Some recent PRs seems to have introduced some of those, let's get them fixed.


for infstate in InfStackUnwind(sv)
if method === infstate.linfo.def
if infstate.linfo.specTypes == sig
if infstate.linfo.specTypes === sig
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need type-equality here?

@@ -106,7 +107,7 @@ function most_general_argtypes(method::Union{Method, Nothing}, @nospecialize(spe
# First, if we're dealing with a varargs method, then we set the last element of `args`
# to the appropriate `Tuple` type or `PartialStruct` instance.
if !toplevel && isva
if specTypes == Tuple
if specTypes === Tuple
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ibid

if method.name === :depwarn && isdefined(Main, :Base) && method.module === Main.Base
add_remark!(interp, sv, "Refusing to infer into `depwarn`")
return MethodCallResult(Any, false, false, nothing, Effects())
# This function is used for computing alternate limit heuristics
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code movement here makes the diff hard to read --- could you try arranging it differently?

Some recent PRs seems to have introduced some of those, let's get them fixed.
Comment on lines -211 to -227
# This function is used for computing alternate limit heuristics
function method_for_inference_heuristics(method::Method, @nospecialize(sig), sparams::SimpleVector)
if isdefined(method, :generator) && method.generator.expand_early && may_invoke_generator(method, sig, sparams)
method_instance = specialize_method(method, sig, sparams)
if isa(method_instance, MethodInstance)
cinfo = get_staged(method_instance)
if isa(cinfo, CodeInfo)
method2 = cinfo.method_for_inference_limit_heuristics
if method2 isa Method
return method2
end
end
end
end
return nothing
end

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved this function to abstractinterpretation.jl since the return value of this funciton should sync with edge_matches_sv and matches_sv.

@aviatesk
Copy link
Sponsor Member Author

aviatesk commented May 2, 2022

@nanosoldier runbenchmarks("inference", vs=":master")

@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - no performance regressions were detected. A full report can be found here.

@aviatesk aviatesk merged commit 7629aa1 into master May 3, 2022
@aviatesk aviatesk deleted the avi/infcmp branch May 3, 2022 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants