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

Support LibGit2 ABI for 1.4.0 and later #46795

Conversation

fxcoudert
Copy link
Contributor

Partial backport of #45411

vtjnash and others added 12 commits September 9, 2022 10:39
…JuliaLang#46581)

Added in JuliaLang#43415, this was too aggressive for many cases. Unlike the
comment suggested, it is unneeded in many cases, so only do it when it
is expected to be maximally profitable.

Fixes JuliaLang#46492

```
julia> @time norm(C_212)
before 45.959497 seconds (81.85 M allocations: 6.976 GiB, 6.31% gc time, 100.00% compilation time)
after  15.781804 seconds (20.81 M allocations: 1.294 GiB, 6.32% gc time, 100.00% compilation time)
```
…`JuliaIO/Tar.jl` repo (not the `master` branch of the `JuliaIO/Tar.jl` repo) (JuliaLang#46733)
It turns out that previously we didn't concretize `invoke` callsite
correctly, as we didn't take into account whether the call being
concretized is `invoke`-d or not, e.g.:
```
julia> invoke_concretized2(a::Int) = a > 0 ? :int : nothing
invoke_concretized2 (generic function with 1 method)

julia> invoke_concretized2(a::Integer) = a > 0 ? :integer : nothing
invoke_concretized2 (generic function with 2 methods)

julia> let
           Base.Experimental.@force_compile
           Base.@invoke invoke_concretized2(42::Integer)
       end
:int # this should return `:integer` instead
```

This commit fixes that up by propagating information `invoke`-d callsite
to `concrete_eval_call`. Now we should be able to pass the following test cases:
```julia
invoke_concretized1(a::Int) = a > 0 ? :int : nothing
invoke_concretized1(a::Integer) = a > 0 ? "integer" : nothing
@test Base.infer_effects((Int,)) do a
    @invoke invoke_concretized1(a::Integer)
end |> Core.Compiler.is_foldable
@test Base.return_types() do
    @invoke invoke_concretized1(42::Integer)
end |> only === String

invoke_concretized2(a::Int) = a > 0 ? :int : nothing
invoke_concretized2(a::Integer) = a > 0 ? :integer : nothing
@test Base.infer_effects((Int,)) do a
    @invoke invoke_concretized2(a::Integer)
end |> Core.Compiler.is_foldable
@test let
    Base.Experimental.@force_compile
    @invoke invoke_concretized2(42::Integer)
end === :integer
```
For some reason `tab_unpack` gained an `@noinline` annotation as well as a conflicting
`@inline`. The lack of inlining was causing performance problems, so remove both of
those, since the function should be inlineable by default.
…46553)

This prevents some invalidations in `mightalias(A::AbstractArray, B::AbstractArray)`
in abstractarray.jl when loading Static.jl.

Here we specialize on the function instead of using map since
`broadcasting` returns a BitArray, `map` returns a Vector{Bool}.

(cherry picked from commit 31d4c22)
The way we were counting the number of bits was assigning a negative number
to `0`, which could lead to a negative total number of bits. Better to just
exit early in this case.
Also, the estimate was slightly off because we were counting the number of leading
zeros in the least significant limb, instead of the most significant.

(cherry picked from commit f7b4ebe)
* improve inferrability of `NamedTuple{names}(nt::NamedTuple) where {names}`
* improve inferrability of `recursive_dotcalls!(ex, args, i=1)`

(cherry picked from commit 5d9807d)
…aLang#46732)

This fixes a few hundred invalidations when loading Static/jl/ArrayInterface.jl.

(cherry picked from commit 70bfa3f)
…_uuid::Base.UUID)` (JuliaLang#46661)

* improve type stability of `process_overrides(artifact_dict::Dict, pkg_uuid::Base.UUID)`

This fixes some invalidations when loading Static.jl

(cherry picked from commit b4af0e5)
* improve type stability of `sort!(v::AbstractVector, lo::Integer, hi::Integer, ::InsertionSortAlg, o::Ordering)`
* improve type stability of `fmt(buf, pos, arg, spec::Spec{T}) where {T <: Strings}`

This fixes some invalidations when loading Static.jl.

(cherry picked from commit 9b1780d)
@KristofferC
Copy link
Sponsor Member

Included in d336126

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.

8 participants