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

fix and de-dup cached calls to methods_by_ftype in compiler #36404

Merged
merged 1 commit into from
Jun 25, 2020

Conversation

JeffBezanson
Copy link
Member

This does a couple things:

  1. Fixes this issue: 8ca6e8d#r40082739 but I'm not sure how to trigger it (or if that's even possible).
  2. I believe we were pessimizing world ranges in some cases (pretty rarely, it seems), due to the cache updating function not being pure (it updates the outer {min,max}_valid arrays during inference).
  3. Refactors the common code into one function.
  4. The closure here was capturing a @nospecialize argument. I boxed it so that the closure can have a concrete type inferred. That could be done generally in lowering but I'll leave that for later.

@JeffBezanson JeffBezanson added compiler:inference Type inference compiler:optimizer Optimization passes (mostly in base/compiler/ssair/) labels Jun 23, 2020
Copy link
Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

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

capturing a @nospecialize argument

That seems like an interesting idea. Even in general, we could put @nospecialize on any (captured) local to select this behavior (and not necessarily need a Box, but just an ::Any typed field).

base/compiler/ssair/inlining.jl Show resolved Hide resolved
@JeffBezanson JeffBezanson merged commit 32b1b14 into master Jun 25, 2020
@JeffBezanson JeffBezanson deleted the jb/matchingmethods branch June 25, 2020 17:06
mbauman added a commit to dlfivefifty/julia that referenced this pull request Jun 26, 2020
* origin/master: (232 commits)
  Add passthrough for non-Markdown docs (JuliaLang#36091)
  Fix pointer to no longer assume contiguity (JuliaLang#36405)
  Ensure string-hashing is defined before it gets used (JuliaLang#36411)
  Make compilecache atomic (JuliaLang#36416)
  add a test for JuliaLang#30739 (JuliaLang#36395)
  Fix broken links in docstring of `repeat` (JuliaLang#36376)
  fix and de-dup cached calls to `methods_by_ftype` in compiler (JuliaLang#36404)
  ml-matches: skip unnecessary work, when possible (JuliaLang#36413)
  gf: fix some issues with the move from using a tree to a hash lookup of leaf types (JuliaLang#36413)
  Add news and manual entry for sincospi (JuliaLang#36403)
  Check axes in Array(::AbstractArray) (fixes JuliaLang#36220) (JuliaLang#36397)
  add versions of `code_typed` and `which` that accept tuple types (JuliaLang#36389)
  Fix spelling of readdir. (JuliaLang#36409)
  add sincospi (JuliaLang#35816)
  fix showing methods with unicode gensymed variable names (JuliaLang#36396)
  Add doctest: eachslice (JuliaLang#36386)
  fix documentation typo ("Ingeger")
  Refactor `abstract_eval` to separate out statements and values (JuliaLang#36350)
  fix return type of `get!` on `IdDict` (JuliaLang#36383)
  Allow single option with REPL.TerminalMenus (JuliaLang#36369)
  ...
simeonschaub pushed a commit to simeonschaub/julia that referenced this pull request Aug 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:inference Type inference compiler:optimizer Optimization passes (mostly in base/compiler/ssair/)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants