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

simplify entry points to type inference #18591

Merged
merged 2 commits into from
Sep 21, 2016
Merged

simplify entry points to type inference #18591

merged 2 commits into from
Sep 21, 2016

Conversation

vtjnash
Copy link
Member

@vtjnash vtjnash commented Sep 20, 2016

this breaks up the typeinf_edge function into its subcomponents,
allowing callers to exercise only the pieces they care about
rather than returning all possible values the caller might care
about in a Tuple

also fixes missing test-and-lock-and-test for threaded inference

(backporting from #17057 WIP)

@tkelman
Copy link
Contributor

tkelman commented Sep 20, 2016

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

return code.rettype
end
else
return code.rettype
Copy link
Contributor

Choose a reason for hiding this comment

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

the logic flow is a bit tough to follow, add more comments here?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe easier to read as

isa(inf, CodeInfo) || return code.rettype
if (inf::CodeInfo).inferred
  return code.rettype
end

Copy link
Contributor

Choose a reason for hiding this comment

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

agree, it would be

Copy link
Member Author

Choose a reason for hiding this comment

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

agreed 3. I'm not sure why Github doesn't hide the comments anymore after the code is changed.

# don't infer it now, as attempting to force it now would be a bad idea (non terminating)
force_infer = false
if method.module == _topmod(method.module) || (isdefined(Main, :Base) && method.module == Main.Base)
# however, some gf have special tfunc and meaning they wouldn't have been inferred yet
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a missing word here? "special tfunc and ___ meaning they" ?

@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @jrevels

@vtjnash
Copy link
Member Author

vtjnash commented Sep 20, 2016

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

@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @jrevels

this breaks up the typeinf_edge function into its subcomponents,
allowing callers to exercise only the pieces they care about
rather than returning all possible values the caller might care
about in a Tuple

also adds missing test-and-lock-and-test for threaded inference
entry points
@vtjnash vtjnash merged commit b0661c2 into master Sep 21, 2016
@vtjnash vtjnash deleted the jn/codeinfo-2 branch September 21, 2016 01:02
maleadt added a commit that referenced this pull request Oct 12, 2016
The logic had been switched since #18591.
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.

4 participants