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

respecialize normalized vararg type parameters as part of precise_container_type #22877

Merged
merged 4 commits into from
Jul 21, 2017

Conversation

jrevels
Copy link
Member

@jrevels jrevels commented Jul 19, 2017

Fix #22875:

julia> @inline g(args...) = one(args...)
g (generic function with 1 method)

julia> f(args...) = g(args...)
f (generic function with 1 method)

# this previously inferred as Any
julia> @code_warntype f(Int)
Variables:
  #self#::#f
  args::Any

Body:
  begin
      return 1
  end::Int64

# this was also previously inferred as Any
julia> @code_warntype Base.promote_type(Int, Float64, Int, Int, Int, Int)
Variables:
  #self#::Base.#promote_type
  T::Any
  S::Any
  U::Any
  V::Any

Body:
  begin
      return Float64
  end::Type{Float64}

This still needs tests, which I'll get to tomorrow (or after dinner, if I'm feeling plucky).

Many thanks to @vtjnash for once again guiding me through the dark waters of inference.

@vtjnash vtjnash added the needs tests Unit tests are required for this change label Jul 20, 2017
@jrevels jrevels added compiler:inference Type inference and removed needs tests Unit tests are required for this change labels Jul 20, 2017
@jrevels
Copy link
Member Author

jrevels commented Jul 20, 2017

Travis failure unrelated?

@KristofferC
Copy link
Sponsor Member

@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 @ararslan

@jrevels
Copy link
Member Author

jrevels commented Jul 21, 2017

Can't reproduce the regressions locally. I can reproduce the perf_local_array speedups, though. It seems that before this PR, that benchmark was hitting #22875 via the calls to samerand(T, n), causing downstream variables to be inferred as Any. With this fix, the function can be fully inferred.

@jrevels jrevels merged commit 5d159b5 into master Jul 21, 2017
@jrevels jrevels deleted the jr/typesplat branch July 21, 2017 19:52
jeffwong pushed a commit to jeffwong/julia that referenced this pull request Jul 24, 2017
…tainer_type (JuliaLang#22877)

also use more specialized vararg type params in inlining_pass if available
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:inference Type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants