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

Improve typesubtract for tuples #35600

Merged
merged 3 commits into from
Apr 28, 2020
Merged

Conversation

tkf
Copy link
Member

@tkf tkf commented Apr 26, 2020

Before:

julia> Core.Compiler.typesubtract(Tuple{Union{Int,Char}}, Tuple{Char})
Tuple{Union{Char, Int64}}

After:

julia> Core.Compiler.typesubtract(Tuple{Union{Int,Char}}, Tuple{Char})
Tuple{Int64}

close #35566

Unfortunately, I couldn't construct an example where the performance is improved by this inference yet, even though I can confirm that the methods are correctly inlined as expected.

base/compiler/typeutils.jl Outdated Show resolved Hide resolved
base/compiler/typeutils.jl Outdated Show resolved Hide resolved
@vtjnash vtjnash merged commit cf0c3e0 into JuliaLang:master Apr 28, 2020
mbauman added a commit that referenced this pull request Apr 28, 2020
* origin/master: (833 commits)
  Improve typesubtract for tuples (#35600)
  Make searchsorted*/findnext/findprev return values of keytype (#32978)
  fix buggy rand(RandomDevice(), Bool) (#35590)
  remove `Ref` allocation on task switch (#35606)
  Revert "partr: fix multiqueue resorting stability" (#35589)
  exclude types with free variables from `type_morespecific` (#35555)
  fix small typo in NEWS.md (#35611)
  enable inline allocation of structs with pointers (#34126)
  SparseArrays: Speed up right-division by diagonal matrices (#35533)
  Allow hashing 1D OffsetArrays
  NEWS item for introspection macros (#35594)
  Special case empty covec-diagonal-vec product (#35557)
  [GCChecker] fix a few tests by looking through casts
  Use norm instead of abs in generic lu factorization (#34575)
  [GCChecker,NFC] run clang-format -style=llvm
  [GCChecker] fix tests and add Makefile
  Add introspection macros support for dot syntax (#35522)
  Specialize `union` for `OneTo` (#35577)
  add pop!(vector, idx, [default]) (#35513)
  bump Pkg version (#35584)
  ...
vtjnash added a commit that referenced this pull request Sep 14, 2020
JeffBezanson pushed a commit that referenced this pull request Sep 21, 2020
vtjnash added a commit that referenced this pull request Sep 23, 2020
vtjnash added a commit that referenced this pull request Sep 24, 2020
vtjnash added a commit that referenced this pull request Sep 24, 2020
Improve typesubtract for tuples (repeat #35600)
@tkf tkf deleted the typesubtract-tuples branch September 26, 2020 23:35
KristofferC pushed a commit that referenced this pull request Oct 21, 2020
This reverts commit cf0c3e0.

(cherry picked from commit b18647e)
@KristofferC KristofferC mentioned this pull request Oct 21, 2020
15 tasks
@vchuravy vchuravy mentioned this pull request Jan 21, 2021
27 tasks
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.

MWE: if x isa T does not narrow the type in else block
3 participants