From dfd7bb4f9fefaa1e156127b7aa7b9b2487e649b4 Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Thu, 17 Feb 2022 12:46:29 -0500 Subject: [PATCH 001/369] Allow more time for profile print when Sockets and Threads watchdogs request info (#44218) (cherry picked from commit 105c77ae68512765b5f769ff3ef05794b8c853dc) --- stdlib/Sockets/test/runtests.jl | 2 +- test/threads_exec.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/Sockets/test/runtests.jl b/stdlib/Sockets/test/runtests.jl index 6b8b1be6e055f..a27bb89408f1d 100644 --- a/stdlib/Sockets/test/runtests.jl +++ b/stdlib/Sockets/test/runtests.jl @@ -16,7 +16,7 @@ function killjob(d) end if @isdefined(SIGINFO) ccall(:uv_kill, Cint, (Cint, Cint), getpid(), SIGINFO) - sleep(1) + sleep(5) # Allow time for profile to collect and print before killing end ccall(:uv_kill, Cint, (Cint, Cint), getpid(), Base.SIGTERM) nothing diff --git a/test/threads_exec.jl b/test/threads_exec.jl index 1b146f48e8c57..63e3be1b88cb7 100644 --- a/test/threads_exec.jl +++ b/test/threads_exec.jl @@ -16,7 +16,7 @@ function killjob(d) end if @isdefined(SIGINFO) ccall(:uv_kill, Cint, (Cint, Cint), getpid(), SIGINFO) - sleep(1) + sleep(5) # Allow time for profile to collect and print before killing end ccall(:uv_kill, Cint, (Cint, Cint), getpid(), Base.SIGTERM) nothing From ed41f7c398fa7a80642658e6b947904ece07059e Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Thu, 17 Feb 2022 12:52:29 -0500 Subject: [PATCH 002/369] Profile: Minor fixes. Signal handling fix. (#44199) (cherry picked from commit 072c041f8fe19a3c94dc4a249de975c64a004d62) --- src/signal-handling.c | 11 ++++++----- src/signals-unix.c | 20 +++++++++++++++----- stdlib/Profile/Project.toml | 3 ++- stdlib/Profile/src/Profile.jl | 5 +++-- stdlib/Profile/test/runtests.jl | 2 -- 5 files changed, 26 insertions(+), 15 deletions(-) diff --git a/src/signal-handling.c b/src/signal-handling.c index 142f03b6c899d..d9c53b0211eae 100644 --- a/src/signal-handling.c +++ b/src/signal-handling.c @@ -132,22 +132,23 @@ static size_t jl_safe_read_mem(const volatile char *ptr, char *out, size_t len) static double profile_autostop_time = -1.0; static double profile_peek_duration = 1.0; // seconds -double jl_get_profile_peek_duration(void) { +double jl_get_profile_peek_duration(void) +{ return profile_peek_duration; } -void jl_set_profile_peek_duration(double t) { +void jl_set_profile_peek_duration(double t) +{ profile_peek_duration = t; - return; } uintptr_t profile_show_peek_cond_loc; JL_DLLEXPORT void jl_set_peek_cond(uintptr_t cond) { profile_show_peek_cond_loc = cond; - return; } -static void jl_check_profile_autostop(void) { +static void jl_check_profile_autostop(void) +{ if ((profile_autostop_time != -1.0) && (jl_hrtime() > profile_autostop_time)) { profile_autostop_time = -1.0; jl_profile_stop_timer(); diff --git a/src/signals-unix.c b/src/signals-unix.c index b2e3ef2952029..8a5822d451335 100644 --- a/src/signals-unix.c +++ b/src/signals-unix.c @@ -539,9 +539,13 @@ JL_DLLEXPORT int jl_profile_start_timer(void) JL_DLLEXPORT void jl_profile_stop_timer(void) { - if (running) + if (running) { timer_delete(timerprof); - running = 0; + // Because SIGUSR1 is multipurpose, care must be taken for running = 0 to be set after the timer has fully stopped. + // There may be a pending signal emitted from the timer so wait a few timer cycles + sleep_ms((nsecprof / GIGA) * 1000 * 3); + running = 0; + } } #elif defined(HAVE_ITIMER) @@ -556,18 +560,24 @@ JL_DLLEXPORT int jl_profile_start_timer(void) timerprof.it_interval.tv_usec = 0; timerprof.it_value.tv_sec = nsecprof / GIGA; timerprof.it_value.tv_usec = ((nsecprof % GIGA) + 999) / 1000; - if (setitimer(ITIMER_PROF, &timerprof, NULL) == -1) - return -3; + // Because SIGUSR1 is multipurpose, set `running` before so that we know that the first SIGUSR1 came from the timer running = 1; + if (setitimer(ITIMER_PROF, &timerprof, NULL) == -1) { + running = 0; + return -3; + } return 0; } JL_DLLEXPORT void jl_profile_stop_timer(void) { if (running) { - running = 0; memset(&timerprof, 0, sizeof(timerprof)); setitimer(ITIMER_PROF, &timerprof, NULL); + // Because SIGUSR1 is multipurpose, care must be taken for running = 0 to be set after the timer has fully stopped. + // There may be a pending signal emitted from the timer so wait a few timer cycles + sleep_ms((nsecprof / GIGA) * 1000 * 3); + running = 0; } } diff --git a/stdlib/Profile/Project.toml b/stdlib/Profile/Project.toml index 1d13dad22233a..334d475832b6d 100644 --- a/stdlib/Profile/Project.toml +++ b/stdlib/Profile/Project.toml @@ -5,9 +5,10 @@ uuid = "9abbd945-dff8-562f-b5e8-e1ebf5ef1b79" Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" [extras] +Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Logging", "Serialization", "Test"] +test = ["Base64", "Logging", "Serialization", "Test"] diff --git a/stdlib/Profile/src/Profile.jl b/stdlib/Profile/src/Profile.jl index 50e03d2c79a5a..b11dfb488c373 100644 --- a/stdlib/Profile/src/Profile.jl +++ b/stdlib/Profile/src/Profile.jl @@ -54,7 +54,7 @@ function _peek_report() iob = IOBuffer() ioc = IOContext(IOContext(iob, stdout), :displaysize=>displaysize(stdout)) print(ioc, groupby = [:thread, :task]) - Base.print(stdout, String(resize!(iob.data, iob.size))) + Base.print(stdout, String(take!(iob))) end # This is a ref so that it can be overridden by other profile info consumers. const peek_report = Ref{Function}(_peek_report) @@ -73,7 +73,8 @@ Set the duration in seconds of the profile "peek" that is triggered via `SIGINFO set_peek_duration(t::Float64) = ccall(:jl_set_profile_peek_duration, Cvoid, (Float64,), t) precompile_script = """ -Profile.@profile sleep(0.5) +import Profile +Profile.@profile while Profile.len_data() < 1000; rand(10,10) * rand(10,10); end Profile.peek_report[]() Profile.clear() """ diff --git a/stdlib/Profile/test/runtests.jl b/stdlib/Profile/test/runtests.jl index 50917b9797c7d..ab87d497fe93e 100644 --- a/stdlib/Profile/test/runtests.jl +++ b/stdlib/Profile/test/runtests.jl @@ -226,8 +226,6 @@ if Sys.isbsd() || Sys.islinux() end end end -else - @warn "Skipping \"SIGINFO/SIGUSR1 profile triggering\" test as it is not supported on this platform" end @testset "FlameGraphs" begin From 54386c78ce91875800aab5ef0f02e8d8db093f03 Mon Sep 17 00:00:00 2001 From: Thomas Christensen Date: Thu, 17 Feb 2022 16:31:22 -0500 Subject: [PATCH 003/369] make `cat(As..., dims=Val((1,2,...))` work (#44211) (cherry picked from commit 1ad2396f05fa63a71e5842c814791cd7c7715100) --- base/abstractarray.jl | 10 ++++++---- test/abstractarray.jl | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/base/abstractarray.jl b/base/abstractarray.jl index 50b83dff86e6b..9c3cb23865dff 100644 --- a/base/abstractarray.jl +++ b/base/abstractarray.jl @@ -1712,13 +1712,15 @@ end _cs(d, a, b) = (a == b ? a : throw(DimensionMismatch( "mismatch in dimension $d (expected $a got $b)"))) -function dims2cat(::Val{n}) where {n} - n <= 0 && throw(ArgumentError("cat dimension must be a positive integer, but got $n")) - ntuple(i -> (i == n), Val(n)) +function dims2cat(::Val{dims}) where dims + if any(≤(0), dims) + throw(ArgumentError("All cat dimensions must be positive integers, but got $dims")) + end + ntuple(in(dims), maximum(dims)) end function dims2cat(dims) - if any(dims .<= 0) + if any(≤(0), dims) throw(ArgumentError("All cat dimensions must be positive integers, but got $dims")) end ntuple(in(dims), maximum(dims)) diff --git a/test/abstractarray.jl b/test/abstractarray.jl index 060f1ffa8b8cb..d650cf67ebf11 100644 --- a/test/abstractarray.jl +++ b/test/abstractarray.jl @@ -732,6 +732,7 @@ function test_cat(::Type{TestAbstractArray}) @test @inferred(cat(As...; dims=Val(3))) == zeros(2, 2, 2) cat3v(As) = cat(As...; dims=Val(3)) @test @inferred(cat3v(As)) == zeros(2, 2, 2) + @test @inferred(cat(As...; dims=Val((1,2)))) == zeros(4, 4) end function test_ind2sub(::Type{TestAbstractArray}) From a9d1ad20a4a1be7997e70114a674c083cbb7965c Mon Sep 17 00:00:00 2001 From: Martin Holters Date: Fri, 18 Feb 2022 09:47:33 +0100 Subject: [PATCH 004/369] Reduce number of `getindex(::Type, ...)` methods (#44127) Previously, there were special cases for `T[]`, `T[a]`, `T[a,b]` and `T[a,b,c]`. Together with the general case for more elements, that meant five methods to consider in cases like `T[x...]` where the length of `x` was not known at compile time. That was beyond the inference limit and such a call would be inferred as `Any`. So this change gets rid of all the special cases. The loop-based general case worked well if all arguments were of the same type, but otherwise suffered from type-instability inside the loop. Without the special cases for low element count this would be hit more often, so for the non-homogeneous case, the loop is replaced with a call to `afoldl` that basically unrolls the loop for up to 32 elements. (cherry picked from commit b8e5d7e7e2e039911e9c6f39e7e5c301fcfc8cb6) --- base/array.jl | 17 ++++++++++------- test/arrayops.jl | 4 +++- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/base/array.jl b/base/array.jl index cf5bbc05e412a..b8ad7e137f25e 100644 --- a/base/array.jl +++ b/base/array.jl @@ -402,17 +402,20 @@ julia> getindex(Int8, 1, 2, 3) """ function getindex(::Type{T}, vals...) where T a = Vector{T}(undef, length(vals)) - @inbounds for i = 1:length(vals) - a[i] = vals[i] + if vals isa NTuple + @inbounds for i in 1:length(vals) + a[i] = vals[i] + end + else + # use afoldl to avoid type instability inside loop + afoldl(1, vals...) do i, v + @inbounds a[i] = v + return i + 1 + end end return a end -getindex(::Type{T}) where {T} = (@inline; Vector{T}()) -getindex(::Type{T}, x) where {T} = (@inline; a = Vector{T}(undef, 1); @inbounds a[1] = x; a) -getindex(::Type{T}, x, y) where {T} = (@inline; a = Vector{T}(undef, 2); @inbounds (a[1] = x; a[2] = y); a) -getindex(::Type{T}, x, y, z) where {T} = (@inline; a = Vector{T}(undef, 3); @inbounds (a[1] = x; a[2] = y; a[3] = z); a) - function getindex(::Type{Any}, @nospecialize vals...) a = Vector{Any}(undef, length(vals)) @inbounds for i = 1:length(vals) diff --git a/test/arrayops.jl b/test/arrayops.jl index 84b0e7d259f45..b2badb66ce93d 100644 --- a/test/arrayops.jl +++ b/test/arrayops.jl @@ -2318,10 +2318,12 @@ let A = zeros(Int, 2, 2), B = zeros(Float64, 2, 2) f40() = Float64[A A] f41() = [A B] f42() = Int[A B] + f43() = Int[A...] + f44() = Float64[A..., B...] for f in [f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, - f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42] + f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44] @test isconcretetype(Base.return_types(f, ())[1]) end end From 5f0d55196debf25b77ef4770bbf71e7d0a6d335a Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Fri, 18 Feb 2022 23:05:27 +0900 Subject: [PATCH 005/369] `AbstractInterpreter`: make it easier to overload pure/concrete-eval (#44224) fix #44174. (cherry picked from commit daa084971c57fa0999588fe3973c78fb2c8f88b0) --- base/compiler/abstractinterpretation.jl | 144 +++++++++++++----------- base/compiler/methodtable.jl | 11 +- 2 files changed, 88 insertions(+), 67 deletions(-) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index 6a9837547834b..4fdaa6257686c 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -65,13 +65,8 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), const_results = Union{InferenceResult,Nothing,ConstResult}[] multiple_matches = napplicable > 1 - if f !== nothing && napplicable == 1 && is_method_pure(applicable[1]::MethodMatch) - val = pure_eval_call(f, argtypes) - if val !== nothing - # TODO: add some sort of edge(s) - return CallMeta(val, MethodResultPure(info)) - end - end + val = pure_eval_call(interp, f, applicable, arginfo, sv) + val !== nothing && return CallMeta(val, MethodResultPure(info)) # TODO: add some sort of edge(s) fargs = arginfo.fargs for i in 1:napplicable @@ -619,27 +614,85 @@ struct MethodCallResult end end +function pure_eval_eligible(interp::AbstractInterpreter, + @nospecialize(f), applicable::Vector{Any}, arginfo::ArgInfo, sv::InferenceState) + return !isoverlayed(method_table(interp, sv)) && + f !== nothing && + length(applicable) == 1 && + is_method_pure(applicable[1]::MethodMatch) && + is_all_const_arg(arginfo) +end + +function is_method_pure(method::Method, @nospecialize(sig), sparams::SimpleVector) + if isdefined(method, :generator) + method.generator.expand_early || return false + mi = specialize_method(method, sig, sparams) + isa(mi, MethodInstance) || return false + staged = get_staged(mi) + (staged isa CodeInfo && (staged::CodeInfo).pure) || return false + return true + end + return method.pure +end +is_method_pure(match::MethodMatch) = is_method_pure(match.method, match.spec_types, match.sparams) + +function pure_eval_call(interp::AbstractInterpreter, + @nospecialize(f), applicable::Vector{Any}, arginfo::ArgInfo, sv::InferenceState) + pure_eval_eligible(interp, f, applicable, arginfo, sv) || return nothing + return _pure_eval_call(f, arginfo) +end +function _pure_eval_call(@nospecialize(f), arginfo::ArgInfo) + args = collect_const_args(arginfo) + try + value = Core._apply_pure(f, args) + return Const(value) + catch + return nothing + end +end + +function concrete_eval_eligible(interp::AbstractInterpreter, + @nospecialize(f), result::MethodCallResult, arginfo::ArgInfo, sv::InferenceState) + return !isoverlayed(method_table(interp, sv)) && + f !== nothing && + result.edge !== nothing && + is_total_or_error(result.edge_effects) && + is_all_const_arg(arginfo) +end + function is_all_const_arg((; argtypes)::ArgInfo) - for a in argtypes - if !isa(a, Const) && !isconstType(a) && !issingletontype(a) - return false - end + for i = 2:length(argtypes) + a = widenconditional(argtypes[i]) + isa(a, Const) || isconstType(a) || issingletontype(a) || return false end return true end -function concrete_eval_const_proven_total_or_error(interp::AbstractInterpreter, - @nospecialize(f), (; argtypes)::ArgInfo, _::InferenceState) - args = Any[ (a = widenconditional(argtypes[i]); - isa(a, Const) ? a.val : - isconstType(a) ? (a::DataType).parameters[1] : - (a::DataType).instance) for i in 2:length(argtypes) ] +function collect_const_args((; argtypes)::ArgInfo) + return Any[ let a = widenconditional(argtypes[i]) + isa(a, Const) ? a.val : + isconstType(a) ? (a::DataType).parameters[1] : + (a::DataType).instance + end for i in 2:length(argtypes) ] +end + +function concrete_eval_call(interp::AbstractInterpreter, + @nospecialize(f), result::MethodCallResult, arginfo::ArgInfo, sv::InferenceState) + concrete_eval_eligible(interp, f, result, arginfo, sv) || return nothing + args = collect_const_args(arginfo) try value = Core._call_in_world_total(get_world_counter(interp), f, args...) - return Const(value) - catch e - return nothing + if is_inlineable_constant(value) || call_result_unused(sv) + # If the constant is not inlineable, still do the const-prop, since the + # code that led to the creation of the Const may be inlineable in the same + # circumstance and may be optimizable. + return ConstCallResults(Const(value), ConstResult(result.edge, value), EFFECTS_TOTAL) + end + catch + # The evaulation threw. By :consistent-cy, we're guaranteed this would have happened at runtime + return ConstCallResults(Union{}, ConstResult(result.edge), result.edge_effects) end + return nothing end function const_prop_enabled(interp::AbstractInterpreter, sv::InferenceState, match::MethodMatch) @@ -671,19 +724,10 @@ function abstract_call_method_with_const_args(interp::AbstractInterpreter, resul if !const_prop_enabled(interp, sv, match) return nothing end - if f !== nothing && result.edge !== nothing && is_total_or_error(result.edge_effects) && is_all_const_arg(arginfo) - rt = concrete_eval_const_proven_total_or_error(interp, f, arginfo, sv) + val = concrete_eval_call(interp, f, result, arginfo, sv) + if val !== nothing add_backedge!(result.edge, sv) - if rt === nothing - # The evaulation threw. By :consistent-cy, we're guaranteed this would have happened at runtime - return ConstCallResults(Union{}, ConstResult(result.edge), result.edge_effects) - end - if is_inlineable_constant(rt.val) || call_result_unused(sv) - # If the constant is not inlineable, still do the const-prop, since the - # code that led to the creation of the Const may be inlineable in the same - # circumstance and may be optimizable. - return ConstCallResults(rt, ConstResult(result.edge, rt.val), EFFECTS_TOTAL) - end + return val end mi = maybe_get_const_prop_profitable(interp, result, f, arginfo, match, sv) mi === nothing && return nothing @@ -1218,36 +1262,6 @@ function abstract_apply(interp::AbstractInterpreter, argtypes::Vector{Any}, sv:: return CallMeta(res, retinfo) end -function is_method_pure(method::Method, @nospecialize(sig), sparams::SimpleVector) - if isdefined(method, :generator) - method.generator.expand_early || return false - mi = specialize_method(method, sig, sparams) - isa(mi, MethodInstance) || return false - staged = get_staged(mi) - (staged isa CodeInfo && (staged::CodeInfo).pure) || return false - return true - end - return method.pure -end -is_method_pure(match::MethodMatch) = is_method_pure(match.method, match.spec_types, match.sparams) - -function pure_eval_call(@nospecialize(f), argtypes::Vector{Any}) - for i = 2:length(argtypes) - a = widenconditional(argtypes[i]) - if !(isa(a, Const) || isconstType(a)) - return nothing - end - end - args = Any[ (a = widenconditional(argtypes[i]); - isa(a, Const) ? a.val : (a::DataType).parameters[1]) for i in 2:length(argtypes) ] - try - value = Core._apply_pure(f, args) - return Const(value) - catch - return nothing - end -end - function argtype_by_index(argtypes::Vector{Any}, i::Int) n = length(argtypes) na = argtypes[n] @@ -1586,8 +1600,10 @@ function abstract_call_known(interp::AbstractInterpreter, @nospecialize(f), elseif max_methods > 1 && istopfunction(f, :copyto!) max_methods = 1 elseif la == 3 && istopfunction(f, :typejoin) - val = pure_eval_call(f, argtypes) - return CallMeta(val === nothing ? Type : val, MethodResultPure()) + if is_all_const_arg(arginfo) + val = _pure_eval_call(f, arginfo) + return CallMeta(val === nothing ? Type : val, MethodResultPure()) + end end atype = argtypes_to_type(argtypes) return abstract_call_gf_by_type(interp, f, arginfo, atype, sv, max_methods) diff --git a/base/compiler/methodtable.jl b/base/compiler/methodtable.jl index 93020ae6a2639..70beb259cb6a5 100644 --- a/base/compiler/methodtable.jl +++ b/base/compiler/methodtable.jl @@ -84,9 +84,9 @@ function findall(@nospecialize(sig::Type), table::OverlayMethodTable; limit::Int _min_val[] = typemin(UInt) _max_val[] = typemax(UInt) ms = _methods_by_ftype(sig, nothing, limit, table.world, false, _min_val, _max_val, _ambig) - end - if ms === false - return missing + if ms === false + return missing + end end return MethodLookupResult(ms::Vector{Any}, WorldRange(_min_val[], _max_val[]), _ambig[] != 0) end @@ -123,3 +123,8 @@ end # This query is not cached findsup(@nospecialize(sig::Type), table::CachedMethodTable) = findsup(sig, table.table) + +isoverlayed(::MethodTableView) = error("unsatisfied MethodTableView interface") +isoverlayed(::InternalMethodTable) = false +isoverlayed(::OverlayMethodTable) = true +isoverlayed(mt::CachedMethodTable) = isoverlayed(mt.table) From 681e31877e042f9381a0e2ef373fa9e65ecacfc0 Mon Sep 17 00:00:00 2001 From: Simeon Schaub Date: Fri, 18 Feb 2022 13:03:35 -0500 Subject: [PATCH 006/369] set type of statement when processing `GlobalRef`s (#44200) Co-authored-by: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Co-authored-by: Jameson Nash (cherry picked from commit 39e849a9efaf8a2a759c3c33d9155df0a27ef04e) --- base/compiler/ssair/ir.jl | 6 +++++- test/compiler/inline.jl | 12 ++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/base/compiler/ssair/ir.jl b/base/compiler/ssair/ir.jl index a86e125fcb307..039d557b2e9e8 100644 --- a/base/compiler/ssair/ir.jl +++ b/base/compiler/ssair/ir.jl @@ -1000,7 +1000,11 @@ function process_node!(compact::IncrementalCompact, result_idx::Int, inst::Instr elseif isa(stmt, GotoNode) && compact.cfg_transforms_enabled result[result_idx][:inst] = GotoNode(compact.bb_rename_succ[stmt.label]) result_idx += 1 - elseif isa(stmt, GlobalRef) || isa(stmt, GotoNode) + elseif isa(stmt, GlobalRef) + result[result_idx][:inst] = stmt + result[result_idx][:type] = argextype(stmt, compact) + result_idx += 1 + elseif isa(stmt, GotoNode) result[result_idx][:inst] = stmt result_idx += 1 elseif isa(stmt, GotoIfNot) && compact.cfg_transforms_enabled diff --git a/test/compiler/inline.jl b/test/compiler/inline.jl index 9347acc83f13f..aa5297066b67b 100644 --- a/test/compiler/inline.jl +++ b/test/compiler/inline.jl @@ -1069,3 +1069,15 @@ end @test fully_eliminated() do issue41694(2) end + +global x44200::Int = 0 +function f44200() + global x = 0 + while x < 10 + x += 1 + end + x +end +let src = code_typed1(f44200) + @test count(x -> isa(x, Core.PiNode), src.code) == 0 +end From 9e634bcbe516c06dd66999735983aa395e00e5ab Mon Sep 17 00:00:00 2001 From: Simeon Schaub Date: Fri, 18 Feb 2022 13:04:07 -0500 Subject: [PATCH 007/369] fix nothrow check for `get_binding_type` (#44229) This got missed in #43671. (cherry picked from commit 6c51d9e87173a6a32dc24f2c0aeac24e12cd93f4) --- base/compiler/tfuncs.jl | 3 ++- test/compiler/inference.jl | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/base/compiler/tfuncs.jl b/base/compiler/tfuncs.jl index ec56b826d1491..54b89c9a04f43 100644 --- a/base/compiler/tfuncs.jl +++ b/base/compiler/tfuncs.jl @@ -1705,7 +1705,8 @@ function _builtin_nothrow(@nospecialize(f), argtypes::Array{Any,1}, @nospecializ end return false elseif f === Core.get_binding_type - return length(argtypes) == 2 + length(argtypes) == 2 || return false + return argtypes[1] ⊑ Module && argtypes[2] ⊑ Symbol elseif f === donotdelete return true end diff --git a/test/compiler/inference.jl b/test/compiler/inference.jl index d4fbe0dbfbf6b..61058f9589f52 100644 --- a/test/compiler/inference.jl +++ b/test/compiler/inference.jl @@ -4028,3 +4028,5 @@ function f_boundscheck_elim(n) ntuple(x->(@inbounds getfield(sin, x)), n) end @test Tuple{} <: code_typed(f_boundscheck_elim, Tuple{Int})[1][2] + +@test !Core.Compiler.builtin_nothrow(Core.get_binding_type, Any[Rational{Int}, Core.Const(:foo)], Any) From bd58e0ce99a5be9d5f72f0aaaf6d192a6ce1c3bf Mon Sep 17 00:00:00 2001 From: Nathan Daly Date: Fri, 18 Feb 2022 16:25:34 -0500 Subject: [PATCH 008/369] Fix build warning in gc-alloc-profiler.cpp: cast to (size_t) (#44180) `std::vector::size()` returns a `size_t`, so we need to cast the int `jl_n_threads` to a `size_t` for the comparison. (cherry picked from commit 15dcd5bb9c3458d52eb70dc59d685af399b54189) --- src/gc-alloc-profiler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gc-alloc-profiler.cpp b/src/gc-alloc-profiler.cpp index a5af9031cd0e3..88177e0ea20ef 100644 --- a/src/gc-alloc-profiler.cpp +++ b/src/gc-alloc-profiler.cpp @@ -71,7 +71,7 @@ extern "C" { // Needed since these functions doesn't take any arguments. JL_DLLEXPORT void jl_start_alloc_profile(double sample_rate) { // We only need to do this once, the first time this is called. - while (g_alloc_profile.per_thread_profiles.size() < jl_n_threads) { + while (g_alloc_profile.per_thread_profiles.size() < (size_t)jl_n_threads) { g_alloc_profile.per_thread_profiles.push_back(jl_per_thread_alloc_profile_t{}); } From a70cfd12dd4049b2f5483695355fda0a64153d9d Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Fri, 18 Feb 2022 16:32:57 -0500 Subject: [PATCH 009/369] fix bug in `addenv` for environment entries with embedded `=` (#44212) Co-authored-by: Jameson Nash Co-authored-by: Fredrik Ekre (cherry picked from commit f5d9b86cfd19e39ceedf6056ef72cc2071c7478c) --- base/cmd.jl | 13 +++++++++++-- test/spawn.jl | 6 ++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/base/cmd.jl b/base/cmd.jl index 5094dea908440..ab639a2b185c8 100644 --- a/base/cmd.jl +++ b/base/cmd.jl @@ -262,6 +262,15 @@ setenv(cmd::Cmd, env::Pair{<:AbstractString}...; dir=cmd.dir) = setenv(cmd, env; dir=dir) setenv(cmd::Cmd; dir=cmd.dir) = Cmd(cmd; dir=dir) +# split environment entry string into before and after first `=` (key and value) +function splitenv(e::String) + i = findnext('=', e, 2) + if i === nothing + throw(ArgumentError("malformed environment entry")) + end + e[1:prevind(e, i)], e[nextind(e, i):end] +end + """ addenv(command::Cmd, env...; inherit::Bool = true) @@ -282,7 +291,7 @@ function addenv(cmd::Cmd, env::Dict; inherit::Bool = true) merge!(new_env, ENV) end else - for (k, v) in eachsplit.(cmd.env, "=") + for (k, v) in splitenv.(cmd.env) new_env[string(k)::String] = string(v)::String end end @@ -301,7 +310,7 @@ function addenv(cmd::Cmd, pairs::Pair{<:AbstractString}...; inherit::Bool = true end function addenv(cmd::Cmd, env::Vector{<:AbstractString}; inherit::Bool = true) - return addenv(cmd, Dict(k => v for (k, v) in eachsplit.(env, "=")); inherit) + return addenv(cmd, Dict(k => v for (k, v) in splitenv.(env)); inherit) end """ diff --git a/test/spawn.jl b/test/spawn.jl index 92232ba5d70f6..a8a2af40643ff 100644 --- a/test/spawn.jl +++ b/test/spawn.jl @@ -826,6 +826,12 @@ end dir = joinpath(pwd(), "dir") cmd = addenv(setenv(`julia`; dir=dir), Dict()) @test cmd.dir == dir + + @test addenv(``, ["a=b=c"], inherit=false).env == ["a=b=c"] + cmd = addenv(``, "a"=>"b=c", inherit=false) + @test cmd.env == ["a=b=c"] + cmd = addenv(cmd, "b"=>"b") + @test issetequal(cmd.env, ["b=b", "a=b=c"]) end @testset "setenv with dir (with tests for #42131)" begin From 18ea404705d945884fd61a61be0fe3e238dc8a71 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Sun, 20 Feb 2022 11:05:33 +0900 Subject: [PATCH 010/369] fix EscapeAnalysis.jl documentation (#44257) --- doc/make.jl | 1 + doc/src/devdocs/EscapeAnalysis.md | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/make.jl b/doc/make.jl index bb7ef83048178..f814ba43382e4 100644 --- a/doc/make.jl +++ b/doc/make.jl @@ -292,6 +292,7 @@ else analytics = "UA-28835595-6", collapselevel = 1, sidebar_sitename = false, + ansicolor = true, ) end diff --git a/doc/src/devdocs/EscapeAnalysis.md b/doc/src/devdocs/EscapeAnalysis.md index c4a5f14faa8ec..983a6782ccc79 100644 --- a/doc/src/devdocs/EscapeAnalysis.md +++ b/doc/src/devdocs/EscapeAnalysis.md @@ -1,3 +1,5 @@ +# `EscapeAnalysis` + `Core.Compiler.EscapeAnalysis` is a compiler utility module that aims to analyze escape information of [Julia's SSA-form IR](@ref Julia-SSA-form-IR) a.k.a. `IRCode`. @@ -18,8 +20,7 @@ This escape analysis aims to: You can give a try to the escape analysis by loading the `EAUtils.jl` utility script that define the convenience entries `code_escapes` and `@code_escapes` for testing and debugging purposes: ```@repl EAUtils -include(normpath(Sys.BINDIR::String, "..", "share", "julia", "test", "testhelpers", "EAUtils.jl")) -using EAUtils +include(normpath(Sys.BINDIR, "..", "share", "julia", "test", "compiler", "EscapeAnalysis", "EAUtils.jl")); using .EAUtils mutable struct SafeRef{T} x::T From e84a9dec81e94dc280dbf5120c68c7d0d67f7303 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Sun, 20 Feb 2022 13:16:59 +0900 Subject: [PATCH 011/369] effects: make `:terminates_globally` functional on recursive functions (#44210) As with loop, it's hard to prove termination of recursive call automatically. But with this commit we can manually specify termination at least. ```julia Base.@assume_effects :terminates_globally function recur_termination1(x) x == 1 && return 1 1 < x < 20 || throw("bad") return x * recur_termination1(x-1) end @test fully_eliminated() do recur_termination1(12) end Base.@assume_effects :terminates_globally function recur_termination2(x) x == 1 && return 1 1 < x < 20 || throw("bad") return _recur_termination2(x) end _recur_termination2(x) = x * recur_termination2(x-1) @test fully_eliminated() do recur_termination2(12) end ``` --- base/compiler/abstractinterpretation.jl | 35 ++++++++++++++++--------- test/compiler/inline.jl | 18 +++++++++++++ 2 files changed, 41 insertions(+), 12 deletions(-) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index 4fdaa6257686c..04fa67fa5d304 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -97,7 +97,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), const_result = abstract_call_method_with_const_args(interp, result, f, this_arginfo, match, sv) effects = result.edge_effects if const_result !== nothing - (;rt, effects, const_result) = const_result + (; rt, effects, const_result) = const_result end tristate_merge!(sv, effects) push!(const_results, const_result) @@ -589,15 +589,27 @@ function abstract_call_method(interp::AbstractInterpreter, method::Method, @nosp if edge === nothing edgecycle = edgelimited = true end - if edgecycle + if is_effect_overrided(sv, :terminates_globally) + # this frame is known to terminate + edge_effects = Effects(edge_effects, terminates=ALWAYS_TRUE) + elseif is_effect_overrided(method, :terminates_globally) + # this edge is known to terminate + edge_effects = Effects(edge_effects, terminates=ALWAYS_TRUE) + elseif edgecycle # Some sort of recursion was detected. Even if we did not limit types, - # we cannot guarantee that the call will terminate. - edge_effects = tristate_merge(edge_effects, - Effects(EFFECTS_TOTAL, terminates=TRISTATE_UNKNOWN)) + # we cannot guarantee that the call will terminate + edge_effects = Effects(edge_effects, terminates=TRISTATE_UNKNOWN) end return MethodCallResult(rt, edgecycle, edgelimited, edge, edge_effects) end +is_effect_overrided(sv::InferenceState, effect::Symbol) = is_effect_overrided(sv.linfo, effect) +function is_effect_overrided(linfo::MethodInstance, effect::Symbol) + def = linfo.def + return isa(def, Method) && is_effect_overrided(def, effect) +end +is_effect_overrided(method::Method, effect::Symbol) = getfield(decode_effects_override(method.purity), effect) + # keeps result and context information of abstract method call, will be used by succeeding constant-propagation struct MethodCallResult rt @@ -2067,14 +2079,13 @@ end function handle_control_backedge!(frame::InferenceState, from::Int, to::Int) if from > to - def = frame.linfo.def - if isa(def, Method) - effects = decode_effects_override(def.purity) - if effects.terminates_globally || effects.terminates_locally - return nothing - end + if is_effect_overrided(frame, :terminates_globally) + # this frame is known to terminate + elseif is_effect_overrided(frame, :terminates_locally) + # this backedge is known to terminate + else + tristate_merge!(frame, Effects(EFFECTS_TOTAL, terminates=TRISTATE_UNKNOWN)) end - tristate_merge!(frame, Effects(EFFECTS_TOTAL, terminates=TRISTATE_UNKNOWN)) end return nothing end diff --git a/test/compiler/inline.jl b/test/compiler/inline.jl index aa5297066b67b..3259c752d9aa0 100644 --- a/test/compiler/inline.jl +++ b/test/compiler/inline.jl @@ -1070,6 +1070,24 @@ end issue41694(2) end +Base.@assume_effects :terminates_globally function recur_termination1(x) + x == 1 && return 1 + 1 < x < 20 || throw("bad") + return x * recur_termination1(x-1) +end +@test fully_eliminated() do + recur_termination1(12) +end +Base.@assume_effects :terminates_globally function recur_termination21(x) + x == 1 && return 1 + 1 < x < 20 || throw("bad") + return recur_termination22(x) +end +recur_termination22(x) = x * recur_termination21(x-1) +@test fully_eliminated() do + recur_termination21(12) + recur_termination22(12) +end + global x44200::Int = 0 function f44200() global x = 0 From e9a82f6476851914ebc38945951ca025cdce0baf Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Mon, 21 Feb 2022 15:15:52 +0900 Subject: [PATCH 012/369] inference: override return type inference by const-prop more carefully (#44282) A return type derived by const-prop' inference can be wider than that of non const-prop' inference in rare cases e.g. when there are cycles but cached result is still accurate. This commit checks if the const-prop'ed result is really more accurate than non-const result. fix https://github.com/Ferrite-FEM/Tensors.jl/issues/178 --- base/compiler/abstractinterpretation.jl | 40 +++++++++++++++++-------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index 04fa67fa5d304..39cabe33ff043 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -94,10 +94,13 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), end this_argtypes = isa(matches, MethodMatches) ? argtypes : matches.applicable_argtypes[i] this_arginfo = ArgInfo(fargs, this_argtypes) - const_result = abstract_call_method_with_const_args(interp, result, f, this_arginfo, match, sv) + const_call_result = abstract_call_method_with_const_args(interp, result, f, this_arginfo, match, sv) effects = result.edge_effects - if const_result !== nothing - (; rt, effects, const_result) = const_result + const_result = nothing + if const_call_result !== nothing + if const_call_result.rt ⊑ rt + (; rt, effects, const_result) = const_call_result + end end tristate_merge!(sv, effects) push!(const_results, const_result) @@ -133,11 +136,17 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), # this is in preparation for inlining, or improving the return result this_argtypes = isa(matches, MethodMatches) ? argtypes : matches.applicable_argtypes[i] this_arginfo = ArgInfo(fargs, this_argtypes) - const_result = abstract_call_method_with_const_args(interp, result, f, this_arginfo, match, sv) + const_call_result = abstract_call_method_with_const_args(interp, result, f, this_arginfo, match, sv) effects = result.edge_effects - if const_result !== nothing - this_rt = const_result.rt - (; effects, const_result) = const_result + const_result = nothing + if const_call_result !== nothing + this_const_rt = const_call_result.rt + # return type of const-prop' inference can be wider than that of non const-prop' inference + # e.g. in cases when there are cycles but cached result is still accurate + if this_const_rt ⊑ this_rt + this_rt = this_const_rt + (; effects, const_result) = const_call_result + end end tristate_merge!(sv, effects) push!(const_results, const_result) @@ -1483,9 +1492,12 @@ function abstract_invoke(interp::AbstractInterpreter, (; fargs, argtypes)::ArgIn # t, a = ti.parameters[i], argtypes′[i] # argtypes′[i] = t ⊑ a ? t : a # end - const_result = abstract_call_method_with_const_args(interp, result, singleton_type(ft′), arginfo, match, sv) - if const_result !== nothing - (;rt, const_result) = const_result + const_call_result = abstract_call_method_with_const_args(interp, result, singleton_type(ft′), arginfo, match, sv) + const_result = nothing + if const_call_result !== nothing + if const_call_result.rt ⊑ rt + (; rt, const_result) = const_call_result + end end return CallMeta(from_interprocedural!(rt, sv, arginfo, sig), InvokeCallInfo(match, const_result)) end @@ -1630,10 +1642,12 @@ function abstract_call_opaque_closure(interp::AbstractInterpreter, closure::Part match = MethodMatch(sig, Core.svec(), closure.source, sig <: rewrap_unionall(sigT, tt)) const_result = nothing if !result.edgecycle - const_result = abstract_call_method_with_const_args(interp, result, nothing, + const_call_result = abstract_call_method_with_const_args(interp, result, nothing, arginfo, match, sv) - if const_result !== nothing - (;rt, const_result) = const_result + if const_call_result !== nothing + if const_call_result.rt ⊑ rt + (; rt, const_result) = const_call_result + end end end info = OpaqueClosureCallInfo(match, const_result) From 64a9bb904599b6404753300d1b8e7436bba2a77e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Sun, 20 Feb 2022 16:17:43 +0000 Subject: [PATCH 013/369] [CPUID] Add ISA entries for A64FX and M1 (#44194) * [CPUID] Rework how current ISA is determined * [CPUID] Add ISA entry for A64FX * [CPUID] Add ISA entry for Apple Silicon M1 * [CPUID] Simplify collection of full set of features for architecture * [CPUID] Remove AES from A64FX ISA, not all chips appear to have it (cherry picked from commit f45b6adb5e8cd7fc59401d28183bc92c6df849f5) --- base/Base.jl | 6 +++--- base/binaryplatforms.jl | 3 ++- base/cpuid.jl | 28 +++++++++++++++++++++------- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/base/Base.jl b/base/Base.jl index f39b227d6f663..9ad0cdf7a6661 100644 --- a/base/Base.jl +++ b/base/Base.jl @@ -276,9 +276,6 @@ include("weakkeydict.jl") include("env.jl") -# BinaryPlatforms, used by Artifacts -include("binaryplatforms.jl") - # functions defined in Random function rand end function randn end @@ -336,6 +333,9 @@ using .Order include("sort.jl") using .Sort +# BinaryPlatforms, used by Artifacts. Needs `Sort`. +include("binaryplatforms.jl") + # Fast math include("fastmath.jl") using .FastMath diff --git a/base/binaryplatforms.jl b/base/binaryplatforms.jl index efc58dc6c6b7a..61e1af796999d 100644 --- a/base/binaryplatforms.jl +++ b/base/binaryplatforms.jl @@ -608,7 +608,8 @@ const arch_march_isa_mapping = let "armv8_0" => get_set("aarch64", "armv8.0-a"), "armv8_1" => get_set("aarch64", "armv8.1-a"), "armv8_2_crypto" => get_set("aarch64", "armv8.2-a+crypto"), - "armv8_4_crypto_sve" => get_set("aarch64", "armv8.4-a+crypto+sve"), + "a64fx" => get_set("aarch64", "a64fx"), + "apple_m1" => get_set("aarch64", "apple_m1"), ], "powerpc64le" => [ "power8" => get_set("powerpc64le", "power8"), diff --git a/base/cpuid.jl b/base/cpuid.jl index b1fb82cf86dae..48930d8064ba9 100644 --- a/base/cpuid.jl +++ b/base/cpuid.jl @@ -56,9 +56,10 @@ const ISAs_by_family = Dict( "aarch64" => [ # Implicit in all sets, because always required: fp, asimd "armv8.0-a" => ISA(Set{UInt32}()), - "armv8.1-a" => ISA(Set((JL_AArch64_lse, JL_AArch64_crc, JL_AArch64_rdm))), - "armv8.2-a+crypto" => ISA(Set((JL_AArch64_lse, JL_AArch64_crc, JL_AArch64_rdm, JL_AArch64_aes, JL_AArch64_sha2))), - "armv8.4-a+crypto+sve" => ISA(Set((JL_AArch64_lse, JL_AArch64_crc, JL_AArch64_rdm, JL_AArch64_fp16fml, JL_AArch64_aes, JL_AArch64_sha2, JL_AArch64_dotprod, JL_AArch64_sve))), + "armv8.1-a" => ISA(Set((JL_AArch64_v8_1a, JL_AArch64_lse, JL_AArch64_crc, JL_AArch64_rdm))), + "armv8.2-a+crypto" => ISA(Set((JL_AArch64_v8_2a, JL_AArch64_lse, JL_AArch64_crc, JL_AArch64_rdm, JL_AArch64_aes, JL_AArch64_sha2))), + "a64fx" => ISA(Set((JL_AArch64_v8_2a, JL_AArch64_lse, JL_AArch64_crc, JL_AArch64_rdm, JL_AArch64_sha2, JL_AArch64_ccpp, JL_AArch64_complxnum, JL_AArch64_fullfp16, JL_AArch64_sve))), + "apple_m1" => ISA(Set((JL_AArch64_v8_5a, JL_AArch64_lse, JL_AArch64_crc, JL_AArch64_rdm, JL_AArch64_aes, JL_AArch64_sha2, JL_AArch64_sha3, JL_AArch64_ccpp, JL_AArch64_complxnum, JL_AArch64_fp16fml, JL_AArch64_fullfp16, JL_AArch64_dotprod, JL_AArch64_rcpc, JL_AArch64_altnzcv))), ], "powerpc64le" => [ # We have no way to test powerpc64le features yet, so we're only going to declare the lowest ISA: @@ -88,14 +89,27 @@ function normalize_arch(arch::String) return arch end +let + # Collect all relevant features for the current architecture, if any. + FEATURES = UInt32[] + arch = normalize_arch(String(Sys.ARCH)) + if arch in keys(ISAs_by_family) + for isa in ISAs_by_family[arch] + unique!(append!(FEATURES, last(isa).features)) + end + end + + # Use `@eval` to inline the list of features. + @eval function cpu_isa() + return ISA(Set{UInt32}(feat for feat in $(FEATURES) if test_cpu_feature(feat))) + end +end + """ cpu_isa() Return the [`ISA`](@ref) (instruction set architecture) of the current CPU. """ -function cpu_isa() - all_features = last(last(get(ISAs_by_family, normalize_arch(String(Sys.ARCH)), "" => [ISA(Set{UInt32}())]))).features - return ISA(Set{UInt32}(feat for feat in all_features if test_cpu_feature(feat))) -end +cpu_isa end # module CPUID From 2e2f214faa35e50501bfb53b8732897a1567e774 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Sat, 19 Feb 2022 07:31:44 -0800 Subject: [PATCH 014/369] Fix missing `jl_effective_threads` declaration (#44251) (cherry picked from commit f852c88fe4e1d9ace9f90c0ddd7d0b33cb5f8565) --- src/jloptions.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/jloptions.c b/src/jloptions.c index 1ff4da7c5c10b..b85e8f7bfe386 100644 --- a/src/jloptions.c +++ b/src/jloptions.c @@ -4,6 +4,7 @@ #include #include "julia.h" +#include "julia_internal.h" #include #include From f1cb21965546146e24ee2b7c07c637897db5d8ce Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Sat, 19 Feb 2022 12:45:05 -0500 Subject: [PATCH 015/369] fix #44239, regression in keyword args in getindex (#44246) (cherry picked from commit 4061e8f898c91d58a117b48a8e9f47260211b962) --- src/julia-syntax.scm | 16 ++++++++++++---- test/syntax.jl | 11 +++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/julia-syntax.scm b/src/julia-syntax.scm index caeca92f75803..52bcb307ebe19 100644 --- a/src/julia-syntax.scm +++ b/src/julia-syntax.scm @@ -120,6 +120,10 @@ ;; inside ref only replace within the first argument (list* 'ref (replace-beginend (cadr ex) a n tuples last) (cddr ex))) + ;; TODO: this probably should not be allowed since keyword args aren't + ;; positional, but in this context we have just used their positions anyway + ((eq? (car ex) 'kw) + (list 'kw (cadr ex) (replace-beginend (caddr ex) a n tuples last))) (else (cons (car ex) (map (lambda (x) (replace-beginend x a n tuples last)) @@ -142,16 +146,20 @@ (idx (if (vararg? idx0) (cadr idx0) idx0)) (last (null? (cdr lst))) (replaced (replace-beginend idx a n tuples last)) - (idx (if (or (not has-va?) (simple-atom? replaced)) replaced (make-ssavalue)))) + (val (if (kwarg? replaced) (caddr replaced) replaced)) + (idx (if (or (not has-va?) (simple-atom? val)) + val (make-ssavalue)))) (loop (cdr lst) (+ n 1) - (if (eq? idx replaced) + (if (eq? idx val) stmts - (cons `(= ,idx ,replaced) + (cons `(= ,idx ,val) stmts)) (if (vararg? idx0) (cons idx tuples) tuples) (cons (if (vararg? idx0) `(... ,idx) - idx) + (if (eq? val replaced) + idx + (list 'kw (cadr replaced) idx))) ret))))))) ;; GF method does not need to keep decl expressions on lambda args diff --git a/test/syntax.jl b/test/syntax.jl index 69d3e8c7fe591..ff65cb235d92c 100644 --- a/test/syntax.jl +++ b/test/syntax.jl @@ -1212,6 +1212,17 @@ let a = [], b = [4,3,2,1] @test a == [1,2] end +# issue #44239 +struct KWGetindex end +Base.getindex(::KWGetindex, args...; kws...) = (args, NamedTuple(kws)) +let A = KWGetindex(), a = [], b = [4,3,2,1] + f() = (push!(a, 1); 2) + g() = (push!(a, 2); ()) + @test A[f(), g()..., k = f()] === ((2,), (k = 2,)) + @test a == [1, 2, 1] + @test A[var"end"=1] === ((), (var"end" = 1,)) +end + @testset "raw_str macro" begin @test raw"$" == "\$" @test raw"\n" == "\\n" From 24fc8e27b6c35e1ff42177a02fe590974815aacd Mon Sep 17 00:00:00 2001 From: Seth Axen Date: Sat, 19 Feb 2022 18:46:55 +0100 Subject: [PATCH 016/369] Fix dot(::Adjoint, ::Adjoint) for numbers that don't commute under multiplication (#44219) Co-authored-by: Fredrik Ekre (cherry picked from commit 928f63ca85d4d8065e6709671f6f8735aa3ec756) --- stdlib/LinearAlgebra/src/generic.jl | 4 +++- stdlib/LinearAlgebra/test/generic.jl | 13 +++++++------ test/testhelpers/Quaternions.jl | 14 ++++++++++++++ 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/stdlib/LinearAlgebra/src/generic.jl b/stdlib/LinearAlgebra/src/generic.jl index 5565b28ebabe7..676e965652e8f 100644 --- a/stdlib/LinearAlgebra/src/generic.jl +++ b/stdlib/LinearAlgebra/src/generic.jl @@ -886,7 +886,9 @@ function dot(x::AbstractArray, y::AbstractArray) s end -dot(x::Adjoint, y::Adjoint) = conj(dot(parent(x), parent(y))) +function dot(x::Adjoint{<:Union{Real,Complex}}, y::Adjoint{<:Union{Real,Complex}}) + return conj(dot(parent(x), parent(y))) +end dot(x::Transpose, y::Transpose) = dot(parent(x), parent(y)) """ diff --git a/stdlib/LinearAlgebra/test/generic.jl b/stdlib/LinearAlgebra/test/generic.jl index 26534a2cdf0cd..b56edf9439fe0 100644 --- a/stdlib/LinearAlgebra/test/generic.jl +++ b/stdlib/LinearAlgebra/test/generic.jl @@ -497,20 +497,21 @@ end end @testset "adjtrans dot" begin - for t in (transpose, adjoint) - x, y = t(rand(ComplexF64, 10)), t(rand(ComplexF64, 10)) + for t in (transpose, adjoint), T in (ComplexF64, Quaternion{Float64}) + x, y = t(rand(T, 10)), t(rand(T, 10)) X, Y = copy(x), copy(y) @test dot(x, y) ≈ dot(X, Y) - x, y = t([rand(ComplexF64, 2, 2) for _ in 1:5]), t([rand(ComplexF64, 2, 2) for _ in 1:5]) + x, y = t([rand(T, 2, 2) for _ in 1:5]), t([rand(T, 2, 2) for _ in 1:5]) X, Y = copy(x), copy(y) @test dot(x, y) ≈ dot(X, Y) - x, y = t(rand(ComplexF64, 10, 5)), t(rand(ComplexF64, 10, 5)) + x, y = t(rand(T, 10, 5)), t(rand(T, 10, 5)) X, Y = copy(x), copy(y) @test dot(x, y) ≈ dot(X, Y) - x = t([rand(ComplexF64, 2, 2) for _ in 1:5, _ in 1:5]) - y = t([rand(ComplexF64, 2, 2) for _ in 1:5, _ in 1:5]) + x = t([rand(T, 2, 2) for _ in 1:5, _ in 1:5]) + y = t([rand(T, 2, 2) for _ in 1:5, _ in 1:5]) X, Y = copy(x), copy(y) @test dot(x, y) ≈ dot(X, Y) + x, y = t([rand(T, 2, 2) for _ in 1:5]), t([rand(T, 2, 2) for _ in 1:5]) end end diff --git a/test/testhelpers/Quaternions.jl b/test/testhelpers/Quaternions.jl index a3967c1aacc43..1eddad322ec40 100644 --- a/test/testhelpers/Quaternions.jl +++ b/test/testhelpers/Quaternions.jl @@ -1,6 +1,7 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license module Quaternions +using Random export Quaternion @@ -36,4 +37,17 @@ Base.:(*)(q::Quaternion, b::Bool) = b * q # remove method ambiguity Base.:(/)(q::Quaternion, w::Quaternion) = q * conj(w) * (1.0 / abs2(w)) Base.:(\)(q::Quaternion, w::Quaternion) = conj(q) * w * (1.0 / abs2(q)) +# adapted from https://github.com/JuliaGeometry/Quaternions.jl/pull/42 +function Base.rand(rng::AbstractRNG, ::Random.SamplerType{Quaternion{T}}) where {T<:Real} + return Quaternion{T}(rand(rng, T), rand(rng, T), rand(rng, T), rand(rng, T)) +end +function Base.randn(rng::AbstractRNG, ::Type{Quaternion{T}}) where {T<:AbstractFloat} + return Quaternion{T}( + randn(rng, T) / 2, + randn(rng, T) / 2, + randn(rng, T) / 2, + randn(rng, T) / 2, + ) +end + end From bb6221c51d3652cff2aeadd56d39a967b5e9534c Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Sat, 19 Feb 2022 09:47:41 -0800 Subject: [PATCH 017/369] Ensure that `open(::Function, ::Cmd)` waits for termination (#44078) On Windows, we observed occasional issues where an error within the function callback to the `open(::Function, ::Cmd)` method would cause problems due to assuming that the opened process had finished by the time the `open()` call was finished. In most cases this was true, however on Windows, it was found that we need to explicitly `wait()` upon the process object to ensure that all file handles held by the subprocess were properly closed by the time `open()` is finished. Co-authored-by: Dilum Aluthge (cherry picked from commit 623ceb7834de47538eddeadfa84a8bf2d9741248) --- base/process.jl | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/base/process.jl b/base/process.jl index 16e66b0bd9884..6aac514191681 100644 --- a/base/process.jl +++ b/base/process.jl @@ -402,16 +402,25 @@ process failed, or if the process attempts to print anything to stdout. """ function open(f::Function, cmds::AbstractCmd, args...; kwargs...) P = open(cmds, args...; kwargs...) + function waitkill(P::Process) + close(P) + # 0.1 seconds after we hope it dies (from closing stdio), + # we kill the process with SIGTERM (15) + local t = Timer(0.1) do t + process_running(P) && kill(P) + end + wait(P) + close(t) + end ret = try f(P) catch - kill(P) - close(P) + waitkill(P) rethrow() end close(P.in) if !eof(P.out) - close(P.out) + waitkill(P) throw(_UVError("open(do)", UV_EPIPE)) end success(P) || pipeline_error(P) From 69407edfdb487f2e6f3e29c5b907d4dd6296d6be Mon Sep 17 00:00:00 2001 From: Julian Samaroo Date: Sat, 19 Feb 2022 22:52:38 -0600 Subject: [PATCH 018/369] Profile.Allocs: jl_raw_alloc_t.task is untyped pointer (#44269) (cherry picked from commit 2714b92b5904c3ae74615ba33f5c738a79bb8969) --- src/gc-alloc-profiler.cpp | 4 ++-- stdlib/Profile/src/Allocs.jl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gc-alloc-profiler.cpp b/src/gc-alloc-profiler.cpp index 88177e0ea20ef..e7ab1a6fdf1f5 100644 --- a/src/gc-alloc-profiler.cpp +++ b/src/gc-alloc-profiler.cpp @@ -20,7 +20,7 @@ struct jl_raw_alloc_t { jl_datatype_t *type_address; jl_raw_backtrace_t backtrace; size_t size; - jl_task_t *task; + void *task; uint64_t timestamp; }; @@ -135,7 +135,7 @@ void _maybe_record_alloc_to_profile(jl_value_t *val, size_t size, jl_datatype_t type, get_raw_backtrace(), size, - jl_current_task, + (void *)jl_current_task, cycleclock() }); } diff --git a/stdlib/Profile/src/Allocs.jl b/stdlib/Profile/src/Allocs.jl index aa689936d4598..26dd90a821e01 100644 --- a/stdlib/Profile/src/Allocs.jl +++ b/stdlib/Profile/src/Allocs.jl @@ -123,7 +123,7 @@ struct Alloc type::Any stacktrace::StackTrace size::Int - task::Ptr{Cvoid} + task::Ptr{Cvoid} # N.B. unrooted, may not be valid timestamp::UInt64 end From 15977a0d2fb14aa79ec043a1cf63818e0d52ec0b Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sun, 20 Feb 2022 04:20:18 -0500 Subject: [PATCH 019/369] In the `sysimage.mk` Makefile, set the `JULIA_NUM_THREADS=1` environment variable when running the `generate_precompile.jl` script (#44281) (cherry picked from commit e454858a69b73d2582402761d8ebde050be217d8) --- contrib/generate_precompile.jl | 4 ++++ sysimage.mk | 1 + 2 files changed, 5 insertions(+) diff --git a/contrib/generate_precompile.jl b/contrib/generate_precompile.jl index e6cf280812685..a10d195229cab 100644 --- a/contrib/generate_precompile.jl +++ b/contrib/generate_precompile.jl @@ -1,5 +1,9 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license +if Threads.nthreads() != 1 + @warn "Running this file with multiple Julia threads may lead to a build error" Threads.nthreads() +end + if Base.isempty(Base.ARGS) || Base.ARGS[1] !== "0" Sys.__init_build() # Prevent this from being put into the Main namespace diff --git a/sysimage.mk b/sysimage.mk index de5c3e22f253a..1586eb7dbc16d 100644 --- a/sysimage.mk +++ b/sysimage.mk @@ -77,6 +77,7 @@ define sysimg_builder $$(build_private_libdir)/sys$1-o.a $$(build_private_libdir)/sys$1-bc.a : $$(build_private_libdir)/sys$1-%.a : $$(build_private_libdir)/sys.ji @$$(call PRINT_JULIA, cd $$(JULIAHOME)/base && \ if ! JULIA_BINDIR=$$(call cygpath_w,$(build_bindir)) WINEPATH="$$(call cygpath_w,$$(build_bindir));$$$$WINEPATH" \ + JULIA_NUM_THREADS=1 \ $$(call spawn, $3) $2 -C "$$(JULIA_CPU_TARGET)" --output-$$* $$(call cygpath_w,$$@).tmp $$(JULIA_SYSIMG_BUILD_FLAGS) \ --startup-file=no --warn-overwrite=yes --sysimage $$(call cygpath_w,$$<) $$(call cygpath_w,$$(JULIAHOME)/contrib/generate_precompile.jl) $(JULIA_PRECOMPILE); then \ echo '*** This error is usually fixed by running `make clean`. If the error persists$$(COMMA) try `make cleanall`. ***'; \ From 8d2f60438da4317f4cbf3c39c47cbcc27ee4251c Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Sun, 20 Feb 2022 09:40:11 -0500 Subject: [PATCH 020/369] Profile: Use grace period to avoid trailing signals from timer (#44268) (cherry picked from commit e723d374b78be36223d42a739b7cc9eb7fc147ff) --- src/signals-unix.c | 20 +++++++++++++------- stdlib/Profile/test/runtests.jl | 9 ++++++--- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/signals-unix.c b/src/signals-unix.c index 8a5822d451335..b4eb57a5501cb 100644 --- a/src/signals-unix.c +++ b/src/signals-unix.c @@ -501,6 +501,16 @@ void usr2_handler(int sig, siginfo_t *info, void *ctx) errno = errno_save; } +// Because SIGUSR1 is dual-purpose, and the timer can have trailing signals after being deleted, +// a 2-second grace period is imposed to ignore any trailing timer-created signals so they don't get +// confused for user triggers +uint64_t last_timer_delete_time = 0; + +int timer_graceperiod_elapsed(void) +{ + return jl_hrtime() > (last_timer_delete_time + 2e9); +} + #if defined(HAVE_TIMER) // Linux-style #include @@ -541,9 +551,7 @@ JL_DLLEXPORT void jl_profile_stop_timer(void) { if (running) { timer_delete(timerprof); - // Because SIGUSR1 is multipurpose, care must be taken for running = 0 to be set after the timer has fully stopped. - // There may be a pending signal emitted from the timer so wait a few timer cycles - sleep_ms((nsecprof / GIGA) * 1000 * 3); + last_timer_delete_time = jl_hrtime(); running = 0; } } @@ -574,9 +582,7 @@ JL_DLLEXPORT void jl_profile_stop_timer(void) if (running) { memset(&timerprof, 0, sizeof(timerprof)); setitimer(ITIMER_PROF, &timerprof, NULL); - // Because SIGUSR1 is multipurpose, care must be taken for running = 0 to be set after the timer has fully stopped. - // There may be a pending signal emitted from the timer so wait a few timer cycles - sleep_ms((nsecprof / GIGA) * 1000 * 3); + last_timer_delete_time = jl_hrtime(); running = 0; } } @@ -786,7 +792,7 @@ static void *signal_listener(void *arg) } #else if (sig == SIGUSR1) { - if (running != 1) + if (running != 1 && timer_graceperiod_elapsed()) trigger_profile_peek(); doexit = 0; } diff --git a/stdlib/Profile/test/runtests.jl b/stdlib/Profile/test/runtests.jl index ab87d497fe93e..c6f78cbed0522 100644 --- a/stdlib/Profile/test/runtests.jl +++ b/stdlib/Profile/test/runtests.jl @@ -200,9 +200,12 @@ if Sys.isbsd() || Sys.islinux() """ iob = Base.BufferStream() p = run(pipeline(`$cmd -e $script`, stderr = devnull, stdout = iob), wait = false) - t = Timer(60) do t # should be done in under 10 seconds + t = Timer(120) do t + # should be under 10 seconds, so give it 2 minutes then report failure + println("KILLING BY PROFILE TEST WATCHDOG\n") + kill(p, Base.SIGTERM) + sleep(10) kill(p, Base.SIGKILL) - sleep(5) close(iob) end try @@ -210,7 +213,7 @@ if Sys.isbsd() || Sys.islinux() @assert occursin("started", s) @assert process_running(p) for _ in 1:2 - sleep(2) + sleep(2.5) if Sys.isbsd() kill(p, 29) # SIGINFO elseif Sys.islinux() From 554d2ccf1c244dde41a86ca191d626a55ac0323b Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Sat, 19 Feb 2022 20:31:41 +0000 Subject: [PATCH 021/369] debuginfo: Fix build on 32-bit ARM This slipped through in 955d4271, as we aren't building for 32 bit ARM during CI right now. GitHub: Fixes #44254. (cherry picked from commit c9ac2eadfb2c80ddd2cff30c5eaec0f4e8695167) --- src/debuginfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/debuginfo.cpp b/src/debuginfo.cpp index 42d67bd6f89c7..53105feb81bfe 100644 --- a/src/debuginfo.cpp +++ b/src/debuginfo.cpp @@ -227,7 +227,7 @@ class JITObjectRegistry continue; } } - uint64_t loadaddr = L.getSectionLoadAddress(section); + uint64_t loadaddr = getLoadAddress(section.getName().get()); size_t seclen = section.getSize(); if (istext) { arm_text_addr = loadaddr; From d9849beda7d63af6407c6d300d60db846f3553b1 Mon Sep 17 00:00:00 2001 From: Aditya Puranik <7466364+Ellipse0934@users.noreply.github.com> Date: Mon, 21 Feb 2022 15:17:52 +0530 Subject: [PATCH 022/369] Fix aliasing bug in copy!(x, x) for x::AbstractSet and x::AbstractDict, fixes #41268 (#44265) (cherry picked from commit 0b48b91c9881823d860eaf0a605072b7f20a4cbb) --- base/abstractdict.jl | 5 ++++- base/abstractset.jl | 5 ++++- test/dict.jl | 2 ++ test/sets.jl | 3 +++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/base/abstractdict.jl b/base/abstractdict.jl index a9c04dac22b7b..daab71c3cc671 100644 --- a/base/abstractdict.jl +++ b/base/abstractdict.jl @@ -189,7 +189,10 @@ empty(a::AbstractDict) = empty(a, keytype(a), valtype(a)) empty(a::AbstractDict, ::Type{V}) where {V} = empty(a, keytype(a), V) # Note: this is the form which makes sense for `Vector`. copy(a::AbstractDict) = merge!(empty(a), a) -copy!(dst::AbstractDict, src::AbstractDict) = merge!(empty!(dst), src) +function copy!(dst::AbstractDict, src::AbstractDict) + dst === src && return dst + merge!(empty!(dst), src) +end """ merge!(d::AbstractDict, others::AbstractDict...) diff --git a/base/abstractset.jl b/base/abstractset.jl index bec4a84b19d15..561e18c15697c 100644 --- a/base/abstractset.jl +++ b/base/abstractset.jl @@ -3,7 +3,10 @@ eltype(::Type{<:AbstractSet{T}}) where {T} = @isdefined(T) ? T : Any sizehint!(s::AbstractSet, n) = nothing -copy!(dst::AbstractSet, src::AbstractSet) = union!(empty!(dst), src) +function copy!(dst::AbstractSet, src::AbstractSet) + dst === src && return dst + union!(empty!(dst), src) +end ## set operations (union, intersection, symmetric difference) diff --git a/test/dict.jl b/test/dict.jl index cbbb475c993fd..ad15764a09d16 100644 --- a/test/dict.jl +++ b/test/dict.jl @@ -1179,6 +1179,8 @@ end @test s === copy!(s, Base.ImmutableDict(a[])) == Dict(a[]) end end + s2 = copy(s) + @test copy!(s, s) == s2 end @testset "map!(f, values(dict))" begin diff --git a/test/sets.jl b/test/sets.jl index 43ba433e780d7..1999dbf3d020f 100644 --- a/test/sets.jl +++ b/test/sets.jl @@ -151,6 +151,9 @@ end @test s === copy!(s, BitSet(a)) == S(a) end end + s = Set([1, 2]) + s2 = copy(s) + @test copy!(s, s) == s2 end @testset "sizehint, empty" begin From 11939610c3578c507b3beeaac7b9bd3fb009b9a1 Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Mon, 21 Feb 2022 10:37:54 -0500 Subject: [PATCH 023/369] Fix bad precompile statements via an output lock (#44252) (cherry picked from commit c5bc69ceba10a90df68dd13a47eb888e1a309faf) --- src/gf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gf.c b/src/gf.c index 01d03fe77394f..25b29c63a0782 100644 --- a/src/gf.c +++ b/src/gf.c @@ -1961,6 +1961,8 @@ jl_code_instance_t *jl_method_compiled(jl_method_instance_t *mi, size_t world) return NULL; } +jl_mutex_t precomp_statement_out_lock; + static void record_precompile_statement(jl_method_instance_t *mi) { static ios_t f_precompile; @@ -1971,6 +1973,8 @@ static void record_precompile_statement(jl_method_instance_t *mi) if (!jl_is_method(def)) return; + if (jl_n_threads > 1) + JL_LOCK(&precomp_statement_out_lock); if (s_precompile == NULL) { const char *t = jl_options.trace_compile; if (!strncmp(t, "stderr", 6)) { @@ -1989,6 +1993,8 @@ static void record_precompile_statement(jl_method_instance_t *mi) if (s_precompile != JL_STDERR) ios_flush(&f_precompile); } + if (jl_n_threads > 1) + JL_UNLOCK(&precomp_statement_out_lock); } jl_code_instance_t *jl_compile_method_internal(jl_method_instance_t *mi, size_t world) From a6f4b5ecefc76f170d2ce7036d5c786e6b12af9e Mon Sep 17 00:00:00 2001 From: Nathan Daly Date: Tue, 22 Feb 2022 15:33:25 -0500 Subject: [PATCH 024/369] Fix thread-safety violation in Allocations Profiler: Create a new per-thread backtrace buffer in ptls (#44116) * Fix thread-safety violation in Allocations Profiler: Re-use the shared `ptls->bt_data` buffer from the thread-local storage for the buffer, to ensure that each thread has a separate buffer. This buffer is shared with the exception throwing mechanism, but is safe to share since julia exception throwing never interleaves with allocations profiling. * Approach two: Create a separate per-thread allocations backtrace buffer. * Update src/gc-alloc-profiler.cpp Co-authored-by: Jameson Nash * Update src/gc-alloc-profiler.cpp Co-authored-by: Jameson Nash * fix type error (#44235) * Update src/gc-alloc-profiler.cpp Co-authored-by: Jameson Nash Co-authored-by: Pete Vilter <7341+vilterp@users.noreply.github.com> (cherry picked from commit 4e57966504edb485838b3458929ad6498f197709) --- src/gc-alloc-profiler.cpp | 19 ++++++++++++++----- src/julia_threads.h | 2 ++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/gc-alloc-profiler.cpp b/src/gc-alloc-profiler.cpp index e7ab1a6fdf1f5..818d6e803c9df 100644 --- a/src/gc-alloc-profiler.cpp +++ b/src/gc-alloc-profiler.cpp @@ -49,15 +49,24 @@ jl_combined_results g_combined_results; // Will live forever. // === stack stuff === jl_raw_backtrace_t get_raw_backtrace() JL_NOTSAFEPOINT { - // A single large buffer to record backtraces onto - static jl_bt_element_t static_bt_data[JL_MAX_BT_SIZE]; + // We first record the backtrace onto a MAX-sized buffer, so that we don't have to + // allocate the buffer until we know the size. To ensure thread-safety, we use a + // per-thread backtrace buffer. + jl_ptls_t ptls = jl_current_task->ptls; + jl_bt_element_t *shared_bt_data_buffer = ptls->profiling_bt_buffer; + if (shared_bt_data_buffer == NULL) { + size_t size = sizeof(jl_bt_element_t) * (JL_MAX_BT_SIZE + 1); + shared_bt_data_buffer = (jl_bt_element_t*) malloc_s(size); + ptls->profiling_bt_buffer = shared_bt_data_buffer; + } - size_t bt_size = rec_backtrace(static_bt_data, JL_MAX_BT_SIZE, 2); + size_t bt_size = rec_backtrace(shared_bt_data_buffer, JL_MAX_BT_SIZE, 2); // Then we copy only the needed bytes out of the buffer into our profile. size_t bt_bytes = bt_size * sizeof(jl_bt_element_t); - jl_bt_element_t *bt_data = (jl_bt_element_t*) malloc(bt_bytes); - memcpy(bt_data, static_bt_data, bt_bytes); + jl_bt_element_t *bt_data = (jl_bt_element_t*) malloc_s(bt_bytes); + memcpy(bt_data, shared_bt_data_buffer, bt_bytes); + return jl_raw_backtrace_t{ bt_data, diff --git a/src/julia_threads.h b/src/julia_threads.h index 371eb51250115..22acf3aec8587 100644 --- a/src/julia_threads.h +++ b/src/julia_threads.h @@ -246,6 +246,8 @@ typedef struct _jl_tls_states_t { // Temporary backtrace buffer. Scanned for gc roots when bt_size > 0. struct _jl_bt_element_t *bt_data; // JL_MAX_BT_SIZE + 1 elements long size_t bt_size; // Size for backtrace in transit in bt_data + // Temporary backtrace buffer used only for allocations profiler. + struct _jl_bt_element_t *profiling_bt_buffer; // Atomically set by the sender, reset by the handler. volatile _Atomic(sig_atomic_t) signal_request; // TODO: no actual reason for this to be _Atomic // Allow the sigint to be raised asynchronously From e23618dc347071b4a62ce4d4b4e1b4a8f2d53281 Mon Sep 17 00:00:00 2001 From: Felix Kastner Date: Wed, 23 Feb 2022 13:32:17 +0100 Subject: [PATCH 025/369] fix `BLAS.spr!` docstring (#44303) (cherry picked from commit 333a3a37f815b0053dcdbc7439a7fb67af16388d) --- stdlib/LinearAlgebra/src/blas.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/LinearAlgebra/src/blas.jl b/stdlib/LinearAlgebra/src/blas.jl index e8d44c1ae1533..9b5506e993ea8 100644 --- a/stdlib/LinearAlgebra/src/blas.jl +++ b/stdlib/LinearAlgebra/src/blas.jl @@ -1216,7 +1216,7 @@ end """ spr!(uplo, α, x, AP) -Update matrix `A` as `α*A*x*x'`, where `A` is a symmetric matrix provided +Update matrix `A` as `A+α*x*x'`, where `A` is a symmetric matrix provided in packed format `AP` and `x` is a vector. With `uplo = 'U'`, the array AP must contain the upper triangular part of the From a274328df6e695f08dd238350cb10980a85c10c4 Mon Sep 17 00:00:00 2001 From: gbaraldi Date: Wed, 23 Feb 2022 09:38:45 -0300 Subject: [PATCH 026/369] Fix M1 tail call issue when building (#44279) (cherry picked from commit 629eb8662a193e5247bdbdba53916041572c6a24) --- src/ccall.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ccall.cpp b/src/ccall.cpp index 332c057afa5c4..1fc6e5d4d3ece 100644 --- a/src/ccall.cpp +++ b/src/ccall.cpp @@ -233,10 +233,11 @@ static GlobalVariable *emit_plt_thunk( else { // musttail support is very bad on ARM, PPC, PPC64 (as of LLVM 3.9) // Known failures includes vararg (not needed here) and sret. -#if (defined(_CPU_X86_) || defined(_CPU_X86_64_) || \ - defined(_CPU_AARCH64_)) + +#if (defined(_CPU_X86_) || defined(_CPU_X86_64_) || (defined(_CPU_AARCH64_) && !defined(_OS_DARWIN_))) // Ref https://bugs.llvm.org/show_bug.cgi?id=47058 // LLVM, as of 10.0.1 emits wrong/worse code when musttail is set + // Apple silicon macs give an LLVM ERROR if musttail is set here #44107. if (!attrs.hasAttrSomewhere(Attribute::ByVal)) ret->setTailCallKind(CallInst::TCK_MustTail); #endif From 7b711ce699723a8f2093e2d4acc4835dd925d096 Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Wed, 23 Feb 2022 16:09:24 +0100 Subject: [PATCH 027/369] set VERSION to 1.8.0-beta1 (#44221) --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 31083204c40c0..7b1cf1d8e357b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.8.0-DEV +1.8.0-beta1 From b8cd73082966c1ace146a94c3447725fa2ee0468 Mon Sep 17 00:00:00 2001 From: Juan Ignacio Polanco Date: Wed, 23 Feb 2022 21:07:30 +0100 Subject: [PATCH 028/369] Make sure `range(start; step, length)` uses TwicePrecision when possible, fixes #44292. (#44313) (cherry picked from commit 1b47efb08753a808c4869bb4fe0561e526cde612) --- base/twiceprecision.jl | 12 ++++++++++-- test/ranges.jl | 12 ++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/base/twiceprecision.jl b/base/twiceprecision.jl index 8f80b2c8438a0..6d91431e47abb 100644 --- a/base/twiceprecision.jl +++ b/base/twiceprecision.jl @@ -408,7 +408,7 @@ function floatrange(a::AbstractFloat, st::AbstractFloat, len::Real, divisor::Abs steprangelen_hp(T, (a,divisor), (st,divisor), nbitslen(T, len, 1), len, oneunit(len)) end -function (:)(start::T, step::T, stop::T) where T<:Union{Float16,Float32,Float64} +function (:)(start::T, step::T, stop::T) where T<:IEEEFloat step == 0 && throw(ArgumentError("range step cannot be zero")) # see if the inputs have exact rational approximations (and if so, # perform all computations in terms of the rationals) @@ -453,7 +453,10 @@ end step(r::StepRangeLen{T,TwicePrecision{T},TwicePrecision{T}}) where {T<:AbstractFloat} = T(r.step) step(r::StepRangeLen{T,TwicePrecision{T},TwicePrecision{T}}) where {T} = T(r.step) -function range_start_step_length(a::T, st::T, len::Integer) where T<:Union{Float16,Float32,Float64} +range_start_step_length(a, st::IEEEFloat, len::Integer) = + range_start_step_length(oftype(st, a), st, len) + +function range_start_step_length(a::T, st::T, len::Integer) where T<:IEEEFloat len = len + 0 # promote with Int start_n, start_d = rat(a) step_n, step_d = rat(st) @@ -471,6 +474,11 @@ function range_start_step_length(a::T, st::T, len::Integer) where T<:Union{Float steprangelen_hp(T, a, st, 0, len, 1) end +function range_step_stop_length(step::IEEEFloat, stop, len::Integer) + r = range_start_step_length(stop, negate(step), len) + reverse(r) +end + # This assumes that r.step has already been split so that (0:len-1)*r.step.hi is exact function unsafe_getindex(r::StepRangeLen{T,<:TwicePrecision,<:TwicePrecision}, i::Integer) where T # Very similar to _getindex_hiprec, but optimized to avoid a 2nd call to add12 diff --git a/test/ranges.jl b/test/ranges.jl index a7f26c7efa629..536c1f4710d9d 100644 --- a/test/ranges.jl +++ b/test/ranges.jl @@ -1612,6 +1612,18 @@ end @test x isa StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}} end +@testset "Issue #44292" begin + let x = @inferred range(0, step=0.2, length=5) + @test x isa StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}} + @test x == [0.0, 0.2, 0.4, 0.6, 0.8] + end + + let x = @inferred range(stop=1, step=0.2, length=5) + @test x isa StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}} + @test x == [0.2, 0.4, 0.6, 0.8, 1.0] + end +end + @testset "Views of ranges" begin @test view(Base.OneTo(10), Base.OneTo(5)) === Base.OneTo(5) @test view(1:10, 1:5) === 1:5 From b2a206183cba1072a0944af494a4b4de633f79bf Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Thu, 24 Feb 2022 01:30:09 -0600 Subject: [PATCH 029/369] Cache external CodeInstances (#43990) Prior to this PR, Julia's precompiled `*.ji` files saved just two categories of code: unspecialized method definitions and type-specialized code for the methods defined by the package. Any novel specializations of methods from Base or previously-loaded packages were not saved, and therefore effectively thrown away. This PR caches all the code---internal or external---called during package definition that hadn't been previously inferred, as long as there is a backedge linking it back to a method owned by a module being precompiled. (The latter condition ensures it will actually be called by package methods, and not merely transiently generated for the purpose of, e.g., metaprogramming or variable initialization.) This makes precompilation more intuitive (now it saves all relevant inference results), and substantially reduces latency for inference-bound packages. Closes #42016 Fixes #35972 Issue #35972 arose because codegen got started without re-inferring some discarded CodeInstances. This forced the compiler to insert a `jl_invoke`. This PR fixes the issue because needed CodeInstances are no longer discarded by precompilation. (cherry picked from commit df81bf9a96c59f257a01307cd0ecf05035d8301f) --- base/Base.jl | 19 +- base/binaryplatforms.jl | 61 +++-- base/compiler/typeinfer.jl | 10 + base/loading.jl | 8 +- src/codegen.cpp | 2 +- src/dump.c | 390 +++++++++++++++++++++++++++--- src/gf.c | 36 ++- src/jltypes.c | 8 +- src/julia.h | 2 + src/julia_internal.h | 4 + src/method.c | 50 +++- stdlib/Artifacts/src/Artifacts.jl | 17 +- test/precompile.jl | 213 +++++++++++++++- 13 files changed, 724 insertions(+), 96 deletions(-) diff --git a/base/Base.jl b/base/Base.jl index 9ad0cdf7a6661..a3fe44a2add86 100644 --- a/base/Base.jl +++ b/base/Base.jl @@ -427,7 +427,7 @@ end_base_include = time_ns() const _sysimage_modules = PkgId[] in_sysimage(pkgid::PkgId) = pkgid in _sysimage_modules -# Precompiles for Revise +# Precompiles for Revise and other packages # TODO: move these to contrib/generate_precompile.jl # The problem is they don't work there for match = _methods(+, (Int, Int), -1, get_world_counter()) @@ -461,6 +461,23 @@ for match = _methods(+, (Int, Int), -1, get_world_counter()) # Code loading uses this sortperm(mtime.(readdir(".")), rev=true) + # JLLWrappers uses these + Dict{UUID,Set{String}}()[UUID("692b3bcd-3c85-4b1f-b108-f13ce0eb3210")] = Set{String}() + get!(Set{String}, Dict{UUID,Set{String}}(), UUID("692b3bcd-3c85-4b1f-b108-f13ce0eb3210")) + eachindex(IndexLinear(), Expr[]) + push!(Expr[], Expr(:return, false)) + vcat(String[], String[]) + k, v = (:hello => nothing) + precompile(indexed_iterate, (Pair{Symbol, Union{Nothing, String}}, Int)) + precompile(indexed_iterate, (Pair{Symbol, Union{Nothing, String}}, Int, Int)) + # Preferences uses these + precompile(get_preferences, (UUID,)) + precompile(record_compiletime_preference, (UUID, String)) + get(Dict{String,Any}(), "missing", nothing) + delete!(Dict{String,Any}(), "missing") + for (k, v) in Dict{String,Any}() + println(k) + end break # only actually need to do this once end diff --git a/base/binaryplatforms.jl b/base/binaryplatforms.jl index 61e1af796999d..87c7f029f0563 100644 --- a/base/binaryplatforms.jl +++ b/base/binaryplatforms.jl @@ -40,10 +40,10 @@ struct Platform <: AbstractPlatform # The "compare strategy" allows selective overriding on how a tag is compared compare_strategies::Dict{String,Function} - function Platform(arch::String, os::String; + # Passing `tags` as a `Dict` avoids the need to infer different NamedTuple specializations + function Platform(arch::String, os::String, _tags::Dict{String}; validate_strict::Bool = false, - compare_strategies::Dict{String,<:Function} = Dict{String,Function}(), - kwargs...) + compare_strategies::Dict{String,<:Function} = Dict{String,Function}()) # A wee bit of normalization os = lowercase(os) arch = CPUID.normalize_arch(arch) @@ -52,8 +52,9 @@ struct Platform <: AbstractPlatform "arch" => arch, "os" => os, ) - for (tag, value) in kwargs - tag = lowercase(string(tag::Symbol)) + for (tag, value) in _tags + value = value::Union{String,VersionNumber,Nothing} + tag = lowercase(tag) if tag ∈ ("arch", "os") throw(ArgumentError("Cannot double-pass key $(tag)")) end @@ -70,8 +71,8 @@ struct Platform <: AbstractPlatform if tag ∈ ("libgfortran_version", "libstdcxx_version", "os_version") if isa(value, VersionNumber) value = string(value) - elseif isa(value, AbstractString) - v = tryparse(VersionNumber, String(value)::String) + elseif isa(value, String) + v = tryparse(VersionNumber, value) if isa(v, VersionNumber) value = string(v) end @@ -110,6 +111,19 @@ struct Platform <: AbstractPlatform end end +# Keyword interface (to avoid inference of specialized NamedTuple methods, use the Dict interface for `tags`) +function Platform(arch::String, os::String; + validate_strict::Bool = false, + compare_strategies::Dict{String,<:Function} = Dict{String,Function}(), + kwargs...) + tags = Dict{String,Any}(String(tag)::String=>tagvalue(value) for (tag, value) in kwargs) + return Platform(arch, os, tags; validate_strict, compare_strategies) +end + +tagvalue(v::Union{String,VersionNumber,Nothing}) = v +tagvalue(v::Symbol) = String(v) +tagvalue(v::AbstractString) = convert(String, v)::String + # Simple tag insertion that performs a little bit of validation function add_tag!(tags::Dict{String,String}, tag::String, value::String) # I know we said only alphanumeric and dots, but let's be generous so that we can expand @@ -699,21 +713,22 @@ function Base.parse(::Type{Platform}, triplet::AbstractString; validate_strict:: end # Extract the information we're interested in: + tags = Dict{String,Any}() arch = get_field(m, arch_mapping) os = get_field(m, os_mapping) - libc = get_field(m, libc_mapping) - call_abi = get_field(m, call_abi_mapping) - libgfortran_version = get_field(m, libgfortran_version_mapping) - libstdcxx_version = get_field(m, libstdcxx_version_mapping) - cxxstring_abi = get_field(m, cxxstring_abi_mapping) + tags["libc"] = get_field(m, libc_mapping) + tags["call_abi"] = get_field(m, call_abi_mapping) + tags["libgfortran_version"] = get_field(m, libgfortran_version_mapping) + tags["libstdcxx_version"] = get_field(m, libstdcxx_version_mapping) + tags["cxxstring_abi"] = get_field(m, cxxstring_abi_mapping) function split_tags(tagstr) tag_fields = split(tagstr, "-"; keepempty=false) if isempty(tag_fields) return Pair{String,String}[] end - return map(v -> Symbol(v[1]) => v[2], split.(tag_fields, "+")) + return map(v -> String(v[1]) => String(v[2]), split.(tag_fields, "+")) end - tags = split_tags(m["tags"]) + merge!(tags, Dict(split_tags(m["tags"]))) # Special parsing of os version number, if any exists function extract_os_version(os_name, pattern) @@ -730,18 +745,9 @@ function Base.parse(::Type{Platform}, triplet::AbstractString; validate_strict:: if os == "freebsd" os_version = extract_os_version("freebsd", r".*freebsd([\d.]+)") end + tags["os_version"] = os_version - return Platform( - arch, os; - validate_strict, - libc, - call_abi, - libgfortran_version, - cxxstring_abi, - libstdcxx_version, - os_version, - tags..., - ) + return Platform(arch, os, tags; validate_strict) end throw(ArgumentError("Platform `$(triplet)` is not an officially supported platform")) end @@ -1068,4 +1074,9 @@ function select_platform(download_info::Dict, platform::AbstractPlatform = HostP return download_info[p] end +# precompiles to reduce latency (see https://github.com/JuliaLang/julia/pull/43990#issuecomment-1025692379) +Dict{Platform,String}()[HostPlatform()] = "" +Platform("x86_64", "linux", Dict{String,Any}(); validate_strict=true) +Platform("x86_64", "linux", Dict{String,String}(); validate_strict=false) # called this way from Artifacts.unpack_platform + end # module diff --git a/base/compiler/typeinfer.jl b/base/compiler/typeinfer.jl index d600df1dbb0a1..4015b7c00bf0d 100644 --- a/base/compiler/typeinfer.jl +++ b/base/compiler/typeinfer.jl @@ -1,5 +1,9 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license +# Tracking of newly-inferred MethodInstances during precompilation +const track_newly_inferred = RefValue{Bool}(false) +const newly_inferred = MethodInstance[] + # build (and start inferring) the inference frame for the top-level MethodInstance function typeinf(interp::AbstractInterpreter, result::InferenceResult, cache::Symbol) frame = InferenceState(result, cache, interp) @@ -389,6 +393,12 @@ function cache_result!(interp::AbstractInterpreter, result::InferenceResult) if !already_inferred inferred_result = transform_result_for_cache(interp, linfo, valid_worlds, result.src) code_cache(interp)[linfo] = CodeInstance(result, inferred_result, valid_worlds) + if track_newly_inferred[] + m = linfo.def + if isa(m, Method) + m.module != Core && push!(newly_inferred, linfo) + end + end end unlock_mi_inference(interp, linfo) nothing diff --git a/base/loading.jl b/base/loading.jl index 7dce4532c1571..1f3297df36448 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -1395,13 +1395,17 @@ function include_package_for_output(pkg::PkgId, input::String, depot_path::Vecto task_local_storage()[:SOURCE_PATH] = source end + Core.Compiler.track_newly_inferred.x = true try Base.include(Base.__toplevel__, input) catch ex precompilableerror(ex) || rethrow() @debug "Aborting `create_expr_cache'" exception=(ErrorException("Declaration of __precompile__(false) not allowed"), catch_backtrace()) exit(125) # we define status = 125 means PrecompileableError + finally + Core.Compiler.track_newly_inferred.x = false end + ccall(:jl_set_newly_inferred, Cvoid, (Any,), Core.Compiler.newly_inferred) end const PRECOMPILE_TRACE_COMPILE = Ref{String}() @@ -2033,12 +2037,12 @@ end Compile the given function `f` for the argument tuple (of types) `args`, but do not execute it. """ -function precompile(@nospecialize(f), args::Tuple) +function precompile(@nospecialize(f), @nospecialize(args::Tuple)) precompile(Tuple{Core.Typeof(f), args...}) end const ENABLE_PRECOMPILE_WARNINGS = Ref(false) -function precompile(argt::Type) +function precompile(@nospecialize(argt::Type)) ret = ccall(:jl_compile_hint, Int32, (Any,), argt) != 0 if !ret && ENABLE_PRECOMPILE_WARNINGS[] @warn "Inactive precompile statement" maxlog=100 form=argt _module=nothing _file=nothing _line=0 diff --git a/src/codegen.cpp b/src/codegen.cpp index be6d8e2f66325..c9e7b2280777e 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -7849,7 +7849,7 @@ jl_compile_result_t jl_emit_codeinst( // don't delete inlineable code, unless it is constant (codeinst->invoke == jl_fptr_const_return_addr || !jl_ir_flag_inlineable((jl_array_t*)codeinst->inferred)) && // don't delete code when generating a precompile file - !imaging_mode) { + !(imaging_mode || jl_options.incremental)) { // if not inlineable, code won't be needed again codeinst->inferred = jl_nothing; } diff --git a/src/dump.c b/src/dump.c index f2c8629ca9c8b..919bac8c82a07 100644 --- a/src/dump.c +++ b/src/dump.c @@ -92,6 +92,16 @@ static arraylist_t reinit_list; // This is not quite globally rooted, but we take care to only // ever assigned rooted values here. static jl_array_t *serializer_worklist JL_GLOBALLY_ROOTED; +// external MethodInstances we want to serialize +static htable_t external_mis; +// Inference tracks newly-inferred MethodInstances during precompilation +// and registers them by calling jl_set_newly_inferred +static jl_array_t *newly_inferred JL_GLOBALLY_ROOTED; + +// New roots to add to Methods. These can't be added until after +// recaching is complete, so we have to hold on to them separately +// Stored as method => (worklist_key, roots) +static htable_t queued_method_roots; // inverse of backedges graph (caller=>callees hash) htable_t edges_map; @@ -140,6 +150,18 @@ jl_value_t *jl_deser_symbol(uint8_t tag) return deser_symbols[tag]; } +uint64_t jl_worklist_key(jl_array_t *worklist) +{ + assert(jl_is_array(worklist)); + size_t len = jl_array_len(worklist); + if (len > 0) { + jl_module_t *topmod = (jl_module_t*)jl_array_ptr_ref(worklist, len-1); + assert(jl_is_module(topmod)); + return topmod->build_id; + } + return 0; +} + // --- serialize --- #define jl_serialize_value(s, v) jl_serialize_value_((s), (jl_value_t*)(v), 0) @@ -163,6 +185,11 @@ static int module_in_worklist(jl_module_t *mod) JL_NOTSAFEPOINT return 0; } +static int method_instance_in_queue(jl_method_instance_t *mi) +{ + return ptrhash_get(&external_mis, mi) != HT_NOTFOUND; +} + // compute whether a type references something internal to worklist // and thus could not have existed before deserialize // and thus does not need delayed unique-ing @@ -219,6 +246,75 @@ static int type_recursively_external(jl_datatype_t *dt) JL_NOTSAFEPOINT return 1; } +// When we infer external method instances, ensure they link back to the +// package. Otherwise they might be, e.g., for external macros +static int has_backedge_to_worklist(jl_method_instance_t *mi, htable_t *visited) +{ + void **bp = ptrhash_bp(visited, mi); + // HT_NOTFOUND: not yet analyzed + // HT_NOTFOUND + 1: doesn't link back + // HT_NOTFOUND + 2: does link back + if (*bp != HT_NOTFOUND) + return (char*)*bp - (char*)HT_NOTFOUND - 1; + *bp = (void*)((char*)HT_NOTFOUND + 1); // preliminarily mark as "not found" + jl_module_t *mod = mi->def.module; + if (jl_is_method(mod)) + mod = ((jl_method_t*)mod)->module; + assert(jl_is_module(mod)); + if (mi->precompiled || module_in_worklist(mod)) { + *bp = (void*)((char*)HT_NOTFOUND + 2); // found + return 1; + } + if (!mi->backedges) { + return 0; + } + size_t i, n = jl_array_len(mi->backedges); + for (i = 0; i < n; i++) { + jl_method_instance_t *be = (jl_method_instance_t*)jl_array_ptr_ref(mi->backedges, i); + if (has_backedge_to_worklist(be, visited)) { + *bp = (void*)((char*)HT_NOTFOUND + 2); // found + return 1; + } + } + return 0; +} + +// given the list of MethodInstances that were inferred during the +// build, select those that are external and have at least one +// relocatable CodeInstance. +static size_t queue_external_mis(jl_array_t *list) +{ + size_t i, n = 0; + htable_t visited; + htable_new(&visited, 0); + if (list) { + assert(jl_is_array(list)); + size_t n0 = jl_array_len(list); + for (i = 0; i < n0; i++) { + jl_method_instance_t *mi = (jl_method_instance_t*)jl_array_ptr_ref(list, i); + assert(jl_is_method_instance(mi)); + if (jl_is_method(mi->def.value)) { + jl_method_t *m = mi->def.method; + if (!module_in_worklist(m->module)) { + jl_code_instance_t *ci = mi->cache; + int relocatable = 0; + while (ci) { + relocatable |= ci->relocatability; + ci = ci->next; + } + if (relocatable && ptrhash_get(&external_mis, mi) == HT_NOTFOUND) { + if (has_backedge_to_worklist(mi, &visited)) { + ptrhash_put(&external_mis, mi, mi); + n++; + } + } + } + } + } + } + htable_free(&visited); + return n; +} static void jl_serialize_datatype(jl_serializer_state *s, jl_datatype_t *dt) JL_GC_DISABLED { @@ -485,8 +581,12 @@ static int jl_serialize_generic(jl_serializer_state *s, jl_value_t *v) JL_GC_DIS return 0; } -static void jl_serialize_code_instance(jl_serializer_state *s, jl_code_instance_t *codeinst, int skip_partial_opaque) JL_GC_DISABLED +static void jl_serialize_code_instance(jl_serializer_state *s, jl_code_instance_t *codeinst, int skip_partial_opaque, int internal) JL_GC_DISABLED { + if (internal > 2) { + while (codeinst && !codeinst->relocatability) + codeinst = codeinst->next; + } if (jl_serialize_generic(s, (jl_value_t*)codeinst)) { return; } @@ -507,7 +607,7 @@ static void jl_serialize_code_instance(jl_serializer_state *s, jl_code_instance_ if (write_ret_type && codeinst->rettype_const && jl_typeis(codeinst->rettype_const, jl_partial_opaque_type)) { if (skip_partial_opaque) { - jl_serialize_code_instance(s, codeinst->next, skip_partial_opaque); + jl_serialize_code_instance(s, codeinst->next, skip_partial_opaque, internal); return; } else { @@ -534,12 +634,13 @@ static void jl_serialize_code_instance(jl_serializer_state *s, jl_code_instance_ jl_serialize_value(s, jl_nothing); } write_uint8(s->s, codeinst->relocatability); - jl_serialize_code_instance(s, codeinst->next, skip_partial_opaque); + jl_serialize_code_instance(s, codeinst->next, skip_partial_opaque, internal); } enum METHOD_SERIALIZATION_MODE { METHOD_INTERNAL = 1, METHOD_EXTERNAL_MT = 2, + METHOD_HAS_NEW_ROOTS = 4, }; static void jl_serialize_value_(jl_serializer_state *s, jl_value_t *v, int as_literal) JL_GC_DISABLED @@ -665,9 +766,16 @@ static void jl_serialize_value_(jl_serializer_state *s, jl_value_t *v, int as_li else if (jl_is_method(v)) { write_uint8(s->s, TAG_METHOD); jl_method_t *m = (jl_method_t*)v; - int serialization_mode = 0; + uint64_t key = 0; + int serialization_mode = 0, nwithkey = 0; if (m->is_for_opaque_closure || module_in_worklist(m->module)) serialization_mode |= METHOD_INTERNAL; + if (!(serialization_mode & METHOD_INTERNAL)) { + key = jl_worklist_key(serializer_worklist); + nwithkey = nroots_with_key(m, key); + if (nwithkey > 0) + serialization_mode |= METHOD_HAS_NEW_ROOTS; + } if (!(serialization_mode & METHOD_INTERNAL)) { // flag this in the backref table as special uintptr_t *bp = (uintptr_t*)ptrhash_bp(&backref_table, v); @@ -693,8 +801,25 @@ static void jl_serialize_value_(jl_serializer_state *s, jl_value_t *v, int as_li else { jl_serialize_value(s, (jl_value_t*)m->external_mt); } - if (!(serialization_mode & METHOD_INTERNAL)) + if (!(serialization_mode & METHOD_INTERNAL)) { + if (serialization_mode & METHOD_HAS_NEW_ROOTS) { + // Serialize the roots that belong to key + write_uint64(s->s, key); + write_int32(s->s, nwithkey); + rle_iter_state rootiter = rle_iter_init(0); + uint64_t *rletable = NULL; + size_t nblocks2 = 0, nroots = jl_array_len(m->roots); + if (m->root_blocks) { + rletable = (uint64_t*)jl_array_data(m->root_blocks); + nblocks2 = jl_array_len(m->root_blocks); + } + // this visits every item, if it becomes a bottlneck we could hop blocks + while (rle_iter_increment(&rootiter, nroots, rletable, nblocks2)) + if (rootiter.key == key) + jl_serialize_value(s, jl_array_ptr_ref(m->roots, rootiter.i)); + } return; + } jl_serialize_value(s, m->specializations); jl_serialize_value(s, jl_atomic_load_relaxed(&m->speckeyset)); jl_serialize_value(s, (jl_value_t*)m->name); @@ -731,6 +856,8 @@ static void jl_serialize_value_(jl_serializer_state *s, jl_value_t *v, int as_li internal = 1; else if (module_in_worklist(mi->def.method->module)) internal = 2; + else if (ptrhash_get(&external_mis, (void*)mi) != HT_NOTFOUND) + internal = 3; write_uint8(s->s, internal); if (!internal) { // also flag this in the backref table as special @@ -748,12 +875,12 @@ static void jl_serialize_value_(jl_serializer_state *s, jl_value_t *v, int as_li jl_array_t *backedges = mi->backedges; if (backedges) { // filter backedges to only contain pointers - // to items that we will actually store (internal == 2) + // to items that we will actually store (internal >= 2) size_t ins, i, l = jl_array_len(backedges); jl_method_instance_t **b_edges = (jl_method_instance_t**)jl_array_data(backedges); for (ins = i = 0; i < l; i++) { jl_method_instance_t *backedge = b_edges[i]; - if (module_in_worklist(backedge->def.method->module)) { + if (module_in_worklist(backedge->def.method->module) || method_instance_in_queue(backedge)) { b_edges[ins++] = backedge; } } @@ -764,10 +891,10 @@ static void jl_serialize_value_(jl_serializer_state *s, jl_value_t *v, int as_li } jl_serialize_value(s, (jl_value_t*)backedges); jl_serialize_value(s, (jl_value_t*)NULL); //callbacks - jl_serialize_code_instance(s, mi->cache, 1); + jl_serialize_code_instance(s, mi->cache, 1, internal); } else if (jl_is_code_instance(v)) { - jl_serialize_code_instance(s, (jl_code_instance_t*)v, 0); + jl_serialize_code_instance(s, (jl_code_instance_t*)v, 0, 2); } else if (jl_typeis(v, jl_module_type)) { jl_serialize_module(s, (jl_module_t*)v); @@ -936,6 +1063,27 @@ static void jl_serialize_value_(jl_serializer_state *s, jl_value_t *v, int as_li } } +// Used to serialize the external method instances queued in queued_method_roots (from newly_inferred) +static void serialize_htable_keys(jl_serializer_state *s, htable_t *ht, int nitems) +{ + write_int32(s->s, nitems); + void **table = ht->table; + size_t i, n = 0, sz = ht->size; + for (i = 0; i < sz; i += 2) { + if (table[i+1] != HT_NOTFOUND) { + jl_serialize_value(s, (jl_value_t*)table[i]); + n += 1; + } + } + assert(n == nitems); +} + +// Create the forward-edge map (caller => callees) +// the intent of these functions is to invert the backedges tree +// for anything that points to a method not part of the worklist +// or method instances not in the queue +// +// from MethodTables static void jl_collect_missing_backedges_to_mod(jl_methtable_t *mt) { jl_array_t *backedges = mt->backedges; @@ -943,7 +1091,7 @@ static void jl_collect_missing_backedges_to_mod(jl_methtable_t *mt) size_t i, l = jl_array_len(backedges); for (i = 1; i < l; i += 2) { jl_method_instance_t *caller = (jl_method_instance_t*)jl_array_ptr_ref(backedges, i); - jl_value_t *missing_callee = jl_array_ptr_ref(backedges, i - 1); + jl_value_t *missing_callee = jl_array_ptr_ref(backedges, i - 1); // signature of abstract callee jl_array_t **edges = (jl_array_t**)ptrhash_bp(&edges_map, (void*)caller); if (*edges == HT_NOTFOUND) *edges = jl_alloc_vec_any(0); @@ -952,8 +1100,7 @@ static void jl_collect_missing_backedges_to_mod(jl_methtable_t *mt) } } -// the intent of this function is to invert the backedges tree -// for anything that points to a method not part of the worklist +// from MethodInstances static void collect_backedges(jl_method_instance_t *callee) JL_GC_DISABLED { jl_array_t *backedges = callee->backedges; @@ -970,6 +1117,11 @@ static void collect_backedges(jl_method_instance_t *callee) JL_GC_DISABLED } +// For functions owned by modules not on the worklist, call this on each method. +// - if the method is owned by a worklist module, add it to the list of things to be +// fully serialized +// - otherwise (i.e., if it's an external method), check all of its specializations. +// Collect backedges from those that are not being fully serialized. static int jl_collect_methcache_from_mod(jl_typemap_entry_t *ml, void *closure) JL_GC_DISABLED { jl_array_t *s = (jl_array_t*)closure; @@ -983,7 +1135,7 @@ static int jl_collect_methcache_from_mod(jl_typemap_entry_t *ml, void *closure) size_t i, l = jl_svec_len(specializations); for (i = 0; i < l; i++) { jl_method_instance_t *callee = (jl_method_instance_t*)jl_svecref(specializations, i); - if ((jl_value_t*)callee != jl_nothing) + if ((jl_value_t*)callee != jl_nothing && !method_instance_in_queue(callee)) collect_backedges(callee); } } @@ -1074,7 +1226,7 @@ static void jl_collect_backedges( /* edges */ jl_array_t *s, /* ext_targets */ j for (i = 0; i < edges_map.size; i += 2) { jl_method_instance_t *caller = (jl_method_instance_t*)table[i]; jl_array_t *callees = (jl_array_t*)table[i + 1]; - if (callees != HT_NOTFOUND && module_in_worklist(caller->def.method->module)) { + if (callees != HT_NOTFOUND && (module_in_worklist(caller->def.method->module) || method_instance_in_queue(caller))) { size_t i, l = jl_array_len(callees); for (i = 0; i < l; i++) { jl_value_t *c = jl_array_ptr_ref(callees, i); @@ -1556,6 +1708,24 @@ static jl_value_t *jl_deserialize_value_method(jl_serializer_state *s, jl_value_ assert(loc != NULL && loc != HT_NOTFOUND); arraylist_push(&flagref_list, loc); arraylist_push(&flagref_list, (void*)pos); + if (serialization_mode & METHOD_HAS_NEW_ROOTS) { + uint64_t key = read_uint64(s->s); + int i, nnew = read_int32(s->s); + jl_array_t *newroots = jl_alloc_vec_any(nnew); + jl_value_t **data = (jl_value_t**)jl_array_data(newroots); + for (i = 0; i < nnew; i++) + data[i] = jl_deserialize_value(s, &(data[i])); + // Storing the new roots in `m->roots` risks losing them due to recaching + // (which replaces pointers to `m` with ones to the "live" method). + // Put them in separate storage so we can find them later. + assert(ptrhash_get(&queued_method_roots, m) == HT_NOTFOUND); + // In storing the key, on 32-bit platforms we need two slots. Might as well do this for all platforms. + jl_svec_t *qmrval = jl_alloc_svec_uninit(3); // GC is disabled + jl_svec_data(qmrval)[0] = (jl_value_t*)(uintptr_t)(key & ((((uint64_t)1) << 32) - 1)); // lo bits + jl_svec_data(qmrval)[1] = (jl_value_t*)(uintptr_t)((key >> 32) & ((((uint64_t)1) << 32) - 1)); // hi bits + jl_svec_data(qmrval)[2] = (jl_value_t*)newroots; + ptrhash_put(&queued_method_roots, m, qmrval); + } return (jl_value_t*)m; } m->specializations = (jl_svec_t*)jl_deserialize_value(s, (jl_value_t**)&m->specializations); @@ -1619,6 +1789,10 @@ static jl_value_t *jl_deserialize_value_method_instance(jl_serializer_state *s, uintptr_t pos = backref_list.len; arraylist_push(&backref_list, mi); int internal = read_uint8(s->s); + if (internal == 1) { + mi->uninferred = jl_deserialize_value(s, &mi->uninferred); + jl_gc_wb(mi, mi->uninferred); + } mi->specTypes = (jl_value_t*)jl_deserialize_value(s, (jl_value_t**)&mi->specTypes); jl_gc_wb(mi, mi->specTypes); mi->def.value = jl_deserialize_value(s, &mi->def.value); @@ -1631,10 +1805,6 @@ static jl_value_t *jl_deserialize_value_method_instance(jl_serializer_state *s, return (jl_value_t*)mi; } - if (internal == 1) { - mi->uninferred = jl_deserialize_value(s, &mi->uninferred); - jl_gc_wb(mi, mi->uninferred); - } mi->sparam_vals = (jl_svec_t*)jl_deserialize_value(s, (jl_value_t**)&mi->sparam_vals); jl_gc_wb(mi, mi->sparam_vals); mi->backedges = (jl_array_t*)jl_deserialize_value(s, (jl_value_t**)&mi->backedges); @@ -1676,6 +1846,7 @@ static jl_value_t *jl_deserialize_value_code_instance(jl_serializer_state *s, jl if ((flags >> 3) & 1) codeinst->precompile = 1; codeinst->relocatability = read_uint8(s->s); + assert(codeinst->relocatability <= 1); codeinst->next = (jl_code_instance_t*)jl_deserialize_value(s, (jl_value_t**)&codeinst->next); jl_gc_wb(codeinst, codeinst->next); if (validate) { @@ -2023,15 +2194,121 @@ static void jl_insert_methods(jl_array_t *list) size_t i, l = jl_array_len(list); for (i = 0; i < l; i += 2) { jl_method_t *meth = (jl_method_t*)jl_array_ptr_ref(list, i); + assert(jl_is_method(meth)); assert(!meth->is_for_opaque_closure); jl_tupletype_t *simpletype = (jl_tupletype_t*)jl_array_ptr_ref(list, i + 1); - assert(jl_is_method(meth)); jl_methtable_t *mt = jl_method_get_table(meth); assert((jl_value_t*)mt != jl_nothing); jl_method_table_insert(mt, meth, simpletype); } } +void remove_code_instance_from_validation(jl_code_instance_t *codeinst) +{ + ptrhash_remove(&new_code_instance_validate, codeinst); +} + +static void jl_insert_method_instances(jl_array_t *list) +{ + size_t i, l = jl_array_len(list); + // Validate the MethodInstances + jl_array_t *valids = jl_alloc_array_1d(jl_array_uint8_type, l); + memset(jl_array_data(valids), 1, l); + size_t world = jl_atomic_load_acquire(&jl_world_counter); + for (i = 0; i < l; i++) { + jl_method_instance_t *mi = (jl_method_instance_t*)jl_array_ptr_ref(list, i); + assert(jl_is_method_instance(mi)); + if (jl_is_method(mi->def.method)) { + // Is this still the method we'd be calling? + jl_methtable_t *mt = jl_method_table_for(mi->specTypes); + struct jl_typemap_assoc search = {(jl_value_t*)mi->specTypes, world, NULL, 0, ~(size_t)0}; + jl_typemap_entry_t *entry = jl_typemap_assoc_by_type(mt->defs, &search, /*offs*/0, /*subtype*/1); + if (entry) { + jl_value_t *mworld = entry->func.value; + if (jl_is_method(mworld) && mi->def.method != (jl_method_t*)mworld && jl_type_morespecific(((jl_method_t*)mworld)->sig, mi->def.method->sig)) { + jl_array_uint8_set(valids, i, 0); + invalidate_backedges(&remove_code_instance_from_validation, mi, world, "jl_insert_method_instance"); + // The codeinst of this mi haven't yet been removed + jl_code_instance_t *codeinst = mi->cache; + while (codeinst) { + remove_code_instance_from_validation(codeinst); + codeinst = codeinst->next; + } + if (_jl_debug_method_invalidation) { + jl_array_ptr_1d_push(_jl_debug_method_invalidation, mworld); + jl_array_ptr_1d_push(_jl_debug_method_invalidation, jl_cstr_to_string("jl_method_table_insert")); // GC disabled + } + } + } + } + } + // While it's tempting to just remove the invalidated MIs altogether, + // this hurts the ability of SnoopCompile to diagnose problems. + for (i = 0; i < l; i++) { + jl_method_instance_t *mi = (jl_method_instance_t*)jl_array_ptr_ref(list, i); + jl_method_instance_t *milive = jl_specializations_get_or_insert(mi); + ptrhash_put(&uniquing_table, mi, milive); // store the association for the 2nd pass + } + // We may need to fix up the backedges for the ones that didn't "go live" + for (i = 0; i < l; i++) { + jl_method_instance_t *mi = (jl_method_instance_t*)jl_array_ptr_ref(list, i); + jl_method_instance_t *milive = (jl_method_instance_t*)ptrhash_get(&uniquing_table, mi); + if (milive != mi) { + // A previously-loaded module compiled this method, so the one we deserialized will be dropped. + // But make sure the backedges are copied over. + if (mi->backedges) { + if (!milive->backedges) { + // Copy all the backedges (after looking up the live ones) + size_t j, n = jl_array_len(mi->backedges); + milive->backedges = jl_alloc_vec_any(n); + jl_gc_wb(milive, milive->backedges); + for (j = 0; j < n; j++) { + jl_method_instance_t *be = (jl_method_instance_t*)jl_array_ptr_ref(mi->backedges, j); + jl_method_instance_t *belive = (jl_method_instance_t*)ptrhash_get(&uniquing_table, be); + if (belive == HT_NOTFOUND) + belive = be; + jl_array_ptr_set(milive->backedges, j, belive); + } + } else { + // Copy the missing backedges (this is an O(N^2) algorithm, but many methods have few MethodInstances) + size_t j, k, n = jl_array_len(mi->backedges), nlive = jl_array_len(milive->backedges); + for (j = 0; j < n; j++) { + jl_method_instance_t *be = (jl_method_instance_t*)jl_array_ptr_ref(mi->backedges, j); + jl_method_instance_t *belive = (jl_method_instance_t*)ptrhash_get(&uniquing_table, be); + if (belive == HT_NOTFOUND) + belive = be; + int found = 0; + for (k = 0; k < nlive; k++) { + if (belive == (jl_method_instance_t*)jl_array_ptr_ref(milive->backedges, k)) { + found = 1; + break; + } + } + if (!found) + jl_array_ptr_1d_push(milive->backedges, (jl_value_t*)belive); + } + } + } + // Additionally, if we have CodeInstance(s) and the running CodeInstance is world-limited, transfer it + if (mi->cache && jl_array_uint8_ref(valids, i)) { + if (!milive->cache || milive->cache->max_world < ~(size_t)0) { + jl_code_instance_t *cilive = milive->cache, *ci; + milive->cache = mi->cache; + jl_gc_wb(milive, milive->cache); + ci = mi->cache; + ci->def = milive; + while (ci->next) { + ci = ci->next; + ci->def = milive; + } + ci->next = cilive; + jl_gc_wb(ci, ci->next); + } + } + } + } +} + // verify that these edges intersect with the same methods as before static void jl_verify_edges(jl_array_t *targets, jl_array_t **pvalids) { @@ -2092,7 +2369,7 @@ static void jl_verify_edges(jl_array_t *targets, jl_array_t **pvalids) // Restore backedges to external targets // `targets` is [callee1, matches1, ...], the global set of non-worklist callees of worklist-owned methods. -// `edges` = [caller1, targets_indexes1, ...], the list of worklist-owned methods calling external methods. +// `list` = [caller1, targets_indexes1, ...], the list of worklist-owned methods calling external methods. static void jl_insert_backedges(jl_array_t *list, jl_array_t *targets) { // map(enable, ((list[i] => targets[list[i + 1] .* 2]) for i in 1:2:length(list) if all(valids[list[i + 1]]))) @@ -2104,7 +2381,6 @@ static void jl_insert_backedges(jl_array_t *list, jl_array_t *targets) for (i = 0; i < l; i += 2) { jl_method_instance_t *caller = (jl_method_instance_t*)jl_array_ptr_ref(list, i); assert(jl_is_method_instance(caller) && jl_is_method(caller->def.method)); - assert(caller->def.method->primary_world == jl_atomic_load_acquire(&jl_world_counter)); // caller should be new jl_array_t *idxs_array = (jl_array_t*)jl_array_ptr_ref(list, i + 1); assert(jl_isa((jl_value_t*)idxs_array, jl_array_int32_type)); int32_t *idxs = (int32_t*)jl_array_data(idxs_array); @@ -2124,14 +2400,18 @@ static void jl_insert_backedges(jl_array_t *list, jl_array_t *targets) } else { jl_methtable_t *mt = jl_method_table_for(callee); - assert((jl_value_t*)mt != jl_nothing); - jl_method_table_add_backedge(mt, callee, (jl_value_t*)caller); + // FIXME: rarely, `callee` has an unexpected `Union` signature, + // see https://github.com/JuliaLang/julia/pull/43990#issuecomment-1030329344 + // Fix the issue and turn this back into an `assert((jl_value_t*)mt != jl_nothing)` + // This workaround exposes us to (rare) 265-violations. + if ((jl_value_t*)mt != jl_nothing) + jl_method_table_add_backedge(mt, callee, (jl_value_t*)caller); } } // then enable it jl_code_instance_t *codeinst = caller->cache; while (codeinst) { - if (codeinst->min_world > 0) + if (ptrhash_get(&new_code_instance_validate, codeinst) != HT_NOTFOUND && codeinst->min_world > 0) codeinst->max_world = ~(size_t)0; ptrhash_remove(&new_code_instance_validate, codeinst); // mark it as handled codeinst = jl_atomic_load_relaxed(&codeinst->next); @@ -2321,6 +2601,14 @@ JL_DLLEXPORT void jl_init_restored_modules(jl_array_t *init_order) // --- entry points --- +// Register all newly-inferred MethodInstances +// This gets called as the final step of Base.include_package_for_output +JL_DLLEXPORT void jl_set_newly_inferred(jl_value_t* _newly_inferred) +{ + assert(_newly_inferred == NULL || jl_is_array(_newly_inferred)); + newly_inferred = (jl_array_t*) _newly_inferred; +} + // Serialize the modules in `worklist` to file `fname` JL_DLLEXPORT int jl_save_incremental(const char *fname, jl_array_t *worklist) { @@ -2352,6 +2640,7 @@ JL_DLLEXPORT int jl_save_incremental(const char *fname, jl_array_t *worklist) arraylist_new(&reinit_list, 0); htable_new(&edges_map, 0); htable_new(&backref_table, 5000); + htable_new(&external_mis, 0); ptrhash_put(&backref_table, jl_main_module, (char*)HT_NOTFOUND + 1); backref_table_numel = 1; jl_idtable_type = jl_base_module ? jl_get_global(jl_base_module, jl_symbol("IdDict")) : NULL; @@ -2367,6 +2656,8 @@ JL_DLLEXPORT int jl_save_incremental(const char *fname, jl_array_t *worklist) jl_array_t *ext_targets = jl_alloc_vec_any(0); // [callee1, matches1, ...] non-worklist callees of worklist-owned methods jl_array_t *edges = jl_alloc_vec_any(0); // [caller1, ext_targets_indexes1, ...] for worklist-owned methods calling external methods + int n_ext_mis = queue_external_mis(newly_inferred); + size_t i; size_t len = jl_array_len(mod_array); for (i = 0; i < len; i++) { @@ -2390,8 +2681,11 @@ JL_DLLEXPORT int jl_save_incremental(const char *fname, jl_array_t *worklist) mod_array }; jl_serialize_value(&s, worklist); // serialize module-owned items (those accessible from the bindings table) - jl_serialize_value(&s, extext_methods); // serialize new methods for external functions - // The next two allow us to restore backedges from external MethodInstances to internal ones + jl_serialize_value(&s, extext_methods); // serialize new worklist-owned methods for external functions + serialize_htable_keys(&s, &external_mis, n_ext_mis); // serialize external MethodInstances + + // The next two allow us to restore backedges from external "unserialized" (stub-serialized) MethodInstances + // to the ones we serialize here jl_serialize_value(&s, edges); jl_serialize_value(&s, ext_targets); jl_finalize_serializer(&s); @@ -2400,6 +2694,7 @@ JL_DLLEXPORT int jl_save_incremental(const char *fname, jl_array_t *worklist) jl_gc_enable(en); htable_reset(&edges_map, 0); htable_reset(&backref_table, 0); + htable_reset(&external_mis, 0); arraylist_free(&reinit_list); // Write the source-text for the dependent files @@ -2630,12 +2925,12 @@ static jl_method_t *jl_lookup_method(jl_methtable_t *mt, jl_datatype_t *sig, siz static jl_method_t *jl_recache_method(jl_method_t *m) { assert(!m->is_for_opaque_closure); + assert(jl_is_method(m)); jl_datatype_t *sig = (jl_datatype_t*)m->sig; jl_methtable_t *mt = jl_method_get_table(m); assert((jl_value_t*)mt != jl_nothing); jl_set_typeof(m, (void*)(intptr_t)0x30); // invalidate the old value to help catch errors - jl_method_t *_new = jl_lookup_method(mt, sig, m->module->primary_world); - return _new; + return jl_lookup_method(mt, sig, m->module->primary_world); } static jl_value_t *jl_recache_other_(jl_value_t *o); @@ -2694,6 +2989,34 @@ static void jl_recache_other(void) flagref_list.len = 0; } +// Wait to copy roots until recaching is done +// This is because recaching requires that all pointers to methods and methodinstances +// stay at their source location as recorded by flagref_list. Once recaching is complete, +// they can be safely copied over. +static void jl_copy_roots(void) +{ + size_t i, j, l; + for (i = 0; i < queued_method_roots.size; i+=2) { + jl_method_t *m = (jl_method_t*)queued_method_roots.table[i]; + m = (jl_method_t*)ptrhash_get(&uniquing_table, m); + jl_svec_t *keyroots = (jl_svec_t*)queued_method_roots.table[i+1]; + if (keyroots != HT_NOTFOUND) { + uint64_t key = (uint64_t)(uintptr_t)jl_svec_ref(keyroots, 0) | ((uint64_t)(uintptr_t)jl_svec_ref(keyroots, 1) << 32); + jl_array_t *roots = (jl_array_t*)jl_svec_ref(keyroots, 2); + assert(jl_is_array(roots)); + l = jl_array_len(roots); + for (j = 0; j < l; j++) { + jl_value_t *r = jl_array_ptr_ref(roots, j); + jl_value_t *newr = (jl_value_t*)ptrhash_get(&uniquing_table, r); + if (newr != HT_NOTFOUND) { + jl_array_ptr_set(roots, j, newr); + } + } + jl_append_method_roots(m, key, roots); + } + } +} + static int trace_method(jl_typemap_entry_t *entry, void *closure) { jl_call_tracer(jl_newmeth_tracer, (jl_value_t*)entry->func.method); @@ -2741,6 +3064,7 @@ static jl_value_t *_jl_restore_incremental(ios_t *f, jl_array_t *mod_array) arraylist_new(&backref_list, 4000); arraylist_push(&backref_list, jl_main_module); arraylist_new(&flagref_list, 0); + htable_new(&queued_method_roots, 0); htable_new(&new_code_instance_validate, 0); arraylist_new(&ccallable_list, 0); htable_new(&uniquing_table, 0); @@ -2756,6 +3080,11 @@ static jl_value_t *_jl_restore_incremental(ios_t *f, jl_array_t *mod_array) // See explanation in jl_save_incremental for variables of the same names jl_value_t *extext_methods = jl_deserialize_value(&s, &extext_methods); + int i, n_ext_mis = read_int32(s.s); + jl_array_t *mi_list = jl_alloc_vec_any(n_ext_mis); // reload MIs stored by serialize_htable_keys + jl_value_t **midata = (jl_value_t**)jl_array_data(mi_list); + for (i = 0; i < n_ext_mis; i++) + midata[i] = jl_deserialize_value(&s, &(midata[i])); jl_value_t *edges = jl_deserialize_value(&s, &edges); jl_value_t *ext_targets = jl_deserialize_value(&s, &ext_targets); @@ -2766,9 +3095,11 @@ static jl_value_t *_jl_restore_incremental(ios_t *f, jl_array_t *mod_array) // at this point, the AST is fully reconstructed, but still completely disconnected // now all of the interconnects will be created jl_recache_types(); // make all of the types identities correct - htable_reset(&uniquing_table, 0); jl_insert_methods((jl_array_t*)extext_methods); // hook up extension methods for external generic functions (needs to be after recache types) jl_recache_other(); // make all of the other objects identities correct (needs to be after insert methods) + jl_copy_roots(); // copying new roots of external methods (must wait until recaching is complete) + // At this point, the novel specializations in mi_list reference the real method, but they haven't been cached in its specializations + jl_insert_method_instances(mi_list); // insert novel specializations htable_free(&uniquing_table); jl_array_t *init_order = jl_finalize_deserializer(&s, tracee_list); // done with f and s (needs to be after recache) if (init_order == NULL) @@ -2787,6 +3118,7 @@ static jl_value_t *_jl_restore_incremental(ios_t *f, jl_array_t *mod_array) htable_free(&new_code_instance_validate); arraylist_free(&flagref_list); arraylist_free(&backref_list); + htable_free(&queued_method_roots); ios_close(f); jl_gc_enable_finalizers(ct, 1); // make sure we don't run any Julia code concurrently before this point diff --git a/src/gf.c b/src/gf.c index 25b29c63a0782..2b5d17c408299 100644 --- a/src/gf.c +++ b/src/gf.c @@ -99,7 +99,7 @@ static int speccache_eq(size_t idx, const void *ty, jl_svec_t *data, uint_t hv) } // get or create the MethodInstance for a specialization -JL_DLLEXPORT jl_method_instance_t *jl_specializations_get_linfo(jl_method_t *m JL_PROPAGATES_ROOT, jl_value_t *type, jl_svec_t *sparams) +static jl_method_instance_t *jl_specializations_get_linfo_(jl_method_t *m JL_PROPAGATES_ROOT, jl_value_t *type, jl_svec_t *sparams, jl_method_instance_t *mi_insert) { if (m->sig == (jl_value_t*)jl_anytuple_type && m->unspecialized) return m->unspecialized; // handle builtin methods @@ -150,7 +150,7 @@ JL_DLLEXPORT jl_method_instance_t *jl_specializations_get_linfo(jl_method_t *m J assert(!jl_types_equal(mi->specTypes, type)); } } - jl_method_instance_t *mi = jl_get_specialized(m, type, sparams); + jl_method_instance_t *mi = mi_insert ? mi_insert : jl_get_specialized(m, type, sparams); JL_GC_PUSH1(&mi); if (hv ? (i + 1 >= cl || jl_svecref(specializations, i + 1) != jl_nothing) : (i <= 1 || jl_svecref(specializations, i - 2) != jl_nothing)) { size_t ncl = cl < 8 ? 8 : (cl*3)>>1; @@ -184,6 +184,19 @@ JL_DLLEXPORT jl_method_instance_t *jl_specializations_get_linfo(jl_method_t *m J } } +JL_DLLEXPORT jl_method_instance_t *jl_specializations_get_linfo(jl_method_t *m JL_PROPAGATES_ROOT, jl_value_t *type, jl_svec_t *sparams) +{ + return jl_specializations_get_linfo_(m, type, sparams, NULL); +} + +jl_method_instance_t *jl_specializations_get_or_insert(jl_method_instance_t *mi) +{ + jl_method_t *m = mi->def.method; + jl_value_t *type = mi->specTypes; + jl_svec_t *sparams = mi->sparam_vals; + return jl_specializations_get_linfo_(m, type, sparams, mi); +} + JL_DLLEXPORT jl_value_t *jl_specializations_lookup(jl_method_t *m, jl_value_t *type) { jl_value_t *mi = (jl_value_t*)jl_specializations_get_linfo(m, type, NULL); @@ -1390,8 +1403,10 @@ static void invalidate_external(jl_method_instance_t *mi, size_t max_world) { } } +static void do_nothing_with_codeinst(jl_code_instance_t *ci) {} + // recursively invalidate cached methods that had an edge to a replaced method -static void invalidate_method_instance(jl_method_instance_t *replaced, size_t max_world, int depth) +static void invalidate_method_instance(void (*f)(jl_code_instance_t*), jl_method_instance_t *replaced, size_t max_world, int depth) { if (_jl_debug_method_invalidation) { jl_value_t *boxeddepth = NULL; @@ -1411,6 +1426,7 @@ static void invalidate_method_instance(jl_method_instance_t *replaced, size_t ma codeinst->max_world = max_world; } assert(codeinst->max_world <= max_world); + (*f)(codeinst); codeinst = jl_atomic_load_relaxed(&codeinst->next); } // recurse to all backedges to update their valid range also @@ -1420,14 +1436,14 @@ static void invalidate_method_instance(jl_method_instance_t *replaced, size_t ma size_t i, l = jl_array_len(backedges); for (i = 0; i < l; i++) { jl_method_instance_t *replaced = (jl_method_instance_t*)jl_array_ptr_ref(backedges, i); - invalidate_method_instance(replaced, max_world, depth + 1); + invalidate_method_instance(f, replaced, max_world, depth + 1); } } JL_UNLOCK(&replaced->def.method->writelock); } // invalidate cached methods that overlap this definition -static void invalidate_backedges(jl_method_instance_t *replaced_mi, size_t max_world, const char *why) +void invalidate_backedges(void (*f)(jl_code_instance_t*), jl_method_instance_t *replaced_mi, size_t max_world, const char *why) { JL_LOCK(&replaced_mi->def.method->writelock); jl_array_t *backedges = replaced_mi->backedges; @@ -1437,7 +1453,7 @@ static void invalidate_backedges(jl_method_instance_t *replaced_mi, size_t max_w size_t i, l = jl_array_len(backedges); jl_method_instance_t **replaced = (jl_method_instance_t**)jl_array_ptr_data(backedges); for (i = 0; i < l; i++) { - invalidate_method_instance(replaced[i], max_world, 1); + invalidate_method_instance(f, replaced[i], max_world, 1); } } JL_UNLOCK(&replaced_mi->def.method->writelock); @@ -1600,7 +1616,7 @@ static void jl_method_table_invalidate(jl_methtable_t *mt, jl_typemap_entry_t *m if ((jl_value_t*)mi != jl_nothing) { invalidated = 1; invalidate_external(mi, methodentry->max_world); - invalidate_backedges(mi, methodentry->max_world, "jl_method_table_disable"); + invalidate_backedges(&do_nothing_with_codeinst, mi, methodentry->max_world, "jl_method_table_disable"); } } if (invalidated && _jl_debug_method_invalidation) { @@ -1731,7 +1747,7 @@ JL_DLLEXPORT void jl_method_table_insert(jl_methtable_t *mt, jl_method_t *method if (missing) { jl_method_instance_t *backedge = (jl_method_instance_t*)backedges[i]; invalidate_external(backedge, max_world); - invalidate_method_instance(backedge, max_world, 0); + invalidate_method_instance(&do_nothing_with_codeinst, backedge, max_world, 0); invalidated = 1; if (_jl_debug_method_invalidation) jl_array_ptr_1d_push(_jl_debug_method_invalidation, (jl_value_t*)backedgetyp); @@ -1801,7 +1817,7 @@ JL_DLLEXPORT void jl_method_table_insert(jl_methtable_t *mt, jl_method_t *method invalidate_external(mi, max_world); if (mi->backedges) { invalidated = 1; - invalidate_backedges(mi, max_world, "jl_method_table_insert"); + invalidate_backedges(&do_nothing_with_codeinst, mi, max_world, "jl_method_table_insert"); } } } @@ -2238,6 +2254,7 @@ JL_DLLEXPORT int jl_compile_hint(jl_tupletype_t *types) if (mi == NULL) return 0; JL_GC_PROMISE_ROOTED(mi); + mi->precompiled = 1; if (jl_generating_output()) { jl_compile_now(mi); // In addition to full compilation of the compilation-signature, if `types` is more specific (e.g. due to nospecialize), @@ -2252,6 +2269,7 @@ JL_DLLEXPORT int jl_compile_hint(jl_tupletype_t *types) types2 = jl_type_intersection_env((jl_value_t*)types, (jl_value_t*)mi->def.method->sig, &tpenv2); jl_method_instance_t *li2 = jl_specializations_get_linfo(mi->def.method, (jl_value_t*)types2, tpenv2); JL_GC_POP(); + li2->precompiled = 1; if (jl_rettype_inferred(li2, world, world) == jl_nothing) (void)jl_type_infer(li2, world, 1); if (jl_typeinf_func && mi->def.method->primary_world <= tworld) { diff --git a/src/jltypes.c b/src/jltypes.c index cb9141dd50fd4..a24e9f7e488bd 100644 --- a/src/jltypes.c +++ b/src/jltypes.c @@ -2466,7 +2466,7 @@ void jl_init_types(void) JL_GC_DISABLED jl_method_instance_type = jl_new_datatype(jl_symbol("MethodInstance"), core, jl_any_type, jl_emptysvec, - jl_perm_symsvec(8, + jl_perm_symsvec(9, "def", "specTypes", "sparam_vals", @@ -2474,8 +2474,9 @@ void jl_init_types(void) JL_GC_DISABLED "backedges", "callbacks", "cache", - "inInference"), - jl_svec(8, + "inInference", + "precompiled"), + jl_svec(9, jl_new_struct(jl_uniontype_type, jl_method_type, jl_module_type), jl_any_type, jl_simplevector_type, @@ -2483,6 +2484,7 @@ void jl_init_types(void) JL_GC_DISABLED jl_any_type, jl_any_type, jl_any_type, + jl_bool_type, jl_bool_type), jl_emptysvec, 0, 1, 3); diff --git a/src/julia.h b/src/julia.h index d726162b88213..afb0d00630dbd 100644 --- a/src/julia.h +++ b/src/julia.h @@ -361,6 +361,7 @@ struct _jl_method_instance_t { jl_array_t *callbacks; // list of callback functions to inform external caches about invalidations _Atomic(struct _jl_code_instance_t*) cache; uint8_t inInference; // flags to tell if inference is running on this object + uint8_t precompiled; // true if this instance was generated by an explicit `precompile(...)` call }; // OpaqueClosure @@ -1723,6 +1724,7 @@ JL_DLLEXPORT ios_t *jl_create_system_image(void *); JL_DLLEXPORT void jl_save_system_image(const char *fname); JL_DLLEXPORT void jl_restore_system_image(const char *fname); JL_DLLEXPORT void jl_restore_system_image_data(const char *buf, size_t len); +JL_DLLEXPORT void jl_set_newly_inferred(jl_value_t *newly_inferred); JL_DLLEXPORT int jl_save_incremental(const char *fname, jl_array_t *worklist); JL_DLLEXPORT jl_value_t *jl_restore_incremental(const char *fname, jl_array_t *depmods); JL_DLLEXPORT jl_value_t *jl_restore_incremental_from_buf(const char *buf, size_t sz, jl_array_t *depmods); diff --git a/src/julia_internal.h b/src/julia_internal.h index 3d43584faf0c4..21c46129b7149 100644 --- a/src/julia_internal.h +++ b/src/julia_internal.h @@ -223,6 +223,7 @@ extern tracer_cb jl_newmeth_tracer; void jl_call_tracer(tracer_cb callback, jl_value_t *tracee); void print_func_loc(JL_STREAM *s, jl_method_t *m); extern jl_array_t *_jl_debug_method_invalidation JL_GLOBALLY_ROOTED; +void invalidate_backedges(void (*f)(jl_code_instance_t*), jl_method_instance_t *replaced_mi, size_t max_world, const char *why); extern JL_DLLEXPORT size_t jl_page_size; extern jl_function_t *jl_typeinf_func; @@ -535,8 +536,10 @@ void jl_resolve_globals_in_ir(jl_array_t *stmts, jl_module_t *m, jl_svec_t *spar int binding_effects); JL_DLLEXPORT void jl_add_method_root(jl_method_t *m, jl_module_t *mod, jl_value_t* root); +void jl_append_method_roots(jl_method_t *m, uint64_t modid, jl_array_t* roots); int get_root_reference(rle_reference *rr, jl_method_t *m, size_t i); jl_value_t *lookup_root(jl_method_t *m, uint64_t key, int index); +int nroots_with_key(jl_method_t *m, uint64_t key); int jl_valid_type_param(jl_value_t *v); @@ -864,6 +867,7 @@ JL_DLLEXPORT jl_code_instance_t *jl_method_compiled(jl_method_instance_t *mi JL_ JL_DLLEXPORT jl_value_t *jl_methtable_lookup(jl_methtable_t *mt, jl_value_t *type, size_t world); JL_DLLEXPORT jl_method_instance_t *jl_specializations_get_linfo( jl_method_t *m JL_PROPAGATES_ROOT, jl_value_t *type, jl_svec_t *sparams); +jl_method_instance_t *jl_specializations_get_or_insert(jl_method_instance_t *mi_ins); JL_DLLEXPORT void jl_method_instance_add_backedge(jl_method_instance_t *callee, jl_method_instance_t *caller); JL_DLLEXPORT void jl_method_table_add_backedge(jl_methtable_t *mt, jl_value_t *typ, jl_value_t *caller); diff --git a/src/method.c b/src/method.c index f71bb8803caf0..7325670bd76a4 100644 --- a/src/method.c +++ b/src/method.c @@ -439,6 +439,7 @@ JL_DLLEXPORT jl_method_instance_t *jl_new_method_instance_uninit(void) li->callbacks = NULL; jl_atomic_store_relaxed(&li->cache, NULL); li->inInference = 0; + li->precompiled = 0; return li; } @@ -1033,15 +1034,8 @@ static void add_root_block(jl_array_t *root_blocks, uint64_t modid, size_t len) blocks[nx2-1] = len; } -JL_DLLEXPORT void jl_add_method_root(jl_method_t *m, jl_module_t *mod, jl_value_t* root) +static void prepare_method_for_roots(jl_method_t *m, uint64_t modid) { - JL_GC_PUSH2(&m, &root); - uint64_t modid = 0; - if (mod) { - assert(jl_is_module(mod)); - modid = mod->build_id; - } - assert(jl_is_method(m)); if (!m->roots) { m->roots = jl_alloc_vec_any(0); jl_gc_wb(m, m->roots); @@ -1050,12 +1044,35 @@ JL_DLLEXPORT void jl_add_method_root(jl_method_t *m, jl_module_t *mod, jl_value_ m->root_blocks = jl_alloc_array_1d(jl_array_uint64_type, 0); jl_gc_wb(m, m->root_blocks); } +} + +JL_DLLEXPORT void jl_add_method_root(jl_method_t *m, jl_module_t *mod, jl_value_t* root) +{ + JL_GC_PUSH2(&m, &root); + uint64_t modid = 0; + if (mod) { + assert(jl_is_module(mod)); + modid = mod->build_id; + } + assert(jl_is_method(m)); + prepare_method_for_roots(m, modid); if (current_root_id(m->root_blocks) != modid) add_root_block(m->root_blocks, modid, jl_array_len(m->roots)); jl_array_ptr_1d_push(m->roots, root); JL_GC_POP(); } +void jl_append_method_roots(jl_method_t *m, uint64_t modid, jl_array_t* roots) +{ + JL_GC_PUSH2(&m, &roots); + assert(jl_is_method(m)); + assert(jl_is_array(roots)); + prepare_method_for_roots(m, modid); + add_root_block(m->root_blocks, modid, jl_array_len(m->roots)); + jl_array_ptr_1d_append(m->roots, roots); + JL_GC_POP(); +} + // given the absolute index i of a root, retrieve its relocatable reference // returns 1 if the root is relocatable int get_root_reference(rle_reference *rr, jl_method_t *m, size_t i) @@ -1084,6 +1101,23 @@ jl_value_t *lookup_root(jl_method_t *m, uint64_t key, int index) return jl_array_ptr_ref(m->roots, i); } +int nroots_with_key(jl_method_t *m, uint64_t key) +{ + size_t nroots = 0; + if (m->roots) + nroots = jl_array_len(m->roots); + if (!m->root_blocks) + return key == 0 ? nroots : 0; + uint64_t *rletable = (uint64_t*)jl_array_data(m->root_blocks); + size_t j, nblocks2 = jl_array_len(m->root_blocks); + int nwithkey = 0; + for (j = 0; j < nblocks2; j+=2) { + if (rletable[j] == key) + nwithkey += (j+3 < nblocks2 ? rletable[j+3] : nroots) - rletable[j+1]; + } + return nwithkey; +} + #ifdef __cplusplus } #endif diff --git a/stdlib/Artifacts/src/Artifacts.jl b/stdlib/Artifacts/src/Artifacts.jl index 645e77944208b..6d3bdb5fb674b 100644 --- a/stdlib/Artifacts/src/Artifacts.jl +++ b/stdlib/Artifacts/src/Artifacts.jl @@ -272,17 +272,17 @@ function unpack_platform(entry::Dict{String,Any}, name::String, end # Collect all String-valued mappings in `entry` and use them as tags - tags = Dict{Symbol, String}() + tags = Dict{String, String}() for (k, v) in entry if v isa String - tags[Symbol(k)] = v + tags[k] = v end end # Removing some known entries that shouldn't be passed through `tags` - delete!(tags, :os) - delete!(tags, :arch) - delete!(tags, Symbol("git-tree-sha1")) - return Platform(entry["arch"], entry["os"]; tags...) + delete!(tags, "os") + delete!(tags, "arch") + delete!(tags, "git-tree-sha1") + return Platform(entry["arch"], entry["os"], tags) end function pack_platform!(meta::Dict, p::AbstractPlatform) @@ -718,4 +718,9 @@ split_artifact_slash(name::AbstractString) = artifact_slash_lookup(name::AbstractString, artifact_dict::Dict, artifacts_toml::AbstractString) = artifact_slash_lookup(String(name)::String, artifact_dict, String(artifacts_toml)::String) +# Precompilation to reduce latency +precompile(load_artifacts_toml, (String,)) +precompile(NamedTuple{(:pkg_uuid,)}, (Tuple{Base.UUID},)) +precompile(Core.kwfunc(load_artifacts_toml), (NamedTuple{(:pkg_uuid,), Tuple{Base.UUID}}, typeof(load_artifacts_toml), String)) + end # module Artifacts diff --git a/test/precompile.jl b/test/precompile.jl index 411267705622d..d39dcd9f7ccb8 100644 --- a/test/precompile.jl +++ b/test/precompile.jl @@ -83,7 +83,6 @@ function group_roots(iter::RLEIterator) return rootsby end - precompile_test_harness("basic precompile functionality") do dir2 precompile_test_harness(false) do dir Foo_file = joinpath(dir, "$Foo_module.jl") @@ -585,11 +584,11 @@ precompile_test_harness(false) do dir end end -# method root provenance -# setindex!(::Dict{K,V}, ::Any, ::K) adds both compression and codegen roots +# method root provenance & external code caching precompile_test_harness("code caching") do dir Bid = rootid(Base) Cache_module = :Cacheb8321416e8a3e2f1 + # Note: calling setindex!(::Dict{K,V}, ::Any, ::K) adds both compression and codegen roots write(joinpath(dir, "$Cache_module.jl"), """ module $Cache_module @@ -619,33 +618,59 @@ precompile_test_harness("code caching") do dir Base.compilecache(Base.PkgId(string(Cache_module))) @eval using $Cache_module M = getfield(@__MODULE__, Cache_module) + # Test that this cache file "owns" all the roots Mid = rootid(M) for name in (:f, :fpush, :callboth) func = getfield(M, name) m = only(collect(methods(func))) @test all(i -> root_provenance(m, i) == Mid, 1:length(m.roots)) end + # Check that we can cache external CodeInstances: + # size(::Vector) has an inferred specialization for Vector{X} + msize = which(size, (Vector{<:Any},)) + hasspec = false + for i = 1:length(msize.specializations) + if isassigned(msize.specializations, i) + mi = msize.specializations[i] + if isa(mi, Core.MethodInstance) + tt = Base.unwrap_unionall(mi.specTypes) + if tt.parameters[2] == Vector{Cacheb8321416e8a3e2f1.X} + if isdefined(mi, :cache) && isa(mi.cache, Core.CodeInstance) && mi.cache.max_world == typemax(UInt) && mi.cache.inferred !== nothing + hasspec = true + break + end + end + end + end + end + @test hasspec + # Test that compilation adds to method roots with appropriate provenance m = which(setindex!, (Dict{M.X,Any}, Any, M.X)) - @test_broken M.X ∈ m.roots # requires caching external compilation results + @test M.X ∈ m.roots + # Check that roots added outside of incremental builds get attributed to a moduleid of 0 Base.invokelatest() do Dict{M.X2,Any}()[M.X2()] = nothing end @test M.X2 ∈ m.roots groups = group_roots(m) - @test_broken M.X ∈ groups[Mid] # requires caching external compilation results - @test M.X2 ∈ groups[rootid(@__MODULE__)] + @test M.X ∈ groups[Mid] # attributed to M + @test M.X2 ∈ groups[0] # activate module is not known @test !isempty(groups[Bid]) + # Check that internal methods and their roots are accounted appropriately minternal = which(M.getelsize, (Vector,)) mi = minternal.specializations[1] + @test Base.unwrap_unionall(mi.specTypes).parameters[2] == Vector{Int32} ci = mi.cache @test ci.relocatability == 1 + @test ci.inferred !== nothing + # ...and that we can add "untracked" roots & non-relocatable CodeInstances to them too Base.invokelatest() do M.getelsize(M.X2[]) end mi = minternal.specializations[2] ci = mi.cache @test ci.relocatability == 0 - # PkgA loads PkgB, and both add roots to the same method (both before and after loading B) + # PkgA loads PkgB, and both add roots to the same `push!` method (both before and after loading B) Cache_module2 = :Cachea1544c83560f0c99 write(joinpath(dir, "$Cache_module2.jl"), """ @@ -677,11 +702,175 @@ precompile_test_harness("code caching") do dir end mT = which(push!, (Vector{T} where T, Any)) groups = group_roots(mT) - # all below require caching external CodeInstances - @test_broken M2.Y ∈ groups[M2id] - @test_broken M2.Z ∈ groups[M2id] - @test_broken M.X ∈ groups[Mid] - @test_broken M.X ∉ groups[M2id] + @test M2.Y ∈ groups[M2id] + @test M2.Z ∈ groups[M2id] + @test M.X ∈ groups[Mid] + @test M.X ∉ groups[M2id] + # backedges of external MethodInstances + # Root gets used by RootA and RootB, and both consumers end up inferring the same MethodInstance from Root + # Do both callers get listed as backedges? + RootModule = :Root_0xab07d60518763a7e + write(joinpath(dir, "$RootModule.jl"), + """ + module $RootModule + function f(x) + while x < 10 + x += oftype(x, 1) + end + return x + end + g1() = f(Int16(9)) + g2() = f(Int16(9)) + # all deliberately uncompiled + end + """) + RootA = :RootA_0xab07d60518763a7e + write(joinpath(dir, "$RootA.jl"), + """ + module $RootA + using $RootModule + fA() = $RootModule.f(Int8(4)) + fA() + $RootModule.g1() + end + """) + RootB = :RootB_0xab07d60518763a7e + write(joinpath(dir, "$RootB.jl"), + """ + module $RootB + using $RootModule + fB() = $RootModule.f(Int8(4)) + fB() + $RootModule.g2() + end + """) + Base.compilecache(Base.PkgId(string(RootA))) + Base.compilecache(Base.PkgId(string(RootB))) + @eval using $RootA + @eval using $RootB + MA = getfield(@__MODULE__, RootA) + MB = getfield(@__MODULE__, RootB) + M = getfield(MA, RootModule) + m = which(M.f, (Any,)) + for mi in m.specializations + mi === nothing && continue + if mi.specTypes.parameters[2] === Int8 + # external callers + mods = Module[] + for be in mi.backedges + push!(mods, be.def.module) + end + @test MA ∈ mods + @test MB ∈ mods + @test length(mods) == 2 + elseif mi.specTypes.parameters[2] === Int16 + # internal callers + meths = Method[] + for be in mi.backedges + push!(meths, be.def) + end + @test which(M.g1, ()) ∈ meths + @test which(M.g2, ()) ∈ meths + @test length(meths) == 2 + end + end + + # Invalidations (this test is adapted from from SnoopCompile) + function hasvalid(mi, world) + isdefined(mi, :cache) || return false + ci = mi.cache + while true + ci.max_world >= world && return true + isdefined(ci, :next) || return false + ci = ci.next + end + end + + StaleA = :StaleA_0xab07d60518763a7e + StaleB = :StaleB_0xab07d60518763a7e + StaleC = :StaleC_0xab07d60518763a7e + write(joinpath(dir, "$StaleA.jl"), + """ + module $StaleA + + stale(x) = rand(1:8) + stale(x::Int) = length(digits(x)) + + not_stale(x::String) = first(x) + + use_stale(c) = stale(c[1]) + not_stale("hello") + build_stale(x) = use_stale(Any[x]) + + # force precompilation + build_stale(37) + stale('c') + + end + """ + ) + write(joinpath(dir, "$StaleB.jl"), + """ + module $StaleB + + # StaleB does not know about StaleC when it is being built. + # However, if StaleC is loaded first, we get `"jl_insert_method_instance"` + # invalidations. + using $StaleA + + # This will be invalidated if StaleC is loaded + useA() = $StaleA.stale("hello") + + # force precompilation + useA() + + end + """ + ) + write(joinpath(dir, "$StaleC.jl"), + """ + module $StaleC + + using $StaleA + + $StaleA.stale(x::String) = length(x) + call_buildstale(x) = $StaleA.build_stale(x) + + call_buildstale("hey") + + end # module + """ + ) + for pkg in (StaleA, StaleB, StaleC) + Base.compilecache(Base.PkgId(string(pkg))) + end + @eval using $StaleA + @eval using $StaleC + @eval using $StaleB + MA = getfield(@__MODULE__, StaleA) + MB = getfield(@__MODULE__, StaleB) + MC = getfield(@__MODULE__, StaleC) + world = Base.get_world_counter() + m = only(methods(MA.use_stale)) + mi = m.specializations[1] + @test hasvalid(mi, world) # it was re-inferred by StaleC + m = only(methods(MA.build_stale)) + mis = filter(!isnothing, collect(m.specializations)) + @test length(mis) == 2 + for mi in mis + if mi.specTypes.parameters[2] == Int + @test mi.cache.max_world < world + else + # The variant for String got "healed" by recompilation in StaleC + @test mi.specTypes.parameters[2] == String + @test mi.cache.max_world == typemax(UInt) + end + end + m = only(methods(MB.useA)) + mi = m.specializations[1] + @test !hasvalid(mi, world) # invalidated by the stale(x::String) method in StaleC + m = only(methods(MC.call_buildstale)) + mi = m.specializations[1] + @test hasvalid(mi, world) # was compiled with the new method end # test --compiled-modules=no command line option From f9c76f0bcb2a26c8d96d878d1c480bf48b0460a0 Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Mon, 28 Feb 2022 13:52:28 -0500 Subject: [PATCH 030/369] Add Pkg 1.8 news (#44370) --- NEWS.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/NEWS.md b/NEWS.md index b82e28130852f..caf9cd14a4568 100644 --- a/NEWS.md +++ b/NEWS.md @@ -111,6 +111,26 @@ Standard library changes * Intersect returns a result with the eltype of the type-promoted eltypes of the two inputs ([#41769]). * Iterating an `Iterators.Reverse` now falls back on reversing the eachindex iterator, if possible ([#43110]). +#### Package Manager + +* New `⌃` and `⌅` indicators beside packages in `pkg> status` that have new versions available. + `⌅` indicates when new versions cannot be installed ([Pkg#2906]). +* New `outdated::Bool` kwarg to `Pkg.status` (`--outdated` or `-o` in the REPL mode) to show + information about packages not at the latest version ([Pkg#2284]). +* New `compat::Bool` kwarg to `Pkg.status` (`--compat` or `-c` in the REPL mode) to show any [compat] + entries in the Project.toml ([Pkg#2702]). +* New `pkg> compat` (and `Pkg.compat`) mode for setting Project compat entries. Provides an interactive editor + via `pkg> compat`, or direct entry manipulation via `pkg> Foo 0.4,0.5` which can load current entries via tab-completion. + i.e. `pkg> compat Fo` autocompletes to `pkg> Foo 0.4,0.5` so that the existing entry can be edited ([Pkg#2702]). +* Pkg now only tries to download packages from the package server in case the server tracks a registry that contains + the package ([Pkg#2689]). +* `Pkg.instantiate` will now warn when a Project.toml is out of sync with a Manifest.toml. It does this by storing a hash + of the project deps and compat entries (other fields are ignored) in the manifest when it is resolved, so that any change + to the Project.toml deps or compat entries without a re-resolve can be detected ([Pkg#2815]). +* If `pkg> add` cannot find a package with the provided name it will now suggest similarly named packages that can be added ([Pkg#2985]). +* The julia version stored in the manifest no longer includes the build number i.e. master will now record as `1.9.0-DEV` ([Pkg#2995]). +* Interrupting a `pkg> test` will now be caught more reliably and exit back to the REPL gracefully ([Pkg#2933]). + #### InteractiveUtils * New macro `@time_imports` for reporting any time spent importing packages and their dependencies ([#41612]). @@ -211,6 +231,16 @@ Tooling Improvements * `GC.enable_logging(true)` can be used to log each garbage collection, with the time it took and the amount of memory that was collected ([#43511]). + + +[Pkg#2284]: https://github.com/JuliaLang/Pkg.jl/issues/2284 +[Pkg#2689]: https://github.com/JuliaLang/Pkg.jl/issues/2689 +[Pkg#2702]: https://github.com/JuliaLang/Pkg.jl/issues/2702 +[Pkg#2815]: https://github.com/JuliaLang/Pkg.jl/issues/2815 +[Pkg#2906]: https://github.com/JuliaLang/Pkg.jl/issues/2906 +[Pkg#2933]: https://github.com/JuliaLang/Pkg.jl/issues/2933 +[Pkg#2985]: https://github.com/JuliaLang/Pkg.jl/issues/2985 +[Pkg#2995]: https://github.com/JuliaLang/Pkg.jl/issues/2995 [#33711]: https://github.com/JuliaLang/julia/issues/33711 From 4857cd2e60de994074a92be0c2ed3510f360f25c Mon Sep 17 00:00:00 2001 From: Philip Tellis Date: Mon, 28 Feb 2022 15:52:39 -0500 Subject: [PATCH 031/369] Fix hyperlinks in 1.8 news (#44371) (cherry-picked from 675911a6ea263a4b0ec3654df9c84aec7285f027) --- NEWS.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index caf9cd14a4568..03ac98b71b198 100644 --- a/NEWS.md +++ b/NEWS.md @@ -17,7 +17,7 @@ New language features * `∀`, `∃`, and `∄` are now allowed as identifier characters ([#42314]). * Support for Unicode 14.0.0 ([#43443]). * `Module(:name, false, false)` can be used to create a `module` that contains no names - (it does not import `Base` or `Core` and does not contain a reference to itself) ([#40110, #42154]). + (it does not import `Base` or `Core` and does not contain a reference to itself) ([#40110], [#42154]). Language changes ---------------- @@ -250,6 +250,7 @@ Tooling Improvements [#38791]: https://github.com/JuliaLang/julia/issues/38791 [#39241]: https://github.com/JuliaLang/julia/issues/39241 [#39245]: https://github.com/JuliaLang/julia/issues/39245 +[#40110]: https://github.com/JuliaLang/julia/issues/40110 [#40382]: https://github.com/JuliaLang/julia/issues/40382 [#40642]: https://github.com/JuliaLang/julia/issues/40642 [#40783]: https://github.com/JuliaLang/julia/issues/40783 @@ -268,6 +269,7 @@ Tooling Improvements [#41794]: https://github.com/JuliaLang/julia/issues/41794 [#41888]: https://github.com/JuliaLang/julia/issues/41888 [#41936]: https://github.com/JuliaLang/julia/issues/41936 +[#42154]: https://github.com/JuliaLang/julia/issues/42154 [#42211]: https://github.com/JuliaLang/julia/issues/42211 [#42225]: https://github.com/JuliaLang/julia/issues/42225 [#42248]: https://github.com/JuliaLang/julia/issues/42248 From 3d8dadb9d8f7d8df1735337313970d02d4e0bfa9 Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Thu, 3 Mar 2022 05:36:37 -0600 Subject: [PATCH 032/369] Add NEWS on precompilation (#44325) --- NEWS.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/NEWS.md b/NEWS.md index 03ac98b71b198..4783338b4b525 100644 --- a/NEWS.md +++ b/NEWS.md @@ -54,6 +54,12 @@ Compiler/Runtime improvements Code heavily dependent on constant propagation should see significant compile-time performance improvements and certain cases (e.g. calls to uninlinable functions that are nevertheless effect free) should see runtime performance improvements. Effects may be overwritten manually with the `@Base.assume_effects` macro ([#43852]). +* Precompilation (with explicit `precompile` directives or representative workloads) now saves more type-inferred code, + resulting in reduced time-to-first task for packages that use precompilation. This change also eliminates the + runtime performance degradation occasionally triggered by precompilation on older Julia versions. More specifically, + any newly-inferred method/type combinations needed by your package--regardless of where those methods were + defined--can now be cached in the precompile file, as long as they are inferrably called by a method owned by + your package ([#43990]). Command-line option changes --------------------------- @@ -306,5 +312,6 @@ Tooling Improvements [#43852]: https://github.com/JuliaLang/julia/issues/43852 [#43865]: https://github.com/JuliaLang/julia/issues/43865 [#43919]: https://github.com/JuliaLang/julia/issues/43919 +[#43990]: https://github.com/JuliaLang/julia/issues/43990 [#44080]: https://github.com/JuliaLang/julia/issues/44080 [#44136]: https://github.com/JuliaLang/julia/issues/44136 From 5d3ebe0fa574b4ff47ee6a939f064331bc398f77 Mon Sep 17 00:00:00 2001 From: "Viral B. Shah" Date: Sat, 19 Feb 2022 17:13:58 -0500 Subject: [PATCH 033/369] Update LBT to 5.0.1 for source build (#44258) (cherry picked from commit 627016aaadc7c01f50f18bc9ff3fa40a02ce3f20) --- deps/blastrampoline.version | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deps/blastrampoline.version b/deps/blastrampoline.version index 86d77ab5bf293..23074f70854dc 100644 --- a/deps/blastrampoline.version +++ b/deps/blastrampoline.version @@ -1,2 +1,2 @@ -BLASTRAMPOLINE_BRANCH=v3.0.4 -BLASTRAMPOLINE_SHA1=23de7a09bf354fe6f655c457bab5bf47fdd2486d +BLASTRAMPOLINE_BRANCH=v5.0.1 +BLASTRAMPOLINE_SHA1=d32042273719672c6669f6442a0be5605d434b70 From 596d31f80152d31d74dd8acf5617ecdcb8f1a530 Mon Sep 17 00:00:00 2001 From: "Viral B. Shah" Date: Mon, 21 Feb 2022 10:04:07 -0500 Subject: [PATCH 034/369] Regenerate all the checksums (#44275) (cherry picked from commit ac922b0ad4295e13ec553abcab3b954e4a60064f) --- .../md5 | 1 - .../sha512 | 1 - deps/checksums/blastrampoline | 4 +- .../compiler-rt-11.0.1.src.tar.xz/md5 | 1 - .../compiler-rt-11.0.1.src.tar.xz/sha512 | 1 - deps/checksums/dsfmt | 4 +- deps/checksums/gmp | 58 ------------------- deps/checksums/libcxx-11.0.1.src.tar.xz/md5 | 1 - .../checksums/libcxx-11.0.1.src.tar.xz/sha512 | 1 - deps/checksums/lldb-11.0.1.src.tar.xz/md5 | 1 - deps/checksums/lldb-11.0.1.src.tar.xz/sha512 | 1 - deps/checksums/llvm | 34 ----------- deps/checksums/llvmunwind | 34 +++++++++++ deps/checksums/mpfr | 4 +- deps/checksums/pcre | 4 +- deps/checksums/zlib | 4 +- 16 files changed, 44 insertions(+), 110 deletions(-) delete mode 100644 deps/checksums/LibCURL-04c450c17024d5b49cb30013f1409306efd35203.tar.gz/md5 delete mode 100644 deps/checksums/LibCURL-04c450c17024d5b49cb30013f1409306efd35203.tar.gz/sha512 delete mode 100644 deps/checksums/compiler-rt-11.0.1.src.tar.xz/md5 delete mode 100644 deps/checksums/compiler-rt-11.0.1.src.tar.xz/sha512 delete mode 100644 deps/checksums/libcxx-11.0.1.src.tar.xz/md5 delete mode 100644 deps/checksums/libcxx-11.0.1.src.tar.xz/sha512 delete mode 100644 deps/checksums/lldb-11.0.1.src.tar.xz/md5 delete mode 100644 deps/checksums/lldb-11.0.1.src.tar.xz/sha512 create mode 100644 deps/checksums/llvmunwind diff --git a/deps/checksums/LibCURL-04c450c17024d5b49cb30013f1409306efd35203.tar.gz/md5 b/deps/checksums/LibCURL-04c450c17024d5b49cb30013f1409306efd35203.tar.gz/md5 deleted file mode 100644 index d10b369971129..0000000000000 --- a/deps/checksums/LibCURL-04c450c17024d5b49cb30013f1409306efd35203.tar.gz/md5 +++ /dev/null @@ -1 +0,0 @@ -6a545e3c5dc4a0d7fe73435ec4c45dea diff --git a/deps/checksums/LibCURL-04c450c17024d5b49cb30013f1409306efd35203.tar.gz/sha512 b/deps/checksums/LibCURL-04c450c17024d5b49cb30013f1409306efd35203.tar.gz/sha512 deleted file mode 100644 index 4f77a3abbb3c2..0000000000000 --- a/deps/checksums/LibCURL-04c450c17024d5b49cb30013f1409306efd35203.tar.gz/sha512 +++ /dev/null @@ -1 +0,0 @@ -1308d4efde43eebd70646a77e4cf2d4a850a7c33d4a26018a1e84b4e7e1fb525ae193385fef7d47c405dbba0d685523d4b593702d93f441bcf8a495cc21fff0e diff --git a/deps/checksums/blastrampoline b/deps/checksums/blastrampoline index c0afa49764b87..d97f2fedd926b 100644 --- a/deps/checksums/blastrampoline +++ b/deps/checksums/blastrampoline @@ -1,5 +1,5 @@ -blastrampoline-23de7a09bf354fe6f655c457bab5bf47fdd2486d.tar.gz/md5/b81efa951fd909591339189f5909ff6b -blastrampoline-23de7a09bf354fe6f655c457bab5bf47fdd2486d.tar.gz/sha512/1c2558bab0aeaa76e7094d8a6a9798c95f2cf4efe2960640b70f1fd752f3dfb73813d9de93b539426376571febaab22ac22c2f903ccdf3296c7b067af92fecdc +blastrampoline-d32042273719672c6669f6442a0be5605d434b70.tar.gz/md5/f380e4238a2dec186ecfe9598f75b824 +blastrampoline-d32042273719672c6669f6442a0be5605d434b70.tar.gz/sha512/00437a96b57d99cef946257480e38e1dfdf325c46bc4a1619f5067565dfb7d9f668b0c8415badb0879b933cb1972f3c4e6be4c9e63a8a85728033e2183373819 libblastrampoline.v5.0.1+0.aarch64-apple-darwin.tar.gz/md5/8b2b28517ef5db95a0b440f1a936422e libblastrampoline.v5.0.1+0.aarch64-apple-darwin.tar.gz/sha512/3d479efc47b8c81fa85fd4d2a868a48304051432b92af90a2bcd2142673f2c422419731b8941f987aed429064532e8634ce3ea8f8d71222cf2d9b9e1e8ba2f7f libblastrampoline.v5.0.1+0.aarch64-linux-gnu.tar.gz/md5/23e53049a0c30c8d24482a25954ee497 diff --git a/deps/checksums/compiler-rt-11.0.1.src.tar.xz/md5 b/deps/checksums/compiler-rt-11.0.1.src.tar.xz/md5 deleted file mode 100644 index 0ad8aad90f820..0000000000000 --- a/deps/checksums/compiler-rt-11.0.1.src.tar.xz/md5 +++ /dev/null @@ -1 +0,0 @@ -29d6186e048936008512b8bbdb3a1b71 diff --git a/deps/checksums/compiler-rt-11.0.1.src.tar.xz/sha512 b/deps/checksums/compiler-rt-11.0.1.src.tar.xz/sha512 deleted file mode 100644 index 59f76a7d34acd..0000000000000 --- a/deps/checksums/compiler-rt-11.0.1.src.tar.xz/sha512 +++ /dev/null @@ -1 +0,0 @@ -869208f0d2c5f0828a317a6006d4ce47a946b03db2692c8557485caddc56fbeb0335a87b4c9663aa0d1397de94337e56ae10f802c4aca443072962f728e2bdf4 diff --git a/deps/checksums/dsfmt b/deps/checksums/dsfmt index 12d071b1fab2b..edadf5c01b1d7 100644 --- a/deps/checksums/dsfmt +++ b/deps/checksums/dsfmt @@ -1,5 +1,3 @@ -dsfmt-2.2.4.tar.gz/md5/ed30e63552d62df48d709dde4f755660 -dsfmt-2.2.4.tar.gz/sha512/fe84e986cbf198172340adfac0436b08f087643eca3f1ceccacde146cbfd8c41e3eb0dfbb062f7ca5f462db13c386abd7c269bc0cbefc9a0ecf97a8a8870a2e4 dSFMT.v2.2.4+1.aarch64-apple-darwin.tar.gz/md5/0299af20dae6bed519635900687f4aeb dSFMT.v2.2.4+1.aarch64-apple-darwin.tar.gz/sha512/5f20bd7602f09dcb23299d979372453db9a0e76a66129d69cc93c4b45a65ad377486f3cecb7093ff65307f515358420dc318b19eaf5945ff2fbfbe6886e95efa dSFMT.v2.2.4+1.aarch64-linux-gnu.tar.gz/md5/78a0fa53ad3db17f2849c744246a6bc6 @@ -32,3 +30,5 @@ dSFMT.v2.2.4+1.x86_64-unknown-freebsd.tar.gz/md5/e27869ac4f1ea6774ade7d3b53cd301 dSFMT.v2.2.4+1.x86_64-unknown-freebsd.tar.gz/sha512/762571a5d5773c2d9780586603859272f48ed67d6c8b09cd95c92fd62dc9bb03c274b12c2c04e05f426c9a42edbbc8e33beba3c79865f2c49459eca2d588b14c dSFMT.v2.2.4+1.x86_64-w64-mingw32.tar.gz/md5/74e5c27ba9eb654b4e998ce73719e724 dSFMT.v2.2.4+1.x86_64-w64-mingw32.tar.gz/sha512/59badcef14b06f14f8f5bce1c72de6750c8310ae18581e24b5d663edefe1bed3d120b4cebb87b53dc664411b62d9802f75aefde4e5236ada1dec740e6ef2445d +dsfmt-2.2.4.tar.gz/md5/ed30e63552d62df48d709dde4f755660 +dsfmt-2.2.4.tar.gz/sha512/fe84e986cbf198172340adfac0436b08f087643eca3f1ceccacde146cbfd8c41e3eb0dfbb062f7ca5f462db13c386abd7c269bc0cbefc9a0ecf97a8a8870a2e4 diff --git a/deps/checksums/gmp b/deps/checksums/gmp index 6b95ca883ddf8..47cee2e34a42f 100644 --- a/deps/checksums/gmp +++ b/deps/checksums/gmp @@ -1,61 +1,3 @@ -GMP.v6.2.1+0.aarch64-apple-darwin.tar.gz/md5/e805c580078e4d6bcaeb6781cb6d56fa -GMP.v6.2.1+0.aarch64-apple-darwin.tar.gz/sha512/62435e80f5fa0b67e2788c8bfc3681426add7a9b2853131bbebe890d1a2d9b54cebaea0860f6ddd0e93e1ae302baba39851d5f58a65acf0b2a9ea1226bb4eea4 -GMP.v6.2.1+0.aarch64-linux-gnu-cxx03.tar.gz/md5/5384d6ba6fd408bc71c2781b643cd59a -GMP.v6.2.1+0.aarch64-linux-gnu-cxx03.tar.gz/sha512/99bdf165b44b53605bd3121a741ca4576c4dd37861f4e2e2f3b508c1a797855ba8647c98f24ded875a1dc55ec577d4f617620c05606b4d2cf04361c143b818e7 -GMP.v6.2.1+0.aarch64-linux-gnu-cxx11.tar.gz/md5/67641c0755a252965fc842d0f55ea24d -GMP.v6.2.1+0.aarch64-linux-gnu-cxx11.tar.gz/sha512/a7db5855898adad99b2d36fce5d8db5b1aaccf47d5fc419c6c52c838a68ae374e49f76424807c351213ee5339acf2bdd31b38de9b75bb826b6c6a37c48c6f12c -GMP.v6.2.1+0.aarch64-linux-musl-cxx03.tar.gz/md5/49377ccee261d425e9fb6d7716776742 -GMP.v6.2.1+0.aarch64-linux-musl-cxx03.tar.gz/sha512/9e8c92c86dd98e339691796362d8a70d51e07d7ba78cc48455ee15243f9df84030ba5cc3080a200a6e94e0c002a7517e702570cc6e6d38301e90f991556cb090 -GMP.v6.2.1+0.aarch64-linux-musl-cxx11.tar.gz/md5/cd4cb308ae7736ea91ec5b97b7c80923 -GMP.v6.2.1+0.aarch64-linux-musl-cxx11.tar.gz/sha512/d84f399b8e66d5d86abcbfb30ba23a1676f5a469e8cde6b316322889ca0a242533bb537bb3cb5c57407dc9d91ce9f3cf879f71bddaf2fdef08b103e30674ec39 -GMP.v6.2.1+0.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/c115f3f1e1575649e8c898336cfb6300 -GMP.v6.2.1+0.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/3443d0994b625adb2c4bb013618372aff82de1c54022c45c7bf1bd043fbda6f50a4202018066569572a3ef8bb90725055628e1295b454dd56951b408d67c2f56 -GMP.v6.2.1+0.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/c80eb461a5427bc83ed38a2b15a6a354 -GMP.v6.2.1+0.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/3bcecb52ad64e587d50a6bdbc19560cd961360b265403639662b9314806e394848e64bd9d2be6881a3467f4c42ab43872035f71d5a0421f3284e5e08ad4cccb3 -GMP.v6.2.1+0.armv6l-linux-musleabihf-cxx03.tar.gz/md5/14f0a09730eda4706b64042c4eb204b0 -GMP.v6.2.1+0.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/c405065dba56aaafeee907baaec3e23337ccdc67f2cdfc460b6d5c338e85b0ec211f39df67a885fa5048d444ad28a07207ecc31872888576fbaec0c2881a2240 -GMP.v6.2.1+0.armv6l-linux-musleabihf-cxx11.tar.gz/md5/14b8bd2136680d00261264876da76f34 -GMP.v6.2.1+0.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/f6b5f56af796bd0e9411eabc53864c773002ba5fee44398770260cd1a0114ce9a1e0d3531f424f968e16436fb9f51e31b896fa3f43277405fe759141093d556d -GMP.v6.2.1+0.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/cfa020ab9b1f0d9f761034ce28acd851 -GMP.v6.2.1+0.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/2678b9b45a065569c58ed840bb5b0f5fb1a1e59897fa7054738760aba737b11f1d180f632f3f04a80a5530463b005367e41f4c599526abc688e86cd9a032888e -GMP.v6.2.1+0.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/8b238ae87be9b3ee908044b5dbd295da -GMP.v6.2.1+0.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/4e91356b3a294f1eec4309e6db0d9160edd5afe3d3cac6b8211853ff179642504669c403e8e6053accf187d86d55a7700db64e870c6321484247cc0648e4e793 -GMP.v6.2.1+0.armv7l-linux-musleabihf-cxx03.tar.gz/md5/fe1c989a71b4a292f96c410b8b467834 -GMP.v6.2.1+0.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/b87d0e869cafa27d5b229025b23b081051b25a38291128290fb15f18f5445129ff7b9a74c3076da011e503463521128c5940677e8290e6e15c7a57e92916be2e -GMP.v6.2.1+0.armv7l-linux-musleabihf-cxx11.tar.gz/md5/47323b44eb6f0b1342500cb38943923a -GMP.v6.2.1+0.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/11bf94c7df9aadbbb01b83628967c110bf9bbfee68ae9f7792ba2aeb004e555c50ed54974f0a56525eb43555a9de955003ff66283979e02724bd577c73b1e855 -GMP.v6.2.1+0.i686-linux-gnu-cxx03.tar.gz/md5/0b8ad9c99dec6097ecad2f7e8946014d -GMP.v6.2.1+0.i686-linux-gnu-cxx03.tar.gz/sha512/29dc39445cc89e156866c7607bace3e61a18348d3772b5f354cdef2b57e6c1c8be1682b1705f5bfa9314c973a7592db9dfc9027f0cf2ad12c935e876c3845052 -GMP.v6.2.1+0.i686-linux-gnu-cxx11.tar.gz/md5/f8ce89edd1412fd54b98c1c85870ecee -GMP.v6.2.1+0.i686-linux-gnu-cxx11.tar.gz/sha512/add5da0d9b5b1cd66192fad3028203114fcf4908d3bd24e6d13fb59d85c4413f82cbde917d6bbc9f80186da54627531680ccf53146b9c0262523c29192a1ac85 -GMP.v6.2.1+0.i686-linux-musl-cxx03.tar.gz/md5/84c1f2487a10daab9b715d9cc490253b -GMP.v6.2.1+0.i686-linux-musl-cxx03.tar.gz/sha512/fb4a2f27a932273e1f2dabfe31c02d96892d3767c9cc488ade254dc05fe0bb1d9894b4e7afc72a7b9928f05b26bbb4eec05df71aaa15c8d99bc050e64f725663 -GMP.v6.2.1+0.i686-linux-musl-cxx11.tar.gz/md5/5fb602b9d2a80aa041fdd9a7f01b0827 -GMP.v6.2.1+0.i686-linux-musl-cxx11.tar.gz/sha512/f51dd2c914c4957052502ff32bb185115f9950a42d20e3443040574ab84ae929ad04f2e53ca5296803f726182c71438156b7f8691c50d3450824693579fd0e4a -GMP.v6.2.1+0.i686-w64-mingw32-cxx03.tar.gz/md5/c03aad92ce6d66b1a795f7213b0ff9f0 -GMP.v6.2.1+0.i686-w64-mingw32-cxx03.tar.gz/sha512/97789b371cb66699fc26e32f658020f0dd9fb4242bc2253be5ccee91e0cda8bfe393b8c57c4bf3ee2ae5c585fd79ad42a48c058c0c02491358680b9acb197137 -GMP.v6.2.1+0.i686-w64-mingw32-cxx11.tar.gz/md5/23a32a01e4fa9e34ff72773c913f4cb3 -GMP.v6.2.1+0.i686-w64-mingw32-cxx11.tar.gz/sha512/1a1569eb095d9cb1c697a488cd57dce9d4a96447d19a94dfa95f03f47b91c2cee676f0fbdf313062019eabe4b6ce28d6c5978f53c9fb537ee6e9c39530bb9529 -GMP.v6.2.1+0.powerpc64le-linux-gnu-cxx03.tar.gz/md5/98e4b7257714395e6a64848381187fb1 -GMP.v6.2.1+0.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/a8775f0f7d2c0f0511fee0fdacbc60e68dbb4dc92a787849516fd9ae01289dfcf2c5b60e2999568e3374e386f6708adc6d3d17b07bc0345f8ed4e3eb00a1e072 -GMP.v6.2.1+0.powerpc64le-linux-gnu-cxx11.tar.gz/md5/dff490a43ca1d6974c43f2d9356c6c54 -GMP.v6.2.1+0.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/557f706464ae636e2720e4483ee4e20d83267f5824ee5c963cf75270d8b76ce8f5c3a1ddc8fbca6ade8d044bfb2e125e19ca43452277a24e6991a6aaf5b4d1f5 -GMP.v6.2.1+0.x86_64-apple-darwin.tar.gz/md5/80a9cf52964de5e9ecca4d4e86606e72 -GMP.v6.2.1+0.x86_64-apple-darwin.tar.gz/sha512/06d4ce5343ab9809908295cc322e0186b5b4cd94b67fbb17d5c648a7f5ed219eb15b8a4bbac2035c078e66eda80b412bb630fff1a9bf60722ba23526e0dfbb9c -GMP.v6.2.1+0.x86_64-linux-gnu-cxx03.tar.gz/md5/a0e34e7eb8dc0a45fa7a746d5077d8f7 -GMP.v6.2.1+0.x86_64-linux-gnu-cxx03.tar.gz/sha512/ae6f052766ffe8e9595ce78d8ad8589459456801910b78321fbd174b095a6822ec046ca69ec9496f0ee676312e7008ca7e9b179890c586672eeab817c8da67b3 -GMP.v6.2.1+0.x86_64-linux-gnu-cxx11.tar.gz/md5/a444271a5a3fb646a1bf3071b4b58109 -GMP.v6.2.1+0.x86_64-linux-gnu-cxx11.tar.gz/sha512/a756425aa4d67cd8822f2fb23d055b455787ed1339f1995f9bbf905021d041dd663ddafd1c681a35bc5e124ce6acbb69789ae483ed7168c9fb8a6bf1bc9c144a -GMP.v6.2.1+0.x86_64-linux-musl-cxx03.tar.gz/md5/1aa292bffef8ebe685e4486513c0cbef -GMP.v6.2.1+0.x86_64-linux-musl-cxx03.tar.gz/sha512/03968755c53457296b79752ca9808d4660aad8474f876836cec9e9d6c1c38267614a134bd222a50eddac5dddbe923df3a4d11298bd1e019876b717033ffd3eb3 -GMP.v6.2.1+0.x86_64-linux-musl-cxx11.tar.gz/md5/ef269f501c1a331ef6c3e7905047c3eb -GMP.v6.2.1+0.x86_64-linux-musl-cxx11.tar.gz/sha512/9c58c2fc09ec6f5e8e21602fdc22ca49c4b54ed1bbf544717c376a1d67b378cd63b9f25c1a8e3e12c358783eba17662b1a6b661ca5f588655e8b6ecbf490e199 -GMP.v6.2.1+0.x86_64-unknown-freebsd.tar.gz/md5/54b35608d79a2bc3f9d81be8cd8fe7a3 -GMP.v6.2.1+0.x86_64-unknown-freebsd.tar.gz/sha512/79aa5e7705aad4b4d5d248d0bef3ab1d17185ce710058a8f3e74e5eab86190a9150d316eb3a33ae41a497f3a94da03f90768978f2e154c5db57f5345bf0ba4c9 -GMP.v6.2.1+0.x86_64-w64-mingw32-cxx03.tar.gz/md5/1499a265b438cf5169286c1830eb5734 -GMP.v6.2.1+0.x86_64-w64-mingw32-cxx03.tar.gz/sha512/d2e6fe76abe0a0cb1a7445ea93cd5bd0bf9f729aec8df9c76d06a1f6f5e67cce442be69b66950eb33aa22cfda2e5a308f2bade64018a27bebfcb4b7a97e1d047 -GMP.v6.2.1+0.x86_64-w64-mingw32-cxx11.tar.gz/md5/fdb4187f617511d8eb19f67f8499a8d0 -GMP.v6.2.1+0.x86_64-w64-mingw32-cxx11.tar.gz/sha512/bb6d8ead1c20cffebc2271461d3787cfad794fee2b32e23583af6521c0667ed9107805268a996d23d6edcab9fe653e542a210cab07252f7713af0c23feb76fb3 GMP.v6.2.1+1.aarch64-apple-darwin.tar.gz/md5/03cb14ac16daabb4a77fe1c78e8e48a9 GMP.v6.2.1+1.aarch64-apple-darwin.tar.gz/sha512/5b8f974a07f579272981f5ebe44191385a4ce95f58d434a3565ffa827a6d65824cbe4173736b7328630bbccfe6af4242195aec24de3f0aa687e2e32a18a97a5c GMP.v6.2.1+1.aarch64-linux-gnu-cxx03.tar.gz/md5/0ce7d419a49f2f90033618bdda2588e7 diff --git a/deps/checksums/libcxx-11.0.1.src.tar.xz/md5 b/deps/checksums/libcxx-11.0.1.src.tar.xz/md5 deleted file mode 100644 index 5b905de3304cc..0000000000000 --- a/deps/checksums/libcxx-11.0.1.src.tar.xz/md5 +++ /dev/null @@ -1 +0,0 @@ -4b2467eb023c9b4c84335808f811d5fa diff --git a/deps/checksums/libcxx-11.0.1.src.tar.xz/sha512 b/deps/checksums/libcxx-11.0.1.src.tar.xz/sha512 deleted file mode 100644 index 251c002b1e83d..0000000000000 --- a/deps/checksums/libcxx-11.0.1.src.tar.xz/sha512 +++ /dev/null @@ -1 +0,0 @@ -adda227d412bc28a47612cc6580bf85353838792b4816633d8401efb92cd65f6801278941f779d301bd6162b75ef8d54825f9cdfb0f61c6f5f621eca7fb7c004 diff --git a/deps/checksums/lldb-11.0.1.src.tar.xz/md5 b/deps/checksums/lldb-11.0.1.src.tar.xz/md5 deleted file mode 100644 index 901bdea38188d..0000000000000 --- a/deps/checksums/lldb-11.0.1.src.tar.xz/md5 +++ /dev/null @@ -1 +0,0 @@ -e49cde09adb5ed43a651e6d5bcb2aded diff --git a/deps/checksums/lldb-11.0.1.src.tar.xz/sha512 b/deps/checksums/lldb-11.0.1.src.tar.xz/sha512 deleted file mode 100644 index 16f939fb1007e..0000000000000 --- a/deps/checksums/lldb-11.0.1.src.tar.xz/sha512 +++ /dev/null @@ -1 +0,0 @@ -05de84a0606becdabacb46fbc5cd67607ca47c22469da13470b76a96b96e6f34b3045fd1f5bed9c82228c2ce529562ee71667788a5048f079fef450d63a1557c diff --git a/deps/checksums/llvm b/deps/checksums/llvm index cff2c009bd0ce..6cb85ecdc0d3b 100644 --- a/deps/checksums/llvm +++ b/deps/checksums/llvm @@ -56,38 +56,6 @@ LLVM.v13.0.1+0.x86_64-w64-mingw32-cxx03.tar.gz/md5/1823541a9a6c9e9134ac764550139 LLVM.v13.0.1+0.x86_64-w64-mingw32-cxx03.tar.gz/sha512/2dbee2c1f01e5cc4f0b70c0147352ad95f0b91f5cb1efcde7ed61b54b2baa1b0bcea0b97e0c0ff6c55526e6b037f25808cf995f861ce46da56195bfe0b0e48e3 LLVM.v13.0.1+0.x86_64-w64-mingw32-cxx11.tar.gz/md5/454453a2afb04e3c4d6cdffb37591a3d LLVM.v13.0.1+0.x86_64-w64-mingw32-cxx11.tar.gz/sha512/21bda5f9ceb9d4030121eb9c563233bcdab5b9d1d5b0b9b0fd22cfba3d507ec59ab4c98211d0d5c2cc5ac0b0695d1fbe4707a0264fde423833cd7a461193b556 -LLVMLibUnwind.v12.0.1+0.aarch64-apple-darwin.tar.gz/md5/b95ad4844e649bf46db43683b55b9f4f -LLVMLibUnwind.v12.0.1+0.aarch64-apple-darwin.tar.gz/sha512/15e0996aebe6db91fe58121001aa7ea4b23685ead3c26b5d89afae34b535e34b4e801a971f4854d8e1a1fbc805cece06272470622eef863e225358113a127913 -LLVMLibUnwind.v12.0.1+0.aarch64-linux-gnu.tar.gz/md5/6d8783dc9b86c9884e0877f0d8ac4167 -LLVMLibUnwind.v12.0.1+0.aarch64-linux-gnu.tar.gz/sha512/d3b0c81498220d77e4f3cc684fb2cc0653792c381207390e695ac30bc74249f96a333a406b2cebdaca14e0b0a27b188cba6209bb5c1cbbb5c184d5626dbdc7a0 -LLVMLibUnwind.v12.0.1+0.aarch64-linux-musl.tar.gz/md5/052a35e879d52244e4b0804be875a38f -LLVMLibUnwind.v12.0.1+0.aarch64-linux-musl.tar.gz/sha512/d1b34fb97f9928e046d3131a050454710a93d38e60287b7e3c92f179f436586d3230cf90b0ca0eb8a3f9ef89fef7b1ffd7d52871645dfa233a8b07ca87ea2ee4 -LLVMLibUnwind.v12.0.1+0.armv6l-linux-gnueabihf.tar.gz/md5/1ad96a03a5dde506b5c05773b1849ec4 -LLVMLibUnwind.v12.0.1+0.armv6l-linux-gnueabihf.tar.gz/sha512/82306fb7b920fa7c71bd53b23d6915e7f256e8da9679cc926a53bb0d879f1f4469f43efe556ca32c9ef59e27b435572c7b39859090652635db4eeefdec0d1685 -LLVMLibUnwind.v12.0.1+0.armv6l-linux-musleabihf.tar.gz/md5/6a24fcd3a4dc3b1a98bb7963b1bb4930 -LLVMLibUnwind.v12.0.1+0.armv6l-linux-musleabihf.tar.gz/sha512/9ba6b83ccec061a1e5260c807dc8afd6e18799431b25a7e65b97662cc4db02509d02ea07fe12025d80914cec7383624b1c8fc9add46511c668e184ede263ac52 -LLVMLibUnwind.v12.0.1+0.armv7l-linux-gnueabihf.tar.gz/md5/09f1bfcf58a4124561553ab5005f9538 -LLVMLibUnwind.v12.0.1+0.armv7l-linux-gnueabihf.tar.gz/sha512/b0907cb857131183ffc338780c6c6dd1d48bf0ba61c3da1b8f20cf9a943373173b621cf9b2e8f1fbc657059a896b84aa025e6d4f0f1d1e8b623fac3e96541765 -LLVMLibUnwind.v12.0.1+0.armv7l-linux-musleabihf.tar.gz/md5/19158bcfae716b26f924d67c4e719342 -LLVMLibUnwind.v12.0.1+0.armv7l-linux-musleabihf.tar.gz/sha512/a90be57990b6699cb737ba96904e94e1f082601ca9d01e670f025b5500f526980741921c9cf672accab78cb5327714ab6ecdbb875174088f0773ebb627a98819 -LLVMLibUnwind.v12.0.1+0.i686-linux-gnu.tar.gz/md5/ba75556eb96b2bcdaf73ff68386d3bc3 -LLVMLibUnwind.v12.0.1+0.i686-linux-gnu.tar.gz/sha512/612fb765695b7aae11ef29608eedf8b959f60c021287a67b03a2a0f57a5814001ffa9b261c9d60d5f3d0582c06c2b41f75fd3afb66a045a248bd43d29e304c97 -LLVMLibUnwind.v12.0.1+0.i686-linux-musl.tar.gz/md5/2fcbceeb1bfde29be0cbca8bb6718bfe -LLVMLibUnwind.v12.0.1+0.i686-linux-musl.tar.gz/sha512/58f281cfc70b3f8a59cf4faa7732824637c811ddc5ea6a058f294f4c3ed4fa6c8ddab5c007567b439f2854635cf4fd146284059bfbc73e7006000ced9383f705 -LLVMLibUnwind.v12.0.1+0.i686-w64-mingw32.tar.gz/md5/153c028d97dceb6924414a7a9a137e1e -LLVMLibUnwind.v12.0.1+0.i686-w64-mingw32.tar.gz/sha512/7ae1f197600eabde9036ae58623de34a6d25636d7861777e324eb97902f65e26c6f3775e757178f8914b0cb6c2e925413f5ffc6abc9b6138470dc9e67a17f212 -LLVMLibUnwind.v12.0.1+0.powerpc64le-linux-gnu.tar.gz/md5/c08a6cf3e1baf156eb05003ed4e9ebe9 -LLVMLibUnwind.v12.0.1+0.powerpc64le-linux-gnu.tar.gz/sha512/f74e44986622329990842cb3ff549ff9254c81863d8bee468b0e58b7621067e7e7f7f18e4cbeafad6a05e0c107323de6828a78dc7afbcd7cd1892383ff417968 -LLVMLibUnwind.v12.0.1+0.x86_64-apple-darwin.tar.gz/md5/caf151150e56827be09acca6964d2b18 -LLVMLibUnwind.v12.0.1+0.x86_64-apple-darwin.tar.gz/sha512/cb3e7aa71367ec4a115bccc2e8ac6bd5d9f22b3935b3889eee1fbf7303c5f553d7d3108977bc1f6c9b6917a6ed9e10bff211fd56b8169233ceae287b112894c2 -LLVMLibUnwind.v12.0.1+0.x86_64-linux-gnu.tar.gz/md5/d95874cbf6f8b55bc314c3968a6a4563 -LLVMLibUnwind.v12.0.1+0.x86_64-linux-gnu.tar.gz/sha512/4986a8d9cc9d8761a99a4f02d017b424484233d4cbe2d4f49ccd371591384b1b8d1c4d31cb908505b86b00f2b164568e57751dd949d91af203ee4a582971798a -LLVMLibUnwind.v12.0.1+0.x86_64-linux-musl.tar.gz/md5/89077d871e15425b1f4c2451fb19a1b2 -LLVMLibUnwind.v12.0.1+0.x86_64-linux-musl.tar.gz/sha512/b65a218b05ade2e2d1582188897b036a4596d09cf65558f178c49c1a1a62b7d992b1d99fbe86a027dc83b614f178e6061f3dfb695b18a8e2b6bf76779b741d96 -LLVMLibUnwind.v12.0.1+0.x86_64-unknown-freebsd.tar.gz/md5/54ac594b4c8e7f261034a8829dad5e34 -LLVMLibUnwind.v12.0.1+0.x86_64-unknown-freebsd.tar.gz/sha512/a43756afd92081e6dd7244d162862fc318b41ca110a5e8be6e4ee2d8fdfd8fb0f79961ae55e48913e055779791bd1c0ecd34fd59281fb66b3c4f24a1f44128f0 -LLVMLibUnwind.v12.0.1+0.x86_64-w64-mingw32.tar.gz/md5/83cf8fc2a085a73b8af4245a82b7d32f -LLVMLibUnwind.v12.0.1+0.x86_64-w64-mingw32.tar.gz/sha512/297a5c7b33bd3f57878871eccb3b9879ea5549639523a1b9db356b710cafb232906a74d668315340d60ba0c5087d3400f14ab92c3704e32e062e6b546abf7df6 LLVM_assert.v13.0.1+0.aarch64-apple-darwin.tar.gz/md5/edbc793469fb7c14af3c33f8584d22df LLVM_assert.v13.0.1+0.aarch64-apple-darwin.tar.gz/sha512/a3137f2d2d4847e6db1acfc834e686379cdd80712feb3d36d616f73af473599356ade48c98a865d3c233a59d395d40114083fbd78617001b95ebe363fe12cde5 LLVM_assert.v13.0.1+0.aarch64-linux-gnu-cxx03.tar.gz/md5/00176b5cd73dea5f9265155574c08dd5 @@ -264,5 +232,3 @@ libLLVM_assert.v13.0.1+0.x86_64-w64-mingw32-cxx11.tar.gz/md5/a458b0572d77d3d79b6 libLLVM_assert.v13.0.1+0.x86_64-w64-mingw32-cxx11.tar.gz/sha512/43b6ab2becd9b3179f91f2f856854d4795e53c4078dda26607e5b6a8dfde37cdc28f9fec6c0ca9e0d0d8de5f2304d5775d5c6b7a03c0f6feb2b93e43053997c4 llvm-julia-13.0.1-0.tar.gz/md5/34edc9f707d86fe8c5758b0ae8c35206 llvm-julia-13.0.1-0.tar.gz/sha512/0d55c1bf3c581551faa077aab7046d1f020e8775ed16f1fbd8ccee65bc8f43173504f5ce1215227fa5e565f2804f8772e2cda039bc333bb23677067a4a3f9f87 -llvmunwind-12.0.1.tar.xz/md5/4ec327cee517fdb1f6a20e83748e2c7b -llvmunwind-12.0.1.tar.xz/sha512/847b6ba03010a43f4fdbfdc49bf16d18fd18474d01584712e651b11191814bf7c1cf53475021d9ee447ed78413202b4ed97973d7bdd851d3e49f8d06f55a7af4 diff --git a/deps/checksums/llvmunwind b/deps/checksums/llvmunwind new file mode 100644 index 0000000000000..678ae7b0c3fc4 --- /dev/null +++ b/deps/checksums/llvmunwind @@ -0,0 +1,34 @@ +LLVMLibUnwind.v12.0.1+0.aarch64-apple-darwin.tar.gz/md5/b95ad4844e649bf46db43683b55b9f4f +LLVMLibUnwind.v12.0.1+0.aarch64-apple-darwin.tar.gz/sha512/15e0996aebe6db91fe58121001aa7ea4b23685ead3c26b5d89afae34b535e34b4e801a971f4854d8e1a1fbc805cece06272470622eef863e225358113a127913 +LLVMLibUnwind.v12.0.1+0.aarch64-linux-gnu.tar.gz/md5/6d8783dc9b86c9884e0877f0d8ac4167 +LLVMLibUnwind.v12.0.1+0.aarch64-linux-gnu.tar.gz/sha512/d3b0c81498220d77e4f3cc684fb2cc0653792c381207390e695ac30bc74249f96a333a406b2cebdaca14e0b0a27b188cba6209bb5c1cbbb5c184d5626dbdc7a0 +LLVMLibUnwind.v12.0.1+0.aarch64-linux-musl.tar.gz/md5/052a35e879d52244e4b0804be875a38f +LLVMLibUnwind.v12.0.1+0.aarch64-linux-musl.tar.gz/sha512/d1b34fb97f9928e046d3131a050454710a93d38e60287b7e3c92f179f436586d3230cf90b0ca0eb8a3f9ef89fef7b1ffd7d52871645dfa233a8b07ca87ea2ee4 +LLVMLibUnwind.v12.0.1+0.armv6l-linux-gnueabihf.tar.gz/md5/1ad96a03a5dde506b5c05773b1849ec4 +LLVMLibUnwind.v12.0.1+0.armv6l-linux-gnueabihf.tar.gz/sha512/82306fb7b920fa7c71bd53b23d6915e7f256e8da9679cc926a53bb0d879f1f4469f43efe556ca32c9ef59e27b435572c7b39859090652635db4eeefdec0d1685 +LLVMLibUnwind.v12.0.1+0.armv6l-linux-musleabihf.tar.gz/md5/6a24fcd3a4dc3b1a98bb7963b1bb4930 +LLVMLibUnwind.v12.0.1+0.armv6l-linux-musleabihf.tar.gz/sha512/9ba6b83ccec061a1e5260c807dc8afd6e18799431b25a7e65b97662cc4db02509d02ea07fe12025d80914cec7383624b1c8fc9add46511c668e184ede263ac52 +LLVMLibUnwind.v12.0.1+0.armv7l-linux-gnueabihf.tar.gz/md5/09f1bfcf58a4124561553ab5005f9538 +LLVMLibUnwind.v12.0.1+0.armv7l-linux-gnueabihf.tar.gz/sha512/b0907cb857131183ffc338780c6c6dd1d48bf0ba61c3da1b8f20cf9a943373173b621cf9b2e8f1fbc657059a896b84aa025e6d4f0f1d1e8b623fac3e96541765 +LLVMLibUnwind.v12.0.1+0.armv7l-linux-musleabihf.tar.gz/md5/19158bcfae716b26f924d67c4e719342 +LLVMLibUnwind.v12.0.1+0.armv7l-linux-musleabihf.tar.gz/sha512/a90be57990b6699cb737ba96904e94e1f082601ca9d01e670f025b5500f526980741921c9cf672accab78cb5327714ab6ecdbb875174088f0773ebb627a98819 +LLVMLibUnwind.v12.0.1+0.i686-linux-gnu.tar.gz/md5/ba75556eb96b2bcdaf73ff68386d3bc3 +LLVMLibUnwind.v12.0.1+0.i686-linux-gnu.tar.gz/sha512/612fb765695b7aae11ef29608eedf8b959f60c021287a67b03a2a0f57a5814001ffa9b261c9d60d5f3d0582c06c2b41f75fd3afb66a045a248bd43d29e304c97 +LLVMLibUnwind.v12.0.1+0.i686-linux-musl.tar.gz/md5/2fcbceeb1bfde29be0cbca8bb6718bfe +LLVMLibUnwind.v12.0.1+0.i686-linux-musl.tar.gz/sha512/58f281cfc70b3f8a59cf4faa7732824637c811ddc5ea6a058f294f4c3ed4fa6c8ddab5c007567b439f2854635cf4fd146284059bfbc73e7006000ced9383f705 +LLVMLibUnwind.v12.0.1+0.i686-w64-mingw32.tar.gz/md5/153c028d97dceb6924414a7a9a137e1e +LLVMLibUnwind.v12.0.1+0.i686-w64-mingw32.tar.gz/sha512/7ae1f197600eabde9036ae58623de34a6d25636d7861777e324eb97902f65e26c6f3775e757178f8914b0cb6c2e925413f5ffc6abc9b6138470dc9e67a17f212 +LLVMLibUnwind.v12.0.1+0.powerpc64le-linux-gnu.tar.gz/md5/c08a6cf3e1baf156eb05003ed4e9ebe9 +LLVMLibUnwind.v12.0.1+0.powerpc64le-linux-gnu.tar.gz/sha512/f74e44986622329990842cb3ff549ff9254c81863d8bee468b0e58b7621067e7e7f7f18e4cbeafad6a05e0c107323de6828a78dc7afbcd7cd1892383ff417968 +LLVMLibUnwind.v12.0.1+0.x86_64-apple-darwin.tar.gz/md5/caf151150e56827be09acca6964d2b18 +LLVMLibUnwind.v12.0.1+0.x86_64-apple-darwin.tar.gz/sha512/cb3e7aa71367ec4a115bccc2e8ac6bd5d9f22b3935b3889eee1fbf7303c5f553d7d3108977bc1f6c9b6917a6ed9e10bff211fd56b8169233ceae287b112894c2 +LLVMLibUnwind.v12.0.1+0.x86_64-linux-gnu.tar.gz/md5/d95874cbf6f8b55bc314c3968a6a4563 +LLVMLibUnwind.v12.0.1+0.x86_64-linux-gnu.tar.gz/sha512/4986a8d9cc9d8761a99a4f02d017b424484233d4cbe2d4f49ccd371591384b1b8d1c4d31cb908505b86b00f2b164568e57751dd949d91af203ee4a582971798a +LLVMLibUnwind.v12.0.1+0.x86_64-linux-musl.tar.gz/md5/89077d871e15425b1f4c2451fb19a1b2 +LLVMLibUnwind.v12.0.1+0.x86_64-linux-musl.tar.gz/sha512/b65a218b05ade2e2d1582188897b036a4596d09cf65558f178c49c1a1a62b7d992b1d99fbe86a027dc83b614f178e6061f3dfb695b18a8e2b6bf76779b741d96 +LLVMLibUnwind.v12.0.1+0.x86_64-unknown-freebsd.tar.gz/md5/54ac594b4c8e7f261034a8829dad5e34 +LLVMLibUnwind.v12.0.1+0.x86_64-unknown-freebsd.tar.gz/sha512/a43756afd92081e6dd7244d162862fc318b41ca110a5e8be6e4ee2d8fdfd8fb0f79961ae55e48913e055779791bd1c0ecd34fd59281fb66b3c4f24a1f44128f0 +LLVMLibUnwind.v12.0.1+0.x86_64-w64-mingw32.tar.gz/md5/83cf8fc2a085a73b8af4245a82b7d32f +LLVMLibUnwind.v12.0.1+0.x86_64-w64-mingw32.tar.gz/sha512/297a5c7b33bd3f57878871eccb3b9879ea5549639523a1b9db356b710cafb232906a74d668315340d60ba0c5087d3400f14ab92c3704e32e062e6b546abf7df6 +llvmunwind-12.0.1.tar.xz/md5/4ec327cee517fdb1f6a20e83748e2c7b +llvmunwind-12.0.1.tar.xz/sha512/847b6ba03010a43f4fdbfdc49bf16d18fd18474d01584712e651b11191814bf7c1cf53475021d9ee447ed78413202b4ed97973d7bdd851d3e49f8d06f55a7af4 diff --git a/deps/checksums/mpfr b/deps/checksums/mpfr index 8353d49aa190b..0eb73ceb693a2 100644 --- a/deps/checksums/mpfr +++ b/deps/checksums/mpfr @@ -1,5 +1,3 @@ -mpfr-4.1.0.tar.bz2/md5/44b892bc5a45bafb4294d134e13aad1d -mpfr-4.1.0.tar.bz2/sha512/410208ee0d48474c1c10d3d4a59decd2dfa187064183b09358ec4c4666e34d74383128436b404123b831e585d81a9176b24c7ced9d913967c5fce35d4040a0b4 MPFR.v4.1.1+1.aarch64-apple-darwin.tar.gz/md5/157265257536980394e0a025b9d28de1 MPFR.v4.1.1+1.aarch64-apple-darwin.tar.gz/sha512/44064eb67f087c2c38857273b069eacec9ebc199dd908f975895ab28bcdeb761adaec1a20cb5c3a98788090eb9ec31678ab1c5802896b22738d120e379f1f6ad MPFR.v4.1.1+1.aarch64-linux-gnu.tar.gz/md5/ed45c58b6f9ee6993f34012570ffa6bd @@ -32,3 +30,5 @@ MPFR.v4.1.1+1.x86_64-unknown-freebsd.tar.gz/md5/9dc9d9bb0662700510b89e6da4f44f2d MPFR.v4.1.1+1.x86_64-unknown-freebsd.tar.gz/sha512/14208fb683233d44eb2263e7674b9c5cf4f7f7151f025b2b00fb482e6609b78b2189eb25edd7c45b8634bca07e1aca746a6094af50d1449248847529ff58bcaa MPFR.v4.1.1+1.x86_64-w64-mingw32.tar.gz/md5/6159f631081b32b7df88e090af417f4c MPFR.v4.1.1+1.x86_64-w64-mingw32.tar.gz/sha512/5086da1de24b1f9431ea7dbe6407ae9c81df7a10b04845e8fe4a476a6a5dcb78d3e4b06ca81c85d1a8cf2d081948d20bb77672a4c9f6d20e194f384a323a1f71 +mpfr-4.1.0.tar.bz2/md5/44b892bc5a45bafb4294d134e13aad1d +mpfr-4.1.0.tar.bz2/sha512/410208ee0d48474c1c10d3d4a59decd2dfa187064183b09358ec4c4666e34d74383128436b404123b831e585d81a9176b24c7ced9d913967c5fce35d4040a0b4 diff --git a/deps/checksums/pcre b/deps/checksums/pcre index f7e1fa0c1a3ba..05a06f9844ddf 100644 --- a/deps/checksums/pcre +++ b/deps/checksums/pcre @@ -1,5 +1,3 @@ -pcre2-10.36.tar.bz2/md5/bd7e7421ff3fa2e2d5429229ecfad095 -pcre2-10.36.tar.bz2/sha512/fc2a920562c80c3d31cedd94028fab55314ae0fb168cac7178f286c344a11fc514939edc3b83b8e0b57c872db4e595fd5530fd1d4b8c779be629553e9ec965a3 PCRE2.v10.36.0+2.aarch64-apple-darwin.tar.gz/md5/12ac3bee39df3a79f868f6463964953b PCRE2.v10.36.0+2.aarch64-apple-darwin.tar.gz/sha512/a1a1312931deb7f742f80886188babcf9c179ed3f156626fb23d92633fde896d1ee9b2d72cd99ae4a1f8048971b6d939e9b0b10c455d4eeec24b265968593486 PCRE2.v10.36.0+2.aarch64-linux-gnu.tar.gz/md5/32240ccddee3040aeedcbe69ea52fcad @@ -32,3 +30,5 @@ PCRE2.v10.36.0+2.x86_64-unknown-freebsd.tar.gz/md5/97410029c0b6ed5f7fb0d14e1f121 PCRE2.v10.36.0+2.x86_64-unknown-freebsd.tar.gz/sha512/229e910759da2959ddef83ca89e05a050c266b8e755c85dfce6a786658be541911c3b78a0fca7dfdee1b41fbbdccf57da75cf9fe45fd2821dba8d2aaeabfd538 PCRE2.v10.36.0+2.x86_64-w64-mingw32.tar.gz/md5/39827564bca329768e0380bd79b869fe PCRE2.v10.36.0+2.x86_64-w64-mingw32.tar.gz/sha512/4579049b99fca3334d726b0ca1f07524d1643a758e375b5b02b8f294ba7d9c2a4130da1a1523de29033233a8848105b3cb660e15bb4a759593405d805ee99883 +pcre2-10.36.tar.bz2/md5/bd7e7421ff3fa2e2d5429229ecfad095 +pcre2-10.36.tar.bz2/sha512/fc2a920562c80c3d31cedd94028fab55314ae0fb168cac7178f286c344a11fc514939edc3b83b8e0b57c872db4e595fd5530fd1d4b8c779be629553e9ec965a3 diff --git a/deps/checksums/zlib b/deps/checksums/zlib index ba31ecdbae00b..6b14164c8318f 100644 --- a/deps/checksums/zlib +++ b/deps/checksums/zlib @@ -1,5 +1,3 @@ -zlib-cacf7f1d4e3d44d871b605da3b647f07d718623f.tar.gz/md5/93d10d4dd040f14ae63417070d1346e8 -zlib-cacf7f1d4e3d44d871b605da3b647f07d718623f.tar.gz/sha512/a1e9c5a2963266a582192d0fe88c179f5239245f11c4df4427dda755ad77d31e1fcf045d7d3fe49141090f4ff8da13d9a2e8d8d317fe6460a5f3e9bdea29b883 Zlib.v1.2.12+1.aarch64-apple-darwin.tar.gz/md5/6e255e13279855a99dae7d4ccf206069 Zlib.v1.2.12+1.aarch64-apple-darwin.tar.gz/sha512/d160928dc6cad6bbc9fce36ea0d807c1f432aae375e6a032b0fd58d18640d02fc50c25233b32f8b73f3fc3488a091cf57418ad04498160441e3d7e4aa79302fe Zlib.v1.2.12+1.aarch64-linux-gnu.tar.gz/md5/ff0ce9d6dec1c1b07114ed48f2bcfc88 @@ -32,3 +30,5 @@ Zlib.v1.2.12+1.x86_64-unknown-freebsd.tar.gz/md5/21dfda8d26dbe76c914216e79d7847d Zlib.v1.2.12+1.x86_64-unknown-freebsd.tar.gz/sha512/2cd7be4070dbf20ab1c46553a9e3f84c98bf8e8fc72bf2eb4678630e648cb9ad02cae5e004f3c2a69216e2782d9bba43eac6a45a480f6fe58d1091a9fbba93ff Zlib.v1.2.12+1.x86_64-w64-mingw32.tar.gz/md5/140ddbeeaf27867aeeeec118682e879d Zlib.v1.2.12+1.x86_64-w64-mingw32.tar.gz/sha512/f61f3d1eb7e7960b2fdbc1d68f22526a06ba598cd821261e7ba3819e00daee4c5b5427f9c03277b57b7226860142f0071410c0583535ca4e4b9acbe5ee4b5ade +zlib-cacf7f1d4e3d44d871b605da3b647f07d718623f.tar.gz/md5/93d10d4dd040f14ae63417070d1346e8 +zlib-cacf7f1d4e3d44d871b605da3b647f07d718623f.tar.gz/sha512/a1e9c5a2963266a582192d0fe88c179f5239245f11c4df4427dda755ad77d31e1fcf045d7d3fe49141090f4ff8da13d9a2e8d8d317fe6460a5f3e9bdea29b883 From 3f28e07fe15c2bca06aae1b6be883d309a5da66e Mon Sep 17 00:00:00 2001 From: "Viral B. Shah" Date: Tue, 22 Feb 2022 22:36:20 -0500 Subject: [PATCH 035/369] Documentation: added example to the function hasfield. (From #41782) (#44274) Co-authored-by: Johnny Chen (cherry picked from commit 9c0e5b0d186ea95a06d5b0bdc4bc19d1a17b444d) (cherry picked from commit aa2421dc99544542c816b7c8e8add727673767d3) --- base/reflection.jl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/base/reflection.jl b/base/reflection.jl index bf8ceabe1f39b..5490cae9511c8 100644 --- a/base/reflection.jl +++ b/base/reflection.jl @@ -194,8 +194,23 @@ fieldnames(t::Type{<:Tuple}) = ntuple(identity, fieldcount(t)) Return a boolean indicating whether `T` has `name` as one of its own fields. +See also [`fieldnames`](@ref), [`fieldcount`](@ref), [`hasproperty`](@ref). + !!! compat "Julia 1.2" This function requires at least Julia 1.2. + +# Examples +```jldoctest +julia> struct Foo + bar::Int + end + +julia> hasfield(Foo, :bar) +true + +julia> hasfield(Foo, :x) +false +``` """ function hasfield(T::Type, name::Symbol) @_pure_meta From acbb1f6f74d3df27344a1a40468ee6ffae3f646c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Thu, 24 Feb 2022 18:36:07 +0000 Subject: [PATCH 036/369] [OpenBLAS_jll] Update to v0.3.20 (#44321) (cherry picked from commit 6850940b8115ec6ee0ba9a7cd20185196620b097) --- deps/checksums/openblas | 188 +++++++++--------- deps/openblas.mk | 7 +- deps/openblas.version | 4 +- ...as-julia42415-lapack625-openblas3392.patch | 95 --------- deps/patches/openblas-ofast-power.patch | 19 +- stdlib/OpenBLAS_jll/Project.toml | 2 +- 6 files changed, 108 insertions(+), 207 deletions(-) delete mode 100644 deps/patches/openblas-julia42415-lapack625-openblas3392.patch diff --git a/deps/checksums/openblas b/deps/checksums/openblas index 31e6e27d61d20..1523372d709fa 100644 --- a/deps/checksums/openblas +++ b/deps/checksums/openblas @@ -1,94 +1,94 @@ -OpenBLAS.v0.3.17+2.aarch64-apple-darwin-libgfortran5.tar.gz/md5/9020e93ed6349bab95c2ca7cf21b2ebf -OpenBLAS.v0.3.17+2.aarch64-apple-darwin-libgfortran5.tar.gz/sha512/3058c47b1fecc9d9d63dee30d277fbe665b3641850e72349415c18dc8372971c3f1c36c9cf62ceec672604e70f5b5a0c118e484f63aaf1aba37075324537908b -OpenBLAS.v0.3.17+2.aarch64-linux-gnu-libgfortran3.tar.gz/md5/02f560828fab7c2df6ce7d81927045ed -OpenBLAS.v0.3.17+2.aarch64-linux-gnu-libgfortran3.tar.gz/sha512/54f9acd7842ad8305073dde0e0e689a35e79cdee8f843560091fa3277957b9ca298d1516d027c6f0870d48743a70285714fec4f09e0eb43bd6954e8d6bea3843 -OpenBLAS.v0.3.17+2.aarch64-linux-gnu-libgfortran4.tar.gz/md5/24f4d8eea07a992735fc4433d24cdd74 -OpenBLAS.v0.3.17+2.aarch64-linux-gnu-libgfortran4.tar.gz/sha512/8e1fb731cb9e3e0a9214c01538b2974eb6ed1a69857327e29dd166719491015d9a0695a75100ec804a5f9beaec121cc095f1ddf8c7a417f18a046035f1969c06 -OpenBLAS.v0.3.17+2.aarch64-linux-gnu-libgfortran5.tar.gz/md5/de3d9d1bd4b8d148084499f97ef9eff3 -OpenBLAS.v0.3.17+2.aarch64-linux-gnu-libgfortran5.tar.gz/sha512/d7d31bc345389c5240a5dc7341741264ea328adc3604c8fea3e21914c13c3a1720270427465daccdfce080d2df6723384d2d9e9907db2a24c8fde32e492ccae4 -OpenBLAS.v0.3.17+2.aarch64-linux-musl-libgfortran3.tar.gz/md5/665a8dd827b32769fd307f65f18ce09f -OpenBLAS.v0.3.17+2.aarch64-linux-musl-libgfortran3.tar.gz/sha512/070d015f72d0030838985e949f1855e40997fcf31e1c51a1cc5666d681cb47fb02a289435cebd8ef15346bcb85140b0e164874dcf9e269e8799253fb538ea3f7 -OpenBLAS.v0.3.17+2.aarch64-linux-musl-libgfortran4.tar.gz/md5/fe47ac70b33442c9c7d882ea87e86901 -OpenBLAS.v0.3.17+2.aarch64-linux-musl-libgfortran4.tar.gz/sha512/d97588cb9511225e160fd6fc828a13e8f99ca6e16ecdbf57bc8e7a95296c004ca11316854f90421cf0ac7935a7ec09045324af2de6084b11c62dcdc3e96d1249 -OpenBLAS.v0.3.17+2.aarch64-linux-musl-libgfortran5.tar.gz/md5/fd550b91aec55ed97c86c876f2339edd -OpenBLAS.v0.3.17+2.aarch64-linux-musl-libgfortran5.tar.gz/sha512/53c258962bff09e8a4642c6bd02949792e36b7681bad45b3d21b711428025262cac3b8171530fe97fcf09b31e1e2029c6e32300ee1facb9c7de497beb8a99edb -OpenBLAS.v0.3.17+2.armv6l-linux-gnueabihf-libgfortran3.tar.gz/md5/eb8996220a8d2ab0ff3fccf791c19d2d -OpenBLAS.v0.3.17+2.armv6l-linux-gnueabihf-libgfortran3.tar.gz/sha512/f2a91bb7523ed50607936774c6d31bba81584046e0bfffb2cccb84ac3319fd1700003991edf54d1c0af4b0558637275309d826fac76a908e46f5f58f006baba9 -OpenBLAS.v0.3.17+2.armv6l-linux-gnueabihf-libgfortran4.tar.gz/md5/02b7b39750d7f4dd4b37c0260dd5ecea -OpenBLAS.v0.3.17+2.armv6l-linux-gnueabihf-libgfortran4.tar.gz/sha512/1017388c9141381e37625ade63ad58ee16c0da6ec775e0c8f20e13912e155e9e868024595accc388708c22341e36b5b9cd8f9343c904ea8e7d30ec1bf6c05310 -OpenBLAS.v0.3.17+2.armv6l-linux-gnueabihf-libgfortran5.tar.gz/md5/56cc6e5f74809a81319ed36ca783bb81 -OpenBLAS.v0.3.17+2.armv6l-linux-gnueabihf-libgfortran5.tar.gz/sha512/fc416c3842ffd49a1a201138559f4271d92d6840847b8b224046c6a6310f30044c598aee453ac4f5ea52e5aafe1b3ebe1dd55486883d5197f15bc4dfe0262af6 -OpenBLAS.v0.3.17+2.armv6l-linux-musleabihf-libgfortran3.tar.gz/md5/78d82e6b98ce18f3a0ea92f2e18eb1bb -OpenBLAS.v0.3.17+2.armv6l-linux-musleabihf-libgfortran3.tar.gz/sha512/bc7476532fed7efa0726937cc6ae8e4a693929cff2dc49fe28dc16ad4d3b18265b907ec0c14e12822d00a018d49dfa487fc3d7867da5c428ced381ccfdf346c0 -OpenBLAS.v0.3.17+2.armv6l-linux-musleabihf-libgfortran4.tar.gz/md5/e55e149728e4e2c18957f6db4dc38c4f -OpenBLAS.v0.3.17+2.armv6l-linux-musleabihf-libgfortran4.tar.gz/sha512/e0403a40a91b2f7db4b23ba46b221b39996f7e6c8a417a4b0346c728e1e8520651e0a3a9ef6bcc0214251f34a968a42bfc124ddf4ea6b4fa2d1122a1e7540365 -OpenBLAS.v0.3.17+2.armv6l-linux-musleabihf-libgfortran5.tar.gz/md5/71f7071a2702ccb32cb9eb296c921210 -OpenBLAS.v0.3.17+2.armv6l-linux-musleabihf-libgfortran5.tar.gz/sha512/29861c10bc8fbdb9163c21e133ac972898ce01eadfc38af089cab680d1d059cbd40ed16304ea3b256844c68070233dfce4197d690080cc9ec12961b8d56b5a94 -OpenBLAS.v0.3.17+2.armv7l-linux-gnueabihf-libgfortran3.tar.gz/md5/b6c52ebccedf4d31ad03e4e883c9cb85 -OpenBLAS.v0.3.17+2.armv7l-linux-gnueabihf-libgfortran3.tar.gz/sha512/f9c04600842629b4ad4dea8afcfa54bc2e06bc4f204714d725e1e87044b155261870ec74bebd05ed21739c6e81e2876226732cf65367e12cb3e52c4fac1db332 -OpenBLAS.v0.3.17+2.armv7l-linux-gnueabihf-libgfortran4.tar.gz/md5/3c154804cea0f5b83a5bb278d8a2bac0 -OpenBLAS.v0.3.17+2.armv7l-linux-gnueabihf-libgfortran4.tar.gz/sha512/5ccf2cab5a473619cfca7f381aa4c5da1f2057d10235224aad76d40c9349880d4e0f84dfe173f1f47653c82ff523fffd01bb6360179d2b1e4687029f64fc2d81 -OpenBLAS.v0.3.17+2.armv7l-linux-gnueabihf-libgfortran5.tar.gz/md5/f5cecf92901773f2aebb13cf23e9603b -OpenBLAS.v0.3.17+2.armv7l-linux-gnueabihf-libgfortran5.tar.gz/sha512/855763d0071009c4d799942e86808c90e06c00a78db4350f8b798a414fad333e5b3fca7397cfcdfc06c5718497d1f19a4c19bc79f8d23685d064947585e98a4f -OpenBLAS.v0.3.17+2.armv7l-linux-musleabihf-libgfortran3.tar.gz/md5/16376d821f9b6b16d7b0ee1890ae79af -OpenBLAS.v0.3.17+2.armv7l-linux-musleabihf-libgfortran3.tar.gz/sha512/68319193bfc960d7879cf2370fe17415d15086587958dfc85bb781c26332399b75cf3928ac0e6d727f6d54ecb41425f1bd724eba4bdba2648c73cc860ff7eba6 -OpenBLAS.v0.3.17+2.armv7l-linux-musleabihf-libgfortran4.tar.gz/md5/7d8099352db1e40a02bf80172979b2f3 -OpenBLAS.v0.3.17+2.armv7l-linux-musleabihf-libgfortran4.tar.gz/sha512/5e73b0b13fe6db964332d663475590d750c3a21c85dd9d2bf181acc7834d22ae94eca7cd69f0dfe58fc4b195dfcdb28bdf526d3603e5706350153a71223f377e -OpenBLAS.v0.3.17+2.armv7l-linux-musleabihf-libgfortran5.tar.gz/md5/efd2b34c3931fe3354ab49f8d6fb330c -OpenBLAS.v0.3.17+2.armv7l-linux-musleabihf-libgfortran5.tar.gz/sha512/ce5f743e261e2801beb075b48d87ff756c8fe157042beb2ffc3d7b506cdf182da11d07bd24dd543103d549f20b83212a0d390eb36c3d9ad715d9ca2cabdeca50 -OpenBLAS.v0.3.17+2.i686-linux-gnu-libgfortran3.tar.gz/md5/f52216036e4f1be71257bc876c67d95b -OpenBLAS.v0.3.17+2.i686-linux-gnu-libgfortran3.tar.gz/sha512/f83db9977940844b220a1ba0e2c2f3c63dfd355301e5d14b01ad85599fb931f5b797bc2ace5563ee5df47a243cac1800514cbe4884ca2a33db78cb1f9937185d -OpenBLAS.v0.3.17+2.i686-linux-gnu-libgfortran4.tar.gz/md5/381088794504a68c826d62cc27d14b9c -OpenBLAS.v0.3.17+2.i686-linux-gnu-libgfortran4.tar.gz/sha512/60b8fa109d32764ad9306e386aabb1ee6809aa03e04253a23a6ea97626d520bafa2ae09ea2f6762fa6bc9d88295bf7dd59fd2978e510c3c63925e7a6560947c2 -OpenBLAS.v0.3.17+2.i686-linux-gnu-libgfortran5.tar.gz/md5/f560fcacad77bf87d8d5945c921938e2 -OpenBLAS.v0.3.17+2.i686-linux-gnu-libgfortran5.tar.gz/sha512/9741eea135584ca23b74827ae02c8f2a91dc8a54b83401e0b2e119aca8c48736ba9816fc224a57f853cfe18fd10467b7f9934f3a10a50073af333270622b4796 -OpenBLAS.v0.3.17+2.i686-linux-musl-libgfortran3.tar.gz/md5/2c52064ddbd658e158347b62ffaa1cb2 -OpenBLAS.v0.3.17+2.i686-linux-musl-libgfortran3.tar.gz/sha512/4fba023c3caefe5fdddf27bac7915d075073c6ed0589348c26864686680710b7e84518072c8e94bdf444e25b5063ee6655afefcb1bf72e64ee5e3247e16fb39a -OpenBLAS.v0.3.17+2.i686-linux-musl-libgfortran4.tar.gz/md5/66da3df20820d2ee0de93e8a512aa5dc -OpenBLAS.v0.3.17+2.i686-linux-musl-libgfortran4.tar.gz/sha512/dca0075ba332ce1e68543f77b4ef666265d8e0bb443171d8cd53775800a3b8e13a755a9de067bcf4503835949bd1bc123f241a32fb74ec0014ef642151f36f1c -OpenBLAS.v0.3.17+2.i686-linux-musl-libgfortran5.tar.gz/md5/2df728b678feae582515a048abc6a3d0 -OpenBLAS.v0.3.17+2.i686-linux-musl-libgfortran5.tar.gz/sha512/755480899352f501fd2bc98adf5cd38a0869b7afbb8d3eb4de173d51ab355f31f03937d6fc2a8f560ca840f3adc04084090a11e495b00b04b465ffb1e0d003e5 -OpenBLAS.v0.3.17+2.i686-w64-mingw32-libgfortran3.tar.gz/md5/52b682596ac8a728bef3baa4e3bcc156 -OpenBLAS.v0.3.17+2.i686-w64-mingw32-libgfortran3.tar.gz/sha512/a6b59fef2d03da5a6246bf1832f0dfa654ab99d0275f69f280bdc54d9a8ab19d2ecce4f53d0f2406114ebdac43b09131c7c3982311f627810cd1de3001bd06b9 -OpenBLAS.v0.3.17+2.i686-w64-mingw32-libgfortran4.tar.gz/md5/0b63ad0bbada8158a000b2f1f64579df -OpenBLAS.v0.3.17+2.i686-w64-mingw32-libgfortran4.tar.gz/sha512/ace0c217299296662ed2e2a479096f26e0bf3a14166429b089ca856214c3d46442ad1b71ae94e2b14fe654fc5acdd940e3ad3970f956e75377601fd99f82b270 -OpenBLAS.v0.3.17+2.i686-w64-mingw32-libgfortran5.tar.gz/md5/a03556c3a4ee2d02f956aa011e5a53ad -OpenBLAS.v0.3.17+2.i686-w64-mingw32-libgfortran5.tar.gz/sha512/dde7ea92fdd47ec05edbeeb71fd3d75cb8b5ba5893e18419e47fd1f06032177a9453fc5920c6bd08aec4e2381c5f2c606ce9df7cbbecdda67d2e67aec8be3265 -OpenBLAS.v0.3.17+2.powerpc64le-linux-gnu-libgfortran3.tar.gz/md5/8c8b0dbb3e0c81d9430460c421dd76ab -OpenBLAS.v0.3.17+2.powerpc64le-linux-gnu-libgfortran3.tar.gz/sha512/8639a186f74c9bf4bf5f9e2f69becf700a3ebec4e119519bdbad53fef559fd525e5f532bf7ea5a63bd29059d9c0564eec89a1cf7802cc7f6a3aeb4be9af3cbec -OpenBLAS.v0.3.17+2.powerpc64le-linux-gnu-libgfortran4.tar.gz/md5/e67d9c5a54b6a5dda63e0fe5ef5b24ad -OpenBLAS.v0.3.17+2.powerpc64le-linux-gnu-libgfortran4.tar.gz/sha512/960cd0bf59fed7c70115358a673cc049cb539aa1b015cb473697309327e3b9afb9447b62239d58d8c56a9e8b1955b2b097b31c14b0013cafe77fbb4b967679be -OpenBLAS.v0.3.17+2.powerpc64le-linux-gnu-libgfortran5.tar.gz/md5/028c1ed0a8b84c83ec64b2970b1739fc -OpenBLAS.v0.3.17+2.powerpc64le-linux-gnu-libgfortran5.tar.gz/sha512/2427b8f4de817ffbbd697f8b7caf710c3a3d9c02045a9650e8fde26c891c7cdc70482bda14f067b0cfa29d436a53f4484a00da8caba6188cba9fe25e7b57dc4c -OpenBLAS.v0.3.17+2.x86_64-apple-darwin-libgfortran3.tar.gz/md5/0277b078caf9b0f0a33bf1da351fcac0 -OpenBLAS.v0.3.17+2.x86_64-apple-darwin-libgfortran3.tar.gz/sha512/52c11d822859209f989462aa38cb8c3a7886cd881da40699a06998498d59bfe40276196218c122b8c0c314384a27e7e4b1b6181c818ad1e543cd2af896be521c -OpenBLAS.v0.3.17+2.x86_64-apple-darwin-libgfortran4.tar.gz/md5/d43dd98167a2c99bd4bbd3f52271595b -OpenBLAS.v0.3.17+2.x86_64-apple-darwin-libgfortran4.tar.gz/sha512/5eef221ed4e30090feec8dfa32a732a1987c692dbd2cf943aafb733ad4e5bd669ec55919ca5c89562e2500b4b1fbaffd6b1bbc8de3f71c9dc0037104412bb234 -OpenBLAS.v0.3.17+2.x86_64-apple-darwin-libgfortran5.tar.gz/md5/e93a6128adb949c43ea946ceca159d38 -OpenBLAS.v0.3.17+2.x86_64-apple-darwin-libgfortran5.tar.gz/sha512/3fa4829b0c18085e935b1c3b7b5062a06ab4ebff60948ae6196ada22476798ee68b4e7b637cf3e5df9dc4dc8a5dbf7c924960b89d58de5c45dc8c8ca4834532a -OpenBLAS.v0.3.17+2.x86_64-linux-gnu-libgfortran3.tar.gz/md5/eddb496fe2c7915d61a4ead82c2622ff -OpenBLAS.v0.3.17+2.x86_64-linux-gnu-libgfortran3.tar.gz/sha512/071d471c973bab1986fe32cd76f4f93eba49fbdf0f72561b90d09b846ce8990e20f328ef1ddfa5e0aa1483f4d95ede80d66fde197bdfec47ea9642a2f16b85d0 -OpenBLAS.v0.3.17+2.x86_64-linux-gnu-libgfortran4.tar.gz/md5/91050bb45fc71c6532d9b3a204903cab -OpenBLAS.v0.3.17+2.x86_64-linux-gnu-libgfortran4.tar.gz/sha512/b02a226dab088e289b4bdcbf6f3ad2319ba26fa880ade277383b482c1e65bc056b834056d7eec0c75b425615d4167bfca581252eb31b87bd2b53d597fb8a47f0 -OpenBLAS.v0.3.17+2.x86_64-linux-gnu-libgfortran5.tar.gz/md5/87a0516c856af6128e2ecd2631c19d34 -OpenBLAS.v0.3.17+2.x86_64-linux-gnu-libgfortran5.tar.gz/sha512/73012b9e99c57fc812e0f64fda6233ce204f2cdfc255ebbea221f614fd1d7ccdf5b2e1f017f55864a5dae8febbd1ed2fafb1fb3a79a53b8c1f1c7d6455ab7fed -OpenBLAS.v0.3.17+2.x86_64-linux-musl-libgfortran3.tar.gz/md5/6446a0328a83c504740b81e0a93087c5 -OpenBLAS.v0.3.17+2.x86_64-linux-musl-libgfortran3.tar.gz/sha512/8f77e02f32e69bf24205f10a3524d96d8bf79050d73f51a522db4228744ad9745a02c1bae1fdd3236a195481b93bec06e92a266fcdc36ea1bcedde33362c51d5 -OpenBLAS.v0.3.17+2.x86_64-linux-musl-libgfortran4.tar.gz/md5/6de9e28283dc703e8597cfe81cb036be -OpenBLAS.v0.3.17+2.x86_64-linux-musl-libgfortran4.tar.gz/sha512/9d99cc42bf17ef982c4884774a43beeb2a160db950a31a5b1970dcdac38ffad316bc21830878aae818cfb4235fe486d757c5d67816ffd556b161acbe66c686fd -OpenBLAS.v0.3.17+2.x86_64-linux-musl-libgfortran5.tar.gz/md5/f1ebb2a6447a2a44c52dafe94499b2f3 -OpenBLAS.v0.3.17+2.x86_64-linux-musl-libgfortran5.tar.gz/sha512/9d1b57a4fff907e7f730de7090e285c5158bcda0867730c23e32cfde4e1b4e5d9be27d19df26178d35fc6f578290e43e120ddcd76854df3c9155b6144ab85dcc -OpenBLAS.v0.3.17+2.x86_64-unknown-freebsd-libgfortran3.tar.gz/md5/e12409bcb87b4889aef1ee6055193777 -OpenBLAS.v0.3.17+2.x86_64-unknown-freebsd-libgfortran3.tar.gz/sha512/f93f703bc74ab355b7fd09f057d7cc0de0bc3a21193e7515bdc4601612ae8d2cfdb4afa61c9450db28058c0cf311e93a2c12a0f921633003df7fca0f4a2e47c4 -OpenBLAS.v0.3.17+2.x86_64-unknown-freebsd-libgfortran4.tar.gz/md5/80e9374a5c694c62085099d16e12b0c5 -OpenBLAS.v0.3.17+2.x86_64-unknown-freebsd-libgfortran4.tar.gz/sha512/cb235f5415fbf7b96c5013e9931b5790e15262f2bb65512064af31e1ec31af86f9a64f4b9874ec97c861ed001ebd0602bff860dda0703bf174db80332e77dd02 -OpenBLAS.v0.3.17+2.x86_64-unknown-freebsd-libgfortran5.tar.gz/md5/42a455ed7d2f102617f7344684c6b532 -OpenBLAS.v0.3.17+2.x86_64-unknown-freebsd-libgfortran5.tar.gz/sha512/8e254f1eca11673c859255f257f2015a1fa285554c0697f4602e64770dfa6f7738149d4aadb5f6451cfa2a21c963f61233535ca98af9f0e1b71137eedef99c22 -OpenBLAS.v0.3.17+2.x86_64-w64-mingw32-libgfortran3.tar.gz/md5/d648f4a82c849bb7d6d6a5290868403c -OpenBLAS.v0.3.17+2.x86_64-w64-mingw32-libgfortran3.tar.gz/sha512/a80c9d4af3f4bff2803a1adf1439e1894197a4a86660e5c4bb25741be590e81785711022928910267c862c4368e5aea2f645bb159e23c403135019c6be31780b -OpenBLAS.v0.3.17+2.x86_64-w64-mingw32-libgfortran4.tar.gz/md5/3e1be20b44219134e47e816682b0b8eb -OpenBLAS.v0.3.17+2.x86_64-w64-mingw32-libgfortran4.tar.gz/sha512/03c64778515e007574c9d14b2dc3dc53dddbb01f6af4872858f5006da446be2ed91b0e07d119651d40d8018968cdf2d3fcc8eebd4834d07b25c2201bb6c3183a -OpenBLAS.v0.3.17+2.x86_64-w64-mingw32-libgfortran5.tar.gz/md5/bc04ffe4100d89fc5eced47d1ac894c4 -OpenBLAS.v0.3.17+2.x86_64-w64-mingw32-libgfortran5.tar.gz/sha512/ab8aea7d065a560305821d199d216e3dfe556e3ec1ebfc98507914fab355e2a0231f628fc7fe4c48dffd80d5d4c4a5a90fd540c8ba90236702ef660af635c09e -openblas-d909f9f3d4fc4ccff36d69f178558df154ba1002.tar.gz/md5/4acd59865ca8b50c823bef1354148930 -openblas-d909f9f3d4fc4ccff36d69f178558df154ba1002.tar.gz/sha512/227ee7decccf9bdd2e5754757f590e32ada95b576db9eddc2c74ef06d35aba1db9438acaf57750184baacac741917f7f5ad9f15991d31314480db371fe59cc17 +OpenBLAS.v0.3.20+0.aarch64-apple-darwin-libgfortran5.tar.gz/md5/036acd7c7b68432f01f2a980bc4958be +OpenBLAS.v0.3.20+0.aarch64-apple-darwin-libgfortran5.tar.gz/sha512/db2c995b09b5ab046491257b44a8806fd5e254bbf4b4df6e9281ffc8d199745a3d6fea912da2fdd657447e194c73db52cf7acb348b49fd37758b6fbbbdfd3a93 +OpenBLAS.v0.3.20+0.aarch64-linux-gnu-libgfortran3.tar.gz/md5/7c5de800082f39fea05d1fdf9cdf2e79 +OpenBLAS.v0.3.20+0.aarch64-linux-gnu-libgfortran3.tar.gz/sha512/78775b01c1f24848da6111d9f4746f0b44f5966aa202af00182c4da649e4b4cf630cd1bb90e8ed32f54dfdbee0f6d03b87c171f03fee9b37886634a20546d627 +OpenBLAS.v0.3.20+0.aarch64-linux-gnu-libgfortran4.tar.gz/md5/eefc198718aa837a04e0f8e6dbdc8b0f +OpenBLAS.v0.3.20+0.aarch64-linux-gnu-libgfortran4.tar.gz/sha512/cdc351d992b795732e02698df8f5f31c301dbcd6d995d2a35790461b08f3c942d70e8f7c031a943873eead4fcbd1e73649aafdfdb7450b955f4848be2e9a43de +OpenBLAS.v0.3.20+0.aarch64-linux-gnu-libgfortran5.tar.gz/md5/8d9ced4a8e441713ceb0d79b72b43ca5 +OpenBLAS.v0.3.20+0.aarch64-linux-gnu-libgfortran5.tar.gz/sha512/b1dfc3f4a539d01266e3e5d400864cd445c4bc561de464e2f6c9eb5704541aa436944f6bfc89be1948e9675f1a83098d77fe52f70886dc90d54206c81f350277 +OpenBLAS.v0.3.20+0.aarch64-linux-musl-libgfortran3.tar.gz/md5/fa63d8009ac2605208ceea9f6183acdd +OpenBLAS.v0.3.20+0.aarch64-linux-musl-libgfortran3.tar.gz/sha512/92b8e2fd2bc45c60aaf8d79c59f96b721d969cd3320c0b04989a5a48099cae213fd4a6aa9dca45910d881e495d87863513b23ee7c433c894655cf72c7b009323 +OpenBLAS.v0.3.20+0.aarch64-linux-musl-libgfortran4.tar.gz/md5/68672f9cbcd9bee92c89b19599897034 +OpenBLAS.v0.3.20+0.aarch64-linux-musl-libgfortran4.tar.gz/sha512/4c19f3cb7afb52cd54c3852fef3815a23e57b5c2ebd9b647ad43ee62191b74474c787b22d6213555f38b8233b96d479631881d522c7bdd544954a9f04b51c509 +OpenBLAS.v0.3.20+0.aarch64-linux-musl-libgfortran5.tar.gz/md5/7fd9458e1482d46f761d6a519999a648 +OpenBLAS.v0.3.20+0.aarch64-linux-musl-libgfortran5.tar.gz/sha512/2e20c845deb5c87c6e02a3512728a27204193a764f8ead1a66ce053b66d03bb853bbf40289727b1b635b17423416a7a69c633242c12f98d3ec1eae5e82a88613 +OpenBLAS.v0.3.20+0.armv6l-linux-gnueabihf-libgfortran3.tar.gz/md5/0868668b73c84e14edb634482d59eddc +OpenBLAS.v0.3.20+0.armv6l-linux-gnueabihf-libgfortran3.tar.gz/sha512/c87f91120db8d3b32cc12077b1e36110f89253fde22aae9de88945fc731ee74271acf31cabac9971635725f586b65cf6b1b9badebcbba5408b0ff4c68b580ccf +OpenBLAS.v0.3.20+0.armv6l-linux-gnueabihf-libgfortran4.tar.gz/md5/9e84b7585acf2bb71781002b2238d888 +OpenBLAS.v0.3.20+0.armv6l-linux-gnueabihf-libgfortran4.tar.gz/sha512/14b57f9d5691997cf01bc6187a1a1d58d07d162ab8eb2a480e7c42f0cff1583161c8b1a059c9eeb83e7ed276c8ffe2e193db001a3b51724e5af24c72f5e33572 +OpenBLAS.v0.3.20+0.armv6l-linux-gnueabihf-libgfortran5.tar.gz/md5/a4768ea555e68fc755da169f1c7eb21c +OpenBLAS.v0.3.20+0.armv6l-linux-gnueabihf-libgfortran5.tar.gz/sha512/490ce2b60cda0b5ed40df103e79b83ab75dd03779ea88b0ae5d3b76acadcf4810b35f69566e396b438d881130e43fd0dbff1672d0383dc7fe275f44574d8830b +OpenBLAS.v0.3.20+0.armv6l-linux-musleabihf-libgfortran3.tar.gz/md5/1a4e7e7cfdefcd878c18bab39b9c80cc +OpenBLAS.v0.3.20+0.armv6l-linux-musleabihf-libgfortran3.tar.gz/sha512/15b512728b49782717770f044958ed3afcd54d6cc70b362a7c96dbadf7599bdcdd157ee021287a70e45957d0a856417540e64e2399cc392b9de55036d607fa29 +OpenBLAS.v0.3.20+0.armv6l-linux-musleabihf-libgfortran4.tar.gz/md5/63ce4aa67d1d56f2cf456285546d3eeb +OpenBLAS.v0.3.20+0.armv6l-linux-musleabihf-libgfortran4.tar.gz/sha512/ac0bd761ef574d3533fa7f6110b9ecf992edf7a68c20fff4faf4b7372d3de4c5ed558119dcdb669296aab5c0da5ce0f51f54abfe998958e1924cfa0eb958305e +OpenBLAS.v0.3.20+0.armv6l-linux-musleabihf-libgfortran5.tar.gz/md5/581bcbd14328d82258511f8b91d8bf84 +OpenBLAS.v0.3.20+0.armv6l-linux-musleabihf-libgfortran5.tar.gz/sha512/be66567c762f70885b187dc8912f83003c69dd5000387b5b82162ba9f47acb17d855f8f5bda2f31d3fc7e01d2aae3cd6b2392632d70ec34f2d648010a8b11f38 +OpenBLAS.v0.3.20+0.armv7l-linux-gnueabihf-libgfortran3.tar.gz/md5/30dfd96f7f3d35df95e70d506f35c9f2 +OpenBLAS.v0.3.20+0.armv7l-linux-gnueabihf-libgfortran3.tar.gz/sha512/84213bbff84899882ab43599f3aeab1c6e3ee8f7158a3873ec2d6a3166e69036c16d742d25c476468f64b6644a2f798485e50427139880f1ae933ad507a2952c +OpenBLAS.v0.3.20+0.armv7l-linux-gnueabihf-libgfortran4.tar.gz/md5/4b82a4e68a43d29538a318763004aa94 +OpenBLAS.v0.3.20+0.armv7l-linux-gnueabihf-libgfortran4.tar.gz/sha512/94d35902c34e6fa68a0648cab65db49650c73ed21d69ee667350cbbb81028413b92fc30e16504648a6b42039f483d327264a3ff39d546cd30241f4672f9300a2 +OpenBLAS.v0.3.20+0.armv7l-linux-gnueabihf-libgfortran5.tar.gz/md5/7e290717c23a468383bd66b46eb58fac +OpenBLAS.v0.3.20+0.armv7l-linux-gnueabihf-libgfortran5.tar.gz/sha512/432cf42a320a265b9259d743eaca75b884663877858149b0feb83948436a941940955c0c89c6de9ca114f0bbf153127a046813195f4669a81cab1ce244cc5a6b +OpenBLAS.v0.3.20+0.armv7l-linux-musleabihf-libgfortran3.tar.gz/md5/f72bf36862607c57fc9cee5dc3f94dac +OpenBLAS.v0.3.20+0.armv7l-linux-musleabihf-libgfortran3.tar.gz/sha512/caecc044e25d2939eec45924d69e64d3854fc54626a56126454fb3855ae2dabf36fc248d7ef9d240f15e8883787a43539e2a0d8dc68fc5c93a094ded94f3b976 +OpenBLAS.v0.3.20+0.armv7l-linux-musleabihf-libgfortran4.tar.gz/md5/66bfd606fc80e02999ad44243d3b686a +OpenBLAS.v0.3.20+0.armv7l-linux-musleabihf-libgfortran4.tar.gz/sha512/b3d76ccf40af1de018e829f5dd696c6d18ad1fd96657a06d190a9d4e939cad5062a3a2ffaeca2ce7f75e822694ae0b817568dd8f115e089a59590bb34af264f8 +OpenBLAS.v0.3.20+0.armv7l-linux-musleabihf-libgfortran5.tar.gz/md5/ef7aca842a623246b4e2876ff28c53ef +OpenBLAS.v0.3.20+0.armv7l-linux-musleabihf-libgfortran5.tar.gz/sha512/a59feb34806d651a2a3614bcc5203407db626e96dabeb6bb12b8d73915cfd87dc02b0e54704c5d0f1b8ab984d85ee64509a934884640d2522fc4a9835989aed8 +OpenBLAS.v0.3.20+0.i686-linux-gnu-libgfortran3.tar.gz/md5/f2ba9ed0f68447aeddfcf3ac883cf83b +OpenBLAS.v0.3.20+0.i686-linux-gnu-libgfortran3.tar.gz/sha512/1b6f300febf5ceeb0045c46cc3d6e9f2481cba2ceb97dcafff1667f06b8b96a2ad4975853e6bc2e3e6715ade28be5fb569fdae005f4fca2140a5557d4a0845ca +OpenBLAS.v0.3.20+0.i686-linux-gnu-libgfortran4.tar.gz/md5/b39347f487b46996de98d9a453ae804e +OpenBLAS.v0.3.20+0.i686-linux-gnu-libgfortran4.tar.gz/sha512/a923a92467b4582f69ec9d96556c8f2ef55a3f99dacecf0491da9740912d14d09a9ba86bdb5fcfbaab87250c57a0c077c2f6ccc08bf3236ba5c7d98822e9c32a +OpenBLAS.v0.3.20+0.i686-linux-gnu-libgfortran5.tar.gz/md5/6d9b4adf3fa54151c45b832b5869409e +OpenBLAS.v0.3.20+0.i686-linux-gnu-libgfortran5.tar.gz/sha512/f15583c15fb4e4b6a38353fbbce2aa57c8f46d58e6c5464a685e5fb0afd76f1bf9b3986c1d34af643a8c9b3a8a24ef63389982c2e8ffbf91a63e8f1ccca2cce5 +OpenBLAS.v0.3.20+0.i686-linux-musl-libgfortran3.tar.gz/md5/fa46f28f624e8c0752bb76abc04a41d5 +OpenBLAS.v0.3.20+0.i686-linux-musl-libgfortran3.tar.gz/sha512/76018ed804f25212760f1128f7d3823a1c8ba72b8cf5d83aa5be5c5f6e3de8076b04be9d5b659af75e3c2fd5cb9a0654dba59651f010534faf174a6c7d836cd3 +OpenBLAS.v0.3.20+0.i686-linux-musl-libgfortran4.tar.gz/md5/48411109935a2ada9d2e336515f36b6f +OpenBLAS.v0.3.20+0.i686-linux-musl-libgfortran4.tar.gz/sha512/9be06c11fb248d6da47dab21f60d1eec6b486a137048f79f2138b5fe6818846ac198da7d73ab93ec161e8861d7e670b587b6eeb846c571497e96023934127903 +OpenBLAS.v0.3.20+0.i686-linux-musl-libgfortran5.tar.gz/md5/b0a81e44dd4a216c60b6ff139512d7b5 +OpenBLAS.v0.3.20+0.i686-linux-musl-libgfortran5.tar.gz/sha512/1b1c3cc5e62af6af8e106c60c59d7ff685d567e93dce19643ba8c0547200000bae96a3473573619ab235c34ff8e65745266001cdc868e948ff3ecaa9ba93389f +OpenBLAS.v0.3.20+0.i686-w64-mingw32-libgfortran3.tar.gz/md5/18988c19ea5bdb81d97f8ce4456319f6 +OpenBLAS.v0.3.20+0.i686-w64-mingw32-libgfortran3.tar.gz/sha512/466d6b05dcf00b6f09c1a8b8fda97a0035838d73d77954f6cd499358e8160af6cf3e8aac97d0f7ba7ced144db1362a9ba126fb113a4469c232a6b9706dc3dc32 +OpenBLAS.v0.3.20+0.i686-w64-mingw32-libgfortran4.tar.gz/md5/d0aa399c07712e9a520a6cb8067bda63 +OpenBLAS.v0.3.20+0.i686-w64-mingw32-libgfortran4.tar.gz/sha512/7c3e0b1c18812719be4d86a641d25d927c9c8cbc6e1571c7a46ca27672ada00cbe3879faf0b5aeaaa0454907551953a20a56be0bc24b651df117532ace2f9067 +OpenBLAS.v0.3.20+0.i686-w64-mingw32-libgfortran5.tar.gz/md5/90d51a2f41c11fc8d1896597dd106cd6 +OpenBLAS.v0.3.20+0.i686-w64-mingw32-libgfortran5.tar.gz/sha512/683c40193ec7a4612c4a36e9d9f6d9443bfb72dbfed7fa10b200305c94589fd75362670d9b4d7646f24b4f7933cfc55a2496030907e2d3fd30b0eed8b6a2d10b +OpenBLAS.v0.3.20+0.powerpc64le-linux-gnu-libgfortran3.tar.gz/md5/30d5022d6f52adccfaf6b3dd837b6151 +OpenBLAS.v0.3.20+0.powerpc64le-linux-gnu-libgfortran3.tar.gz/sha512/433a520458d6804eccf69c74fe357e6d819223b0398007f17420a6aa77a466177d9dcd4f467821b4d99f4397f5e0c1dc0864512a7f69c43f23bc40b6414449b6 +OpenBLAS.v0.3.20+0.powerpc64le-linux-gnu-libgfortran4.tar.gz/md5/2848232be1646333d6d413a588519d99 +OpenBLAS.v0.3.20+0.powerpc64le-linux-gnu-libgfortran4.tar.gz/sha512/edb51d55f602d2a271109dbc12e59e23c232e58833bcc34dd857858d10d318eac99ba300fe4c6480b995e152ff036ff175218a2f4b29910a27f1861543d1e978 +OpenBLAS.v0.3.20+0.powerpc64le-linux-gnu-libgfortran5.tar.gz/md5/8bd4f4d571dc382eaf0084000596276e +OpenBLAS.v0.3.20+0.powerpc64le-linux-gnu-libgfortran5.tar.gz/sha512/f9507f6dc53c632e0f26de074bcd312956b2fb492e9f1d32e3cdf1a6099d6f2b17eea09ae825b2414a28dfbd6958813cffa289fde0a15cf7cba4e6b3653d2a28 +OpenBLAS.v0.3.20+0.x86_64-apple-darwin-libgfortran3.tar.gz/md5/c644f00642c69946d12b8f1f96a8e766 +OpenBLAS.v0.3.20+0.x86_64-apple-darwin-libgfortran3.tar.gz/sha512/2bd51e9adda3e0955ab26c5c178e9a75a8d9c1b4cd2fd221bbb7b9eb72337cd5034f42b53aaddcf97a807e01f2b9836f9be95a5c6517c831374a3b5148b6e380 +OpenBLAS.v0.3.20+0.x86_64-apple-darwin-libgfortran4.tar.gz/md5/cea0d5ad3528298e4512c900a13f21ec +OpenBLAS.v0.3.20+0.x86_64-apple-darwin-libgfortran4.tar.gz/sha512/379ad13b723acde1d2239335c2611a9ebd2abe1432931d4c2395fce9f50bbd5d830a23fd5ea5afc1fc251704e4ed880468abde42bb0ea75b6bb0abb9a7753c5b +OpenBLAS.v0.3.20+0.x86_64-apple-darwin-libgfortran5.tar.gz/md5/bc726288a19a8bdcef3205de12b5f172 +OpenBLAS.v0.3.20+0.x86_64-apple-darwin-libgfortran5.tar.gz/sha512/3e26b8a2075f997ded8750d84e3257b895e7e05adac77d836e66fa7478b43368b7d4b7a458c6991cb642ce0d135b1b507dade7302c4f5a44aabe637849bc1acb +OpenBLAS.v0.3.20+0.x86_64-linux-gnu-libgfortran3.tar.gz/md5/d162add49c7ee74dfc23b820bbd363b6 +OpenBLAS.v0.3.20+0.x86_64-linux-gnu-libgfortran3.tar.gz/sha512/70bcc15f37e4cd822c2f95d8fd23e912829450825399d31c29c00a4ea219ca37f8831d3132ae4b5972fe9ec95c304bd1274a12ec8a8b289b1830cfb7ca0392d7 +OpenBLAS.v0.3.20+0.x86_64-linux-gnu-libgfortran4.tar.gz/md5/f036c51e0954b8b76e3023280144b5ff +OpenBLAS.v0.3.20+0.x86_64-linux-gnu-libgfortran4.tar.gz/sha512/2101747ec254f51fe5c2cfc49ce9599aeacf0d3e7bcb14c9ccaa59d8b0f7e9dcda98ab3ff38973817b736a33ddf654e17748d8a9c3b40e5352a198278484a2f0 +OpenBLAS.v0.3.20+0.x86_64-linux-gnu-libgfortran5.tar.gz/md5/143d8e7cf2fb615ccab6617bffa4acf7 +OpenBLAS.v0.3.20+0.x86_64-linux-gnu-libgfortran5.tar.gz/sha512/6e72144f83cb329301feedea02581a100d137f3b209af4983500c432b6d23cc7473c85a7b1ba90e24965508e74a191b49cea8820b5899793440c3ce067acbe06 +OpenBLAS.v0.3.20+0.x86_64-linux-musl-libgfortran3.tar.gz/md5/871863002d0053784a81409b4581c8cd +OpenBLAS.v0.3.20+0.x86_64-linux-musl-libgfortran3.tar.gz/sha512/908936494c981e14bcd7818043efe979d9522ae1c9ebcd69feb853c46a2249da1cb5292844d0de7276762a21ad8680a1117229f3ad53332b536233d8722c4d85 +OpenBLAS.v0.3.20+0.x86_64-linux-musl-libgfortran4.tar.gz/md5/ce4897980b12374801095fadfad11196 +OpenBLAS.v0.3.20+0.x86_64-linux-musl-libgfortran4.tar.gz/sha512/ba551942563a58fd22d182a29cee83ce5f51db10e52bc8cb27d979dc71632484e1acb713d4304d773c3111d5dba532bd65651374e91a364f8125295acacfffd4 +OpenBLAS.v0.3.20+0.x86_64-linux-musl-libgfortran5.tar.gz/md5/301ae23724b44c1d10e4febdc6738df3 +OpenBLAS.v0.3.20+0.x86_64-linux-musl-libgfortran5.tar.gz/sha512/2f1479b1f1d10682751b025493bc38cd5eb9854620024b1f0ac45ba0f7a7621b4795c4c2f89eece5c80b671387d095b118d58d8ba201214f45bcea1ac64fca91 +OpenBLAS.v0.3.20+0.x86_64-unknown-freebsd-libgfortran3.tar.gz/md5/51088d57d2a9e9e50259128a0ac48727 +OpenBLAS.v0.3.20+0.x86_64-unknown-freebsd-libgfortran3.tar.gz/sha512/c88b1eb662c16b75c46a25959f6fff22de2cfb2a97ff1c0cd482528e83d54a4d8bbf33c3e7d6a79ad75998d0c6d46ef6f245e8ad406d1a072907138d7ca4a34c +OpenBLAS.v0.3.20+0.x86_64-unknown-freebsd-libgfortran4.tar.gz/md5/06167501fc4cc7b6587ead3696ef72af +OpenBLAS.v0.3.20+0.x86_64-unknown-freebsd-libgfortran4.tar.gz/sha512/a853a4c5163e0bc0266e75df0b208794e8439a008b625b520b51e7891825a355960f62fe2275e4f849c345862fabf0339d0d22d4bdcd87acfb17ffd65627f74d +OpenBLAS.v0.3.20+0.x86_64-unknown-freebsd-libgfortran5.tar.gz/md5/73a43356c9bf374765a2bc8910e2eb49 +OpenBLAS.v0.3.20+0.x86_64-unknown-freebsd-libgfortran5.tar.gz/sha512/0c2092789f4eeab1725cdfd7d308a2ede054b993d6d1a83f671c5c8e9f651565c282af7371c958c61a57679a233d3f62a287afb44225498dc31249f6821ddf98 +OpenBLAS.v0.3.20+0.x86_64-w64-mingw32-libgfortran3.tar.gz/md5/46bd5ef0708671aeb2a533476a04591b +OpenBLAS.v0.3.20+0.x86_64-w64-mingw32-libgfortran3.tar.gz/sha512/1b0a3f9e61101cbf455da70056dea75637f3008df727072a22150072e7bfc773294378fc42a492b2351f9af2d6b7866503c0039f8addeab07d4f4b5d0f42b5fb +OpenBLAS.v0.3.20+0.x86_64-w64-mingw32-libgfortran4.tar.gz/md5/7e412c9961e4762c40cca9c27e5c9aa2 +OpenBLAS.v0.3.20+0.x86_64-w64-mingw32-libgfortran4.tar.gz/sha512/6a275bd153bb0ba227f39ffbfe95ee1f84f42f79361f7d3a7b1a5c29ca253b8d8b2427ce389f10cf2b95fb87d91dcdf1144f24c82d11320a0aad7dfb8d3c0498 +OpenBLAS.v0.3.20+0.x86_64-w64-mingw32-libgfortran5.tar.gz/md5/2a24ea7c7a9bdf8069d7f62c55d09bb5 +OpenBLAS.v0.3.20+0.x86_64-w64-mingw32-libgfortran5.tar.gz/sha512/7f9134df42be432199119b2a5ef5df2552247cca8647546fb755901d5903030fd5cb565c711248f173c71409cd3b30609a2adadf0213c9a096a9b70298b29a87 +openblas-0b678b19dc03f2a999d6e038814c4c50b9640a4e.tar.gz/md5/4586a405791fb16775eb9aecdd7daa59 +openblas-0b678b19dc03f2a999d6e038814c4c50b9640a4e.tar.gz/sha512/c34a498f2f1ecf65c5174a198022558bf6626eb6da0c4191762a35fd9d335c67dd17246cee3ef503301738a202650aaefe5e0073d8abefd3d1b8ba19cc953304 diff --git a/deps/openblas.mk b/deps/openblas.mk index 50873c9220f08..d4ee63a543bf0 100644 --- a/deps/openblas.mk +++ b/deps/openblas.mk @@ -90,12 +90,7 @@ $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/openblas-ofast-power.patch-applied: $(BUILDDIR)/ patch -p1 -f < $(SRCDIR)/patches/openblas-ofast-power.patch echo 1 > $@ -$(BUILDDIR)/$(OPENBLAS_SRC_DIR)/openblas-julia42415-lapack625-openblas3392.patch-applied: $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/openblas-ofast-power.patch-applied - cd $(BUILDDIR)/$(OPENBLAS_SRC_DIR) && \ - patch -p1 -f < $(SRCDIR)/patches/openblas-julia42415-lapack625-openblas3392.patch - echo 1 > $@ - -$(BUILDDIR)/$(OPENBLAS_SRC_DIR)/neoverse-generic-kernels.patch-applied: $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/openblas-julia42415-lapack625-openblas3392.patch-applied +$(BUILDDIR)/$(OPENBLAS_SRC_DIR)/neoverse-generic-kernels.patch-applied: $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/openblas-ofast-power.patch-applied cd $(BUILDDIR)/$(OPENBLAS_SRC_DIR) && \ patch -p1 -f < $(SRCDIR)/patches/neoverse-generic-kernels.patch echo 1 > $@ diff --git a/deps/openblas.version b/deps/openblas.version index 346e75dac614b..ceb01600b0ea7 100644 --- a/deps/openblas.version +++ b/deps/openblas.version @@ -1,2 +1,2 @@ -OPENBLAS_BRANCH=v0.3.17 -OPENBLAS_SHA1=d909f9f3d4fc4ccff36d69f178558df154ba1002 +OPENBLAS_BRANCH=v0.3.20 +OPENBLAS_SHA1=0b678b19dc03f2a999d6e038814c4c50b9640a4e diff --git a/deps/patches/openblas-julia42415-lapack625-openblas3392.patch b/deps/patches/openblas-julia42415-lapack625-openblas3392.patch deleted file mode 100644 index e7b874b961cca..0000000000000 --- a/deps/patches/openblas-julia42415-lapack625-openblas3392.patch +++ /dev/null @@ -1,95 +0,0 @@ -From 2be5ee3cca97a597f2ee2118808a2d5eacea050c Mon Sep 17 00:00:00 2001 -From: Martin Kroeker -Date: Fri, 1 Oct 2021 11:17:21 +0200 -Subject: [PATCH 1/4] Fix out of bounds read in ?llarv (Reference-LAPACK PR - 625) - ---- - lapack-netlib/SRC/clarrv.f | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lapack-netlib/SRC/clarrv.f b/lapack-netlib/SRC/clarrv.f -index a45f55ac3b..26a9febc87 100644 ---- a/lapack-netlib/SRC/clarrv.f -+++ b/lapack-netlib/SRC/clarrv.f -@@ -351,7 +351,7 @@ SUBROUTINE CLARRV( N, VL, VU, D, L, PIVMIN, - * - * Quick return if possible - * -- IF( N.LE.0 ) THEN -+ IF( (N.LE.0) .OR. (M.LE.0) ) THEN - RETURN - END IF - * - -From fe497efa0510466fd93578aaf9da1ad8ed4edbe7 Mon Sep 17 00:00:00 2001 -From: Martin Kroeker -Date: Fri, 1 Oct 2021 11:18:20 +0200 -Subject: [PATCH 2/4] Fix out of bounds read in ?llarv (Reference-LAPACK PR - 625) - ---- - lapack-netlib/SRC/dlarrv.f | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lapack-netlib/SRC/dlarrv.f b/lapack-netlib/SRC/dlarrv.f -index 4a59a2bbf9..a1c6e9c9d7 100644 ---- a/lapack-netlib/SRC/dlarrv.f -+++ b/lapack-netlib/SRC/dlarrv.f -@@ -353,7 +353,7 @@ SUBROUTINE DLARRV( N, VL, VU, D, L, PIVMIN, - * - * Quick return if possible - * -- IF( N.LE.0 ) THEN -+ IF( (N.LE.0).OR.(M.LE.0) ) THEN - RETURN - END IF - * - -From ddb0ff5353637bb5f5ad060c9620e334c143e3d7 Mon Sep 17 00:00:00 2001 -From: Martin Kroeker -Date: Fri, 1 Oct 2021 11:19:07 +0200 -Subject: [PATCH 3/4] Fix out of bounds read in ?llarv (Reference-LAPACK PR - 625) - ---- - lapack-netlib/SRC/slarrv.f | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lapack-netlib/SRC/slarrv.f b/lapack-netlib/SRC/slarrv.f -index 04519fde8c..9448b2fd92 100644 ---- a/lapack-netlib/SRC/slarrv.f -+++ b/lapack-netlib/SRC/slarrv.f -@@ -353,7 +353,7 @@ SUBROUTINE SLARRV( N, VL, VU, D, L, PIVMIN, - * - * Quick return if possible - * -- IF( N.LE.0 ) THEN -+ IF( (N.LE.0).OR.(M.LE.0) ) THEN - RETURN - END IF - * - -From 337b65133df174796794871b3988cd03426e6d41 Mon Sep 17 00:00:00 2001 -From: Martin Kroeker -Date: Fri, 1 Oct 2021 11:19:53 +0200 -Subject: [PATCH 4/4] Fix out of bounds read in ?llarv (Reference-LAPACK PR - 625) - ---- - lapack-netlib/SRC/zlarrv.f | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lapack-netlib/SRC/zlarrv.f b/lapack-netlib/SRC/zlarrv.f -index 23976dbefe..8d10e3c2e3 100644 ---- a/lapack-netlib/SRC/zlarrv.f -+++ b/lapack-netlib/SRC/zlarrv.f -@@ -351,7 +351,7 @@ SUBROUTINE ZLARRV( N, VL, VU, D, L, PIVMIN, - * - * Quick return if possible - * -- IF( N.LE.0 ) THEN -+ IF( (N.LE.0).OR.(M.LE.0) ) THEN - RETURN - END IF - * diff --git a/deps/patches/openblas-ofast-power.patch b/deps/patches/openblas-ofast-power.patch index c741496cae757..405e3f7581331 100644 --- a/deps/patches/openblas-ofast-power.patch +++ b/deps/patches/openblas-ofast-power.patch @@ -1,17 +1,18 @@ diff --git a/Makefile.power b/Makefile.power -index 946f5523..19593050 100644 +index 28a0bae0..b4869fbd 100644 --- a/Makefile.power +++ b/Makefile.power -@@ -11,14 +11,14 @@ endif - +@@ -11,7 +11,7 @@ endif + ifeq ($(CORE), POWER10) ifneq ($(C_COMPILER), PGI) -CCOMMON_OPT += -Ofast -mcpu=power10 -mtune=power10 -mvsx -fno-fast-math +CCOMMON_OPT += -mcpu=power10 -mtune=power10 -mvsx -fno-fast-math - FCOMMON_OPT += -O2 -frecursive -mcpu=power10 -mtune=power10 -fno-fast-math - endif - endif - + ifeq ($(F_COMPILER), IBM) + FCOMMON_OPT += -O2 -qrecur -qnosave + else +@@ -22,7 +22,7 @@ endif + ifeq ($(CORE), POWER9) ifneq ($(C_COMPILER), PGI) -CCOMMON_OPT += -Ofast -mvsx -fno-fast-math @@ -19,8 +20,8 @@ index 946f5523..19593050 100644 ifeq ($(C_COMPILER), GCC) ifneq ($(GCCVERSIONGT4), 1) $(warning your compiler is too old to fully support POWER9, getting a newer version of gcc is recommended) -@@ -51,7 +51,7 @@ endif - +@@ -59,7 +59,7 @@ endif + ifeq ($(CORE), POWER8) ifneq ($(C_COMPILER), PGI) -CCOMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -fno-fast-math diff --git a/stdlib/OpenBLAS_jll/Project.toml b/stdlib/OpenBLAS_jll/Project.toml index 3ab110db99410..21fa9e9f0a0e6 100644 --- a/stdlib/OpenBLAS_jll/Project.toml +++ b/stdlib/OpenBLAS_jll/Project.toml @@ -1,6 +1,6 @@ name = "OpenBLAS_jll" uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" -version = "0.3.17+2" +version = "0.3.20+0" [deps] CompilerSupportLibraries_jll = "e66e0078-7015-5450-92f7-15fbd957f2ae" From e12020f966e70a4db26abd3b00ca4f922ddc16f6 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Thu, 24 Feb 2022 17:08:37 -0500 Subject: [PATCH 037/369] fix #43411, wrapped `NamedTuple` can be bitstype more often (#44311) (cherry picked from commit f20d5de466def02ec88e2889e80e24e736b0ade4) --- src/jltypes.c | 2 ++ test/core.jl | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/jltypes.c b/src/jltypes.c index a24e9f7e488bd..e19b4c536d94d 100644 --- a/src/jltypes.c +++ b/src/jltypes.c @@ -61,6 +61,8 @@ static int layout_uses_free_typevars(jl_value_t *v, jl_typeenv_t *env) jl_datatype_t *dt = (jl_datatype_t*)v; if (dt->layout || dt->isconcretetype || !dt->name->mayinlinealloc) return 0; + if (dt->name == jl_namedtuple_typename) + return layout_uses_free_typevars(jl_tparam0(dt), env) || layout_uses_free_typevars(jl_tparam1(dt), env); jl_svec_t *types = jl_get_fieldtypes(dt); size_t i, l = jl_svec_len(types); for (i = 0; i < l; i++) { diff --git a/test/core.jl b/test/core.jl index 43d6da062560b..6dbd8f3d9fa0e 100644 --- a/test/core.jl +++ b/test/core.jl @@ -7324,6 +7324,12 @@ end @test isbitstype(X41654) @test ('a'=>X41654(),)[1][2] isa X41654 +# issue #43411 +struct A43411{S, T} + x::NamedTuple{S, T} +end +@test isbitstype(A43411{(:a,), Tuple{Int}}) + # Issue #34206/34207 function mre34206(a, n) va = view(a, :) From b4e22094aad654770fe331f8f5b238c69a979e5c Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Thu, 24 Feb 2022 14:52:14 -0800 Subject: [PATCH 038/369] [macOS] Codesign binary-dist tarballs (#44305) Because we're starting to distribute macOS tarballs as well, let's codesign them by default, when possible. (cherry picked from commit 6b29ebda35b6c844198c5d1533587711a6700df2) --- Makefile | 12 ++++++++++++ contrib/mac/app/Makefile | 3 +++ 2 files changed, 15 insertions(+) diff --git a/Makefile b/Makefile index 086ed515c62b7..952b9a00c1e63 100644 --- a/Makefile +++ b/Makefile @@ -427,9 +427,21 @@ ifeq ($(OS), Linux) endif ifeq ($(OS), WINNT) cd $(BUILDROOT)/julia-$(JULIA_COMMIT)/bin && rm -f llvm* llc.exe lli.exe opt.exe LTO.dll bugpoint.exe macho-dump.exe +endif + # If we're on macOS, and we have a codesigning identity, then codesign the binary-dist tarball! +ifeq ($(OS),Darwin) +ifneq ($(MACOS_CODESIGN_IDENTITY),) + echo "Codesigning with identity $(MACOS_CODESIGN_IDENTITY)"; \ + MACHO_FILES=$$(find "$(BUILDROOT)/julia-$(JULIA_COMMIT)" -type f -perm -0111 | cut -d: -f1); \ + for f in $${MACHO_FILES}; do \ + echo "Codesigning $${f}..."; \ + codesign -s "$(MACOS_CODESIGN_IDENTITY)" --option=runtime --entitlements $(JULIAHOME)/contrib/mac/app/Entitlements.plist -vvv --timestamp --deep --force "$${f}"; \ + done +endif endif cd $(BUILDROOT) && $(TAR) zcvf $(JULIA_BINARYDIST_FILENAME).tar.gz julia-$(JULIA_COMMIT) + exe: # run Inno Setup to compile installer $(call spawn,$(JULIAHOME)/dist-extras/inno/iscc.exe /DAppVersion=$(JULIA_VERSION) /DSourceDir="$(call cygpath_w,$(BUILDROOT)/julia-$(JULIA_COMMIT))" /DRepoDir="$(call cygpath_w,$(JULIAHOME))" /F"$(JULIA_BINARYDIST_FILENAME)" /O"$(call cygpath_w,$(BUILDROOT))" $(INNO_ARGS) $(call cygpath_w,$(JULIAHOME)/contrib/windows/build-installer.iss)) diff --git a/contrib/mac/app/Makefile b/contrib/mac/app/Makefile index edb6f868c9486..81b7e47cdf2cf 100644 --- a/contrib/mac/app/Makefile +++ b/contrib/mac/app/Makefile @@ -50,6 +50,9 @@ dmg/$(APP_NAME): startup.applescript julia.icns make -C $(JULIAHOME) binary-dist tar zxf $(JULIAHOME)/$(JULIA_BINARYDIST_FILENAME).tar.gz -C $@/Contents/Resources/julia --strip-components 1 find $@/Contents/Resources/julia -type f -exec chmod -w {} \; + # Even though the tarball may already be signed, we re-sign here to make it easier to add + # unsigned executables (like the app launcher) and whatnot, without needing to maintain lists + # of what is or is not signed. Codesigning is cheap, so might as well do it early and often. if [ -n "$$MACOS_CODESIGN_IDENTITY" ]; then \ echo "Codesigning with identity $$MACOS_CODESIGN_IDENTITY"; \ MACHO_FILES=$$(find "$@" -type f -perm -0111 | cut -d: -f1); \ From 24e3c06fbda94f01a52fae222a53512db0d46381 Mon Sep 17 00:00:00 2001 From: Yichao Yu Date: Fri, 25 Feb 2022 09:48:24 -0500 Subject: [PATCH 039/369] Make sure all the relocations are filled in for partially cloned target (#44262) We collect the relocations (i.e. the GOT slots that is used in the code) for each target in `tgt.relocs`. Needing a relocation, however, does not imply that the function is cloned for this target within the group (It does mean that at least one target in the group has it cloned). The previous version would miss the relocation in this case. This was triggerred with the following cloning situation caller: clone_1 callee: clone_1, clone_1.clone_3 Since caller.clone_1 may call either callee.clone_1 or callee.clone_1.clone_3 a relocation for callee will be used and is required to be initialized. In addition to target 1, target 2 (and in fact target 3) within group 1 will also use caller.clone_1. However, since callee isn't cloned for target 2 the previous version wouldn't have saved this slot in the relocation array. (cherry picked from commit 76fc067185ce7737247122b5a1781f079a8f0711) --- src/llvm-multiversioning.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/llvm-multiversioning.cpp b/src/llvm-multiversioning.cpp index 57e90a9aa8056..afbe712f32c13 100644 --- a/src/llvm-multiversioning.cpp +++ b/src/llvm-multiversioning.cpp @@ -1052,7 +1052,7 @@ void CloneCtx::emit_metadata() idxs.push_back(baseidx); for (uint32_t j = 0; j < nfvars; j++) { auto base_f = grp->base_func(fvars[j]); - if (shared_relocs.count(j)) { + if (shared_relocs.count(j) || tgt->relocs.count(j)) { count++; idxs.push_back(jl_sysimg_tag_mask | j); auto f = map_get(*tgt->vmap, base_f, base_f); @@ -1060,7 +1060,7 @@ void CloneCtx::emit_metadata() } else if (auto f = map_get(*tgt->vmap, base_f)) { count++; - idxs.push_back(tgt->relocs.count(j) ? (jl_sysimg_tag_mask | j) : j); + idxs.push_back(j); offsets.push_back(get_ptrdiff32(cast(f), fbase)); } } From bfaabceb3d2ee32321bf2ba19338a75a7deab543 Mon Sep 17 00:00:00 2001 From: Simeon Schaub Date: Tue, 1 Mar 2022 17:09:38 -0500 Subject: [PATCH 040/369] fix #44328: method validation for opaque closures (#44335) I believe it's intentional that for these methods, the `sig` field is just ignored and always set to `Tuple`. Also fixes a lowering bug I discovered that would cause errors if `Union` was shadowed. I have verified that this fixes the reported warnings. Co-authored-by: Jameson Nash (cherry picked from commit 5deb503acb0d6dc2a801800ba2710b7e023db519) --- base/compiler/validation.jl | 5 ++++- src/julia-syntax.scm | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/base/compiler/validation.jl b/base/compiler/validation.jl index 77ee422b6ffcd..0931686184a2e 100644 --- a/base/compiler/validation.jl +++ b/base/compiler/validation.jl @@ -53,6 +53,7 @@ const NON_TOP_LEVEL_METHOD = "encountered `Expr` head `:method` in non-top-level const NON_TOP_LEVEL_GLOBAL = "encountered `Expr` head `:global` in non-top-level code (i.e. `nargs` > 0)" const SIGNATURE_NARGS_MISMATCH = "method signature does not match number of method arguments" const SLOTNAMES_NARGS_MISMATCH = "CodeInfo for method contains fewer slotnames than the number of method arguments" +const INVALID_SIGNATURE_OPAQUE_CLOSURE = "invalid signature of method for opaque closure - `sig` field must always be set to `Tuple`" struct InvalidCodeError <: Exception kind::String @@ -215,7 +216,9 @@ function validate_code!(errors::Vector{>:InvalidCodeError}, mi::Core.MethodInsta m = mi.def::Method mnargs = m.nargs n_sig_params = length((unwrap_unionall(m.sig)::DataType).parameters) - if (m.isva ? (n_sig_params < (mnargs - 1)) : (n_sig_params != mnargs)) + if m.is_for_opaque_closure + m.sig === Tuple || push!(errors, InvalidCodeError(INVALID_SIGNATURE_OPAQUE_CLOSURE, (m.sig, m.isva))) + elseif (m.isva ? (n_sig_params < (mnargs - 1)) : (n_sig_params != mnargs)) push!(errors, InvalidCodeError(SIGNATURE_NARGS_MISMATCH, (m.isva, n_sig_params, mnargs))) end end diff --git a/src/julia-syntax.scm b/src/julia-syntax.scm index 52bcb307ebe19..0f0e5c032d377 100644 --- a/src/julia-syntax.scm +++ b/src/julia-syntax.scm @@ -3862,7 +3862,7 @@ f(x) = yt(x) v))) cvs))) `(new_opaque_closure - ,(cadr e) (call (core apply_type) Union) (core Any) + ,(cadr e) (call (core apply_type) (core Union)) (core Any) (opaque_closure_method (null) ,nargs ,isva ,functionloc ,(convert-lambda lam2 (car (lam:args lam2)) #f '() (symbol-to-idx-map cvs))) ,@var-exprs)))) ((method) From dc8714a0b2063654588d80d60561fe55e3ca7b1f Mon Sep 17 00:00:00 2001 From: "Viral B. Shah" Date: Wed, 2 Mar 2022 23:10:02 -0500 Subject: [PATCH 041/369] Update BLAS.vendor() to return :lbt `vendor()` returns `:lbt` `libblas_name` and `liblapack_name` are set to "libblastrampoline" (cherry picked from commit bf6d9ded5a1c7787b19802ccc8d9cf8b3279e0d1) --- base/Base.jl | 4 ++++ stdlib/LinearAlgebra/src/blas.jl | 13 ++----------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/base/Base.jl b/base/Base.jl index a3fe44a2add86..cbfa5ede6aef9 100644 --- a/base/Base.jl +++ b/base/Base.jl @@ -161,6 +161,10 @@ end include(strcat((length(Core.ARGS)>=2 ? Core.ARGS[2] : ""), "build_h.jl")) # include($BUILDROOT/base/build_h.jl) include(strcat((length(Core.ARGS)>=2 ? Core.ARGS[2] : ""), "version_git.jl")) # include($BUILDROOT/base/version_git.jl) +# These used to be in build_h.jl and are retained for backwards compatibility +const libblas_name = "libblastrampoline" +const liblapack_name = "libblastrampoline" + # numeric operations include("hashing.jl") include("rounding.jl") diff --git a/stdlib/LinearAlgebra/src/blas.jl b/stdlib/LinearAlgebra/src/blas.jl index 9b5506e993ea8..46f7bd283ed87 100644 --- a/stdlib/LinearAlgebra/src/blas.jl +++ b/stdlib/LinearAlgebra/src/blas.jl @@ -79,6 +79,8 @@ using LinearAlgebra: BlasReal, BlasComplex, BlasFloat, BlasInt, DimensionMismatc include("lbt.jl") +vendor() = :lbt + """ get_config() @@ -89,17 +91,6 @@ Return an object representing the current `libblastrampoline` configuration. """ get_config() = lbt_get_config() -# We hard-lock `vendor()` to `openblas(64)` here to satisfy older code, but all new code should use -# `get_config()` since it is now possible to have multiple vendors loaded at once. -function vendor() - Base.depwarn("`vendor()` is deprecated, use `BLAS.get_config()` and inspect the output instead", :vendor; force=true) - if USE_BLAS64 - return :openblas64 - else - return :openblas - end -end - if USE_BLAS64 macro blasfunc(x) return Expr(:quote, Symbol(x, "64_")) From c25534e2015765cd5270bb3e751fe1607f5940d6 Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Thu, 3 Mar 2022 02:32:16 -0600 Subject: [PATCH 042/369] Fix memory error during precompilation (#44345) Fixes #44338 (cherry picked from commit b4ea0f7c4bd4b712e8bc2e86525a17be76f2cd01) --- src/dump.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dump.c b/src/dump.c index 919bac8c82a07..c23533c81702f 100644 --- a/src/dump.c +++ b/src/dump.c @@ -272,6 +272,7 @@ static int has_backedge_to_worklist(jl_method_instance_t *mi, htable_t *visited) for (i = 0; i < n; i++) { jl_method_instance_t *be = (jl_method_instance_t*)jl_array_ptr_ref(mi->backedges, i); if (has_backedge_to_worklist(be, visited)) { + bp = ptrhash_bp(visited, mi); // re-acquire since rehashing might change the location *bp = (void*)((char*)HT_NOTFOUND + 2); // found return 1; } @@ -286,10 +287,10 @@ static size_t queue_external_mis(jl_array_t *list) { size_t i, n = 0; htable_t visited; - htable_new(&visited, 0); if (list) { assert(jl_is_array(list)); size_t n0 = jl_array_len(list); + htable_new(&visited, n0); for (i = 0; i < n0; i++) { jl_method_instance_t *mi = (jl_method_instance_t*)jl_array_ptr_ref(list, i); assert(jl_is_method_instance(mi)); @@ -2640,7 +2641,7 @@ JL_DLLEXPORT int jl_save_incremental(const char *fname, jl_array_t *worklist) arraylist_new(&reinit_list, 0); htable_new(&edges_map, 0); htable_new(&backref_table, 5000); - htable_new(&external_mis, 0); + htable_new(&external_mis, newly_inferred ? jl_array_len(newly_inferred) : 0); ptrhash_put(&backref_table, jl_main_module, (char*)HT_NOTFOUND + 1); backref_table_numel = 1; jl_idtable_type = jl_base_module ? jl_get_global(jl_base_module, jl_symbol("IdDict")) : NULL; From aa04f593602ca1461ee268b83e4873e28af44100 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Thu, 3 Mar 2022 10:49:13 -0500 Subject: [PATCH 043/369] asan,build: fix linker flags for -fsanitize builds (#44420) Fix #44361 Fix #42540 (cherry picked from commit 7324966ae735c4f1ca69e4c2d9e75a4a511032c7) --- .buildkite/pipelines/main/misc/sanitizers.yml | 1 - Make.inc | 18 ++++++------------ src/julia.expmap | 2 -- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/.buildkite/pipelines/main/misc/sanitizers.yml b/.buildkite/pipelines/main/misc/sanitizers.yml index c8ebee340a48e..d5e83fb91cf68 100644 --- a/.buildkite/pipelines/main/misc/sanitizers.yml +++ b/.buildkite/pipelines/main/misc/sanitizers.yml @@ -21,7 +21,6 @@ steps: timeout_in_minutes: 120 if: | # We only run the `asan` job on Julia 1.8 and later. (pipeline.slug != "julia-release-1-dot-6") && (pipeline.slug != "julia-release-1-dot-7") - soft_fail: true # TODO: delete this line (and thus disallow failures) once JuliaLang/julia#42540 is fixed commands: | echo "--- Build julia-debug with ASAN" contrib/asan/build.sh ./tmp/test-asan -j$${JULIA_CPU_THREADS:?} debug diff --git a/Make.inc b/Make.inc index 9ea021e68c959..a95eab1ec1abe 100644 --- a/Make.inc +++ b/Make.inc @@ -483,9 +483,6 @@ endif endif ifeq ($(USEGCC),1) -ifeq ($(SANITIZE),1) -$(error Sanitizers are only supported with clang. Try setting SANITIZE=0) -endif CC := $(CROSS_COMPILE)gcc CXX := $(CROSS_COMPILE)g++ JCFLAGS := -std=gnu99 -pipe $(fPIC) -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 @@ -519,6 +516,8 @@ JCPPFLAGS += -D_LARGEFILE_SOURCE -D_DARWIN_USE_64_BIT_INODE=1 endif endif +JLDFLAGS := + ifeq ($(USECCACHE), 1) # Expand CC, CXX and FC here already because we want the original definition and not the ccache version. CC_ARG := $(CC) @@ -1237,15 +1236,11 @@ IFUNC_DETECT_SRC := 'void (*f0(void))(void) { return (void(*)(void))0L; }; void ifeq (supported, $(shell echo $(IFUNC_DETECT_SRC) | $(CC) -Werror -x c - -S -o /dev/null > /dev/null 2>&1 && echo supported)) JCPPFLAGS += -DJULIA_HAS_IFUNC_SUPPORT=1 endif -JLDFLAGS := -Wl,-Bdynamic -ifneq ($(SANITIZE),1) -ifneq ($(SANITIZE_MEMORY),1) -ifneq ($(LLVM_SANITIZE),1) +JLDFLAGS += -Wl,-Bdynamic OSLIBS += -Wl,--version-script=$(JULIAHOME)/src/julia.expmap +ifneq ($(SANITIZE),1) JLDFLAGS += -Wl,-no-undefined endif -endif -endif ifeq (-Bsymbolic-functions, $(shell $(LD) --help | grep -o -e "-Bsymbolic-functions")) JLIBLDFLAGS := -Wl,-Bsymbolic-functions else @@ -1256,7 +1251,7 @@ JLIBLDFLAGS := endif ifeq ($(OS), FreeBSD) -JLDFLAGS := -Wl,-Bdynamic +JLDFLAGS += -Wl,-Bdynamic OSLIBS += -lelf -lkvm -lrt -lpthread -latomic # Tweak order of libgcc_s in DT_NEEDED, @@ -1274,7 +1269,6 @@ SHLIB_EXT := dylib OSLIBS += -framework CoreFoundation WHOLE_ARCHIVE := -Xlinker -all_load NO_WHOLE_ARCHIVE := -JLDFLAGS := HAVE_SSP := 1 JLIBLDFLAGS := -Wl,-compatibility_version,$(SOMAJOR) -Wl,-current_version,$(JULIA_MAJOR_VERSION).$(JULIA_MINOR_VERSION).$(JULIA_PATCH_VERSION) endif @@ -1283,7 +1277,7 @@ ifeq ($(OS), WINNT) HAVE_SSP := 1 OSLIBS += -Wl,--export-all-symbols -Wl,--version-script=$(JULIAHOME)/src/julia.expmap \ $(NO_WHOLE_ARCHIVE) -lpsapi -lkernel32 -lws2_32 -liphlpapi -lwinmm -ldbghelp -luserenv -lsecur32 -latomic -JLDFLAGS := -Wl,--stack,8388608 +JLDFLAGS += -Wl,--stack,8388608 ifeq ($(ARCH),i686) JLDFLAGS += -Wl,--large-address-aware endif diff --git a/src/julia.expmap b/src/julia.expmap index 558dfec6bd260..2d801dceae044 100644 --- a/src/julia.expmap +++ b/src/julia.expmap @@ -1,7 +1,5 @@ { global: - __asan*; - __tsan*; pthread*; __stack_chk_guard; asprintf; From 1cd27ca859db00c6a0c37608028aaed40dc5e409 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Thu, 3 Mar 2022 10:49:31 -0500 Subject: [PATCH 044/369] add jl_egal and jl_gc_safepoint back to exports list (#44419) Simple oversight when these were turned into macros. I could not find any others that seemed applicable, so just these two appeared to need fixing right now. Fix #44373 (cherry picked from commit 8eb872c159f608640b25bf60a6952556f955758b) --- src/jl_exported_funcs.inc | 54 ++++++++++++++++++++------------------- src/jlapi.c | 9 +++++-- src/julia.h | 2 ++ 3 files changed, 37 insertions(+), 28 deletions(-) diff --git a/src/jl_exported_funcs.inc b/src/jl_exported_funcs.inc index 7748809dcdf05..d63500fe21736 100644 --- a/src/jl_exported_funcs.inc +++ b/src/jl_exported_funcs.inc @@ -21,6 +21,10 @@ XX(jl_apply_type2) \ XX(jl_argument_datatype) \ XX(jl_argument_method_table) \ + XX(jl_arraylen) \ + XX(jl_arrayref) \ + XX(jl_arrayset) \ + XX(jl_arrayunset) \ XX(jl_array_cconvert_cstring) \ XX(jl_array_copy) \ XX(jl_array_del_at) \ @@ -31,19 +35,15 @@ XX(jl_array_grow_beg) \ XX(jl_array_grow_end) \ XX(jl_array_isassigned) \ - XX(jl_arraylen) \ XX(jl_array_ptr) \ XX(jl_array_ptr_1d_append) \ XX(jl_array_ptr_1d_push) \ XX(jl_array_ptr_copy) \ XX(jl_array_rank) \ - XX(jl_arrayref) \ - XX(jl_arrayset) \ XX(jl_array_size) \ XX(jl_array_sizehint) \ XX(jl_array_to_string) \ XX(jl_array_typetagdata) \ - XX(jl_arrayunset) \ XX(jl_array_validate_dims) \ XX(jl_atexit_hook) \ XX(jl_atomic_bool_cmpswap_bits) \ @@ -85,8 +85,8 @@ XX(jl_call1) \ XX(jl_call2) \ XX(jl_call3) \ - XX(jl_call_in_typeinf_world) \ XX(jl_calloc) \ + XX(jl_call_in_typeinf_world) \ XX(jl_capture_interp_frame) \ XX(jl_ceil_llvm) \ XX(jl_ceil_llvm_withtype) \ @@ -115,6 +115,7 @@ XX(jl_dlopen) \ XX(jl_dlsym) \ XX(jl_dump_host_cpu) \ + XX(jl_egal) \ XX(jl_egal__bits) \ XX(jl_egal__special) \ XX(jl_eh_restore_state) \ @@ -131,15 +132,14 @@ XX(jl_error) \ XX(jl_errorf) \ XX(jl_eval_string) \ - XX(jl_exception_clear) \ XX(jl_exceptionf) \ + XX(jl_exception_clear) \ XX(jl_exception_occurred) \ XX(jl_excstack_state) \ XX(jl_exit) \ XX(jl_exit_on_sigint) \ XX(jl_exit_threaded_region) \ XX(jl_expand) \ - XX(jl_resolve_globals_in_ir) \ XX(jl_expand_and_resolve) \ XX(jl_expand_stmt) \ XX(jl_expand_stmt_with_loc) \ @@ -150,11 +150,11 @@ XX(jl_gc_add_finalizer) \ XX(jl_gc_add_finalizer_th) \ XX(jl_gc_add_ptr_finalizer) \ + XX(jl_gc_allocobj) \ XX(jl_gc_alloc_0w) \ XX(jl_gc_alloc_1w) \ XX(jl_gc_alloc_2w) \ XX(jl_gc_alloc_3w) \ - XX(jl_gc_allocobj) \ XX(jl_gc_alloc_typed) \ XX(jl_gc_big_alloc) \ XX(jl_gc_collect) \ @@ -184,6 +184,7 @@ XX(jl_gc_pool_alloc) \ XX(jl_gc_queue_multiroot) \ XX(jl_gc_queue_root) \ + XX(jl_gc_safepoint) \ XX(jl_gc_schedule_foreign_sweepfunc) \ XX(jl_gc_set_cb_notify_external_alloc) \ XX(jl_gc_set_cb_notify_external_free) \ @@ -198,6 +199,9 @@ XX(jl_generic_function_def) \ XX(jl_gensym) \ XX(jl_getallocationgranularity) \ + XX(jl_getnameinfo) \ + XX(jl_getpagesize) \ + XX(jl_getpid) \ XX(jl_get_ARCH) \ XX(jl_get_backtrace) \ XX(jl_get_binding) \ @@ -224,14 +228,11 @@ XX(jl_get_module_infer) \ XX(jl_get_module_of_binding) \ XX(jl_get_module_optlevel) \ - XX(jl_getnameinfo) \ XX(jl_get_next_task) \ XX(jl_get_nth_field) \ XX(jl_get_nth_field_checked) \ XX(jl_get_nth_field_noalloc) \ - XX(jl_getpagesize) \ XX(jl_get_pgcstack) \ - XX(jl_getpid) \ XX(jl_get_ptls_states) \ XX(jl_get_root_symbol) \ XX(jl_get_safe_restore) \ @@ -255,19 +256,19 @@ XX(jl_idtable_rehash) \ XX(jl_infer_thunk) \ XX(jl_init) \ - XX(jl_init__threading) \ + XX(jl_init_options) \ XX(jl_init_restored_modules) \ XX(jl_init_with_image) \ XX(jl_init_with_image__threading) \ - XX(jl_init_options) \ + XX(jl_init__threading) \ XX(jl_install_sigint_handler) \ XX(jl_instantiate_type_in_env) \ XX(jl_instantiate_unionall) \ XX(jl_intersect_types) \ - XX(jl_in_threaded_region) \ XX(jl_intrinsic_name) \ XX(jl_invoke) \ XX(jl_invoke_api) \ + XX(jl_in_threaded_region) \ XX(jl_iolock_begin) \ XX(jl_iolock_end) \ XX(jl_ios_buffer_n) \ @@ -280,6 +281,8 @@ XX(jl_ir_slotflag) \ XX(jl_isa) \ XX(jl_isa_compileable_sig) \ + XX(jl_islayout_inline) \ + XX(jl_istopmod) \ XX(jl_is_binding_deprecated) \ XX(jl_is_char_signed) \ XX(jl_is_const) \ @@ -288,12 +291,10 @@ XX(jl_is_imported) \ XX(jl_is_initialized) \ XX(jl_is_in_pure_context) \ - XX(jl_islayout_inline) \ XX(jl_is_memdebug) \ XX(jl_is_not_broken_subtype) \ XX(jl_is_operator) \ XX(jl_is_task_started) \ - XX(jl_istopmod) \ XX(jl_is_unary_and_binary_operator) \ XX(jl_is_unary_operator) \ XX(jl_lazy_load_and_lookup) \ @@ -336,8 +337,8 @@ XX(jl_nb_available) \ XX(jl_new_array) \ XX(jl_new_bits) \ - XX(jl_new_code_info_uninit) \ XX(jl_new_codeinst) \ + XX(jl_new_code_info_uninit) \ XX(jl_new_datatype) \ XX(jl_new_foreign_type) \ XX(jl_new_method_instance_uninit) \ @@ -347,14 +348,14 @@ XX(jl_new_primitivetype) \ XX(jl_new_struct) \ XX(jl_new_structt) \ - XX(jl_new_struct_uninit) \ XX(jl_new_structv) \ + XX(jl_new_struct_uninit) \ XX(jl_new_task) \ XX(jl_new_typename_in) \ XX(jl_new_typevar) \ XX(jl_next_from_addrinfo) \ - XX(jl_no_exc_handler) \ XX(jl_normalize_to_compilable_sig) \ + XX(jl_no_exc_handler) \ XX(jl_object_id) \ XX(jl_object_id_) \ XX(jl_obvious_subtype) \ @@ -372,8 +373,8 @@ XX(jl_pop_handler) \ XX(jl_preload_sysimg_so) \ XX(jl_prepend_cwd) \ - XX(jl_print_backtrace) \ XX(jl_printf) \ + XX(jl_print_backtrace) \ XX(jl_process_events) \ XX(jl_profile_clear_data) \ XX(jl_profile_delay_nsec) \ @@ -394,6 +395,7 @@ XX(jl_realloc) \ XX(jl_register_newmeth_tracer) \ XX(jl_reshape_array) \ + XX(jl_resolve_globals_in_ir) \ XX(jl_restore_excstack) \ XX(jl_restore_incremental) \ XX(jl_restore_incremental_from_buf) \ @@ -472,18 +474,18 @@ XX(jl_tty_set_mode) \ XX(jl_tupletype_fill) \ XX(jl_typeassert) \ + XX(jl_typeinf_begin) \ + XX(jl_typeinf_end) \ + XX(jl_typename_str) \ + XX(jl_typeof_str) \ + XX(jl_types_equal) \ XX(jl_type_equality_is_identity) \ XX(jl_type_error) \ XX(jl_type_error_rt) \ - XX(jl_typeinf_begin) \ - XX(jl_typeinf_end) \ XX(jl_type_intersection) \ XX(jl_type_intersection_with_env) \ XX(jl_type_morespecific) \ XX(jl_type_morespecific_no_subtype) \ - XX(jl_typename_str) \ - XX(jl_typeof_str) \ - XX(jl_types_equal) \ XX(jl_type_union) \ XX(jl_type_unionall) \ XX(jl_unbox_bool) \ @@ -499,8 +501,8 @@ XX(jl_unbox_uint8) \ XX(jl_unbox_uint8pointer) \ XX(jl_unbox_voidpointer) \ - XX(jl_uncompress_argname_n) \ XX(jl_uncompress_argnames) \ + XX(jl_uncompress_argname_n) \ XX(jl_uncompress_ir) \ XX(jl_undefined_var_error) \ XX(jl_value_ptr) \ diff --git a/src/jlapi.c b/src/jlapi.c index 3ab01c5def7f4..18a98d943187b 100644 --- a/src/jlapi.c +++ b/src/jlapi.c @@ -411,7 +411,7 @@ JL_DLLEXPORT const char *jl_git_commit(void) return commit; } -// Create function versions of some useful macros +// Create function versions of some useful macros for GDB or FFI use JL_DLLEXPORT jl_taggedvalue_t *(jl_astaggedvalue)(jl_value_t *v) { return jl_astaggedvalue(v); @@ -432,6 +432,11 @@ JL_DLLEXPORT jl_value_t *(jl_get_fieldtypes)(jl_value_t *v) return (jl_value_t*)jl_get_fieldtypes((jl_datatype_t*)v); } +JL_DLLEXPORT int ijl_egal(jl_value_t *a, jl_value_t *b) +{ + return jl_egal(a, b); +} + #ifndef __clang_gcanalyzer__ JL_DLLEXPORT int8_t (jl_gc_unsafe_enter)(void) @@ -459,7 +464,7 @@ JL_DLLEXPORT void (jl_gc_safe_leave)(int8_t state) } #endif -JL_DLLEXPORT void (jl_gc_safepoint)(void) +JL_DLLEXPORT void jl_gc_safepoint(void) { jl_task_t *ct = jl_current_task; jl_gc_safepoint_(ct->ptls); diff --git a/src/julia.h b/src/julia.h index afb0d00630dbd..2d51de2f3ed9b 100644 --- a/src/julia.h +++ b/src/julia.h @@ -7,6 +7,7 @@ #include "jl_internal_funcs.inc" #undef jl_setjmp #undef jl_longjmp +#undef jl_egal #endif #include "julia_fasttls.h" @@ -925,6 +926,7 @@ STATIC_INLINE void jl_gc_multi_wb(const void *parent, const jl_value_t *ptr) JL_ JL_DLLEXPORT void *jl_gc_managed_malloc(size_t sz); JL_DLLEXPORT void *jl_gc_managed_realloc(void *d, size_t sz, size_t oldsz, int isaligned, jl_value_t *owner); +JL_DLLEXPORT void jl_gc_safepoint(void); // object accessors ----------------------------------------------------------- From 4a30b380fbb3314461706b6b1b3ea6d6fd47e8db Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Thu, 3 Mar 2022 08:45:49 -0800 Subject: [PATCH 045/369] Clarify the behavior of `@threads for` (#44168) * Clarify the behavior of `@threads for` Co-authored-by: Ian Butterworth (cherry picked from commit 2f67b51c70280cf7f0f2da5de2e7769da0d49869) --- base/threadingconstructs.jl | 92 +++++++++++++++++++++++++------------ 1 file changed, 62 insertions(+), 30 deletions(-) diff --git a/base/threadingconstructs.jl b/base/threadingconstructs.jl index 9ed416caec2a6..a3413701fb7de 100644 --- a/base/threadingconstructs.jl +++ b/base/threadingconstructs.jl @@ -99,46 +99,82 @@ end """ Threads.@threads [schedule] for ... end -A macro to parallelize a `for` loop to run with multiple threads. Splits the iteration -space among multiple tasks and runs those tasks on threads according to a scheduling -policy. -A barrier is placed at the end of the loop which waits for all tasks to finish -execution. - -The `schedule` argument can be used to request a particular scheduling policy. - -Except for `:static` scheduling, how the iterations are assigned to tasks, and how the tasks -are assigned to the worker threads is undefined. The exact assignments can be different -for each execution. The scheduling option is a hint. The loop body code (including any code -transitively called from it) must not make assumptions about the distribution of iterations -to tasks or the worker thread in which they are executed. The loop body for each iteration -must be able to make forward progress independent of other iterations and be free from data -races. As such, synchronizations across iterations may deadlock. +A macro to execute a `for` loop in parallel. The iteration space is distributed to +coarse-grained tasks. This policy can be specified by the `schedule` argument. The +execution of the loop waits for the evaluation of all iterations. + +See also: [`@spawn`](@ref Threads.@spawn) and +`pmap` in [`Distributed`](@ref man-distributed). + +# Extended help + +## Semantics + +Unless stronger guarantees are specified by the scheduling option, the loop executed by +`@threads` macro have the following semantics. + +The `@threads` macro executes the loop body in an unspecified order and potentially +concurrently. It does not specify the exact assignments of the tasks and the worker threads. +The assignments can be different for each execution. The loop body code (including any code +transitively called from it) must not make any assumptions about the distribution of +iterations to tasks or the worker thread in which they are executed. The loop body for each +iteration must be able to make forward progress independent of other iterations and be free +from data races. As such, invalid synchronizations across iterations may deadlock while +unsynchronized memory accesses may result in undefined behavior. For example, the above conditions imply that: - The lock taken in an iteration *must* be released within the same iteration. - Communicating between iterations using blocking primitives like `Channel`s is incorrect. -- Write only to locations not shared across iterations (unless a lock or atomic operation is used). +- Write only to locations not shared across iterations (unless a lock or atomic operation is + used). +- The value of [`threadid()`](@ref Threads.threadid) may change even within a single + iteration. -Schedule options are: -- `:dynamic` (default) will schedule iterations dynamically to available worker threads, - assuming that the workload for each iteration is uniform. -- `:static` creates one task per thread and divides the iterations equally among - them, assigning each task specifically to each thread. - Specifying `:static` is an error if used from inside another `@threads` loop - or from a thread other than 1. +## Schedulers -Without the scheduler argument, the exact scheduling is unspecified and varies across Julia releases. +Without the scheduler argument, the exact scheduling is unspecified and varies across Julia +releases. Currently, `:dynamic` is used when the scheduler is not specified. !!! compat "Julia 1.5" The `schedule` argument is available as of Julia 1.5. +### `:dynamic` (default) + +`:dynamic` scheduler executes iterations dynamically to available worker threads. Current +implementation assumes that the workload for each iteration is uniform. However, this +assumption may be removed in the future. + +This scheduling option is merely a hint to the underlying execution mechanism. However, a +few properties can be expected. The number of `Task`s used by `:dynamic` scheduler is +bounded by a small constant multiple of the number of available worker threads +([`nthreads()`](@ref Threads.nthreads)). Each task processes contiguous regions of the +iteration space. Thus, `@threads :dynamic for x in xs; f(x); end` is typically more +efficient than `@sync for x in xs; @spawn f(x); end` if `length(xs)` is significantly +larger than the number of the worker threads and the run-time of `f(x)` is relatively +smaller than the cost of spawning and synchronizaing a task (typically less than 10 +microseconds). + !!! compat "Julia 1.8" The `:dynamic` option for the `schedule` argument is available and the default as of Julia 1.8. -For example, an illustration of the different scheduling strategies where `busywait` -is a non-yielding timed loop that runs for a number of seconds. +### `:static` + +`:static` scheduler creates one task per thread and divides the iterations equally among +them, assigning each task specifically to each thread. In particular, the value of +[`threadid()`](@ref Threads.threadid) is guranteed to be constant within one iteration. +Specifying `:static` is an error if used from inside another `@threads` loop or from a +thread other than 1. + +!!! note + `:static` scheduling exists for supporting transition of code written before Julia 1.3. + In newly written library functions, `:static` scheduling is discouraged because the + functions using this option cannot be called from arbitrary worker threads. + +## Example + +To illustrate of the different scheduling strategies, consider the following function +`busywait` containing a non-yielding timed loop that runs for a given number of seconds. ```julia-repl julia> function busywait(seconds) @@ -166,10 +202,6 @@ julia> @time begin The `:dynamic` example takes 2 seconds since one of the non-occupied threads is able to run two of the 1-second iterations to complete the for loop. - -See also: [`@spawn`](@ref Threads.@spawn), [`nthreads()`](@ref Threads.nthreads), -[`threadid()`](@ref Threads.threadid), `pmap` in [`Distributed`](@ref man-distributed), -`BLAS.set_num_threads` in [`LinearAlgebra`](@ref man-linalg). """ macro threads(args...) na = length(args) From f2539a0d04130886f6c6428dd36f6f1f91bc6fb1 Mon Sep 17 00:00:00 2001 From: Oscar Smith Date: Thu, 3 Mar 2022 16:32:49 -0500 Subject: [PATCH 046/369] fix error show edge case (#44319) * fix errors Co-authored-by: Simeon Schaub (cherry picked from commit a9d8c859c71c7ed4aaa370ae659eba8eea263f4d) --- base/errorshow.jl | 2 +- test/error.jl | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/base/errorshow.jl b/base/errorshow.jl index 9441292e2c6ee..e56a095d832fd 100644 --- a/base/errorshow.jl +++ b/base/errorshow.jl @@ -508,7 +508,7 @@ function show_method_candidates(io::IO, ex::MethodError, @nospecialize kwargs=() end print(iob, ")") show_method_params(iob0, tv) - file, line = functionloc(method) + file, line = updated_methodloc(method) if file === nothing file = string(method.file) end diff --git a/test/error.jl b/test/error.jl index e9d011e382a61..9b87cb6fff185 100644 --- a/test/error.jl +++ b/test/error.jl @@ -86,3 +86,13 @@ end e = SystemError("fail") @test e.extrainfo === nothing end + +@testset "MethodError for methods without line numbers" begin + try + eval(Expr(:function, :(f44319()), 0)) + f44319(1) + catch e + s = sprint(showerror, e) + @test s == "MethodError: no method matching f44319(::Int64)\nClosest candidates are:\n f44319() at none:0" + end +end From c39510e8f1cb49aaf466165368f62ce2129cc4bb Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Thu, 3 Mar 2022 21:42:46 -0500 Subject: [PATCH 047/369] optimizer: bail out of inlining if ir_inline_unionsplit will fail (#44416) Intersection cannot deal with this `metharg`, so it does not simplify the type at all when handling this case. This can cause us to run into an assertion later, where we assume the intersection of a non-Varags type will always return a simple DataType without Varargs. Fixes #44238 atype = Tuple{typeof(Base.similar), Tuple{Union{Polyhedra.Polyhedron{T}, Polyhedra.Representation{T}} where T}, Array{_A, 1} where _A, Array{_C, 1} where _C, Array{_B, 1} where _B} metharg = Tuple{typeof(Base.similar), Tuple{Vararg{Union{Polyhedra.Polyhedron{T}, Polyhedra.Representation{T}} where T}}, Vararg{Union{Union{AbstractArray{var"#s14", 1}, Polyhedra.AbstractRepIterator{var"#s13", var"#s14"} where var"#s13", Polyhedra.AllRepIterator{var"#s14", var"#s14", LinElemT, LRT, RT} where RT<:Polyhedra.AbstractRepIterator{var"#s14", var"#s14"} where LRT<:Polyhedra.AbstractRepIterator{var"#s14", LinElemT} where LinElemT where var"#s14"} where var"#s14"<:(Polyhedra.HyperPlane{T, AT} where AT<:AbstractArray{T, 1}), Union{AbstractArray{var"#s14", 1}, Polyhedra.AbstractRepIterator{var"#s13", var"#s14"} where var"#s13", Polyhedra.AllRepIterator{var"#s14", var"#s14", LinElemT, LRT, RT} where RT<:Polyhedra.AbstractRepIterator{var"#s14", var"#s14"} where LRT<:Polyhedra.AbstractRepIterator{var"#s14", LinElemT} where LinElemT where var"#s14"} where var"#s14"<:(Polyhedra.HalfSpace{T, AT} where AT<:AbstractArray{T, 1}), Union{AbstractArray{var"#s14", 1}, Polyhedra.AbstractRepIterator{var"#s13", var"#s14"} where var"#s13", Polyhedra.AllRepIterator{var"#s14", var"#s14", LinElemT, LRT, RT} where RT<:Polyhedra.AbstractRepIterator{var"#s14", var"#s14"} where LRT<:Polyhedra.AbstractRepIterator{var"#s14", LinElemT} where LinElemT where var"#s14"} where var"#s14"<:AbstractArray{T, 1}, Union{AbstractArray{var"#s14", 1}, Polyhedra.AbstractRepIterator{var"#s13", var"#s14"} where var"#s13", Polyhedra.AllRepIterator{var"#s14", var"#s14", LinElemT, LRT, RT} where RT<:Polyhedra.AbstractRepIterator{var"#s14", var"#s14"} where LRT<:Polyhedra.AbstractRepIterator{var"#s14", LinElemT} where LinElemT where var"#s14"} where var"#s14"<:(Polyhedra.Line{T, AT} where AT<:AbstractArray{T, 1}), Union{AbstractArray{var"#s14", 1}, Polyhedra.AbstractRepIterator{var"#s13", var"#s14"} where var"#s13", Polyhedra.AllRepIterator{var"#s14", var"#s14", LinElemT, LRT, RT} where RT<:Polyhedra.AbstractRepIterator{var"#s14", var"#s14"} where LRT<:Polyhedra.AbstractRepIterator{var"#s14", LinElemT} where LinElemT where var"#s14"} where var"#s14"<:(Polyhedra.Ray{T, AT} where AT<:AbstractArray{T, 1})} where T}} Currently `typeintersection(atype, metharg) === metharg` (cherry picked from commit ffc5ffa40826a174f08c5710f640990884f8357c) --- base/compiler/ssair/inlining.jl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/base/compiler/ssair/inlining.jl b/base/compiler/ssair/inlining.jl index fc3c3a60115e6..510c3bdaf5b03 100644 --- a/base/compiler/ssair/inlining.jl +++ b/base/compiler/ssair/inlining.jl @@ -820,9 +820,9 @@ end function analyze_method!(match::MethodMatch, argtypes::Vector{Any}, flag::UInt8, state::InliningState) method = match.method - methsig = method.sig + spec_types = match.spec_types - # Check that we habe the correct number of arguments + # Check that we have the correct number of arguments na = Int(method.nargs) npassedargs = length(argtypes) if na != npassedargs && !(na > 0 && method.isva) @@ -832,6 +832,13 @@ function analyze_method!(match::MethodMatch, argtypes::Vector{Any}, # call this function return nothing end + if !match.fully_covers + # type-intersection was not able to give us a simple list of types, so + # ir_inline_unionsplit won't be able to deal with inlining this + if !(spec_types isa DataType && length(spec_types.parameters) == length(argtypes) && !isvarargtype(spec_types.parameters[end])) + return nothing + end + end # Bail out if any static parameters are left as TypeVar validate_sparams(match.sparams) || return nothing From 5f6632780bd6298df574e824feafec8fe6f3775c Mon Sep 17 00:00:00 2001 From: KristofferC Date: Fri, 4 Mar 2022 08:58:28 +0100 Subject: [PATCH 048/369] Revert "Update BLAS.vendor() to return :lbt" This reverts commit e54b04a1996270bf8941a3e1f6c45808022108a9. --- base/Base.jl | 4 ---- stdlib/LinearAlgebra/src/blas.jl | 13 +++++++++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/base/Base.jl b/base/Base.jl index cbfa5ede6aef9..a3fe44a2add86 100644 --- a/base/Base.jl +++ b/base/Base.jl @@ -161,10 +161,6 @@ end include(strcat((length(Core.ARGS)>=2 ? Core.ARGS[2] : ""), "build_h.jl")) # include($BUILDROOT/base/build_h.jl) include(strcat((length(Core.ARGS)>=2 ? Core.ARGS[2] : ""), "version_git.jl")) # include($BUILDROOT/base/version_git.jl) -# These used to be in build_h.jl and are retained for backwards compatibility -const libblas_name = "libblastrampoline" -const liblapack_name = "libblastrampoline" - # numeric operations include("hashing.jl") include("rounding.jl") diff --git a/stdlib/LinearAlgebra/src/blas.jl b/stdlib/LinearAlgebra/src/blas.jl index 46f7bd283ed87..9b5506e993ea8 100644 --- a/stdlib/LinearAlgebra/src/blas.jl +++ b/stdlib/LinearAlgebra/src/blas.jl @@ -79,8 +79,6 @@ using LinearAlgebra: BlasReal, BlasComplex, BlasFloat, BlasInt, DimensionMismatc include("lbt.jl") -vendor() = :lbt - """ get_config() @@ -91,6 +89,17 @@ Return an object representing the current `libblastrampoline` configuration. """ get_config() = lbt_get_config() +# We hard-lock `vendor()` to `openblas(64)` here to satisfy older code, but all new code should use +# `get_config()` since it is now possible to have multiple vendors loaded at once. +function vendor() + Base.depwarn("`vendor()` is deprecated, use `BLAS.get_config()` and inspect the output instead", :vendor; force=true) + if USE_BLAS64 + return :openblas64 + else + return :openblas + end +end + if USE_BLAS64 macro blasfunc(x) return Expr(:quote, Symbol(x, "64_")) From ed0eb780ca6d0ef4ac233f8adeff7d8510b23275 Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Fri, 4 Mar 2022 12:36:58 -0600 Subject: [PATCH 049/369] Fix htable cleanup (#44446) This htable was allocated conditionally, so the cleanup must be too. Co-authored by: Jameson Nash (cherry picked from commit c3d7edc4cdba65ca27bd4f4b2f55730ebfba9f88) --- src/dump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dump.c b/src/dump.c index c23533c81702f..956466ac765b2 100644 --- a/src/dump.c +++ b/src/dump.c @@ -312,8 +312,8 @@ static size_t queue_external_mis(jl_array_t *list) } } } + htable_free(&visited); } - htable_free(&visited); return n; } From 5b14e0747d5c9144ee15fb65eace94bd75916c89 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Sun, 6 Mar 2022 00:02:44 -0500 Subject: [PATCH 050/369] [RemoveAddrspaces] make MappedTypes non-static (#44453) (cherry picked from commit 610fc20640b93c5a41bbedc3483a031886e983e7) --- src/llvm-remove-addrspaces.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/llvm-remove-addrspaces.cpp b/src/llvm-remove-addrspaces.cpp index 9b3631e264124..bcc03bd4d3fb3 100644 --- a/src/llvm-remove-addrspaces.cpp +++ b/src/llvm-remove-addrspaces.cpp @@ -105,10 +105,9 @@ class AddrspaceRemoveTypeRemapper : public ValueMapTypeRemapper { } private: - static DenseMap MappedTypes; + DenseMap MappedTypes; }; -DenseMap AddrspaceRemoveTypeRemapper::MappedTypes; class AddrspaceRemoveValueMaterializer : public ValueMaterializer { ValueToValueMapTy &VM; From 885eccf3a866eda1d497fadcfd21e5b924d877b5 Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Sun, 6 Mar 2022 21:30:53 -0500 Subject: [PATCH 051/369] Fix intermittent `threaded loop executed in order` test warning (#44479) (cherry picked from commit cfb0d465e0858eabb8591668d1320e00f6fc964e) --- test/threads_exec.jl | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/test/threads_exec.jl b/test/threads_exec.jl index 63e3be1b88cb7..ca8ec03b685e4 100644 --- a/test/threads_exec.jl +++ b/test/threads_exec.jl @@ -70,7 +70,23 @@ end # parallel loop with parallel atomic addition function threaded_loop(a, r, x) + counter = Threads.Atomic{Int}(min(Threads.nthreads(), length(r))) @threads for i in r + # synchronize the start given that each partition is started sequentially, + # meaning that without the wait, if the loop is too fast the iteration can happen in order + if counter[] != 0 + Threads.atomic_sub!(counter, 1) + spins = 0 + while counter[] != 0 + GC.safepoint() + ccall(:jl_cpu_pause, Cvoid, ()) + spins += 1 + if spins > 500_000_000 # about 10 seconds + @warn "Failed wait for all workers. Unfinished rogue tasks occupying worker threads?" + break + end + end + end j = i - firstindex(r) + 1 a[j] = 1 + atomic_add!(x, 1) end @@ -83,18 +99,13 @@ function test_threaded_loop_and_atomic_add() a = zeros(Int, n) threaded_loop(a,r,x) found = zeros(Bool,n) - was_inorder = true for i=1:length(a) - was_inorder &= a[i]==i found[a[i]] = true end @test x[] == n # Next test checks that all loop iterations ran, # and were unique (via pigeon-hole principle). @test !(false in found) - if was_inorder && nthreads() > 1 - println(stderr, "Warning: threaded loop executed in order") - end end end From 406b29392e776e547d06d54ee546ccf5fd62be39 Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Sun, 6 Mar 2022 07:59:06 -0500 Subject: [PATCH 052/369] =?UTF-8?q?Fix=20or=20suppress=20some=20noisy=20te?= =?UTF-8?q?sts=20=F0=9F=8F=8C=EF=B8=8F=E2=80=8D=E2=99=82=EF=B8=8F=20(#4444?= =?UTF-8?q?4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit d9714655cab409db4d57030cb403f3f553dc6453) --- .../md5 | 1 + .../sha512 | 1 + .../md5 | 1 - .../sha512 | 1 - stdlib/Artifacts/test/refresh_artifacts.jl | 4 ++-- stdlib/LazyArtifacts/test/runtests.jl | 16 ++++++++++------ stdlib/LibGit2/test/bad_ca_roots.jl | 8 +++++--- stdlib/REPL/test/repl.jl | 2 ++ stdlib/SHA.version | 2 +- test/backtrace.jl | 2 +- test/boundscheck_exec.jl | 4 +++- test/deprecation_exec.jl | 17 ++++++++++------- test/loading.jl | 9 +++++---- test/misc.jl | 19 ++++++++++++++++--- test/secretbuffer.jl | 3 ++- test/specificity.jl | 5 +++++ test/syntax.jl | 10 +++++----- 17 files changed, 69 insertions(+), 36 deletions(-) create mode 100644 deps/checksums/SHA-2d1f84e6f8417a1a368de48318640d948b023e7a.tar.gz/md5 create mode 100644 deps/checksums/SHA-2d1f84e6f8417a1a368de48318640d948b023e7a.tar.gz/sha512 delete mode 100644 deps/checksums/SHA-57c3a8c8358021b7a58526364e6885768fd95de2.tar.gz/md5 delete mode 100644 deps/checksums/SHA-57c3a8c8358021b7a58526364e6885768fd95de2.tar.gz/sha512 diff --git a/deps/checksums/SHA-2d1f84e6f8417a1a368de48318640d948b023e7a.tar.gz/md5 b/deps/checksums/SHA-2d1f84e6f8417a1a368de48318640d948b023e7a.tar.gz/md5 new file mode 100644 index 0000000000000..f682cf3518658 --- /dev/null +++ b/deps/checksums/SHA-2d1f84e6f8417a1a368de48318640d948b023e7a.tar.gz/md5 @@ -0,0 +1 @@ +de53629eb0b1ce98ac6b245bdbf14e9d diff --git a/deps/checksums/SHA-2d1f84e6f8417a1a368de48318640d948b023e7a.tar.gz/sha512 b/deps/checksums/SHA-2d1f84e6f8417a1a368de48318640d948b023e7a.tar.gz/sha512 new file mode 100644 index 0000000000000..870098ef7aada --- /dev/null +++ b/deps/checksums/SHA-2d1f84e6f8417a1a368de48318640d948b023e7a.tar.gz/sha512 @@ -0,0 +1 @@ +71cdc58b03cc4f42f8c4b9c2353d6f94d77b4ac5c9d374387d435c57ba85e966f3be4e8c8447b34e184cb8e665c42b3cd2c9d9742c86f7fb5c71a85df5087966 diff --git a/deps/checksums/SHA-57c3a8c8358021b7a58526364e6885768fd95de2.tar.gz/md5 b/deps/checksums/SHA-57c3a8c8358021b7a58526364e6885768fd95de2.tar.gz/md5 deleted file mode 100644 index 1bcc55fb297fa..0000000000000 --- a/deps/checksums/SHA-57c3a8c8358021b7a58526364e6885768fd95de2.tar.gz/md5 +++ /dev/null @@ -1 +0,0 @@ -96d57bc32f4f9bb8c66117c96e6243fc diff --git a/deps/checksums/SHA-57c3a8c8358021b7a58526364e6885768fd95de2.tar.gz/sha512 b/deps/checksums/SHA-57c3a8c8358021b7a58526364e6885768fd95de2.tar.gz/sha512 deleted file mode 100644 index 7f6c994b2fbb7..0000000000000 --- a/deps/checksums/SHA-57c3a8c8358021b7a58526364e6885768fd95de2.tar.gz/sha512 +++ /dev/null @@ -1 +0,0 @@ -7243eddcccb634910f35252f30b29fe44c348955039bea56546765ab828bddb575a87603e91c89bee2619ea6e45b606c23fab2c8f4fc28c910571800732201a9 diff --git a/stdlib/Artifacts/test/refresh_artifacts.jl b/stdlib/Artifacts/test/refresh_artifacts.jl index a70e13db1ee93..7078912c00072 100644 --- a/stdlib/Artifacts/test/refresh_artifacts.jl +++ b/stdlib/Artifacts/test/refresh_artifacts.jl @@ -12,11 +12,11 @@ let if meta isa Array for meta in meta get(meta, "lazy", false) && continue - ensure_artifact_installed(name, meta, toml; platform=unused) + ensure_artifact_installed(name, meta, toml; platform=unused, io = devnull) end else; meta::Dict get(meta, "lazy", false) && continue - ensure_artifact_installed(name, meta, toml; platform=unused) + ensure_artifact_installed(name, meta, toml; platform=unused, io = devnull) end end end diff --git a/stdlib/LazyArtifacts/test/runtests.jl b/stdlib/LazyArtifacts/test/runtests.jl index 5e3850caecf4c..53898082cd346 100644 --- a/stdlib/LazyArtifacts/test/runtests.jl +++ b/stdlib/LazyArtifacts/test/runtests.jl @@ -5,8 +5,10 @@ using Test mktempdir() do tempdir LazyArtifacts.Artifacts.with_artifacts_directory(tempdir) do - socrates_dir = artifact"socrates" - @test isdir(socrates_dir) + redirect_stderr(devnull) do + socrates_dir = artifact"socrates" + @test isdir(socrates_dir) + end ex = @test_throws ErrorException artifact"HelloWorldC" @test startswith(ex.value.msg, "Artifact \"HelloWorldC\" was not installed correctly. ") end @@ -18,10 +20,12 @@ end using Test mktempdir() do tempdir Artifacts.with_artifacts_directory(tempdir) do - socrates_dir = @test_logs( - (:warn, "using Pkg instead of using LazyArtifacts is deprecated"), - artifact"socrates") - @test isdir(socrates_dir) + redirect_stderr(devnull) do + socrates_dir = @test_logs( + (:warn, "using Pkg instead of using LazyArtifacts is deprecated"), + artifact"socrates") + @test isdir(socrates_dir) + end end end'`, dir=@__DIR__))) diff --git a/stdlib/LibGit2/test/bad_ca_roots.jl b/stdlib/LibGit2/test/bad_ca_roots.jl index e4ebdc709637a..4882065167bdb 100644 --- a/stdlib/LibGit2/test/bad_ca_roots.jl +++ b/stdlib/LibGit2/test/bad_ca_roots.jl @@ -9,7 +9,9 @@ using Test, LibGit2, NetworkOptions # if that changes, this may need to be adjusted const CAN_SET_CA_ROOTS_PATH = !Sys.isapple() && !Sys.iswindows() -@testset "empty CA roots file" begin +# Given this is a sub-processed test file, not using @testsets avoids +# leaking the report print into the Base test runner report +begin # empty CA roots file # these fail for different reasons on different platforms: # - on Apple & Windows you cannot set the CA roots path location # - on Linux & FreeBSD you you can but these are invalid files @@ -29,14 +31,14 @@ const CAN_SET_CA_ROOTS_PATH = !Sys.isapple() && !Sys.iswindows() end if CAN_SET_CA_ROOTS_PATH - @testset "non-empty but bad CA roots file" begin + begin # non-empty but bad CA roots file # should still be possible to initialize ENV["JULIA_SSL_CA_ROOTS_PATH"] = joinpath(@__DIR__, "bad_ca_roots.pem") @test LibGit2.ensure_initialized() === nothing end mktempdir() do dir repo_url = "https://github.com/JuliaLang/Example.jl" - @testset "HTTPS clone with bad CA roots fails" begin + begin # HTTPS clone with bad CA roots fails repo_path = joinpath(dir, "Example.HTTPS") c = LibGit2.CredentialPayload(allow_prompt=false, allow_git_helpers=false) redirect_stderr(devnull) diff --git a/stdlib/REPL/test/repl.jl b/stdlib/REPL/test/repl.jl index d711d0be5e243..05f583c807165 100644 --- a/stdlib/REPL/test/repl.jl +++ b/stdlib/REPL/test/repl.jl @@ -751,6 +751,7 @@ fake_repl() do stdin_write, stdout_read, repl @test readuntil(stdout_read, "end", keep=true) == "\n\r\e[7C α=1\n\r\e[7C β=2\n\r\e[7Cend" # Test switching repl modes + redirect_stdout(devnull) do # to suppress "foo" echoes sendrepl2("""\e[200~ julia> A = 1 1 @@ -775,6 +776,7 @@ fake_repl() do stdin_write, stdout_read, repl wait(c) @test Main.A == 1 @test Main.B == 2 + end # redirect_stdout # Close repl write(stdin_write, '\x04') diff --git a/stdlib/SHA.version b/stdlib/SHA.version index 312fbc55ea97c..f2242a336c6fe 100644 --- a/stdlib/SHA.version +++ b/stdlib/SHA.version @@ -1,4 +1,4 @@ SHA_BRANCH = master -SHA_SHA1 = 57c3a8c8358021b7a58526364e6885768fd95de2 +SHA_SHA1 = 2d1f84e6f8417a1a368de48318640d948b023e7a SHA_GIT_URL := https://github.com/JuliaCrypto/SHA.jl.git SHA_TAR_URL = https://api.github.com/repos/JuliaCrypto/SHA.jl/tarball/$1 diff --git a/test/backtrace.jl b/test/backtrace.jl index 3aebfec410f34..35b607137a5c2 100644 --- a/test/backtrace.jl +++ b/test/backtrace.jl @@ -184,7 +184,7 @@ end # issue 28618 let bt, found = false - @info "" + @debug "" bt = backtrace() for frame in map(lookup, bt) if frame[1].line == @__LINE__() - 2 && frame[1].file == Symbol(@__FILE__) diff --git a/test/boundscheck_exec.jl b/test/boundscheck_exec.jl index 71690c55faeca..715700e00378f 100644 --- a/test/boundscheck_exec.jl +++ b/test/boundscheck_exec.jl @@ -259,7 +259,9 @@ if bc_opt == bc_default || bc_opt == bc_off @test !occursin("arrayref(true", typed_40281) end -@testset "pass inbounds meta to getindex on CartesianIndices (#42115)" begin +# Given this is a sub-processed test file, not using @testsets avoids +# leaking the report print into the Base test runner report +begin # Pass inbounds meta to getindex on CartesianIndices (#42115) @inline getindex_42115(r, i) = @inbounds getindex(r, i) @inline getindex_42115(r, i, j) = @inbounds getindex(r, i, j) diff --git a/test/deprecation_exec.jl b/test/deprecation_exec.jl index efbb251daa1e0..7b73c874495ee 100644 --- a/test/deprecation_exec.jl +++ b/test/deprecation_exec.jl @@ -43,7 +43,9 @@ struct T21972 end end -@testset "@deprecate" begin +# Given this is a sub-processed test file, not using @testsets avoids +# leaking the report print into the Base test runner report +begin # @deprecate using .DeprecationTests using .Foo1234 @test foo1234(3) == 4 @@ -87,7 +89,7 @@ f24658() = depwarn24658() depwarn24658() = Base.firstcaller(backtrace(), :_func_not_found_) -@testset "firstcaller" begin +begin # firstcaller # issue #24658 @test eval(:(if true; f24658(); end)) == (Ptr{Cvoid}(0),StackTraces.UNKNOWN) end @@ -113,7 +115,7 @@ global_logger(prev_logger) #------------------------------------------------------------------------------- # BEGIN 0.7 deprecations -@testset "parser syntax deprecations" begin +begin # parser syntax deprecations # #15524 # @test (@test_deprecated Meta.parse("for a=b f() end")) == :(for a=b; f() end) @test_broken length(Test.collect_test_logs(()->Meta.parse("for a=b f() end"))[1]) > 0 @@ -121,10 +123,11 @@ end # END 0.7 deprecations -@testset "tuple indexed by float deprecation" begin +begin # tuple indexed by float deprecation @test_deprecated getindex((1,), 1.0) === 1 @test_deprecated getindex((1,2), 2.0) === 2 - @test_throws Exception getindex((), 1.0) - @test_throws Exception getindex((1,2), 0.0) - @test_throws Exception getindex((1,2), -1.0) + @test Base.JLOptions().depwarn == 1 + @test_throws Exception @test_warn r"`getindex(t::Tuple, i::Real)` is deprecated" getindex((), 1.0) + @test_throws Exception @test_warn r"`getindex(t::Tuple, i::Real)` is deprecated" getindex((1,2), 0.0) + @test_throws Exception @test_warn r"`getindex(t::Tuple, i::Real)` is deprecated" getindex((1,2), -1.0) end diff --git a/test/loading.jl b/test/loading.jl index dc8a9103fbbe5..7dd6ce2935be6 100644 --- a/test/loading.jl +++ b/test/loading.jl @@ -234,6 +234,7 @@ append!(empty!(DEPOT_PATH), [mktempdir(), joinpath(@__DIR__, "depot")]) @test watcher_counter[] == 0 @test_logs (:error, r"active project callback .* failed") Base.set_active_project(nothing) @test watcher_counter[] == 1 +pop!(Base.active_project_callbacks) @test load_path() == [joinpath(@__DIR__, "project", "Project.toml")] @@ -731,14 +732,14 @@ end append!(empty!(LOAD_PATH), saved_load_path) append!(empty!(DEPOT_PATH), saved_depot_path) -for _ = 1:2 pop!(Base.active_project_callbacks) end +pop!(Base.active_project_callbacks) Base.set_active_project(saved_active_project) @test watcher_counter[] == 3 # issue #28190 -module Foo; import Libdl; end -import .Foo.Libdl; import Libdl -@test Foo.Libdl === Libdl +module Foo28190; import Libdl; end +import .Foo28190.Libdl; import Libdl +@test Foo28190.Libdl === Libdl @testset "include with mapexpr" begin let exprs = Any[] diff --git a/test/misc.jl b/test/misc.jl index 9a92d0fda0076..efc647667f4b6 100644 --- a/test/misc.jl +++ b/test/misc.jl @@ -283,6 +283,7 @@ v11801, t11801 = @timed sin(1) @test names(@__MODULE__, all = true) == names_before_timing +redirect_stdout(devnull) do # suppress time prints # Accepted @time argument formats @test @time true @test @time "message" true @@ -349,6 +350,11 @@ end after = Base.cumulative_compile_time_ns_after(); @test after >= before; +# wait for completion of these tasks before restoring stdout, to suppress their @time prints. +wait(t1); wait(t2) + +end # redirect_stdout + # interactive utilities struct ambigconvert; end # inject a problematic `convert` method to ensure it still works @@ -1065,9 +1071,16 @@ end GC.safepoint() - GC.enable_logging(true) - GC.gc() - GC.enable_logging(false) + mktemp() do tmppath, _ + open(tmppath, "w") do tmpio + redirect_stderr(tmpio) do + GC.enable_logging(true) + GC.gc() + GC.enable_logging(false) + end + end + @test occursin("GC: pause", read(open(tmppath), String)) + end end @testset "fieldtypes Module" begin diff --git a/test/secretbuffer.jl b/test/secretbuffer.jl index aea2a662766c9..df67204dd63ba 100644 --- a/test/secretbuffer.jl +++ b/test/secretbuffer.jl @@ -99,6 +99,7 @@ using Test @test position(sb) == 0 skip(sb, sb.size) @test position(sb) == sb.size + shred!(sb) end @testset "seekend" begin sb = SecretBuffer("hello") @@ -108,7 +109,6 @@ using Test end @testset "position" begin sb = SecretBuffer("Julia") - println("testing position") initial_pos = (position(sb)) seek(sb,2) mid_pos = position(sb) @@ -120,5 +120,6 @@ using Test sb1 = SecretBuffer("hello") sb2 = SecretBuffer("juliaisawesome") @test hash(sb1, UInt(5)) === hash(sb2, UInt(5)) + shred!(sb1); shred!(sb2) end end diff --git a/test/specificity.jl b/test/specificity.jl index de65c289be02a..1a5c117ce5d9d 100644 --- a/test/specificity.jl +++ b/test/specificity.jl @@ -90,7 +90,12 @@ begin @test f((1,2,3), A) == 3 @test f((1,2), A) == 2 @test f((), reshape([1])) == 1 + + oldstderr = stderr + newstderr = redirect_stderr() # redirect stderr to avoid method definition overwrite warning f(dims::NTuple{N,Int}, A::AbstractArray{T,N}) where {T,N} = 4 + redirect_stderr(oldstderr) + @test f((1,2), A) == 4 @test f((1,2,3), A) == 3 end diff --git a/test/syntax.jl b/test/syntax.jl index ff65cb235d92c..2f95b9505d056 100644 --- a/test/syntax.jl +++ b/test/syntax.jl @@ -2972,15 +2972,15 @@ end end @testset "slurping into function def" begin - x, f()... = [1, 2, 3] + x, f1()... = [1, 2, 3] @test x == 1 - @test f() == [2, 3] + @test f1() == [2, 3] # test that call to `Base.rest` is outside the definition of `f` - @test f() === f() + @test f1() === f1() - x, f()... = 1, 2, 3 + x, f2()... = 1, 2, 3 @test x == 1 - @test f() == (2, 3) + @test f2() == (2, 3) end @testset "long function bodies" begin From 901ad02eb0239cf5ba7d46ea0f386b4c512d8240 Mon Sep 17 00:00:00 2001 From: Gerhard Aigner Date: Fri, 25 Feb 2022 10:37:43 +0100 Subject: [PATCH 053/369] Indicate defaults in comandline help (#44223) Co-authored-by: Gerhard Aigner Co-authored-by: Jameson Nash (cherry picked from commit c6b5fa276b95a50280b9846243bd1f30e74d2371) --- doc/man/julia.1 | 151 +++++++++++++++---------- doc/src/manual/command-line-options.md | 51 +++++---- src/jloptions.c | 128 +++++++++++---------- test/cmdlineargs.jl | 2 +- 4 files changed, 192 insertions(+), 140 deletions(-) diff --git a/doc/man/julia.1 b/doc/man/julia.1 index 0b008619014e1..0cd5580df5556 100644 --- a/doc/man/julia.1 +++ b/doc/man/julia.1 @@ -21,16 +21,18 @@ .\" - diagnostics .\" - notes -.TH JULIA 1 2013-12-10 Julia "Julia Programmers' Reference Guide" +.TH JULIA 1 2022-02-17 JULIA .\" from the front page of https://julialang.org/ .SH NAME julia - a high-level, high-performance dynamic programming language for technical computing .SH SYNOPSIS -julia [option] [program] [args..] +\fBjulia\fR [OPTIONS...] \fB--\fR [PROGRAMMFILE] [ARGS...] + +If a Julia source file is given as a \fIPROGRAMFILE\fP (optionally followed by +arguments in \fIARGS\fP) Julia will execute the program and exit. -.\" Taken almost verbatim from the front page of https://julialang.org/ .SH DESCRIPTION Julia is a high-level, high-performance dynamic programming language for technical computing, with syntax that is familiar to users @@ -49,10 +51,6 @@ For a more in-depth discussion of the rationale and advantages of Julia over other systems, please see the online manual: https://docs.julialang.org -If a Julia source file is given as a \fIprogram\fP (optionally followed by - arguments in \fIargs\fP) Julia will execute the program and exit. - -.\" This section was taken nearly verbatim from the output of `julia --help` .SH "COMMAND-LINE OPTIONS" .TP @@ -63,6 +61,10 @@ Display version information -h, --help Print help message +.TP +--help-hidden +Print uncommon options not shown by `-h` + .TP --project[=/@.] Set as the home project/environment. The default @. option will search @@ -73,22 +75,27 @@ found. -J, --sysimage Start up with the given system image file -.TP ---sysimage-native-code={yes|no} -Use precompiled code from system image if available - .TP -H, --home Set location of julia executable .TP ---startup-file={yes|no} -Load ~/.julia/config/startup.jl +--startup-file={yes*|no} +Load `JULIA_DEPOT_PATH/config/startup.jl`; if `JULIA_DEPOT_PATH` +environment variable is unset, load `~/.julia/config/startup.jl` .TP ---handle-signals={yes|no} +--handle-signals={yes*|no} Enable or disable Julia's default signal handlers +.TP +--sysimage-native-code={yes*|no} +Use native code from system image if available + +.TP +--compiled-modules={yes*|no} +Enable or disable incremental precompilation of modules + .TP -e, --eval Evaluate @@ -106,8 +113,9 @@ Load immediately on all processors Enable n threads .TP --p, --procs -Run n local processes +-p, --procs {N|auto} +Integer value N launches N additional local worker processes `auto` launches as many workers +as the number of local CPU threads (logical cores) .TP --machine-file @@ -115,68 +123,86 @@ Run processes on hosts listed in .TP -i -Interactive mode; REPL runs and isinteractive() is true +Interactive mode; REPL runs and `isinteractive()` is true + +.TP +-q, --quiet +Quiet startup: no banner, suppress REPL warnings .TP ---banner={yes|no|auto} +--banner={yes|no|auto*} Enable or disable startup banner .TP ---color={yes|no|auto} +--color={yes|no|auto*} Enable or disable color text .TP ---history-file={yes|no} +--history-file={yes*|no} Load or save history .TP ---compile={yes|no|all|min} -Enable or disable compiler, or request exhaustive or minimal compilation +--depwarn={yes|no*|error} +Enable or disable syntax and method deprecation warnings (`error` turns warnings into errors) .TP --C, --cpu-target= -Limit usage of cpu features up to +--warn-overwrite={yes|no*} +Enable or disable method overwrite warnings .TP --O, --optimize -Run time-intensive code optimizations +--warn-scope={yes*|no} +Enable or disable warning for ambiguous top-level scope .TP --O , --optimize= -Set the optimization level to +-C, --cpu-target= +Limit usage of CPU features up to ; set to `help` to see the available options .TP ---min-optlevel= -Set the minimum optimization level to , overriding per-module settings +-O, --optimize={0,1,2*,3} +Set the optimization level (level 3 if `-O` is used without a level) .TP --g -Enable generation of full debug info +--min-optlevel={0*,1,2,3} +Set a lower bound on the optimization level .TP --g -Set the level of debug info generation to +-g {0,1*,2} +Set the level of debug info generation (level 2 if `-g` is used without a level) .TP ---inline={yes|no} -Control whether inlining is permitted (overrides functions declared as @inline) +--inline={yes*|no} +Control whether inlining is permitted, including overriding @inline declarations .TP ---check-bounds={yes|no|auto} +--check-bounds={yes|no|auto*} Emit bounds checks always, never, or respect @inbounds declarations .TP --math-mode={ieee|user} -Always use IEEE semantics for math (ignoring declarations), -or adhere to declarations in source code +Disallow or enable unsafe floating point optimizations (overrides @fastmath declaration) .TP ---depwarn={yes|no|error} -Enable or disable syntax and method deprecation warnings ('error' turns warnings into errors) +--code-coverage[={none*|user|all}] +Count executions of source lines (omitting setting is equivalent to `user`) .TP ---warn-overwrite={yes|no} -Enable or disable method overwrite warnings + --code-coverage=tracefile.info + Append coverage information to the LCOV tracefile (filename supports format tokens) + +.TP +--track-allocation[={none*|user|all}] +Count bytes allocated by each source line (omitting setting is equivalent to `user`) + +.TP +--bug-report=KIND +Launch a bug report session. It can be used to start a REPL, run a script, or evaluate +expressions. It first tries to use BugReporting.jl installed in current environment and +fallbacks to the latest compatible BugReporting.jl if not. For more information, see +--bug-report=help. + +.TP +--compile={yes*|no|all|min} +Enable or disable JIT compiler, or request exhaustive or minimal compilation .TP --output-o @@ -186,36 +212,45 @@ Generate an object file (including system image data) --output-ji Generate a system image data file (.ji) +.TP +--strip-metadata +Remove docstrings and source location info from system image + +.TP +--strip-ir +Remove IR (intermediate representation) of compiled functions + +.TP +--output-unopt-bc +Generate unoptimized LLVM bitcode (.bc) + .TP --output-bc Generate LLVM bitcode (.bc) .TP ---output-incremental={yes|no} -Generate an incremental output file (rather than complete) +--output-asm +Generate an assembly file (.s) .TP ---code-coverage={none|user|all}, --code-coverage -Count executions of source lines (omitting setting is equivalent to 'user') +--output-incremental={yes|no*} +Generate an incremental output file (rather than complete) .TP ---track-allocation={none|user|all}, --track-allocation -Count bytes allocated by each source line +--trace-compile={stderr,name} +Print precompile statements for methods compiled during execution or save to a path -.SH FILES -.I ~/.julia/config/startup.jl -.RS -Per user startup file. -.RE +.TP +-image-codegen +Force generate code in imaging mode -.I /etc/julia/startup.jl -.RS -System-wide startup file. -.RE +.SH FILES AND ENVIRONMENT +See https://docs.julialang.org/en/v1/manual/environment-variables/ .SH BUGS Please report any bugs using the GitHub issue tracker: https://github.com/julialang/julia/issues?state=open + .SH AUTHORS Contributors: https://github.com/JuliaLang/julia/graphs/contributors diff --git a/doc/src/manual/command-line-options.md b/doc/src/manual/command-line-options.md index f3ad39a6aed16..f171386604708 100644 --- a/doc/src/manual/command-line-options.md +++ b/doc/src/manual/command-line-options.md @@ -72,20 +72,20 @@ There are various ways to run Julia code and provide options, similar to those a julia [switches] -- [programfile] [args...] ``` -The following is a complete list of command-line switches available when launching julia, e.g. - +The following is a complete list of command-line switches available when launching julia (a '*' marks the default value, if applicable): |Switch |Description| |:--- |:---| |`-v`, `--version` |Display version information| |`-h`, `--help` |Print command-line options (this message).| +|`--help-hidden` |Uncommon options not shown by `-h`| |`--project[={\|@.}]` |Set `` as the home project/environment. The default `@.` option will search through parent directories until a `Project.toml` or `JuliaProject.toml` file is found.| |`-J`, `--sysimage ` |Start up with the given system image file| |`-H`, `--home ` |Set location of `julia` executable| -|`--startup-file={yes\|no}` |Load `~/.julia/config/startup.jl`| -|`--handle-signals={yes\|no}` |Enable or disable Julia's default signal handlers| -|`--sysimage-native-code={yes\|no}` |Use native code from system image if available| -|`--compiled-modules={yes\|no}` |Enable or disable incremental precompilation of modules| +|`--startup-file={yes*\|no}` |Load `JULIA_DEPOT_PATH/config/startup.jl`; if `JULIA_DEPOT_PATH` environment variable is unset, load `~/.julia/config/startup.jl`| +|`--handle-signals={yes*\|no}` |Enable or disable Julia's default signal handlers| +|`--sysimage-native-code={yes*\|no}` |Use native code from system image if available| +|`--compiled-modules={yes*\|no}` |Enable or disable incremental precompilation of modules| |`-e`, `--eval ` |Evaluate ``| |`-E`, `--print ` |Evaluate `` and display the result| |`-L`, `--load ` |Load `` immediately on all processors| @@ -94,22 +94,35 @@ The following is a complete list of command-line switches available when launchi |`--machine-file ` |Run processes on hosts listed in ``| |`-i` |Interactive mode; REPL runs and `isinteractive()` is true| |`-q`, `--quiet` |Quiet startup: no banner, suppress REPL warnings| -|`--banner={yes\|no\|auto}` |Enable or disable startup banner| -|`--color={yes\|no\|auto}` |Enable or disable color text| -|`--history-file={yes\|no}` |Load or save history| -|`--depwarn={yes\|no\|error}` |Enable or disable syntax and method deprecation warnings (`error` turns warnings into errors)| -|`--warn-overwrite={yes\|no}` |Enable or disable method overwrite warnings| +|`--banner={yes\|no\|auto*}` |Enable or disable startup banner| +|`--color={yes\|no\|auto*}` |Enable or disable color text| +|`--history-file={yes*\|no}` |Load or save history| +|`--depwarn={yes\|no*\|error}` |Enable or disable syntax and method deprecation warnings (`error` turns warnings into errors)| +|`--warn-overwrite={yes\|no*}` |Enable or disable method overwrite warnings| +|`--warn-scope={yes*\|no}` |Enable or disable warning for ambiguous top-level scope| |`-C`, `--cpu-target ` |Limit usage of CPU features up to ``; set to `help` to see the available options| -|`-O`, `--optimize={0,1,2,3}` |Set the optimization level (default level is 2 if unspecified or 3 if used without a level)| -|`--min-optlevel={0,1,2,3}` |Set the lower bound on per-module optimization (default is 0)| -|`-g`, `-g ` |Enable or set the level of debug info generation (default level is 1 if unspecified or 2 if used without a level)| +|`-O`, `--optimize={0,1,2*,3}` |Set the optimization level (level is 3 if `-O` is used without a level)| +|`--min-optlevel={0*,1,2,3}` |Set the lower bound on per-module optimization| +|`-g {0,1*,2}` |Set the level of debug info generation (level is 2 if `-g` is used without a level)| |`--inline={yes\|no}` |Control whether inlining is permitted, including overriding `@inline` declarations| -|`--check-bounds={yes\|no\|auto}` |Emit bounds checks always, never, or respect `@inbounds` declarations| +|`--check-bounds={yes\|no\|auto*}` |Emit bounds checks always, never, or respect `@inbounds` declarations| |`--math-mode={ieee,fast}` |Disallow or enable unsafe floating point optimizations (overrides `@fastmath` declaration)| -|`--code-coverage={none\|user\|all}` |Count executions of source lines| -|`--code-coverage` |equivalent to `--code-coverage=user`| -|`--track-allocation={none\|user\|all}` |Count bytes allocated by each source line| -|`--track-allocation` |equivalent to `--track-allocation=user`| +|`--code-coverage[={none*\|user\|all}]` |Count executions of source lines (omitting setting is equivalent to `user`)| +|`--code-coverage=tracefile.info` |Append coverage information to the LCOV tracefile (filename supports format tokens).| +|`--track-allocation[={none*\|user\|all}]` |Count bytes allocated by each source line (omitting setting is equivalent to "user")| +|`--bug-report=KIND` |Launch a bug report session. It can be used to start a REPL, run a script, or evaluate expressions. It first tries to use BugReporting.jl installed in current environment and fallbacks to the latest compatible BugReporting.jl if not. For more nformation, see `--bug-report=help`.| +|`--compile={yes*\|no\|all\|min}` |Enable or disable JIT compiler, or request exhaustive or minimal compilation| +|`--output-o ` |Generate an object file (including system image data)| +|`--output-ji ` |Generate a system image data file (.ji)| +|`--strip-metadata` |Remove docstrings and source location info from system image| +|`--strip-ir` |Remove IR (intermediate representation) of compiled functions| +|`--output-unopt-bc ` |Generate unoptimized LLVM bitcode (.bc)| +|`--output-bc ` |Generate LLVM bitcode (.bc)| +|`--output-asm ` |Generate an assembly file (.s)| +|`--output-incremental={yes\|no*}` |Generate an incremental output file (rather than complete)| +|`--trace-compile={stderr,name}` |Print precompile statements for methods compiled during execution or save to a path| +|`--image-codegen` |Force generate code in imaging mode| + !!! compat "Julia 1.1" In Julia 1.0, the default `--project=@.` option did not search up from the root diff --git a/src/jloptions.c b/src/jloptions.c index b85e8f7bfe386..1a572d4e25fd9 100644 --- a/src/jloptions.c +++ b/src/jloptions.c @@ -74,7 +74,7 @@ JL_DLLEXPORT void jl_init_options(void) NULL, // output-o NULL, // output-asm NULL, // output-ji - NULL, // output-code_coverage + NULL, // output-code_coverage 0, // incremental 0, // image_file_specified JL_OPTIONS_WARN_SCOPE_ON, // ambiguous scope warning @@ -86,97 +86,101 @@ JL_DLLEXPORT void jl_init_options(void) jl_options_initialized = 1; } -static const char usage[] = "julia [switches] -- [programfile] [args...]\n"; +static const char usage[] = "\n julia [switches] -- [programfile] [args...]\n\n"; static const char opts[] = - " -v, --version Display version information\n" - " -h, --help Print this message (--help-hidden for more)\n" - " --help-hidden Uncommon options not shown by `-h`\n\n" + "Switches (a '*' marks the default value, if applicable):\n\n" + " -v, --version Display version information\n" + " -h, --help Print this message (--help-hidden for more)\n" + " --help-hidden Uncommon options not shown by `-h`\n\n" // startup options - " --project[={|@.}] Set as the home project/environment\n" - " -J, --sysimage Start up with the given system image file\n" - " -H, --home Set location of `julia` executable\n" - " --startup-file={yes|no} Load `~/.julia/config/startup.jl`\n" - " --handle-signals={yes|no} Enable or disable Julia's default signal handlers\n" - " --sysimage-native-code={yes|no}\n" - " Use native code from system image if available\n" - " --compiled-modules={yes|no}\n" - " Enable or disable incremental precompilation of modules\n\n" + " --project[={|@.}] Set as the home project/environment\n" + " -J, --sysimage Start up with the given system image file\n" + " -H, --home Set location of `julia` executable\n" + " --startup-file={yes*|no} Load `JULIA_DEPOT_PATH/config/startup.jl`; if `JULIA_DEPOT_PATH`\n" + " environment variable is unset, load `~/.julia/config/startup.jl`\n" + " --handle-signals={yes*|no} Enable or disable Julia's default signal handlers\n" + " --sysimage-native-code={yes*|no}\n" + " Use native code from system image if available\n" + " --compiled-modules={yes*|no}\n" + " Enable or disable incremental precompilation of modules\n\n" // actions - " -e, --eval Evaluate \n" - " -E, --print Evaluate and display the result\n" - " -L, --load Load immediately on all processors\n\n" + " -e, --eval Evaluate \n" + " -E, --print Evaluate and display the result\n" + " -L, --load Load immediately on all processors\n\n" // parallel options - " -t, --threads {N|auto} Enable N threads; \"auto\" currently sets N to the number of local\n" - " CPU threads but this might change in the future\n" - " -p, --procs {N|auto} Integer value N launches N additional local worker processes\n" - " \"auto\" launches as many workers as the number of local CPU threads (logical cores)\n" - " --machine-file Run processes on hosts listed in \n\n" + " -t, --threads {N|auto} Enable N threads; \"auto\" currently sets N to the number of local\n" + " CPU threads but this might change in the future\n" + " -p, --procs {N|auto} Integer value N launches N additional local worker processes\n" + " \"auto\" launches as many workers as the number of local CPU threads (logical cores)\n" + " --machine-file Run processes on hosts listed in \n\n" // interactive options - " -i Interactive mode; REPL runs and isinteractive() is true\n" - " -q, --quiet Quiet startup: no banner, suppress REPL warnings\n" - " --banner={yes|no|auto} Enable or disable startup banner\n" - " --color={yes|no|auto} Enable or disable color text\n" - " --history-file={yes|no} Load or save history\n\n" + " -i Interactive mode; REPL runs and `isinteractive()` is true\n" + " -q, --quiet Quiet startup: no banner, suppress REPL warnings\n" + " --banner={yes|no|auto*} Enable or disable startup banner\n" + " --color={yes|no|auto*} Enable or disable color text\n" + " --history-file={yes*|no} Load or save history\n\n" // error and warning options - " --depwarn={yes|no|error} Enable or disable syntax and method deprecation warnings (\"error\" turns warnings into errors)\n" - " --warn-overwrite={yes|no} Enable or disable method overwrite warnings\n" - " --warn-scope={yes|no} Enable or disable warning for ambiguous top-level scope\n\n" + " --depwarn={yes|no*|error} Enable or disable syntax and method deprecation warnings (`error` turns warnings into errors)\n" + " --warn-overwrite={yes|no*} Enable or disable method overwrite warnings\n" + " --warn-scope={yes*|no} Enable or disable warning for ambiguous top-level scope\n\n" // code generation options - " -C, --cpu-target Limit usage of CPU features up to ; set to \"help\" to see the available options\n" - " -O, --optimize={0,1,2,3} Set the optimization level (default level is 2 if unspecified or 3 if used without a level)\n" - " --min-optlevel={0,1,2,3} Set a lower bound on the optimization level (default is 0)\n" - " -g, -g Enable or set the level of debug info generation" + " -C, --cpu-target Limit usage of CPU features up to ; set to `help` to see the available options\n" + " -O, --optimize={0,1,2*,3} Set the optimization level (level 3 if `-O` is used without a level)\n" + " --min-optlevel={0*,1,2,3} Set a lower bound on the optimization level\n" #ifdef JL_DEBUG_BUILD - " (default level for julia-debug is 2 if unspecified or if used without a level)\n" + " -g [{0,1,2*}] Set the level of debug info generation in the julia-debug build\n" #else - " (default level is 1 if unspecified or 2 if used without a level)\n" + " -g [{0,1*,2}] Set the level of debug info generation (level 2 if `-g` is used without a level)\n" #endif - " --inline={yes|no} Control whether inlining is permitted, including overriding @inline declarations\n" - " --check-bounds={yes|no|auto}\n" - " Emit bounds checks always, never, or respect @inbounds declarations\n" + " --inline={yes*|no} Control whether inlining is permitted, including overriding @inline declarations\n" + " --check-bounds={yes|no|auto*}\n" + " Emit bounds checks always, never, or respect @inbounds declarations\n" #ifdef USE_POLLY - " --polly={yes|no} Enable or disable the polyhedral optimizer Polly (overrides @polly declaration)\n" + " --polly={yes*|no} Enable or disable the polyhedral optimizer Polly (overrides @polly declaration)\n" #endif - " --math-mode={ieee,fast} Disallow or enable unsafe floating point optimizations (overrides @fastmath declaration)\n\n" + " --math-mode={ieee,fast} Disallow or enable unsafe floating point optimizations (overrides @fastmath declaration)\n\n" // instrumentation options - " --code-coverage={none|user|all}, --code-coverage\n" - " Count executions of source lines (omitting setting is equivalent to \"user\")\n" + " --code-coverage[={none*|user|all}]\n" + " Count executions of source lines (omitting setting is equivalent to `user`)\n" " --code-coverage=tracefile.info\n" - " Append coverage information to the LCOV tracefile (filename supports format tokens).\n" + " Append coverage information to the LCOV tracefile (filename supports format tokens)\n" // TODO: These TOKENS are defined in `runtime_ccall.cpp`. A more verbose `--help` should include that list here. - " --track-allocation={none|user|all}, --track-allocation\n" - " Count bytes allocated by each source line (omitting setting is equivalent to \"user\")\n" - " --bug-report=KIND Launch a bug report session. It can be used to start a REPL, run a script, or evaluate\n" - " expressions. It first tries to use BugReporting.jl installed in current environment and\n" - " fallbacks to the latest compatible BugReporting.jl if not. For more information, see\n" - " --bug-report=help.\n\n" + " --track-allocation[={none*|user|all}]\n" + " Count bytes allocated by each source line (omitting setting is equivalent to `user`)\n" + " --bug-report=KIND Launch a bug report session. It can be used to start a REPL, run a script, or evaluate\n" + " expressions. It first tries to use BugReporting.jl installed in current environment and\n" + " fallbacks to the latest compatible BugReporting.jl if not. For more information, see\n" + " --bug-report=help.\n\n" ; static const char opts_hidden[] = + "Switches (a '*' marks the default value, if applicable):\n\n" // code generation options - " --compile={yes|no|all|min}Enable or disable JIT compiler, or request exhaustive or minimal compilation\n" + " --compile={yes*|no|all|min}\n" + " Enable or disable JIT compiler, or request exhaustive or minimal compilation\n\n" // compiler output options - " --output-o name Generate an object file (including system image data)\n" - " --output-ji name Generate a system image data file (.ji)\n" - " --strip-metadata Remove docstrings and source location info from system image\n" - " --strip-ir Remove IR (intermediate representation) of compiled functions\n" + " --output-o Generate an object file (including system image data)\n" + " --output-ji Generate a system image data file (.ji)\n" + " --strip-metadata Remove docstrings and source location info from system image\n" + " --strip-ir Remove IR (intermediate representation) of compiled functions\n\n" // compiler debugging (see the devdocs for tips on using these options) - " --output-unopt-bc name Generate unoptimized LLVM bitcode (.bc)\n" - " --output-bc name Generate LLVM bitcode (.bc)\n" - " --output-asm name Generate an assembly file (.s)\n" - " --output-incremental=no Generate an incremental output file (rather than complete)\n" + " --output-unopt-bc Generate unoptimized LLVM bitcode (.bc)\n" + " --output-bc Generate LLVM bitcode (.bc)\n" + " --output-asm Generate an assembly file (.s)\n" + " --output-incremental={yes|no*}\n" + " Generate an incremental output file (rather than complete)\n" " --trace-compile={stderr,name}\n" - " Print precompile statements for methods compiled during execution or save to a path\n\n" - " --image-codegen Force generate code in imaging mode\n" + " Print precompile statements for methods compiled during execution or save to a path\n" + " --image-codegen Force generate code in imaging mode\n" ; JL_DLLEXPORT void jl_parse_opts(int *argcp, char ***argvp) @@ -237,7 +241,7 @@ JL_DLLEXPORT void jl_parse_opts(int *argcp, char ***argvp) { "bug-report", required_argument, 0, opt_bug_report }, { "sysimage", required_argument, 0, 'J' }, { "sysimage-native-code", required_argument, 0, opt_sysimage_native_code }, - { "compiled-modules", required_argument, 0, opt_compiled_modules }, + { "compiled-modules",required_argument, 0, opt_compiled_modules }, { "cpu-target", required_argument, 0, 'C' }, { "procs", required_argument, 0, 'p' }, { "threads", required_argument, 0, 't' }, diff --git a/test/cmdlineargs.jl b/test/cmdlineargs.jl index 0a03e60f6dd03..8f11f6a6c7a44 100644 --- a/test/cmdlineargs.jl +++ b/test/cmdlineargs.jl @@ -123,7 +123,7 @@ let exename = `$(Base.julia_cmd()) --startup-file=no --color=no` @test read(`$exename -v`, String) == read(`$exename --version`, String) # --help - let header = "julia [switches] -- [programfile] [args...]" + let header = "\n julia [switches] -- [programfile] [args...]" @test startswith(read(`$exename -h`, String), header) @test startswith(read(`$exename --help`, String), header) end From bedccaf7a25fe4624f2d88746cf35668c175f337 Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Thu, 3 Mar 2022 08:16:02 -0500 Subject: [PATCH 054/369] Add option for codecov and allocation tracking to be restricted by path (#44359) (cherry picked from commit 166b829a208a0aaa3c1f27d6e2134e409b2b6806) --- base/options.jl | 1 + base/util.jl | 4 +++ doc/man/julia.1 | 10 +++++++ src/codegen.cpp | 37 +++++++++++++++--------- src/init.c | 2 ++ src/jloptions.c | 18 ++++++++++++ src/jloptions.h | 1 + src/julia.h | 1 + test/cmdlineargs.jl | 33 +++++++++++++++++++++ test/testhelpers/coverage_file.info.bad2 | 20 +++++++++++++ 10 files changed, 113 insertions(+), 14 deletions(-) create mode 100644 test/testhelpers/coverage_file.info.bad2 diff --git a/base/options.jl b/base/options.jl index 2af8337673b93..52bfb1237a858 100644 --- a/base/options.jl +++ b/base/options.jl @@ -20,6 +20,7 @@ struct JLOptions compile_enabled::Int8 code_coverage::Int8 malloc_log::Int8 + tracked_path::Ptr{UInt8} opt_level::Int8 opt_level_min::Int8 debug_level::Int8 diff --git a/base/util.jl b/base/util.jl index 935f357367a8e..df9e29790deb6 100644 --- a/base/util.jl +++ b/base/util.jl @@ -196,6 +196,8 @@ function julia_cmd(julia=joinpath(Sys.BINDIR, julia_exename())) push!(addflags, "--code-coverage=user") elseif opts.code_coverage == 2 push!(addflags, "--code-coverage=all") + elseif opts.code_coverage == 3 + push!(addflags, "--code-coverage=@$(unsafe_string(opts.tracked_path))") end isempty(coverage_file) || push!(addflags, "--code-coverage=$coverage_file") end @@ -204,6 +206,8 @@ function julia_cmd(julia=joinpath(Sys.BINDIR, julia_exename())) push!(addflags, "--track-allocation=user") elseif opts.malloc_log == 2 push!(addflags, "--track-allocation=all") + elseif opts.malloc_log == 3 + push!(addflags, "--track-allocation=@$(unsafe_string(opts.tracked_path))") end if opts.color == 1 push!(addflags, "--color=yes") diff --git a/doc/man/julia.1 b/doc/man/julia.1 index 0cd5580df5556..249c8e0bd214e 100644 --- a/doc/man/julia.1 +++ b/doc/man/julia.1 @@ -185,6 +185,11 @@ Disallow or enable unsafe floating point optimizations (overrides @fastmath decl --code-coverage[={none*|user|all}] Count executions of source lines (omitting setting is equivalent to `user`) +.TP +--code-coverage=@ +Count executions of source lines in a file or files under a given directory. A `@` must +be placed before the path to indicate this option. A `@` with no path will track the current directory. + .TP --code-coverage=tracefile.info Append coverage information to the LCOV tracefile (filename supports format tokens) @@ -193,6 +198,11 @@ Count executions of source lines (omitting setting is equivalent to `user`) --track-allocation[={none*|user|all}] Count bytes allocated by each source line (omitting setting is equivalent to `user`) +.TP +--track-allocation=@ +Count bytes allocated by each source line in a file or files under a given directory. A `@` +must be placed before the path to indicate this option. A `@` with no path will track the current directory. + .TP --bug-report=KIND Launch a bug report session. It can be used to start a REPL, run a script, or evaluate diff --git a/src/codegen.cpp b/src/codegen.cpp index c9e7b2280777e..89107f99413dc 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -6956,15 +6956,20 @@ static std::pair, jl_llvm_functions_t> return (!jl_is_submodule(mod, jl_base_module) && !jl_is_submodule(mod, jl_core_module)); }; + auto in_tracked_path = [] (StringRef file) { + return jl_options.tracked_path != NULL && file.startswith(jl_options.tracked_path); + }; bool mod_is_user_mod = in_user_mod(ctx.module); + bool mod_is_tracked = in_tracked_path(ctx.file); struct DebugLineTable { DebugLoc loc; StringRef file; ssize_t line; bool is_user_code; + bool is_tracked; // falls within an explicitly set file or directory unsigned inlined_at; bool operator ==(const DebugLineTable &other) const { - return other.loc == loc && other.file == file && other.line == line && other.is_user_code == is_user_code && other.inlined_at == inlined_at; + return other.loc == loc && other.file == file && other.line == line && other.is_user_code == is_user_code && other.is_tracked == is_tracked && other.inlined_at == inlined_at; } }; std::vector linetable; @@ -6977,6 +6982,7 @@ static std::pair, jl_llvm_functions_t> topinfo.file = ctx.file; topinfo.line = toplineno; topinfo.is_user_code = mod_is_user_mod; + topinfo.is_tracked = mod_is_tracked; topinfo.inlined_at = 0; topinfo.loc = topdebugloc; for (size_t i = 0; i < nlocs; i++) { @@ -6990,13 +6996,14 @@ static std::pair, jl_llvm_functions_t> info.line = jl_unbox_long(jl_fieldref(locinfo, 3)); info.inlined_at = jl_unbox_long(jl_fieldref(locinfo, 4)); assert(info.inlined_at <= i); + info.file = jl_symbol_name(filesym); + if (info.file.empty()) + info.file = ""; if (module == ctx.module) info.is_user_code = mod_is_user_mod; else info.is_user_code = in_user_mod(module); - info.file = jl_symbol_name(filesym); - if (info.file.empty()) - info.file = ""; + info.is_tracked = in_tracked_path(info.file); if (ctx.debug_enabled) { StringRef fname; if (jl_is_method_instance(method)) @@ -7110,13 +7117,15 @@ static std::pair, jl_llvm_functions_t> cursor = -1; }; - auto do_coverage = [&] (bool in_user_code) { + auto do_coverage = [&] (bool in_user_code, bool is_tracked) { return (coverage_mode == JL_LOG_ALL || - (coverage_mode == JL_LOG_USER && in_user_code)); + (in_user_code && coverage_mode == JL_LOG_USER) || + (is_tracked && coverage_mode == JL_LOG_PATH)); }; - auto do_malloc_log = [&] (bool in_user_code) { + auto do_malloc_log = [&] (bool in_user_code, bool is_tracked) { return (malloc_log_mode == JL_LOG_ALL || - (malloc_log_mode == JL_LOG_USER && in_user_code)); + (in_user_code && malloc_log_mode == JL_LOG_USER) || + (is_tracked && malloc_log_mode == JL_LOG_PATH)); }; std::vector current_lineinfo, new_lineinfo; auto coverageVisitStmt = [&] (size_t dbg) { @@ -7135,15 +7144,15 @@ static std::pair, jl_llvm_functions_t> if (newdbg != current_lineinfo[dbg]) { current_lineinfo[dbg] = newdbg; const auto &info = linetable.at(newdbg); - if (do_coverage(info.is_user_code)) + if (do_coverage(info.is_user_code, info.is_tracked)) coverageVisitLine(ctx, info.file, info.line); } } new_lineinfo.clear(); }; auto mallocVisitStmt = [&] (unsigned dbg, Value *sync) { - if (!do_malloc_log(mod_is_user_mod) || dbg == 0) { - if (do_malloc_log(true) && sync) + if (!do_malloc_log(mod_is_user_mod, mod_is_tracked) || dbg == 0) { + if (do_malloc_log(true, mod_is_tracked) && sync) ctx.builder.CreateCall(prepare_call(sync_gc_total_bytes_func), {sync}); return; } @@ -7154,7 +7163,7 @@ static std::pair, jl_llvm_functions_t> if (coverage_mode != JL_LOG_NONE) { // record all lines that could be covered for (const auto &info : linetable) - if (do_coverage(info.is_user_code)) + if (do_coverage(info.is_user_code, info.is_tracked)) jl_coverage_alloc_line(info.file, info.line); } @@ -7209,7 +7218,7 @@ static std::pair, jl_llvm_functions_t> } Value *sync_bytes = nullptr; - if (do_malloc_log(true)) + if (do_malloc_log(true, mod_is_tracked)) sync_bytes = ctx.builder.CreateCall(prepare_call(diff_gc_total_bytes_func), {}); { // coverage for the function definition line number const auto &topinfo = linetable.at(0); @@ -7217,7 +7226,7 @@ static std::pair, jl_llvm_functions_t> if (topinfo == linetable.at(1)) current_lineinfo.push_back(1); } - if (do_coverage(topinfo.is_user_code)) + if (do_coverage(topinfo.is_user_code, topinfo.is_tracked)) coverageVisitLine(ctx, topinfo.file, topinfo.line); } diff --git a/src/init.c b/src/init.c index 724261704836e..6bebffdcf326c 100644 --- a/src/init.c +++ b/src/init.c @@ -583,6 +583,8 @@ static void jl_resolve_sysimg_location(JL_IMAGE_SEARCH rel) jl_options.machine_file = abspath(jl_options.machine_file, 0); if (jl_options.output_code_coverage) jl_options.output_code_coverage = absformat(jl_options.output_code_coverage); + if (jl_options.tracked_path) + jl_options.tracked_path = absformat(jl_options.tracked_path); const char **cmdp = jl_options.cmds; if (cmdp) { diff --git a/src/jloptions.c b/src/jloptions.c index 1a572d4e25fd9..978da79c1e95d 100644 --- a/src/jloptions.c +++ b/src/jloptions.c @@ -49,6 +49,7 @@ JL_DLLEXPORT void jl_init_options(void) JL_OPTIONS_COMPILE_DEFAULT, // compile_enabled 0, // code_coverage 0, // malloc_log + NULL, // tracked_path 2, // opt_level 0, // opt_level_min #ifdef JL_DEBUG_BUILD @@ -149,11 +150,20 @@ static const char opts[] = // instrumentation options " --code-coverage[={none*|user|all}]\n" " Count executions of source lines (omitting setting is equivalent to `user`)\n" + " --code-coverage=@\n" + " Count executions but only in files that fall under the given file path/directory.\n" + " The `@` prefix is required to select this option. A `@` with no path will track the\n" + " current directory.\n" + " --code-coverage=tracefile.info\n" " Append coverage information to the LCOV tracefile (filename supports format tokens)\n" // TODO: These TOKENS are defined in `runtime_ccall.cpp`. A more verbose `--help` should include that list here. " --track-allocation[={none*|user|all}]\n" " Count bytes allocated by each source line (omitting setting is equivalent to `user`)\n" + " --track-allocation=@\n" + " Count bytes but only in files that fall under the given file path/directory.\n" + " The `@` prefix is required to select this option. A `@` with no path will track the\n" + " current directory.\n" " --bug-report=KIND Launch a bug report session. It can be used to start a REPL, run a script, or evaluate\n" " expressions. It first tries to use BugReporting.jl installed in current environment and\n" " fallbacks to the latest compatible BugReporting.jl if not. For more information, see\n" @@ -515,6 +525,10 @@ JL_DLLEXPORT void jl_parse_opts(int *argcp, char ***argvp) codecov = JL_LOG_ALL; jl_options.output_code_coverage = optarg; } + else if (!strncmp(optarg, "@", 1)) { + codecov = JL_LOG_PATH; + jl_options.tracked_path = optarg + 1; // skip `@` + } else jl_errorf("julia: invalid argument to --code-coverage (%s)", optarg); break; @@ -531,6 +545,10 @@ JL_DLLEXPORT void jl_parse_opts(int *argcp, char ***argvp) malloclog = JL_LOG_ALL; else if (!strcmp(optarg,"none")) malloclog = JL_LOG_NONE; + else if (!strncmp(optarg, "@", 1)) { + malloclog = JL_LOG_PATH; + jl_options.tracked_path = optarg + 1; // skip `@` + } else jl_errorf("julia: invalid argument to --track-allocation (%s)", optarg); break; diff --git a/src/jloptions.h b/src/jloptions.h index 0f53bc0f8a4de..2425b2bb680c2 100644 --- a/src/jloptions.h +++ b/src/jloptions.h @@ -24,6 +24,7 @@ typedef struct { int8_t compile_enabled; int8_t code_coverage; int8_t malloc_log; + const char *tracked_path; int8_t opt_level; int8_t opt_level_min; int8_t debug_level; diff --git a/src/julia.h b/src/julia.h index 2d51de2f3ed9b..5e22c262fb47d 100644 --- a/src/julia.h +++ b/src/julia.h @@ -2077,6 +2077,7 @@ JL_DLLEXPORT int jl_generating_output(void) JL_NOTSAFEPOINT; #define JL_LOG_NONE 0 #define JL_LOG_USER 1 #define JL_LOG_ALL 2 +#define JL_LOG_PATH 3 #define JL_OPTIONS_CHECK_BOUNDS_DEFAULT 0 #define JL_OPTIONS_CHECK_BOUNDS_ON 1 diff --git a/test/cmdlineargs.jl b/test/cmdlineargs.jl index 8f11f6a6c7a44..43d3728dcb988 100644 --- a/test/cmdlineargs.jl +++ b/test/cmdlineargs.jl @@ -326,6 +326,39 @@ let exename = `$(Base.julia_cmd()) --startup-file=no --color=no` rm(covfile) @test occursin(expected, got) || (expected, got) @test_broken occursin(expected_good, got) + + # Ask for coverage in specific file + # TODO: Figure out why asking for a specific file/dir means some lines are under-counted + # NOTE that a different expected reference is loaded here + expected = replace(read(joinpath(helperdir, "coverage_file.info.bad2"), String), + "" => realpath(inputfile)) + tfile = realpath(inputfile) + @test readchomp(`$exename -E "(Base.JLOptions().code_coverage, unsafe_string(Base.JLOptions().tracked_path))" -L $inputfile + --code-coverage=$covfile --code-coverage=@$tfile`) == "(3, $(repr(tfile)))" + @test isfile(covfile) + got = read(covfile, String) + rm(covfile) + @test occursin(expected, got) || (expected, got) + @test_broken occursin(expected_good, got) + + # Ask for coverage in directory + tdir = dirname(realpath(inputfile)) + @test readchomp(`$exename -E "(Base.JLOptions().code_coverage, unsafe_string(Base.JLOptions().tracked_path))" -L $inputfile + --code-coverage=$covfile --code-coverage=@$tdir`) == "(3, $(repr(tdir)))" + @test isfile(covfile) + got = read(covfile, String) + rm(covfile) + @test occursin(expected, got) || (expected, got) + @test_broken occursin(expected_good, got) + + # Ask for coverage in a different directory + tdir = mktempdir() # a dir that contains no code + @test readchomp(`$exename -E "(Base.JLOptions().code_coverage, unsafe_string(Base.JLOptions().tracked_path))" -L $inputfile + --code-coverage=$covfile --code-coverage=@$tdir`) == "(3, $(repr(tdir)))" + @test isfile(covfile) + got = read(covfile, String) + @test isempty(got) + rm(covfile) end # --track-allocation diff --git a/test/testhelpers/coverage_file.info.bad2 b/test/testhelpers/coverage_file.info.bad2 new file mode 100644 index 0000000000000..a766597be4c17 --- /dev/null +++ b/test/testhelpers/coverage_file.info.bad2 @@ -0,0 +1,20 @@ +SF: +DA:3,1 +DA:4,1 +DA:5,0 +DA:7,1 +DA:8,1 +DA:9,3 +DA:10,5 +DA:11,0 +DA:12,1 +DA:14,0 +DA:17,1 +DA:18,0 +DA:19,0 +DA:20,0 +DA:22,1 +DA:1234,0 +LH:9 +LF:16 +end_of_record From c4f6c1260358ff252d980320f0c6512eea6b4a89 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Wed, 23 Feb 2022 14:08:22 +0900 Subject: [PATCH 055/369] inference: remove `CachedMethodTable` (#44240) Since we couldn't confirm any performance benefit from `CachedMethodTable` in the current infrastructure (see the benchmark results in #44240), now I'd like to propose to eliminate that entirely and save a bit of space. --- base/compiler/inferencestate.jl | 4 +-- base/compiler/methodtable.jl | 53 +++++++++------------------------ base/compiler/types.jl | 1 - 3 files changed, 16 insertions(+), 42 deletions(-) diff --git a/base/compiler/inferencestate.jl b/base/compiler/inferencestate.jl index 17539f7621c74..39c4c9a2ceb66 100644 --- a/base/compiler/inferencestate.jl +++ b/base/compiler/inferencestate.jl @@ -65,7 +65,7 @@ mutable struct InferenceState # The place to look up methods while working on this function. # In particular, we cache method lookup results for the same function to # fast path repeated queries. - method_table::CachedMethodTable{InternalMethodTable} + method_table::InternalMethodTable # The interpreter that created this inference state. Not looked at by # NativeInterpreter. But other interpreters may use this to detect cycles @@ -141,7 +141,7 @@ mutable struct InferenceState cache === :global, false, false, Effects(consistent, ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, inbounds_taints_consistency), - CachedMethodTable(method_table(interp)), + method_table(interp), interp) result.result = frame cache !== :no && push!(get_inference_cache(interp), result) diff --git a/base/compiler/methodtable.jl b/base/compiler/methodtable.jl index 70beb259cb6a5..4086023a725f0 100644 --- a/base/compiler/methodtable.jl +++ b/base/compiler/methodtable.jl @@ -2,22 +2,6 @@ abstract type MethodTableView; end -struct MethodLookupResult - # Really Vector{Core.MethodMatch}, but it's easier to represent this as - # and work with Vector{Any} on the C side. - matches::Vector{Any} - valid_worlds::WorldRange - ambig::Bool -end -length(result::MethodLookupResult) = length(result.matches) -function iterate(result::MethodLookupResult, args...) - r = iterate(result.matches, args...) - r === nothing && return nothing - match, state = r - return (match::MethodMatch, state) -end -getindex(result::MethodLookupResult, idx::Int) = getindex(result.matches, idx)::MethodMatch - """ struct InternalMethodTable <: MethodTableView @@ -39,19 +23,21 @@ struct OverlayMethodTable <: MethodTableView mt::Core.MethodTable end -""" - struct CachedMethodTable <: MethodTableView - -Overlays another method table view with an additional local fast path cache that -can respond to repeated, identical queries faster than the original method table. -""" -struct CachedMethodTable{T} <: MethodTableView - cache::IdDict{Any, Union{Missing, MethodLookupResult}} - table::T +struct MethodLookupResult + # Really Vector{Core.MethodMatch}, but it's easier to represent this as + # and work with Vector{Any} on the C side. + matches::Vector{Any} + valid_worlds::WorldRange + ambig::Bool +end +length(result::MethodLookupResult) = length(result.matches) +function iterate(result::MethodLookupResult, args...) + r = iterate(result.matches, args...) + r === nothing && return nothing + match, state = r + return (match::MethodMatch, state) end -CachedMethodTable(table::T) where T = - CachedMethodTable{T}(IdDict{Any, Union{Missing, MethodLookupResult}}(), - table) +getindex(result::MethodLookupResult, idx::Int) = getindex(result.matches, idx)::MethodMatch """ findall(sig::Type, view::MethodTableView; limit=typemax(Int)) @@ -91,13 +77,6 @@ function findall(@nospecialize(sig::Type), table::OverlayMethodTable; limit::Int return MethodLookupResult(ms::Vector{Any}, WorldRange(_min_val[], _max_val[]), _ambig[] != 0) end -function findall(@nospecialize(sig::Type), table::CachedMethodTable; limit::Int=typemax(Int)) - box = Core.Box(sig) - return get!(table.cache, sig) do - findall(box.contents, table.table; limit=limit) - end -end - """ findsup(sig::Type, view::MethodTableView)::Union{Tuple{MethodMatch, WorldRange}, Nothing} @@ -121,10 +100,6 @@ function findsup(@nospecialize(sig::Type), table::InternalMethodTable) (result.method, WorldRange(min_valid[], max_valid[])) end -# This query is not cached -findsup(@nospecialize(sig::Type), table::CachedMethodTable) = findsup(sig, table.table) - isoverlayed(::MethodTableView) = error("unsatisfied MethodTableView interface") isoverlayed(::InternalMethodTable) = false isoverlayed(::OverlayMethodTable) = true -isoverlayed(mt::CachedMethodTable) = isoverlayed(mt.table) diff --git a/base/compiler/types.jl b/base/compiler/types.jl index 956fd7c747e80..1fd33d47f0408 100644 --- a/base/compiler/types.jl +++ b/base/compiler/types.jl @@ -263,7 +263,6 @@ struct NativeInterpreter <: AbstractInterpreter # incorrect, fail out loudly. @assert world <= get_world_counter() - return new( # Initially empty cache Vector{InferenceResult}(), From 5bd974a9da04f924d12bc8e407f817a938b9cef7 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Thu, 3 Mar 2022 10:31:35 +0900 Subject: [PATCH 056/369] `AbstractInterpreter`: remove `method_table(::AbstractInterpreter, ::InferenceState)` interface (#44389) In #44240 we removed the `CachedMethodTable` support as it turned out to be ineffective under the current compiler infrastructure. Because of this, there is no strong reason to keep a method table per `InferenceState`. This commit simply removes the `method_table(::AbstractInterpreter, ::InferenceState)` interface and should make it clearer which interface should be overloaded to implement a contextual dispatch. --- base/compiler/abstractinterpretation.jl | 14 ++++---- base/compiler/inferencestate.jl | 31 ++++++---------- base/compiler/types.jl | 7 ++++ test/choosetests.jl | 2 +- test/compiler/AbstractInterpreter.jl | 47 +++++++++++++++++++++++++ 5 files changed, 73 insertions(+), 28 deletions(-) create mode 100644 test/compiler/AbstractInterpreter.jl diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index 39cabe33ff043..53cc5fdeddf09 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -47,7 +47,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), end argtypes = arginfo.argtypes - matches = find_matching_methods(argtypes, atype, method_table(interp, sv), InferenceParams(interp).MAX_UNION_SPLITTING, max_methods) + matches = find_matching_methods(argtypes, atype, method_table(interp), InferenceParams(interp).MAX_UNION_SPLITTING, max_methods) if isa(matches, FailedMethodMatch) add_remark!(interp, sv, matches.reason) tristate_merge!(sv, Effects()) @@ -637,7 +637,7 @@ end function pure_eval_eligible(interp::AbstractInterpreter, @nospecialize(f), applicable::Vector{Any}, arginfo::ArgInfo, sv::InferenceState) - return !isoverlayed(method_table(interp, sv)) && + return !isoverlayed(method_table(interp)) && f !== nothing && length(applicable) == 1 && is_method_pure(applicable[1]::MethodMatch) && @@ -674,7 +674,7 @@ end function concrete_eval_eligible(interp::AbstractInterpreter, @nospecialize(f), result::MethodCallResult, arginfo::ArgInfo, sv::InferenceState) - return !isoverlayed(method_table(interp, sv)) && + return !isoverlayed(method_table(interp)) && f !== nothing && result.edge !== nothing && is_total_or_error(result.edge_effects) && @@ -2110,14 +2110,14 @@ function typeinf_local(interp::AbstractInterpreter, frame::InferenceState) frame.dont_work_on_me = true # mark that this function is currently on the stack W = frame.ip states = frame.stmt_types - n = frame.nstmts + nstmts = frame.nstmts nargs = frame.nargs def = frame.linfo.def isva = isa(def, Method) && def.isva nslots = nargs - isva slottypes = frame.slottypes ssavaluetypes = frame.src.ssavaluetypes::Vector{Any} - while frame.pc´´ <= n + while frame.pc´´ <= nstmts # make progress on the active ip set local pc::Int = frame.pc´´ while true # inner loop optimizes the common case where it can run straight from pc to pc + 1 @@ -2189,7 +2189,7 @@ function typeinf_local(interp::AbstractInterpreter, frame::InferenceState) end end elseif isa(stmt, ReturnNode) - pc´ = n + 1 + pc´ = nstmts + 1 bestguess = frame.bestguess rt = abstract_eval_value(interp, stmt.val, changes, frame) rt = widenreturn(rt, bestguess, nslots, slottypes, changes) @@ -2310,7 +2310,7 @@ function typeinf_local(interp::AbstractInterpreter, frame::InferenceState) ssavaluetypes[pc] = Any end - pc´ > n && break # can't proceed with the fast-path fall-through + pc´ > nstmts && break # can't proceed with the fast-path fall-through newstate = stupdate!(states[pc´], changes) if isa(stmt, GotoNode) && frame.pc´´ < pc´ # if we are processing a goto node anyways, diff --git a/base/compiler/inferencestate.jl b/base/compiler/inferencestate.jl index 39c4c9a2ceb66..928811dd63a3b 100644 --- a/base/compiler/inferencestate.jl +++ b/base/compiler/inferencestate.jl @@ -62,11 +62,6 @@ mutable struct InferenceState # Inferred purity flags ipo_effects::Effects - # The place to look up methods while working on this function. - # In particular, we cache method lookup results for the same function to - # fast path repeated queries. - method_table::InternalMethodTable - # The interpreter that created this inference state. Not looked at by # NativeInterpreter. But other interpreters may use this to detect cycles interp::AbstractInterpreter @@ -85,9 +80,9 @@ mutable struct InferenceState src.ssavaluetypes = Any[ NOT_FOUND for i = 1:nssavalues ] stmt_info = Any[ nothing for i = 1:length(code) ] - n = length(code) - s_types = Union{Nothing, VarTable}[ nothing for i = 1:n ] - s_edges = Union{Nothing, Vector{Any}}[ nothing for i = 1:n ] + nstmts = length(code) + s_types = Union{Nothing, VarTable}[ nothing for i = 1:nstmts ] + s_edges = Union{Nothing, Vector{Any}}[ nothing for i = 1:nstmts ] # initial types nslots = length(src.slotflags) @@ -129,19 +124,17 @@ mutable struct InferenceState @assert cache === :no || cache === :local || cache === :global frame = new( params, result, linfo, - sp, slottypes, mod, 0, - IdSet{InferenceState}(), IdSet{InferenceState}(), + sp, slottypes, mod, #=currpc=#0, + #=pclimitations=#IdSet{InferenceState}(), #=limitations=#IdSet{InferenceState}(), src, get_world_counter(interp), valid_worlds, nargs, s_types, s_edges, stmt_info, - Union{}, ip, 1, n, handler_at, - ssavalue_uses, - Vector{Tuple{InferenceState,LineNum}}(), # cycle_backedges - Vector{InferenceState}(), # callers_in_cycle + #=bestguess=#Union{}, ip, #=pc´´=#1, nstmts, handler_at, ssavalue_uses, + #=cycle_backedges=#Vector{Tuple{InferenceState,LineNum}}(), + #=callers_in_cycle=#Vector{InferenceState}(), #=parent=#nothing, - cache === :global, false, false, - Effects(consistent, ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, - inbounds_taints_consistency), - method_table(interp), + #=cached=#cache === :global, + #=inferred=#false, #=dont_work_on_me=#false, + #=ipo_effects=#Effects(consistent, ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, inbounds_taints_consistency), interp) result.result = frame cache !== :no && push!(get_inference_cache(interp), result) @@ -267,8 +260,6 @@ function iterate(unw::InfStackUnwind, (infstate, cyclei)::Tuple{InferenceState, (infstate::InferenceState, (infstate, cyclei)) end -method_table(interp::AbstractInterpreter, sv::InferenceState) = sv.method_table - function InferenceState(result::InferenceResult, cache::Symbol, interp::AbstractInterpreter) # prepare an InferenceState object for inferring lambda src = retrieve_code_info(result.linfo) diff --git a/base/compiler/types.jl b/base/compiler/types.jl index 1fd33d47f0408..6d4a650470237 100644 --- a/base/compiler/types.jl +++ b/base/compiler/types.jl @@ -314,6 +314,13 @@ may_compress(::AbstractInterpreter) = true may_discard_trees(::AbstractInterpreter) = true verbose_stmt_info(::AbstractInterpreter) = false +""" + method_table(interp::AbstractInterpreter) -> MethodTableView + +Returns a method table this `interp` uses for method lookup. +External `AbstractInterpreter` can optionally return `OverlayMethodTable` here +to incorporate customized dispatches for the overridden methods. +""" method_table(interp::AbstractInterpreter) = InternalMethodTable(get_world_counter(interp)) """ diff --git a/test/choosetests.jl b/test/choosetests.jl index f86f665bc2217..099dfa18a71c5 100644 --- a/test/choosetests.jl +++ b/test/choosetests.jl @@ -142,7 +142,7 @@ function choosetests(choices = []) filtertests!(tests, "subarray") filtertests!(tests, "compiler", ["compiler/inference", "compiler/validation", "compiler/ssair", "compiler/irpasses", "compiler/codegen", - "compiler/inline", "compiler/contextual", + "compiler/inline", "compiler/contextual", "compiler/AbstractInterpreter", "compiler/EscapeAnalysis/local", "compiler/EscapeAnalysis/interprocedural"]) filtertests!(tests, "compiler/EscapeAnalysis", [ "compiler/EscapeAnalysis/local", "compiler/EscapeAnalysis/interprocedural"]) diff --git a/test/compiler/AbstractInterpreter.jl b/test/compiler/AbstractInterpreter.jl new file mode 100644 index 0000000000000..6ef2adf7177fa --- /dev/null +++ b/test/compiler/AbstractInterpreter.jl @@ -0,0 +1,47 @@ +# This file is a part of Julia. License is MIT: https://julialang.org/license + +const CC = Core.Compiler +import Core: MethodInstance, CodeInstance +import .CC: WorldRange, WorldView + +# define new `AbstractInterpreter` that satisfies the minimum interface requirements +# while managing its cache independently +macro newinterp(name) + cachename = gensym(string(name, "Cache")) + name = esc(name) + quote + struct $cachename + dict::IdDict{MethodInstance,CodeInstance} + end + struct $name <: CC.AbstractInterpreter + interp::CC.NativeInterpreter + cache::$cachename + $name(world = Base.get_world_counter(); + interp = CC.NativeInterpreter(world), + cache = $cachename(IdDict{MethodInstance,CodeInstance}()) + ) = new(interp, cache) + end + CC.InferenceParams(interp::$name) = CC.InferenceParams(interp.interp) + CC.OptimizationParams(interp::$name) = CC.OptimizationParams(interp.interp) + CC.get_world_counter(interp::$name) = CC.get_world_counter(interp.interp) + CC.get_inference_cache(interp::$name) = CC.get_inference_cache(interp.interp) + CC.code_cache(interp::$name) = WorldView(interp.cache, WorldRange(CC.get_world_counter(interp))) + CC.get(wvc::WorldView{<:$cachename}, mi::MethodInstance, default) = get(wvc.cache.dict, mi, default) + CC.getindex(wvc::WorldView{<:$cachename}, mi::MethodInstance) = getindex(wvc.cache.dict, mi) + CC.haskey(wvc::WorldView{<:$cachename}, mi::MethodInstance) = haskey(wvc.cache.dict, mi) + CC.setindex!(wvc::WorldView{<:$cachename}, ci::CodeInstance, mi::MethodInstance) = setindex!(wvc.cache.dict, ci, mi) + end +end + +# `OverlayMethodTable` +# -------------------- +import Base.Experimental: @MethodTable, @overlay + +@newinterp MTOverlayInterp +@MethodTable(OverlayedMT) +CC.method_table(interp::MTOverlayInterp) = CC.OverlayMethodTable(CC.get_world_counter(interp), OverlayedMT) + +@overlay OverlayedMT sin(x::Float64) = 1 +@test Base.return_types((Int,), MTOverlayInterp()) do x + sin(x) +end == Any[Int] From d15704aad45c33839c36dd3d24fd90ff2a063fa0 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Mon, 7 Mar 2022 13:16:37 +0900 Subject: [PATCH 057/369] `AbstractInterpreter`: implement `findsup` for `OverlayMethodTable` (#44448) --- base/compiler/abstractinterpretation.jl | 3 +- base/compiler/methodtable.jl | 61 +++++++++++++++---------- base/reflection.jl | 12 ++--- src/gf.c | 23 +++++----- stdlib/Test/src/Test.jl | 2 +- test/compiler/AbstractInterpreter.jl | 18 ++++++++ 6 files changed, 75 insertions(+), 44 deletions(-) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index 53cc5fdeddf09..cf261367a642f 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -1476,7 +1476,8 @@ function abstract_invoke(interp::AbstractInterpreter, (; fargs, argtypes)::ArgIn argtype = Tuple{ft, argtype.parameters...} result = findsup(types, method_table(interp)) result === nothing && return CallMeta(Any, false) - method, valid_worlds = result + match, valid_worlds = result + method = match.method update_valid_age!(sv, valid_worlds) (ti, env::SimpleVector) = ccall(:jl_type_intersection_with_env, Any, (Any, Any), nargtype, method.sig)::SimpleVector (; rt, edge) = result = abstract_call_method(interp, method, ti, env, false, sv) diff --git a/base/compiler/methodtable.jl b/base/compiler/methodtable.jl index 4086023a725f0..841a020b43a8d 100644 --- a/base/compiler/methodtable.jl +++ b/base/compiler/methodtable.jl @@ -40,7 +40,7 @@ end getindex(result::MethodLookupResult, idx::Int) = getindex(result.matches, idx)::MethodMatch """ - findall(sig::Type, view::MethodTableView; limit=typemax(Int)) + findall(sig::Type, view::MethodTableView; limit::Int=typemax(Int)) -> MethodLookupResult or missing Find all methods in the given method table `view` that are applicable to the given signature `sig`. If no applicable methods are found, an empty result is @@ -48,37 +48,43 @@ returned. If the number of applicable methods exceeded the specified limit, `missing` is returned. """ function findall(@nospecialize(sig::Type), table::InternalMethodTable; limit::Int=typemax(Int)) - _min_val = RefValue{UInt}(typemin(UInt)) - _max_val = RefValue{UInt}(typemax(UInt)) - _ambig = RefValue{Int32}(0) - ms = _methods_by_ftype(sig, nothing, limit, table.world, false, _min_val, _max_val, _ambig) - if ms === false - return missing - end - return MethodLookupResult(ms::Vector{Any}, WorldRange(_min_val[], _max_val[]), _ambig[] != 0) + return _findall(sig, nothing, table.world, limit) end function findall(@nospecialize(sig::Type), table::OverlayMethodTable; limit::Int=typemax(Int)) + result = _findall(sig, table.mt, table.world, limit) + result === missing && return missing + if !isempty(result) + if all(match->match.fully_covers, result) + # no need to fall back to the internal method table + return result + else + # merge the match results with the internal method table + fallback_result = _findall(sig, nothing, table.world, limit) + return MethodLookupResult( + vcat(result.matches, fallback_result.matches), + WorldRange(min(result.valid_worlds.min_world, fallback_result.valid_worlds.min_world), + max(result.valid_worlds.max_world, fallback_result.valid_worlds.max_world)), + result.ambig | fallback_result.ambig) + end + end + # fall back to the internal method table + return _findall(sig, nothing, table.world, limit) +end + +function _findall(@nospecialize(sig::Type), mt::Union{Nothing,Core.MethodTable}, world::UInt, limit::Int) _min_val = RefValue{UInt}(typemin(UInt)) _max_val = RefValue{UInt}(typemax(UInt)) _ambig = RefValue{Int32}(0) - ms = _methods_by_ftype(sig, table.mt, limit, table.world, false, _min_val, _max_val, _ambig) + ms = _methods_by_ftype(sig, mt, limit, world, false, _min_val, _max_val, _ambig) if ms === false return missing - elseif isempty(ms) - # fall back to the internal method table - _min_val[] = typemin(UInt) - _max_val[] = typemax(UInt) - ms = _methods_by_ftype(sig, nothing, limit, table.world, false, _min_val, _max_val, _ambig) - if ms === false - return missing - end end return MethodLookupResult(ms::Vector{Any}, WorldRange(_min_val[], _max_val[]), _ambig[] != 0) end """ - findsup(sig::Type, view::MethodTableView)::Union{Tuple{MethodMatch, WorldRange}, Nothing} + findsup(sig::Type, view::MethodTableView) -> Tuple{MethodMatch, WorldRange} or nothing Find the (unique) method `m` such that `sig <: m.sig`, while being more specific than any other method with the same property. In other words, find @@ -92,12 +98,21 @@ upper bound of `sig`, or it is possible that among the upper bounds, there is no least element. In both cases `nothing` is returned. """ function findsup(@nospecialize(sig::Type), table::InternalMethodTable) + return _findsup(sig, nothing, table.world) +end + +function findsup(@nospecialize(sig::Type), table::OverlayMethodTable) + result = _findsup(sig, table.mt, table.world) + result === nothing || return result + return _findsup(sig, nothing, table.world) # fall back to the internal method table +end + +function _findsup(@nospecialize(sig::Type), mt::Union{Nothing,Core.MethodTable}, world::UInt) min_valid = RefValue{UInt}(typemin(UInt)) max_valid = RefValue{UInt}(typemax(UInt)) - result = ccall(:jl_gf_invoke_lookup_worlds, Any, (Any, UInt, Ptr{Csize_t}, Ptr{Csize_t}), - sig, table.world, min_valid, max_valid)::Union{MethodMatch, Nothing} - result === nothing && return nothing - (result.method, WorldRange(min_valid[], max_valid[])) + result = ccall(:jl_gf_invoke_lookup_worlds, Any, (Any, Any, UInt, Ptr{Csize_t}, Ptr{Csize_t}), + sig, mt, world, min_valid, max_valid)::Union{MethodMatch, Nothing} + return result === nothing ? result : (result, WorldRange(min_valid[], max_valid[])) end isoverlayed(::MethodTableView) = error("unsatisfied MethodTableView interface") diff --git a/base/reflection.jl b/base/reflection.jl index 5490cae9511c8..0ae3b087fc022 100644 --- a/base/reflection.jl +++ b/base/reflection.jl @@ -1347,15 +1347,11 @@ end print_statement_costs(args...; kwargs...) = print_statement_costs(stdout, args...; kwargs...) function _which(@nospecialize(tt::Type), world=get_world_counter()) - min_valid = RefValue{UInt}(typemin(UInt)) - max_valid = RefValue{UInt}(typemax(UInt)) - match = ccall(:jl_gf_invoke_lookup_worlds, Any, - (Any, UInt, Ptr{Csize_t}, Ptr{Csize_t}), - tt, world, min_valid, max_valid) - if match === nothing + result = Core.Compiler._findsup(tt, nothing, world) + if result === nothing error("no unique matching method found for the specified argument types") end - return match::Core.MethodMatch + return first(result)::Core.MethodMatch end """ @@ -1478,7 +1474,7 @@ true function hasmethod(@nospecialize(f), @nospecialize(t); world::UInt=get_world_counter()) t = to_tuple_type(t) t = signature_type(f, t) - return ccall(:jl_gf_invoke_lookup, Any, (Any, UInt), t, world) !== nothing + return ccall(:jl_gf_invoke_lookup, Any, (Any, Any, UInt), t, nothing, world) !== nothing end function hasmethod(@nospecialize(f), @nospecialize(t), kwnames::Tuple{Vararg{Symbol}}; world::UInt=get_world_counter()) diff --git a/src/gf.c b/src/gf.c index 2b5d17c408299..964e4d1e01963 100644 --- a/src/gf.c +++ b/src/gf.c @@ -1217,7 +1217,7 @@ static jl_method_instance_t *cache_method( return newmeth; } -static jl_method_match_t *_gf_invoke_lookup(jl_value_t *types JL_PROPAGATES_ROOT, size_t world, size_t *min_valid, size_t *max_valid); +static jl_method_match_t *_gf_invoke_lookup(jl_value_t *types JL_PROPAGATES_ROOT, jl_value_t *mt, size_t world, size_t *min_valid, size_t *max_valid); static jl_method_instance_t *jl_mt_assoc_by_type(jl_methtable_t *mt JL_PROPAGATES_ROOT, jl_datatype_t *tt, size_t world) { @@ -1237,7 +1237,7 @@ static jl_method_instance_t *jl_mt_assoc_by_type(jl_methtable_t *mt JL_PROPAGATE size_t min_valid = 0; size_t max_valid = ~(size_t)0; - jl_method_match_t *matc = _gf_invoke_lookup((jl_value_t*)tt, world, &min_valid, &max_valid); + jl_method_match_t *matc = _gf_invoke_lookup((jl_value_t*)tt, jl_nothing, world, &min_valid, &max_valid); jl_method_instance_t *nf = NULL; if (matc) { JL_GC_PUSH1(&matc); @@ -2540,36 +2540,37 @@ JL_DLLEXPORT jl_value_t *jl_apply_generic(jl_value_t *F, jl_value_t **args, uint return _jl_invoke(F, args, nargs, mfunc, world); } -static jl_method_match_t *_gf_invoke_lookup(jl_value_t *types JL_PROPAGATES_ROOT, size_t world, size_t *min_valid, size_t *max_valid) +static jl_method_match_t *_gf_invoke_lookup(jl_value_t *types JL_PROPAGATES_ROOT, jl_value_t *mt, size_t world, size_t *min_valid, size_t *max_valid) { jl_value_t *unw = jl_unwrap_unionall((jl_value_t*)types); if (jl_is_tuple_type(unw) && jl_tparam0(unw) == jl_bottom_type) return NULL; - jl_methtable_t *mt = jl_method_table_for(unw); - if ((jl_value_t*)mt == jl_nothing) + if (mt == jl_nothing) + mt = (jl_value_t*)jl_method_table_for(unw); + if (mt == jl_nothing) mt = NULL; - jl_value_t *matches = ml_matches(mt, (jl_tupletype_t*)types, 1, 0, 0, world, 1, min_valid, max_valid, NULL); + jl_value_t *matches = ml_matches((jl_methtable_t*)mt, (jl_tupletype_t*)types, 1, 0, 0, world, 1, min_valid, max_valid, NULL); if (matches == jl_false || jl_array_len(matches) != 1) return NULL; jl_method_match_t *matc = (jl_method_match_t*)jl_array_ptr_ref(matches, 0); return matc; } -JL_DLLEXPORT jl_value_t *jl_gf_invoke_lookup(jl_value_t *types, size_t world) +JL_DLLEXPORT jl_value_t *jl_gf_invoke_lookup(jl_value_t *types, jl_value_t *mt, size_t world) { // Deprecated: Use jl_gf_invoke_lookup_worlds for future development size_t min_valid = 0; size_t max_valid = ~(size_t)0; - jl_method_match_t *matc = _gf_invoke_lookup(types, world, &min_valid, &max_valid); + jl_method_match_t *matc = _gf_invoke_lookup(types, mt, world, &min_valid, &max_valid); if (matc == NULL) return jl_nothing; return (jl_value_t*)matc->method; } -JL_DLLEXPORT jl_value_t *jl_gf_invoke_lookup_worlds(jl_value_t *types, size_t world, size_t *min_world, size_t *max_world) +JL_DLLEXPORT jl_value_t *jl_gf_invoke_lookup_worlds(jl_value_t *types, jl_value_t *mt, size_t world, size_t *min_world, size_t *max_world) { - jl_method_match_t *matc = _gf_invoke_lookup(types, world, min_world, max_world); + jl_method_match_t *matc = _gf_invoke_lookup(types, mt, world, min_world, max_world); if (matc == NULL) return jl_nothing; return (jl_value_t*)matc; @@ -2590,7 +2591,7 @@ jl_value_t *jl_gf_invoke(jl_value_t *types0, jl_value_t *gf, jl_value_t **args, jl_value_t *types = NULL; JL_GC_PUSH1(&types); types = jl_argtype_with_function(gf, types0); - jl_method_t *method = (jl_method_t*)jl_gf_invoke_lookup(types, world); + jl_method_t *method = (jl_method_t*)jl_gf_invoke_lookup(types, jl_nothing, world); JL_GC_PROMISE_ROOTED(method); if ((jl_value_t*)method == jl_nothing) { diff --git a/stdlib/Test/src/Test.jl b/stdlib/Test/src/Test.jl index 5693d65c7f913..95cd1ecccd9c3 100644 --- a/stdlib/Test/src/Test.jl +++ b/stdlib/Test/src/Test.jl @@ -1774,7 +1774,7 @@ function detect_unbound_args(mods...; params = tuple_sig.parameters[1:(end - 1)] tuple_sig = Base.rewrap_unionall(Tuple{params...}, m.sig) world = Base.get_world_counter() - mf = ccall(:jl_gf_invoke_lookup, Any, (Any, UInt), tuple_sig, world) + mf = ccall(:jl_gf_invoke_lookup, Any, (Any, Any, UInt), tuple_sig, nothing, world) if mf !== nothing && mf !== m && mf.sig <: tuple_sig continue end diff --git a/test/compiler/AbstractInterpreter.jl b/test/compiler/AbstractInterpreter.jl index 6ef2adf7177fa..f1fe4b06dcb63 100644 --- a/test/compiler/AbstractInterpreter.jl +++ b/test/compiler/AbstractInterpreter.jl @@ -45,3 +45,21 @@ CC.method_table(interp::MTOverlayInterp) = CC.OverlayMethodTable(CC.get_world_co @test Base.return_types((Int,), MTOverlayInterp()) do x sin(x) end == Any[Int] +@test Base.return_types((Any,), MTOverlayInterp()) do x + Base.@invoke sin(x::Float64) +end == Any[Int] + +# fallback to the internal method table +@test Base.return_types((Int,), MTOverlayInterp()) do x + cos(x) +end == Any[Float64] +@test Base.return_types((Any,), MTOverlayInterp()) do x + Base.@invoke cos(x::Float64) +end == Any[Float64] + +# not fully covered overlay method match +overlay_match(::Any) = nothing +@overlay OverlayedMT overlay_match(::Int) = missing +@test Base.return_types((Any,), MTOverlayInterp()) do x + overlay_match(x) +end == Any[Union{Nothing,Missing}] From 0a4a8506ace84cb2cdc7614e1bbb3f7c7109bc0f Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Wed, 9 Mar 2022 16:34:11 +0900 Subject: [PATCH 058/369] follow up #44448, correct `findall`/`findsup` for `OverlayMethodTable` (#44511) - respect world range of failed lookup into `OverlayMethodTable`: - fix calculation of merged valid world range: - make `findsup` return valid `WorldRange` unconditionally, and enable more strict world validation within `abstract_invoke`: - fix the default `limit::Int` value of `findall` --- base/compiler/abstractinterpretation.jl | 7 ++-- base/compiler/methodtable.jl | 46 ++++++++++++++----------- base/reflection.jl | 6 ++-- 3 files changed, 31 insertions(+), 28 deletions(-) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index cf261367a642f..14f37ff87c464 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -1474,11 +1474,10 @@ function abstract_invoke(interp::AbstractInterpreter, (; fargs, argtypes)::ArgIn types = rewrap_unionall(Tuple{ft, unwrap_unionall(types).parameters...}, types)::Type nargtype = Tuple{ft, nargtype.parameters...} argtype = Tuple{ft, argtype.parameters...} - result = findsup(types, method_table(interp)) - result === nothing && return CallMeta(Any, false) - match, valid_worlds = result - method = match.method + match, valid_worlds = findsup(types, method_table(interp)) + match === nothing && return CallMeta(Any, false) update_valid_age!(sv, valid_worlds) + method = match.method (ti, env::SimpleVector) = ccall(:jl_type_intersection_with_env, Any, (Any, Any), nargtype, method.sig)::SimpleVector (; rt, edge) = result = abstract_call_method(interp, method, ti, env, false, sv) edge !== nothing && add_backedge!(edge::MethodInstance, sv) diff --git a/base/compiler/methodtable.jl b/base/compiler/methodtable.jl index 841a020b43a8d..f68cdd52d1b06 100644 --- a/base/compiler/methodtable.jl +++ b/base/compiler/methodtable.jl @@ -47,29 +47,28 @@ given signature `sig`. If no applicable methods are found, an empty result is returned. If the number of applicable methods exceeded the specified limit, `missing` is returned. """ -function findall(@nospecialize(sig::Type), table::InternalMethodTable; limit::Int=typemax(Int)) +function findall(@nospecialize(sig::Type), table::InternalMethodTable; limit::Int=Int(typemax(Int32))) return _findall(sig, nothing, table.world, limit) end -function findall(@nospecialize(sig::Type), table::OverlayMethodTable; limit::Int=typemax(Int)) +function findall(@nospecialize(sig::Type), table::OverlayMethodTable; limit::Int=Int(typemax(Int32))) result = _findall(sig, table.mt, table.world, limit) result === missing && return missing - if !isempty(result) - if all(match->match.fully_covers, result) - # no need to fall back to the internal method table - return result - else - # merge the match results with the internal method table - fallback_result = _findall(sig, nothing, table.world, limit) - return MethodLookupResult( - vcat(result.matches, fallback_result.matches), - WorldRange(min(result.valid_worlds.min_world, fallback_result.valid_worlds.min_world), - max(result.valid_worlds.max_world, fallback_result.valid_worlds.max_world)), - result.ambig | fallback_result.ambig) - end + nr = length(result) + if nr ≥ 1 && result[nr].fully_covers + # no need to fall back to the internal method table + return result end # fall back to the internal method table - return _findall(sig, nothing, table.world, limit) + fallback_result = _findall(sig, nothing, table.world, limit) + fallback_result === missing && return missing + # merge the fallback match results with the internal method table + return MethodLookupResult( + vcat(result.matches, fallback_result.matches), + WorldRange( + max(result.valid_worlds.min_world, fallback_result.valid_worlds.min_world), + min(result.valid_worlds.max_world, fallback_result.valid_worlds.max_world)), + result.ambig | fallback_result.ambig) end function _findall(@nospecialize(sig::Type), mt::Union{Nothing,Core.MethodTable}, world::UInt, limit::Int) @@ -102,17 +101,22 @@ function findsup(@nospecialize(sig::Type), table::InternalMethodTable) end function findsup(@nospecialize(sig::Type), table::OverlayMethodTable) - result = _findsup(sig, table.mt, table.world) - result === nothing || return result - return _findsup(sig, nothing, table.world) # fall back to the internal method table + match, valid_worlds = _findsup(sig, table.mt, table.world) + match !== nothing && return match, valid_worlds + # fall back to the internal method table + fallback_match, fallback_valid_worlds = _findsup(sig, nothing, table.world) + return fallback_match, WorldRange( + max(valid_worlds.min_world, fallback_valid_worlds.min_world), + min(valid_worlds.max_world, fallback_valid_worlds.max_world)) end function _findsup(@nospecialize(sig::Type), mt::Union{Nothing,Core.MethodTable}, world::UInt) min_valid = RefValue{UInt}(typemin(UInt)) max_valid = RefValue{UInt}(typemax(UInt)) - result = ccall(:jl_gf_invoke_lookup_worlds, Any, (Any, Any, UInt, Ptr{Csize_t}, Ptr{Csize_t}), + match = ccall(:jl_gf_invoke_lookup_worlds, Any, (Any, Any, UInt, Ptr{Csize_t}, Ptr{Csize_t}), sig, mt, world, min_valid, max_valid)::Union{MethodMatch, Nothing} - return result === nothing ? result : (result, WorldRange(min_valid[], max_valid[])) + valid_worlds = WorldRange(min_valid[], max_valid[]) + return match, valid_worlds end isoverlayed(::MethodTableView) = error("unsatisfied MethodTableView interface") diff --git a/base/reflection.jl b/base/reflection.jl index 0ae3b087fc022..95fb81c8859d6 100644 --- a/base/reflection.jl +++ b/base/reflection.jl @@ -1347,11 +1347,11 @@ end print_statement_costs(args...; kwargs...) = print_statement_costs(stdout, args...; kwargs...) function _which(@nospecialize(tt::Type), world=get_world_counter()) - result = Core.Compiler._findsup(tt, nothing, world) - if result === nothing + match, _ = Core.Compiler._findsup(tt, nothing, world) + if match === nothing error("no unique matching method found for the specified argument types") end - return first(result)::Core.MethodMatch + return match end """ From d14209d58bbdd132490bb94a9749832960f3a7b9 Mon Sep 17 00:00:00 2001 From: Oscar Smith Date: Tue, 8 Mar 2022 11:28:07 -0500 Subject: [PATCH 059/369] fix negative numbers to powers >2^64 (#44456) *fix negative numbers to powers >2^64 (cherry picked from commit 03433a20a848ee1c07cfcae6283ec25e01b49a18) --- base/math.jl | 4 ++++ test/math.jl | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/base/math.jl b/base/math.jl index af86c11c01b26..1fb10467e184f 100644 --- a/base/math.jl +++ b/base/math.jl @@ -998,6 +998,8 @@ end @constprop :aggressive function ^(x::Float64, y::Float64) yint = unsafe_trunc(Int, y) # Note, this is actually safe since julia freezes the result y == yint && return x^yint + #numbers greater than 2*inv(eps(T)) must be even, and the pow will overflow + y >= 2*inv(eps()) && return x^(typemax(Int64)-1) x<0 && y > -4e18 && throw_exp_domainerror(x) # |y| is small enough that y isn't an integer x == 1 && return 1.0 return pow_body(x, y) @@ -1016,6 +1018,8 @@ end @constprop :aggressive function ^(x::T, y::T) where T <: Union{Float16, Float32} yint = unsafe_trunc(Int64, y) # Note, this is actually safe since julia freezes the result y == yint && return x^yint + #numbers greater than 2*inv(eps(T)) must be even, and the pow will overflow + y >= 2*inv(eps(T)) && return x^(typemax(Int64)-1) x < 0 && y > -4e18 && throw_exp_domainerror(x) # |y| is small enough that y isn't an integer return pow_body(x, y) end diff --git a/test/math.jl b/test/math.jl index af280066f2f22..22bb026ceed0c 100644 --- a/test/math.jl +++ b/test/math.jl @@ -155,6 +155,10 @@ end @test x^y === T(big(x)^big(y)) @test x^1 === x @test x^yi === T(big(x)^yi) + # test (-x)^y for y larger than typemax(Int) + @test T(-1)^floatmax(T) === T(1) + @test prevfloat(T(-1))^floatmax(T) === T(Inf) + @test nextfloat(T(-1))^floatmax(T) === T(0.0) # test for large negative exponent where error compensation matters @test 0.9999999955206014^-1.0e8 == 1.565084574870928 @test (-x)^yi == x^yi From 225cb1db4171079f0258753dd5205b6972c4227a Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Tue, 8 Mar 2022 19:24:08 +0100 Subject: [PATCH 060/369] remove deprecation warning for `@_inline_meta` (#44516) (cherry picked from commit 02abca3c293abdded1b3fa3629ced944c7a4e27b) --- base/deprecated.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/deprecated.jl b/base/deprecated.jl index 6709023147283..1af38ebcdac1c 100644 --- a/base/deprecated.jl +++ b/base/deprecated.jl @@ -266,8 +266,8 @@ end # BEGIN 1.8 deprecations -@deprecate var"@_inline_meta" var"@inline" false -@deprecate var"@_noinline_meta" var"@noinline" false +const var"@_inline_meta" = var"@inline" +const var"@_noinline_meta" = var"@noinline" @deprecate getindex(t::Tuple, i::Real) t[convert(Int, i)] # END 1.8 deprecations From 19ce653c00d1a539c7026850d98ee45cd401bc0f Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Tue, 8 Mar 2022 15:31:33 -0500 Subject: [PATCH 061/369] process: ensure uvfinalize and _uv_close_cb are synchronized (#44476) There appeared to be a possibility they could race and the data field might already be destroyed before we reached the close callback, from looking at the state of the program when reproducing #44460. This is because the uv_return_spawn set the handle to NULL, which later can cause the uvfinalize to exit early (if the finalizer gets run on another thread, since we have disabled finalizers on our thread). Then the GC can reap the julia Process object prior to uv_close cleaning up the object. We solve this by calling disassociate_julia_struct before dropping the reference to the handle. But then we also fully address any remaining race condition by having uvfinalize acquire a lock also. The uv_return_spawn callback also needs to be synchronized with the constructor, since we might have arrived there before we finished allocating the Process struct here, leading to missed exit events. Fixes #44460 (cherry picked from commit c591bf2f412c208c00e55ee503db840104aaca45) --- base/process.jl | 24 +++++++++++++++++------- src/jl_uv.c | 4 ++-- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/base/process.jl b/base/process.jl index 6aac514191681..cbc251ed6dbca 100644 --- a/base/process.jl +++ b/base/process.jl @@ -38,9 +38,13 @@ pipe_writer(p::ProcessChain) = p.in # release ownership of the libuv handle function uvfinalize(proc::Process) if proc.handle != C_NULL - disassociate_julia_struct(proc.handle) - ccall(:jl_close_uv, Cvoid, (Ptr{Cvoid},), proc.handle) - proc.handle = C_NULL + iolock_begin() + if proc.handle != C_NULL + disassociate_julia_struct(proc.handle) + ccall(:jl_close_uv, Cvoid, (Ptr{Cvoid},), proc.handle) + proc.handle = C_NULL + end + iolock_end() end nothing end @@ -52,6 +56,7 @@ function uv_return_spawn(p::Ptr{Cvoid}, exit_status::Int64, termsignal::Int32) proc = unsafe_pointer_to_objref(data)::Process proc.exitcode = exit_status proc.termsignal = termsignal + disassociate_julia_struct(proc) # ensure that data field is set to C_NULL ccall(:jl_close_uv, Cvoid, (Ptr{Cvoid},), proc.handle) proc.handle = C_NULL lock(proc.exitnotify) @@ -95,8 +100,9 @@ end end for io in stdio] handle = Libc.malloc(_sizeof_uv_process) - disassociate_julia_struct(handle) # ensure that data field is set to C_NULL + disassociate_julia_struct(handle) (; exec, flags, env, dir) = cmd + iolock_begin() err = ccall(:jl_spawn, Int32, (Cstring, Ptr{Cstring}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Tuple{Cint, UInt}}, Int, @@ -109,13 +115,17 @@ end cpumask === nothing ? C_NULL : cpumask, cpumask === nothing ? 0 : length(cpumask), @cfunction(uv_return_spawn, Cvoid, (Ptr{Cvoid}, Int64, Int32))) + if err == 0 + pp = Process(cmd, handle) + associate_julia_struct(handle, pp) + else + ccall(:jl_forceclose_uv, Cvoid, (Ptr{Cvoid},), handle) # will call free on handle eventually + end + iolock_end() end if err != 0 - ccall(:jl_forceclose_uv, Cvoid, (Ptr{Cvoid},), handle) # will call free on handle eventually throw(_UVError("could not spawn " * repr(cmd), err)) end - pp = Process(cmd, handle) - associate_julia_struct(handle, pp) return pp end diff --git a/src/jl_uv.c b/src/jl_uv.c index d2372b59c4670..d2a78c26bbc72 100644 --- a/src/jl_uv.c +++ b/src/jl_uv.c @@ -282,7 +282,7 @@ JL_DLLEXPORT void jl_uv_disassociate_julia_struct(uv_handle_t *handle) handle->data = NULL; } -#define UV_CLOSED 0x02 // UV_HANDLE_CLOSED on Windows (same value) +#define UV_HANDLE_CLOSED 0x02 JL_DLLEXPORT int jl_spawn(char *name, char **argv, uv_loop_t *loop, uv_process_t *proc, @@ -308,7 +308,7 @@ JL_DLLEXPORT int jl_spawn(char *name, char **argv, if (!(flags == UV_INHERIT_FD || flags == UV_INHERIT_STREAM || flags == UV_IGNORE)) { proc->type = UV_PROCESS; proc->loop = loop; - proc->flags = UV_CLOSED; + proc->flags = UV_HANDLE_CLOSED; return UV_EINVAL; } } From 390551910a84fd08be330eac333a5dad2b0c549a Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Tue, 8 Mar 2022 15:31:54 -0500 Subject: [PATCH 062/369] ensure invoke kwargs work on Types (#44464) Fix #44227 (cherry picked from commit f731c38bf84604443f0760b114957e40f2b10fa2) --- src/builtins.c | 4 ++-- test/core.jl | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/builtins.c b/src/builtins.c index ca2f56adaf6d8..11da13285e9ca 100644 --- a/src/builtins.c +++ b/src/builtins.c @@ -1286,7 +1286,7 @@ JL_CALLABLE(jl_f_invoke_kwsorter) if (nt < jl_page_size/sizeof(jl_value_t*)) { jl_value_t **types = (jl_value_t**)alloca(nt*sizeof(jl_value_t*)); types[0] = (jl_value_t*)jl_namedtuple_type; - types[1] = jl_typeof(func); + types[1] = jl_is_type(func) ? (jl_value_t*)jl_wrap_Type(func) : jl_typeof(func); for (i = 2; i < nt; i++) types[i] = jl_tparam(argtypes, i - 2); argtypes = (jl_value_t*)jl_apply_tuple_type_v(types, nt); @@ -1295,7 +1295,7 @@ JL_CALLABLE(jl_f_invoke_kwsorter) jl_svec_t *types = jl_alloc_svec_uninit(nt); JL_GC_PUSH1(&types); jl_svecset(types, 0, jl_namedtuple_type); - jl_svecset(types, 1, jl_typeof(func)); + jl_svecset(types, 1, jl_is_type(func) ? (jl_value_t*)jl_wrap_Type(func) : jl_typeof(func)); for (i = 2; i < nt; i++) jl_svecset(types, i, jl_tparam(argtypes, i - 2)); argtypes = (jl_value_t*)jl_apply_tuple_type(types); diff --git a/test/core.jl b/test/core.jl index 6dbd8f3d9fa0e..93ba97df60420 100644 --- a/test/core.jl +++ b/test/core.jl @@ -1524,6 +1524,12 @@ let @test invoke(i2169, Tuple{Array}, Int8[1]) === Int8(-128) end +# issue #44227 +struct F{T} end +F{Int32}(; y=1) = 1 +F{Int64}(; y=1) = invoke(F{Int32}, Tuple{}; y) +@test F{Int64}() === 1 + # issue #2365 mutable struct B2365{T} v::Union{T, Nothing} From ba660cfa52463f7efcb5d93fea97761ea38ee3b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Wed, 9 Mar 2022 01:44:19 +0000 Subject: [PATCH 063/369] [CompilerSupportLibraries_jll] Update to v0.5.2 (#44487) The main difference since previous version should be the libraries for aarch64-apple-darwin, which are based on a more recent version of the GCC fork for this platform. There are a couple of notable ABI changes here: * `libgcc_s` is now called `libgcc_s.1.1.dylib` instead of `libgcc_s.2.dylib` * there is now `libquadmath.0.dylib` for this platform, which was missing before. (cherry picked from commit cb2fa5d8483906f6e4c3b47f975e1c5ee2819d04) --- Make.inc | 4 +- base/Makefile | 4 + deps/checksums/compilersupportlibraries | 184 +++++++++--------- .../CompilerSupportLibraries_jll/Project.toml | 2 +- .../src/CompilerSupportLibraries_jll.jl | 2 +- 5 files changed, 100 insertions(+), 96 deletions(-) diff --git a/Make.inc b/Make.inc index a95eab1ec1abe..a143b871efecb 100644 --- a/Make.inc +++ b/Make.inc @@ -1,4 +1,4 @@ -# -*- mode: makefile-gmake -*- +# -*- mode: makefile -*- # vi:syntax=make ## Note: @@ -1472,7 +1472,7 @@ endif endif ifeq ($(OS),Darwin) ifeq ($(ARCH),aarch64) -LIBGCC_NAME := libgcc_s.2.$(SHLIB_EXT) +LIBGCC_NAME := libgcc_s.1.1.$(SHLIB_EXT) else LIBGCC_NAME := libgcc_s.1.$(SHLIB_EXT) endif diff --git a/base/Makefile b/base/Makefile index f3ed73791085e..23a9c4011131e 100644 --- a/base/Makefile +++ b/base/Makefile @@ -206,7 +206,11 @@ else ifneq ($(USE_SYSTEM_OPENLIBM),0) $(eval $(call symlink_system_library,OPENLIBM,$(LIBMNAME))) endif +ifeq ($(APPLE_ARCH),arm64) +$(eval $(call symlink_system_library,CSL,libgcc_s,1.1)) +else $(eval $(call symlink_system_library,CSL,libgcc_s,1)) +endif ifneq (,$(LIBGFORTRAN_VERSION)) $(eval $(call symlink_system_library,CSL,libgfortran,$(LIBGFORTRAN_VERSION))) endif diff --git a/deps/checksums/compilersupportlibraries b/deps/checksums/compilersupportlibraries index e351d100cb481..86250fdc63390 100644 --- a/deps/checksums/compilersupportlibraries +++ b/deps/checksums/compilersupportlibraries @@ -1,92 +1,92 @@ -CompilerSupportLibraries.v0.5.0+0.aarch64-apple-darwin-libgfortran5.tar.gz/md5/307711def378e337a999c182aa7e07d8 -CompilerSupportLibraries.v0.5.0+0.aarch64-apple-darwin-libgfortran5.tar.gz/sha512/0dcad5e315e045397320f667b27fc378da898ebfea9b55a2837e68b29434fe2c2ddc9652cc75a4551062ce70a2bfaffa8223c77398aa41fe1a73ccb44952cd8f -CompilerSupportLibraries.v0.5.0+0.aarch64-linux-gnu-libgfortran3.tar.gz/md5/177f2665038919c3f8ed968226ff3b56 -CompilerSupportLibraries.v0.5.0+0.aarch64-linux-gnu-libgfortran3.tar.gz/sha512/ea67c3b9986106aee12e5f22ab3d3c5d71a58759a7d20a7724bbb198e5c71f42fa2034e46f3147006a2d2277b3881f0546030d1040cb9393e58eeae87eb82c4d -CompilerSupportLibraries.v0.5.0+0.aarch64-linux-gnu-libgfortran4.tar.gz/md5/f16db35be9018a5c61eaafaaf7226d10 -CompilerSupportLibraries.v0.5.0+0.aarch64-linux-gnu-libgfortran4.tar.gz/sha512/051b5a0dd2235eaa90557e487c83499b3d7e0b9e921f7b2f14e77c81152c338acd5bac8040bdf6679db656cd8039093db43565f843dede253717425e464e61b0 -CompilerSupportLibraries.v0.5.0+0.aarch64-linux-gnu-libgfortran5.tar.gz/md5/e6082f3e46b627fdaef09f1ef81c1d7b -CompilerSupportLibraries.v0.5.0+0.aarch64-linux-gnu-libgfortran5.tar.gz/sha512/13d0ab1c0e84a65db729ea6bd45a868d9d65e1a0ec95412448846d1044e2bbf11b11d96cfa576dccf3d7eccc4bed4eb9ae4bac0989e9b1b97adad5e404dfe4a4 -CompilerSupportLibraries.v0.5.0+0.aarch64-linux-musl-libgfortran3.tar.gz/md5/00703177897f8c46a577c2b0518432bc -CompilerSupportLibraries.v0.5.0+0.aarch64-linux-musl-libgfortran3.tar.gz/sha512/af14ad1303f3918dd691e0b509ea0fd52ac7c9f0c285e8dbb741bd34ce0b1927f89f219fcf8d260315c503b18bf98b3df117810328066a9964917cc34968ce98 -CompilerSupportLibraries.v0.5.0+0.aarch64-linux-musl-libgfortran4.tar.gz/md5/f823b692319cd370ca59189ad2ba4a3d -CompilerSupportLibraries.v0.5.0+0.aarch64-linux-musl-libgfortran4.tar.gz/sha512/b0c4131bf4d15c482bbed83fcc570da2f7bb8ef99d507e0e13eb0c8f5519ec73ff234c58d505294be3f8d39b6dd1c7022578db02005ae111c7873243e8ddc8ef -CompilerSupportLibraries.v0.5.0+0.aarch64-linux-musl-libgfortran5.tar.gz/md5/a9ef1a68518058fe6c945e8b00f8400f -CompilerSupportLibraries.v0.5.0+0.aarch64-linux-musl-libgfortran5.tar.gz/sha512/6aa53edf48a17ec8515cad5c79a15ab0e40cc44c9ffb188fd57fc560dde7a99d6487ead6e4caafaa9912c6590c6a391f914016fd4342589da09d56c657ad2c07 -CompilerSupportLibraries.v0.5.0+0.armv6l-linux-gnueabihf-libgfortran3.tar.gz/md5/d3aaf50955ad671917e941e0dcf3803f -CompilerSupportLibraries.v0.5.0+0.armv6l-linux-gnueabihf-libgfortran3.tar.gz/sha512/72983b2272300c2332cfe6864b5dd5249bbbb181bd65b10bf6bfb3a37e5e582bb9c159db0b63a077066a325899a2864717f28c60c85027be3b637bb80f994e52 -CompilerSupportLibraries.v0.5.0+0.armv6l-linux-gnueabihf-libgfortran4.tar.gz/md5/e221d51df9b18b2562a0f3e8dc8012cd -CompilerSupportLibraries.v0.5.0+0.armv6l-linux-gnueabihf-libgfortran4.tar.gz/sha512/758b07b4a559dda747574649926333a70355e2d80acb2ea37bb39777c0b1cecf8f308a5f8062110c378db2230ec8baf23385ae313d1c58de8bfc651573c64c1f -CompilerSupportLibraries.v0.5.0+0.armv6l-linux-gnueabihf-libgfortran5.tar.gz/md5/96f7feef9b1dd7944130de2e9cda68b8 -CompilerSupportLibraries.v0.5.0+0.armv6l-linux-gnueabihf-libgfortran5.tar.gz/sha512/8b4aaff1388cd506bef7f3a9edd42ed8ee1db468a18d34cd5d58d7da305853dbf48d4665e99c06c6fb0115e421d19dba5c36e947cb06defe7f479a05b547f112 -CompilerSupportLibraries.v0.5.0+0.armv6l-linux-musleabihf-libgfortran3.tar.gz/md5/a1e3642a7ce2b7834aa2f1b695a9977c -CompilerSupportLibraries.v0.5.0+0.armv6l-linux-musleabihf-libgfortran3.tar.gz/sha512/9d22b1fa8fa8eaaa5316cb494eb223e0fe73660aa5ca7518180e40d296d6d07a9863938501e5d5350bf79e79d975d7d66dca12768a0a69527d2c17baf7aaf345 -CompilerSupportLibraries.v0.5.0+0.armv6l-linux-musleabihf-libgfortran4.tar.gz/md5/d897098fd98928c2d644ed5ee26c3faa -CompilerSupportLibraries.v0.5.0+0.armv6l-linux-musleabihf-libgfortran4.tar.gz/sha512/4aad051f4f1e3d744825c650363a49f39e04cbd44dad25197ddee1890339e9441aa872f893478a2d8ff556c9a70a89c2885cd779ba3efd3c0f7193c386b820b7 -CompilerSupportLibraries.v0.5.0+0.armv6l-linux-musleabihf-libgfortran5.tar.gz/md5/c36bfd4c5b90d55c55bc18feaf51b134 -CompilerSupportLibraries.v0.5.0+0.armv6l-linux-musleabihf-libgfortran5.tar.gz/sha512/ab16c638780a0118b930ac587df81fa74d2731bf1af402266106e1ecb791df353c1f368a8e7fc9147d390825ff8624e600aae45f1f6ccfc0015ce131368452d7 -CompilerSupportLibraries.v0.5.0+0.armv7l-linux-gnueabihf-libgfortran3.tar.gz/md5/feb76551e6f7407de3006a3d363cee7a -CompilerSupportLibraries.v0.5.0+0.armv7l-linux-gnueabihf-libgfortran3.tar.gz/sha512/976f8e34e72231b013ea0418feff9c3c9efa7b9c34688aca115a03f2bade8760ca9f259f8f502ef5012fbb389f4bf365fd7639b066daca16fb7ec1d32b5cd789 -CompilerSupportLibraries.v0.5.0+0.armv7l-linux-gnueabihf-libgfortran4.tar.gz/md5/560ca43fa6dbd3f2e9052401477df165 -CompilerSupportLibraries.v0.5.0+0.armv7l-linux-gnueabihf-libgfortran4.tar.gz/sha512/333c7f4fbc172e7fd3d99e2673dbed1d9c699a5bb29a20095a255fadc89ded05abda755fc167aa8a16a4e93f524390c9c817df7b67fccdca88754d0301259977 -CompilerSupportLibraries.v0.5.0+0.armv7l-linux-gnueabihf-libgfortran5.tar.gz/md5/d3ac5f871599ab225a1128c302486345 -CompilerSupportLibraries.v0.5.0+0.armv7l-linux-gnueabihf-libgfortran5.tar.gz/sha512/adb706882e923978b6e18c7134578bc86ed4e031a7a0120222018cd1b8efcf530854e426b6442dbd80b8c77c3677f1906aedb12c0ddeb33efcdd3bcd2c4a109a -CompilerSupportLibraries.v0.5.0+0.armv7l-linux-musleabihf-libgfortran3.tar.gz/md5/58774aa398a63479af3f4c69678d0191 -CompilerSupportLibraries.v0.5.0+0.armv7l-linux-musleabihf-libgfortran3.tar.gz/sha512/fe9307e6fb0b54522495fc9cc48756a60fc79af27d9e73bfb3ee49cbb366dddec1beedca03614f15761b308bc28014205f174f673fa258e76d5947446b87b039 -CompilerSupportLibraries.v0.5.0+0.armv7l-linux-musleabihf-libgfortran4.tar.gz/md5/af1a8ce693ba307e61184f4023d73d67 -CompilerSupportLibraries.v0.5.0+0.armv7l-linux-musleabihf-libgfortran4.tar.gz/sha512/2ea581bb44408fc789ac306734736f6eb6cf0a15b234f43a6f50ae8f10014b5689f5aa8356112c2b54a86b9a7734ace3479c4e4aba1e5df636dda3dcd09b7e28 -CompilerSupportLibraries.v0.5.0+0.armv7l-linux-musleabihf-libgfortran5.tar.gz/md5/20d62064f495877f12b7e87e684ad43a -CompilerSupportLibraries.v0.5.0+0.armv7l-linux-musleabihf-libgfortran5.tar.gz/sha512/31b1c7c9fe3378e8bb788c897bbac0505a5ae70f500f3b1457325dbbb149c14224a88d17fbcf453465d8a572f33157766bb0e815cce7c8a2aa8a44422d34a365 -CompilerSupportLibraries.v0.5.0+0.i686-linux-gnu-libgfortran3.tar.gz/md5/fd4035aef1c83be0b865d70aa35e770b -CompilerSupportLibraries.v0.5.0+0.i686-linux-gnu-libgfortran3.tar.gz/sha512/a72047e7071838899d75896b4dcbdc102bca884507f4758b4e0dd62f50c9ce584f2b2b86d8b67dfc4fce9864faf9723056820e464bbab1a6173be47ad941d6da -CompilerSupportLibraries.v0.5.0+0.i686-linux-gnu-libgfortran4.tar.gz/md5/89715bfa0e69528d4d294ed449ef0e09 -CompilerSupportLibraries.v0.5.0+0.i686-linux-gnu-libgfortran4.tar.gz/sha512/6eb7947c72ec32d189221de42d5a76423a1fb5745db0812d88afe7f961d8f42669c7cf487235c1dcc81fbe73106b785c906bd6741e98f60e9931f4083be0e9ce -CompilerSupportLibraries.v0.5.0+0.i686-linux-gnu-libgfortran5.tar.gz/md5/5c1c73dc72029781847f74bcb1189c4b -CompilerSupportLibraries.v0.5.0+0.i686-linux-gnu-libgfortran5.tar.gz/sha512/642d35ed41a65c7a2d7f4f127f936d3cb1665c207aa5feef25cce09cc11e733d7ec129673fea873403567c35cf16122ed1635c303ba13bb3349be44585f3ca82 -CompilerSupportLibraries.v0.5.0+0.i686-linux-musl-libgfortran3.tar.gz/md5/f91c962e7bc3ffb825c7e5fb1e099ba6 -CompilerSupportLibraries.v0.5.0+0.i686-linux-musl-libgfortran3.tar.gz/sha512/f89df221ff80bcbb1e6edc2f9cc28dc138d7d6ae99ac018a3cdc9a09ba637f1a9938b1f0876086f4f822fb911853286dd4f1776d603a403190bee052431ae572 -CompilerSupportLibraries.v0.5.0+0.i686-linux-musl-libgfortran4.tar.gz/md5/d2a81da3371a638f76087629ae0a6507 -CompilerSupportLibraries.v0.5.0+0.i686-linux-musl-libgfortran4.tar.gz/sha512/67941af15a0f032a853cdea180e4f87249bed2dfd09ade6fca9760f5a44b26fc94a0d6932803edbd27b75aa8d26e64c377af2d64ddcba3206562be1427a64c80 -CompilerSupportLibraries.v0.5.0+0.i686-linux-musl-libgfortran5.tar.gz/md5/cec9f3b9d4924a49a34c632efd167752 -CompilerSupportLibraries.v0.5.0+0.i686-linux-musl-libgfortran5.tar.gz/sha512/9320eee2b6dbadd4e0ed3f8763d58854eb179b1d1661c8f1dba75c22af2330812040507944b0ab20b7a7cb233c9953a1d3a4b27937e7b7a858aed2255ad0fbbc -CompilerSupportLibraries.v0.5.0+0.i686-w64-mingw32-libgfortran3.tar.gz/md5/c36411b24c8bec4805230bd4fe0f2391 -CompilerSupportLibraries.v0.5.0+0.i686-w64-mingw32-libgfortran3.tar.gz/sha512/839b447efa46caffa699258ec8ae5e0a55d7f98a7fc037b48e6a6c29193e3d8bf48397575cc518716f41e2e9344daa670693df605a1b9d4a23d3f454ec5ab399 -CompilerSupportLibraries.v0.5.0+0.i686-w64-mingw32-libgfortran4.tar.gz/md5/d2e392edff3525afff6734fdf47c9ab1 -CompilerSupportLibraries.v0.5.0+0.i686-w64-mingw32-libgfortran4.tar.gz/sha512/1816c7ed409acc1435c7fcfd550b7664a08b31ecf433a906d8903a60ed458dab0fa712bd0d1590a0dc8506763a617446ba402efc78a2c010562c45e8eca66a88 -CompilerSupportLibraries.v0.5.0+0.i686-w64-mingw32-libgfortran5.tar.gz/md5/2cfeb5cd0a7e2400c9be3e846a1875d2 -CompilerSupportLibraries.v0.5.0+0.i686-w64-mingw32-libgfortran5.tar.gz/sha512/ca620dd8542ffe9a177b0f95712e77e59b0fc1044e0186dd7468a86aba4d2b92931a1d6f980e75cceb26c6c5f9dab427f4ce32e0f77998b9a827b3ce9151041c -CompilerSupportLibraries.v0.5.0+0.powerpc64le-linux-gnu-libgfortran3.tar.gz/md5/8ba0e4070358839909934d8a1bc9e0bf -CompilerSupportLibraries.v0.5.0+0.powerpc64le-linux-gnu-libgfortran3.tar.gz/sha512/8750769ca321f863fbb354f6e4e76b1241f7e24e5f4ea14ea511486dc5bc4fe8274740f1500149c5ac85a8214a0193c9a09332f35eb47e6222bef9070eecc6c8 -CompilerSupportLibraries.v0.5.0+0.powerpc64le-linux-gnu-libgfortran4.tar.gz/md5/50554a092af3a4a651b53e3ce3cf8a2d -CompilerSupportLibraries.v0.5.0+0.powerpc64le-linux-gnu-libgfortran4.tar.gz/sha512/53ec765d4de3b0bae9727b3b2a27437b184f2072aecda5d0b22d648a95fbba777bb89da823bc851d7242cd3f8c212e3fdaea8e5af11db21c578c2e12db51991d -CompilerSupportLibraries.v0.5.0+0.powerpc64le-linux-gnu-libgfortran5.tar.gz/md5/b09a5913b537b26aa7f8996b1877c748 -CompilerSupportLibraries.v0.5.0+0.powerpc64le-linux-gnu-libgfortran5.tar.gz/sha512/b68020c1b1acf4a1c51822bccc1eb67574ceffae3c133e7efe22ec0cc3a674a7c056c01be02c1c681f469fe1443d76baf4b0e305bec8181e57c3ce5a446a5c22 -CompilerSupportLibraries.v0.5.0+0.x86_64-apple-darwin-libgfortran3.tar.gz/md5/1e4c5d2084f76eacb4419214668c6594 -CompilerSupportLibraries.v0.5.0+0.x86_64-apple-darwin-libgfortran3.tar.gz/sha512/696155b560bfaf592bf7024ba0e6f084382dd269cdd25416fa8840387c101132901e94709c8d0534f038666a6f6849c3d55e8bed4223b5be499e099b49610e77 -CompilerSupportLibraries.v0.5.0+0.x86_64-apple-darwin-libgfortran4.tar.gz/md5/63b386e59f3732d03459c59000fc1382 -CompilerSupportLibraries.v0.5.0+0.x86_64-apple-darwin-libgfortran4.tar.gz/sha512/f6c7e0611df7fd86cc9ca63b380e112561d10b489bc8fbfe911c441ef5e87776761d3c161ff5f6aade479f7e96456084c6939d7eff175ced4f42b3b9ee29426a -CompilerSupportLibraries.v0.5.0+0.x86_64-apple-darwin-libgfortran5.tar.gz/md5/07e22a4b58aaaf145e52b36602c5b08d -CompilerSupportLibraries.v0.5.0+0.x86_64-apple-darwin-libgfortran5.tar.gz/sha512/8a047b0098e8504e2dde0113170416686bc70f9d685fcb19bf3eb76afe30dc16a3b0d2023eb704c25025bbef87e99603dbd2a2708b1a3df908747b06cbfc92ee -CompilerSupportLibraries.v0.5.0+0.x86_64-linux-gnu-libgfortran3.tar.gz/md5/23048b3be33f184ffc9be42ca914aa3a -CompilerSupportLibraries.v0.5.0+0.x86_64-linux-gnu-libgfortran3.tar.gz/sha512/4573b21e34f4d8127a86c18f95065039da92eeb9ade4058bd8459034bb4a003ceefe29e865089126fdc36cffd95a9c12bcb72ed74bff5987a9d1f4b300ecfe45 -CompilerSupportLibraries.v0.5.0+0.x86_64-linux-gnu-libgfortran4.tar.gz/md5/3314ec0668abf069c900558de0690b65 -CompilerSupportLibraries.v0.5.0+0.x86_64-linux-gnu-libgfortran4.tar.gz/sha512/d012c4674401773000f0de831cb8b4b6c454d0ab68d51fbbe970504e76c693211086a24a7df34de2390eaeb438ab23f63c68b480a408ab2136f442aba5094bd7 -CompilerSupportLibraries.v0.5.0+0.x86_64-linux-gnu-libgfortran5.tar.gz/md5/e7768c00909613b8f29f6a5860ff4247 -CompilerSupportLibraries.v0.5.0+0.x86_64-linux-gnu-libgfortran5.tar.gz/sha512/43c29456a0fc74c4fda42d088903651c6bbac6b842f2aa600e3019b391b04158ee97f884e6962bd9e7a9cf337dbb1cdb2151d103e1dee5214ba798b167b1ed32 -CompilerSupportLibraries.v0.5.0+0.x86_64-linux-musl-libgfortran3.tar.gz/md5/b2a30e92ba8e40ef070e3ec7c16b97f0 -CompilerSupportLibraries.v0.5.0+0.x86_64-linux-musl-libgfortran3.tar.gz/sha512/64a4029dd1e84922728b2c93a455d7d6b262c979dddf59301ff96e9c28980fbd9c1db57e81afaece96ccb51b9751e5a0180b84e412427430487280c56d8da266 -CompilerSupportLibraries.v0.5.0+0.x86_64-linux-musl-libgfortran4.tar.gz/md5/b0610d32a80b3f87baebf0250b0f92d6 -CompilerSupportLibraries.v0.5.0+0.x86_64-linux-musl-libgfortran4.tar.gz/sha512/3b7098fbb82e4a7a903b82f942303b248e0e35be13a47e4839a036085c4a33925f1f78fe941b852331cc52de80f32bcdb9a64ccff0386e1070a6ca4600c08eb8 -CompilerSupportLibraries.v0.5.0+0.x86_64-linux-musl-libgfortran5.tar.gz/md5/3f905dd4e8b3cfd2cc3f8efcaa50a407 -CompilerSupportLibraries.v0.5.0+0.x86_64-linux-musl-libgfortran5.tar.gz/sha512/22af14d245e3c062131dd274afa6d9c7cde9a11ee2455e27ae2f7725a025fc2cd6cdb3a1a3c899988c6c3412a714c1f0763f4e08924726212405938c3cf66da5 -CompilerSupportLibraries.v0.5.0+0.x86_64-unknown-freebsd-libgfortran3.tar.gz/md5/2c56a22c935dda76831f36c713cca099 -CompilerSupportLibraries.v0.5.0+0.x86_64-unknown-freebsd-libgfortran3.tar.gz/sha512/6bd9bd6ec8b6b18013b3c6de344de134835c9281d39bc5e6e31928970c60b584fa625df18efbce3ea571dee53011dec73e9aae9159e812f219692fbb4dd86a2d -CompilerSupportLibraries.v0.5.0+0.x86_64-unknown-freebsd-libgfortran4.tar.gz/md5/e483c3e85b4d4b2685ee4e8f09951ac1 -CompilerSupportLibraries.v0.5.0+0.x86_64-unknown-freebsd-libgfortran4.tar.gz/sha512/47c2f305237ccd55ed2ba445cbcd599c23f9c1392388017506f9d61a4dc8fec4ba4136be81a0e82de4f161f6788c4a62acc9d71efe6cf90b766e5339950ed337 -CompilerSupportLibraries.v0.5.0+0.x86_64-unknown-freebsd-libgfortran5.tar.gz/md5/41c25d9cf7545721b8d4dd2386e95ead -CompilerSupportLibraries.v0.5.0+0.x86_64-unknown-freebsd-libgfortran5.tar.gz/sha512/173570bbf4eb60d678472058ec2c18732cd27ad2911457c83f47a1d97c1c0028d91005cf56539e51d4a04178544ac0bba47ea27e74b6b4e8d3310551ad3167fe -CompilerSupportLibraries.v0.5.0+0.x86_64-w64-mingw32-libgfortran3.tar.gz/md5/f124c93580a038ce806f479568b46597 -CompilerSupportLibraries.v0.5.0+0.x86_64-w64-mingw32-libgfortran3.tar.gz/sha512/c313390dbcffaea6cb5202645b5304134a1ce6aac5a3835696f45316c8170b237c04f13166694eee0f31903ac1e5c3cd73ad8974ba19b44289da3504d3436f8c -CompilerSupportLibraries.v0.5.0+0.x86_64-w64-mingw32-libgfortran4.tar.gz/md5/050fe7a6bdf980c198f4c201629d15e0 -CompilerSupportLibraries.v0.5.0+0.x86_64-w64-mingw32-libgfortran4.tar.gz/sha512/211e435f5e2b7209aedaf4a81b5e0d5e615b9144de248c06e43dc61b31890dbde80d718e74454b489bd1f77476d34bd01d3f9a25355bc50fca0dc07df0264cad -CompilerSupportLibraries.v0.5.0+0.x86_64-w64-mingw32-libgfortran5.tar.gz/md5/3566d0f714c1503b92160b486a4eaa4a -CompilerSupportLibraries.v0.5.0+0.x86_64-w64-mingw32-libgfortran5.tar.gz/sha512/b2f29c1c6dc35e1002021f8f15a20a72a57c346b33a6d045ff7a261e88767738a4da1dd88aa71a20514bdf6376099979c9d938173fa3ae28641c40372c94db60 +CompilerSupportLibraries.v0.5.2+0.aarch64-apple-darwin-libgfortran5.tar.gz/md5/e0651fbefd39d405ec97d7530f2887d7 +CompilerSupportLibraries.v0.5.2+0.aarch64-apple-darwin-libgfortran5.tar.gz/sha512/0a067b7e37d98a4c96dd1400b8c1a07c82cc223d11a93a0ee2455c3b55b394eee0cb251e26206495453f2cf8866822fb586ffe105f44e3380fa949adffe8b83c +CompilerSupportLibraries.v0.5.2+0.aarch64-linux-gnu-libgfortran3.tar.gz/md5/1f4a5e98cd88a08029326ca5e9d47e9c +CompilerSupportLibraries.v0.5.2+0.aarch64-linux-gnu-libgfortran3.tar.gz/sha512/696f359746de592d4e30dc9ad19d5e07ebc1e6635e1f082e249747c42338ef04ce885fee5ad5915ec39fa2866af4265bb6ef580c75874c091a15b64d02626123 +CompilerSupportLibraries.v0.5.2+0.aarch64-linux-gnu-libgfortran4.tar.gz/md5/8285fd34164fac0410fcec6bb9d8b8e4 +CompilerSupportLibraries.v0.5.2+0.aarch64-linux-gnu-libgfortran4.tar.gz/sha512/df0869d357326c803d8ff33c9734f01457d877e80c4af33745d4ca016144eb0c52fba7aad7e1098eecde3fc4cf41ed971638b4b6f901c7306a2072e8c14c3513 +CompilerSupportLibraries.v0.5.2+0.aarch64-linux-gnu-libgfortran5.tar.gz/md5/82add6093bda667442236c04d84b6934 +CompilerSupportLibraries.v0.5.2+0.aarch64-linux-gnu-libgfortran5.tar.gz/sha512/81538d75950cdf931f9aaa932d1f9cf40998bc256924c3231e984179f6a5c3eca0f7e1ba315b21f2add3bf9376e3a45ee59ccd8d9f6d765105e05da25bf65cfc +CompilerSupportLibraries.v0.5.2+0.aarch64-linux-musl-libgfortran3.tar.gz/md5/ee0d6a9f0a1372e36a02a95b6c07aefc +CompilerSupportLibraries.v0.5.2+0.aarch64-linux-musl-libgfortran3.tar.gz/sha512/f248e57249af88520f9c7ac32dba45ca03e5904606b4edb682ea514c31a9a775198d02f0892e79124326e184d7906b7a13b0e4f3e7721352b8105cdfa72f89ed +CompilerSupportLibraries.v0.5.2+0.aarch64-linux-musl-libgfortran4.tar.gz/md5/dddc8f7a9be9f07e9738e2a027fe8a0c +CompilerSupportLibraries.v0.5.2+0.aarch64-linux-musl-libgfortran4.tar.gz/sha512/36f9b94f470d451b9c3c2429026292463434427625563240467f50374624a69fbca7ddcb0678937a58d22d32a8157571d3e201c47cc9a2484d1d75d4c0f77ebc +CompilerSupportLibraries.v0.5.2+0.aarch64-linux-musl-libgfortran5.tar.gz/md5/12b7eb088023eaf9583ffa6f9f0e18ac +CompilerSupportLibraries.v0.5.2+0.aarch64-linux-musl-libgfortran5.tar.gz/sha512/a5f5a6053e63ea1fb0185a0c3a7752a938373da847dffb872c1227ed3a0a80f2de1e4394baaaeeb8e0d8f2a4da123433896742cfdca6f94343bd4d0ab3578c65 +CompilerSupportLibraries.v0.5.2+0.armv6l-linux-gnueabihf-libgfortran3.tar.gz/md5/e5e6918571981e4cfa5a2951e59f2df7 +CompilerSupportLibraries.v0.5.2+0.armv6l-linux-gnueabihf-libgfortran3.tar.gz/sha512/5d7b0f4f55b6726ae7317edb170cafb6a2c4563b0f4a90c619da95c120edd8fdce118bbd1e7168110f75cc899b857472fd524a396deb6d9f2552f53c861faeb7 +CompilerSupportLibraries.v0.5.2+0.armv6l-linux-gnueabihf-libgfortran4.tar.gz/md5/7ae11706e9c6c043ad771f2700d06591 +CompilerSupportLibraries.v0.5.2+0.armv6l-linux-gnueabihf-libgfortran4.tar.gz/sha512/4f2f01aed00a58f4393cfd4608df1a6df6c9bff6e352a02a2b9af13f14a4436611769d64d082d3b151ba23d3d905ae2700bf469b9858249757ad7b5aae716d6a +CompilerSupportLibraries.v0.5.2+0.armv6l-linux-gnueabihf-libgfortran5.tar.gz/md5/e922dad7dad1d5f80cc154a6ddb6de35 +CompilerSupportLibraries.v0.5.2+0.armv6l-linux-gnueabihf-libgfortran5.tar.gz/sha512/3fabbcedbbc4abfe1e0c01c387bbe2537105937674877122b5b66d6015944a58f547106da1e185c1434de0c1883d356f8dc52968f075a00c6a8a52edaaf88957 +CompilerSupportLibraries.v0.5.2+0.armv6l-linux-musleabihf-libgfortran3.tar.gz/md5/53741f61d806efe045a5abe0e748aa36 +CompilerSupportLibraries.v0.5.2+0.armv6l-linux-musleabihf-libgfortran3.tar.gz/sha512/b975a8fdfb736ef2b1aede2c89e390df261bfe8aaf8ffdb37887add09263d95f46642c3898ac19ec6098cdfdfc7f0726436dc273e9f70f10fe1abf4ea945277a +CompilerSupportLibraries.v0.5.2+0.armv6l-linux-musleabihf-libgfortran4.tar.gz/md5/9687cf768c6c2879261e385c44ba490c +CompilerSupportLibraries.v0.5.2+0.armv6l-linux-musleabihf-libgfortran4.tar.gz/sha512/02f9accf8273597f6889677de64255e4e399d67377b5363ed31dea7e2118cc24d3b7fad7c0632aea79dee44250b1ff74bf2fa22e4f3e7755de65871854112c14 +CompilerSupportLibraries.v0.5.2+0.armv6l-linux-musleabihf-libgfortran5.tar.gz/md5/b62a81b9f43903b3de6fa1c78c03b89f +CompilerSupportLibraries.v0.5.2+0.armv6l-linux-musleabihf-libgfortran5.tar.gz/sha512/d44eecb30ccf19bc8dca41c738dbedd2bd2cb6e379a3ab181c955cb9cdf9bae8efeaf7a90c85dc7434520ead7e910d38e92b448cff7aecaef0902684e9b06c9f +CompilerSupportLibraries.v0.5.2+0.armv7l-linux-gnueabihf-libgfortran3.tar.gz/md5/e31780333339ac64f54ad434578d6294 +CompilerSupportLibraries.v0.5.2+0.armv7l-linux-gnueabihf-libgfortran3.tar.gz/sha512/9c3b91ed90f3393dfc72e7e2feefa60afe6ad457971950b163ffbecafa41cea43a15cdfadd8f402fd8fb61652c224f5b1a04c432fb0f43593749f51ed1340116 +CompilerSupportLibraries.v0.5.2+0.armv7l-linux-gnueabihf-libgfortran4.tar.gz/md5/0f7bdfb908aa3d721428a1ee8412b594 +CompilerSupportLibraries.v0.5.2+0.armv7l-linux-gnueabihf-libgfortran4.tar.gz/sha512/3199da41c3df3d702a557c8b5e9fdde3a47c12d4c45fb9094fd194cbbe667663334b6cc0a5169fcc755790c4b5fada71c5094dc8d9a7f8b6c836d3f4c4c6e509 +CompilerSupportLibraries.v0.5.2+0.armv7l-linux-gnueabihf-libgfortran5.tar.gz/md5/f455758e436750092ba2df65adcfd380 +CompilerSupportLibraries.v0.5.2+0.armv7l-linux-gnueabihf-libgfortran5.tar.gz/sha512/b5d0dbdff19b5ce076b8ae7b907da25fdbe05eabd47e46987f9987690a3a670d14bd3d2c2343d366ca1ee861b85fcbaccc1460ba3a73571686ef9e4330427b65 +CompilerSupportLibraries.v0.5.2+0.armv7l-linux-musleabihf-libgfortran3.tar.gz/md5/4cf3790d881b829b4b8da882987d5a40 +CompilerSupportLibraries.v0.5.2+0.armv7l-linux-musleabihf-libgfortran3.tar.gz/sha512/ef5810243af32135da0cb7d08ae35ff8a2cce50c05200450154aa860c181719844466b787faae551aa71bd94e721f2d7d17ab14a049d0558666037862aff2f6a +CompilerSupportLibraries.v0.5.2+0.armv7l-linux-musleabihf-libgfortran4.tar.gz/md5/a49e1fa6e040ac86ddd85a3188f83a76 +CompilerSupportLibraries.v0.5.2+0.armv7l-linux-musleabihf-libgfortran4.tar.gz/sha512/cb0292651392a14f952181eb7a4a0ea6359632e96b017169cf4f1792f44f2846b5d6b2b5d334dee490262dd1c2d421de49d1f4a919402392f77fdaf60c1d19a3 +CompilerSupportLibraries.v0.5.2+0.armv7l-linux-musleabihf-libgfortran5.tar.gz/md5/3f64969e0e70dc8644fe09637dd1cbe7 +CompilerSupportLibraries.v0.5.2+0.armv7l-linux-musleabihf-libgfortran5.tar.gz/sha512/0a71f8b731911019666bdc82f42e306ff1801321362ce6fe58988c9a1b110cd032a01c11fd0f9a6a3fbf6c6545f3287e363f5b3c40ef2eab0659638c38687196 +CompilerSupportLibraries.v0.5.2+0.i686-linux-gnu-libgfortran3.tar.gz/md5/28f58931f66a3405fc4c99ce40724ece +CompilerSupportLibraries.v0.5.2+0.i686-linux-gnu-libgfortran3.tar.gz/sha512/d5290079264cfc6f716dcc9171f8412369e685c7ba0b9e82ae3d764de41671fbb4a24fdf7ebae9a9b913393837c2e41951326dbf3e870340fba7121709ebba8b +CompilerSupportLibraries.v0.5.2+0.i686-linux-gnu-libgfortran4.tar.gz/md5/f98763aae801cc7d88124bea422f13ca +CompilerSupportLibraries.v0.5.2+0.i686-linux-gnu-libgfortran4.tar.gz/sha512/da2095a462637ffcd0825949f4bcc86be9484c9e009648dc3c2e22e2fa19c65124e5e45f2694e85616df49b1181e2f4d2b886d3b83401c09ca58207db461ea23 +CompilerSupportLibraries.v0.5.2+0.i686-linux-gnu-libgfortran5.tar.gz/md5/1bfee57db4f2bdd788e59e34d0bb4506 +CompilerSupportLibraries.v0.5.2+0.i686-linux-gnu-libgfortran5.tar.gz/sha512/8f4814d97d6cd6c1f0c1d23fce875c40b6df7de7a8dc66e66681ba3c533120cb14d9d018808ff4e33dec53bb8958fbcedc9be6ac70817839ff89a0db5c0d18a8 +CompilerSupportLibraries.v0.5.2+0.i686-linux-musl-libgfortran3.tar.gz/md5/5da7af0483ffde929c58f3ae411f6489 +CompilerSupportLibraries.v0.5.2+0.i686-linux-musl-libgfortran3.tar.gz/sha512/97e56fe4fe0e10fa0d57ec10882a62d290829940049ffce7a8d81a843b91c7844e53d737bcdbc7a5e8206ca9820a7066fcdd7d0eed1e831d7af96222ccca1224 +CompilerSupportLibraries.v0.5.2+0.i686-linux-musl-libgfortran4.tar.gz/md5/a0b5cf513f2f02107c8887ea5e30cdda +CompilerSupportLibraries.v0.5.2+0.i686-linux-musl-libgfortran4.tar.gz/sha512/aeeacfb58094751fe5cec87825ebb02a22c58d3e7300b6ca6066eb717e28ebecff230838c32935ac11376a6efdd5a0c44fe0c8e7d5b9a1f0165171c2b67a2d8b +CompilerSupportLibraries.v0.5.2+0.i686-linux-musl-libgfortran5.tar.gz/md5/569ef42292d8cfd157026b434e93fe4d +CompilerSupportLibraries.v0.5.2+0.i686-linux-musl-libgfortran5.tar.gz/sha512/daf543fbe7e80fd63220f7c08e0d6b51d45ce9e0af592a591eecadcaac9b859ce596df2bf8fcb3fb72fb799f869d0caac28acb5d26b3c3aed6dc80245b90dcce +CompilerSupportLibraries.v0.5.2+0.i686-w64-mingw32-libgfortran3.tar.gz/md5/f4e0f3d40f7f77d32f26424dedff850f +CompilerSupportLibraries.v0.5.2+0.i686-w64-mingw32-libgfortran3.tar.gz/sha512/57e35c39c4c93919cdbbe33891b5938918d33840ad33ed51a010f9deab791d60fa2d030d3e14df6e445e0607dc9280b07ca287a3273630bf7e245d6ab8069cbd +CompilerSupportLibraries.v0.5.2+0.i686-w64-mingw32-libgfortran4.tar.gz/md5/d366731c11314cb908fca2032e7fefca +CompilerSupportLibraries.v0.5.2+0.i686-w64-mingw32-libgfortran4.tar.gz/sha512/a7e087e718f9d8cb4957b8bf3a4554faae97510b25d88a3e9ae4241cb69efa5b520bd9424a0072e7d712c9435e6900690c56004a716a716838367e91fe20e11d +CompilerSupportLibraries.v0.5.2+0.i686-w64-mingw32-libgfortran5.tar.gz/md5/eff855bb45f038c9d74c67ae2eed5641 +CompilerSupportLibraries.v0.5.2+0.i686-w64-mingw32-libgfortran5.tar.gz/sha512/e674d60247086bb8029270406d246a4857e668442a77299a431ec837446387bd1ed2de5e0f9f6985cc6e5d15b6692f40b18e0016e7c9d4e95a3770dffc19b44d +CompilerSupportLibraries.v0.5.2+0.powerpc64le-linux-gnu-libgfortran3.tar.gz/md5/0bfe78d226b3d89a83b54c6ff39239e1 +CompilerSupportLibraries.v0.5.2+0.powerpc64le-linux-gnu-libgfortran3.tar.gz/sha512/fed14514c9603a1e4772d2fd5f4a48da751c10e34b6fba5e0c35ff40b8ed165af6daebc051fa86751bdffb8f820ac779215dc3b38c4ff5c1624214b61d7ad1b0 +CompilerSupportLibraries.v0.5.2+0.powerpc64le-linux-gnu-libgfortran4.tar.gz/md5/d5219b60117555a3ccd41ab406d485f4 +CompilerSupportLibraries.v0.5.2+0.powerpc64le-linux-gnu-libgfortran4.tar.gz/sha512/9268d7c2c6ef649dc753757f9afc7ac1382e521d02c58a91eead9873f2a80f215f3b67f9a33abad53c8bca18c19ae3e63804e01e3109c939d33555c7ec8c5b1a +CompilerSupportLibraries.v0.5.2+0.powerpc64le-linux-gnu-libgfortran5.tar.gz/md5/1f620c9a049e00b8b11c3970a23f2761 +CompilerSupportLibraries.v0.5.2+0.powerpc64le-linux-gnu-libgfortran5.tar.gz/sha512/6ac900dfac9268334c9b54badbfbec323151353e8d87d3199f875a505febf863766ded0c52bce2939e5975fa6e35a28cc16c88e7c1cce37d65725fe275813606 +CompilerSupportLibraries.v0.5.2+0.x86_64-apple-darwin-libgfortran3.tar.gz/md5/c21c35b00ed7ad0171d63006f1a4170d +CompilerSupportLibraries.v0.5.2+0.x86_64-apple-darwin-libgfortran3.tar.gz/sha512/f993a616a75b1f5ee140ed47b6e4aa981cffbbffd795fc0cf9df9397a6366a4507a158530e961c398bab656e7d51a27be026088678e0c19485ef0bad136bb69a +CompilerSupportLibraries.v0.5.2+0.x86_64-apple-darwin-libgfortran4.tar.gz/md5/f0cd5c8631256f3b903e95ad3623d702 +CompilerSupportLibraries.v0.5.2+0.x86_64-apple-darwin-libgfortran4.tar.gz/sha512/81de3f699169254fa83a3ab8b6063ddfd300065edf90f15239b0a304f3feea9534acba7d982058a7712ce94dcdb1ae036502f276813a96f8254e323787556d63 +CompilerSupportLibraries.v0.5.2+0.x86_64-apple-darwin-libgfortran5.tar.gz/md5/6030c114c1250e99958a0727da9d6daf +CompilerSupportLibraries.v0.5.2+0.x86_64-apple-darwin-libgfortran5.tar.gz/sha512/1d4be1c0718aeab056368653b7f34bd5ac3c85edb9fbdc2752b8c4877fcf5d080774506519cf285954485d806bccc18323f6c45f069db8bd314d064a2cc1ed66 +CompilerSupportLibraries.v0.5.2+0.x86_64-linux-gnu-libgfortran3.tar.gz/md5/b45ac0c04357de9d013df598dd13f3bf +CompilerSupportLibraries.v0.5.2+0.x86_64-linux-gnu-libgfortran3.tar.gz/sha512/42174d05c7165f87693efa09facc9405c9d6eab490c4b5fc74ba02e1e2e871799a24dcb7496e0693f30f9c3fd7e81020b77a3dd946832288769063f6d2a31aba +CompilerSupportLibraries.v0.5.2+0.x86_64-linux-gnu-libgfortran4.tar.gz/md5/761998b08e4b460cec95468adb850c31 +CompilerSupportLibraries.v0.5.2+0.x86_64-linux-gnu-libgfortran4.tar.gz/sha512/32853dcb3202e735325e1e0e3d88e2e446d7c88d45bc462d4e91f7d57dfd78b0f3381302e72163fafdb1c2cef53d4822e1c52289081e06b7b74d67e2ed0d34c2 +CompilerSupportLibraries.v0.5.2+0.x86_64-linux-gnu-libgfortran5.tar.gz/md5/dfd50d071702f903213ea0c6a42ad81b +CompilerSupportLibraries.v0.5.2+0.x86_64-linux-gnu-libgfortran5.tar.gz/sha512/3d6ecca7689bcb1925801d26a328790228c564bb731f6fa25d88763eeb22cccc4409dd6376c7b574ec242fbf85e41fd82d038a2650f8d33bb850b9a9a9f9a722 +CompilerSupportLibraries.v0.5.2+0.x86_64-linux-musl-libgfortran3.tar.gz/md5/0b374bc55dd0d5f4cf34a12d4901c022 +CompilerSupportLibraries.v0.5.2+0.x86_64-linux-musl-libgfortran3.tar.gz/sha512/10db23cc1d1367f40fed6c6cfc232fdc49f55e666d3623faa1af40dd781ea7a5d37b6b5a39524f0fc57d6d49947f429389bbf7075f10163090d7ea48903e688a +CompilerSupportLibraries.v0.5.2+0.x86_64-linux-musl-libgfortran4.tar.gz/md5/1e28cdc7937a500b081a1f4d340190f2 +CompilerSupportLibraries.v0.5.2+0.x86_64-linux-musl-libgfortran4.tar.gz/sha512/0b635b8f594739453033fd1dc5496976a8fff314dd078e2d8248d3c2136abaaa610ebc45252a81d16db9d91a0ec20a552f1bcb65ed3b50a627e40168e7f100e0 +CompilerSupportLibraries.v0.5.2+0.x86_64-linux-musl-libgfortran5.tar.gz/md5/f6fcf32044f69d8305a718eeb7651614 +CompilerSupportLibraries.v0.5.2+0.x86_64-linux-musl-libgfortran5.tar.gz/sha512/5940a145a3203d5a4a9b7cd9aab45b8bcff08a43a69a8fea67a9e18535625c8ecc051ba344421253b2f96eaa1a007d42555897a8f8aa0e8bd5dbf1ddbd38f197 +CompilerSupportLibraries.v0.5.2+0.x86_64-unknown-freebsd-libgfortran3.tar.gz/md5/eb46728ef7d3ce955d5a497a556138c2 +CompilerSupportLibraries.v0.5.2+0.x86_64-unknown-freebsd-libgfortran3.tar.gz/sha512/922d3a85059e7cedc6e0e52687cd6f22cb708677a65fcab86f7571737d8f17455f15b3f1af7442ee5fd04a437f226d4eee374d0f353a10f8f7a87160d7a2351d +CompilerSupportLibraries.v0.5.2+0.x86_64-unknown-freebsd-libgfortran4.tar.gz/md5/fc1f4fc44c08f0c3040b976558a35e3e +CompilerSupportLibraries.v0.5.2+0.x86_64-unknown-freebsd-libgfortran4.tar.gz/sha512/5406251fe1d1d1901ac4e6af3b8e9394fcaee2fa6a4f3d2817161a1626bc6b45d7b184f9bdd3d2e6571640f40b4e06c61f321358ad8fe484871ab9b878801a95 +CompilerSupportLibraries.v0.5.2+0.x86_64-unknown-freebsd-libgfortran5.tar.gz/md5/e1b52fdb233c9667610867e278e7719a +CompilerSupportLibraries.v0.5.2+0.x86_64-unknown-freebsd-libgfortran5.tar.gz/sha512/efadc4efc419808cb289c8c8f52664a72f2646bad2e8e02533456cf9afd613d4cbacd121da786316206df8f65b5264498f25adb04f7673121b2a58a20c4a75b9 +CompilerSupportLibraries.v0.5.2+0.x86_64-w64-mingw32-libgfortran3.tar.gz/md5/a449351de41a3140534d278aacedc54e +CompilerSupportLibraries.v0.5.2+0.x86_64-w64-mingw32-libgfortran3.tar.gz/sha512/db5bfbd161eba076598465cfee277418c6e9f4f0f7c4672a437c68ceff374f600917fdcaaa9dfdb945103d2b5c9786663e8e9403f6fdc796cda7c529dadf28ba +CompilerSupportLibraries.v0.5.2+0.x86_64-w64-mingw32-libgfortran4.tar.gz/md5/facd6a008270b85d08ca835556921127 +CompilerSupportLibraries.v0.5.2+0.x86_64-w64-mingw32-libgfortran4.tar.gz/sha512/236438e05eb3f50063aea90522e61f10a03c474f3c26117c071bf94d4ca24fae56e09a565cbf00dc5d1eabefec804fa5503ecbcc324b5da00a65b5471fccfadf +CompilerSupportLibraries.v0.5.2+0.x86_64-w64-mingw32-libgfortran5.tar.gz/md5/cd294be65ddd327d6c0feeca8b13f922 +CompilerSupportLibraries.v0.5.2+0.x86_64-w64-mingw32-libgfortran5.tar.gz/sha512/73dc99009d25fa0ebafa77d7c5747d21a6e0778a6266a2408df885d9553e4b8029c104e1fe174526d9261252bb564128ae7cf9058268475d168c79d19ee4f0c0 diff --git a/stdlib/CompilerSupportLibraries_jll/Project.toml b/stdlib/CompilerSupportLibraries_jll/Project.toml index 15ca525723c07..877a1ab5b005c 100644 --- a/stdlib/CompilerSupportLibraries_jll/Project.toml +++ b/stdlib/CompilerSupportLibraries_jll/Project.toml @@ -4,7 +4,7 @@ uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" # NOTE: When updating this, also make sure to update the value # `CSL_NEXT_GLIBCXX_VERSION` in `deps/csl.mk`, to properly disable # automatic usage of BB-built CSLs on extremely up-to-date systems! -version = "0.5.0+0" +version = "0.5.2+0" [deps] Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" diff --git a/stdlib/CompilerSupportLibraries_jll/src/CompilerSupportLibraries_jll.jl b/stdlib/CompilerSupportLibraries_jll/src/CompilerSupportLibraries_jll.jl index af8a679d87e10..1b2c0cd41cbe2 100644 --- a/stdlib/CompilerSupportLibraries_jll/src/CompilerSupportLibraries_jll.jl +++ b/stdlib/CompilerSupportLibraries_jll/src/CompilerSupportLibraries_jll.jl @@ -33,7 +33,7 @@ if Sys.iswindows() const libgomp = "libgomp-1.dll" elseif Sys.isapple() if arch(HostPlatform()) == "aarch64" - const libgcc_s = "@rpath/libgcc_s.2.dylib" + const libgcc_s = "@rpath/libgcc_s.1.1.dylib" else const libgcc_s = "@rpath/libgcc_s.1.dylib" end From abf0a9a0e2ed0942139b985d40557c6188016eb9 Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Wed, 9 Mar 2022 08:22:11 +0100 Subject: [PATCH 064/369] export CanonicalIndexError (#44524) (cherry picked from commit cd704d28eba856cb40c218746bc4a9f00fb2464e) --- base/exports.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/base/exports.jl b/base/exports.jl index 2d790f16b7986..dff6b0c9bc208 100644 --- a/base/exports.jl +++ b/base/exports.jl @@ -122,6 +122,7 @@ export Cwstring, # Exceptions + CanonicalIndexError, CapturedException, CompositeException, DimensionMismatch, From 9de639a748580cd60bc1383b59f30e249769043d Mon Sep 17 00:00:00 2001 From: Juan Ignacio Polanco Date: Fri, 11 Mar 2022 21:34:33 +0100 Subject: [PATCH 065/369] `range` uses `TwicePrecision` when possible (part 2) (#44528) (cherry picked from commit 45ab66452ef08cfcb62aa091037ce0a78367a762) --- base/twiceprecision.jl | 18 ++++++++++++++--- test/ranges.jl | 46 ++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 59 insertions(+), 5 deletions(-) diff --git a/base/twiceprecision.jl b/base/twiceprecision.jl index 6d91431e47abb..860f2d23185cc 100644 --- a/base/twiceprecision.jl +++ b/base/twiceprecision.jl @@ -453,8 +453,14 @@ end step(r::StepRangeLen{T,TwicePrecision{T},TwicePrecision{T}}) where {T<:AbstractFloat} = T(r.step) step(r::StepRangeLen{T,TwicePrecision{T},TwicePrecision{T}}) where {T} = T(r.step) -range_start_step_length(a, st::IEEEFloat, len::Integer) = - range_start_step_length(oftype(st, a), st, len) +range_start_step_length(a::Real, st::IEEEFloat, len::Integer) = + range_start_step_length(promote(a, st)..., len) + +range_start_step_length(a::IEEEFloat, st::Real, len::Integer) = + range_start_step_length(promote(a, st)..., len) + +range_start_step_length(a::IEEEFloat, st::IEEEFloat, len::Integer) = + range_start_step_length(promote(a, st)..., len) function range_start_step_length(a::T, st::T, len::Integer) where T<:IEEEFloat len = len + 0 # promote with Int @@ -474,7 +480,13 @@ function range_start_step_length(a::T, st::T, len::Integer) where T<:IEEEFloat steprangelen_hp(T, a, st, 0, len, 1) end -function range_step_stop_length(step::IEEEFloat, stop, len::Integer) +range_step_stop_length(step::Real, stop::IEEEFloat, len::Integer) = + range_step_stop_length(promote(step, stop)..., len) + +range_step_stop_length(step::IEEEFloat, stop::Real, len::Integer) = + range_step_stop_length(promote(step, stop)..., len) + +function range_step_stop_length(step::IEEEFloat, stop::IEEEFloat, len::Integer) r = range_start_step_length(stop, negate(step), len) reverse(r) end diff --git a/test/ranges.jl b/test/ranges.jl index 536c1f4710d9d..c448f4b99e201 100644 --- a/test/ranges.jl +++ b/test/ranges.jl @@ -1618,9 +1618,51 @@ end @test x == [0.0, 0.2, 0.4, 0.6, 0.8] end - let x = @inferred range(stop=1, step=0.2, length=5) + let x = @inferred range(0.0, step=2, length=5) @test x isa StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}} - @test x == [0.2, 0.4, 0.6, 0.8, 1.0] + @test x == [0.0, 2.0, 4.0, 6.0, 8.0] + @test x === range(0.0, step=2.0, length=5) + @test x === range(0.0f0, step=2e0, length=5) + @test x === range(0e0, step=2.0f0, length=5) + end + + # start::IEEEFloat and step::Complex + let x = @inferred range(2.0, step=1im, length=3) + @test typeof(x) === StepRangeLen{ComplexF64, Float64, Complex{Int}, Int} + @test x == range(2, step=1im, length=3) # compare with integer range + @test x == 2.0 .+ [0im, 1im, 2im] + end + + # start::Complex and step::IEEEFloat + let x = @inferred range(2im, step=1.0, length=3) + @test typeof(x) === StepRangeLen{ComplexF64, Complex{Int}, Float64, Int} + @test x == range(2im, step=1, length=3) # compare with integer range + end + + # stop::IEEEFloat and step::Complex + let x = @inferred range(stop=2.0, step=1im, length=3) + @test typeof(x) === StepRangeLen{ComplexF64, ComplexF64, Complex{Int}, Int} + @test x == range(stop=2, step=1im, length=3) # compare with integer range + @test x == 2.0 .- [2im, 1im, 0im] + end + + # stop::Complex and step::IEEEFloat + let x = @inferred range(stop=2im, step=1.0, length=3) + @test typeof(x) === StepRangeLen{ComplexF64, ComplexF64, Float64, Int} + @test x == range(stop=2im, step=1, length=3) # compare with integer range + end + + let x = @inferred range(stop=10, step=2.0, length=5) + @test x isa StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}} + @test x === @inferred range(stop=10.0, step=2.0, length=5) + @test x === @inferred range(stop=10f0, step=2.0, length=5) + @test x === @inferred range(stop=10e0, step=2.0f0, length=5) + @test x == [2, 4, 6, 8, 10] + end + + let x = @inferred range(stop=10.0, step=2, length=4) + @test x isa StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}} + @test x == [4.0, 6.0, 8.0, 10.0] end end From 1caaa303b96cd2165b2e4ab62820b76499be91c1 Mon Sep 17 00:00:00 2001 From: Oscar Smith Date: Sat, 12 Mar 2022 03:01:25 -0500 Subject: [PATCH 066/369] fix precision issue in Float64^Float64. (#44529) * improve accuracy for x^-3 (cherry picked from commit 258ddc07d413e4c5889a6594a5b93ac6e1508018) --- base/intfuncs.jl | 1 - base/math.jl | 9 +++--- .../manual/complex-and-rational-numbers.md | 2 +- test/math.jl | 30 +++++++++++++++---- 4 files changed, 30 insertions(+), 12 deletions(-) diff --git a/base/intfuncs.jl b/base/intfuncs.jl index 3c2d9b4beec7b..44c7be0626126 100644 --- a/base/intfuncs.jl +++ b/base/intfuncs.jl @@ -321,7 +321,6 @@ const HWNumber = Union{HWReal, Complex{<:HWReal}, Rational{<:HWReal}} @inline literal_pow(::typeof(^), x::HWNumber, ::Val{3}) = x*x*x @inline literal_pow(::typeof(^), x::HWNumber, ::Val{-1}) = inv(x) @inline literal_pow(::typeof(^), x::HWNumber, ::Val{-2}) = (i=inv(x); i*i) -@inline literal_pow(::typeof(^), x::HWNumber, ::Val{-3}) = (i=inv(x); i*i*i) # don't use the inv(x) transformation here since float^p is slightly more accurate @inline literal_pow(::typeof(^), x::AbstractFloat, ::Val{p}) where {p} = x^p diff --git a/base/math.jl b/base/math.jl index 1fb10467e184f..a8ec2a97f0f61 100644 --- a/base/math.jl +++ b/base/math.jl @@ -1009,8 +1009,8 @@ end !isfinite(x) && return x*(y>0 || isnan(x)) x==0 && return abs(y)*Inf*(!(y>0)) logxhi,logxlo = Base.Math._log_ext(x) - xyhi = logxhi*y - xylo = logxlo*y + xyhi, xylo = two_mul(logxhi,y) + xylo = muladd(logxlo, y, xylo) hi = xyhi+xylo return Base.Math.exp_impl(hi, xylo-(hi-xyhi), Val(:ℯ)) end @@ -1040,6 +1040,7 @@ end @assume_effects :terminates_locally @noinline function pow_body(x::Float64, n::Integer) y = 1.0 xnlo = ynlo = 0.0 + n == 3 && return x*x*x # keep compatibility with literal_pow if n < 0 rx = inv(x) n==-2 && return rx*rx #keep compatability with literal_pow @@ -1047,7 +1048,6 @@ end x = rx n = -n end - n == 3 && return x*x*x # keep compatibility with literal_pow while n > 1 if n&1 > 0 err = muladd(y, xnlo, x*ynlo) @@ -1064,8 +1064,9 @@ end end function ^(x::Float32, n::Integer) - n < 0 && return inv(x)^(-n) + n == -2 && return (i=inv(x); i*i) n == 3 && return x*x*x #keep compatibility with literal_pow + n < 0 && return Float32(Base.power_by_squaring(inv(Float64(x)),-n)) Float32(Base.power_by_squaring(Float64(x),n)) end @inline ^(x::Float16, y::Integer) = Float16(Float32(x) ^ y) diff --git a/doc/src/manual/complex-and-rational-numbers.md b/doc/src/manual/complex-and-rational-numbers.md index 94ad70982bbae..ac48e5b420f5e 100644 --- a/doc/src/manual/complex-and-rational-numbers.md +++ b/doc/src/manual/complex-and-rational-numbers.md @@ -36,7 +36,7 @@ julia> (-1 + 2im)^2 -3 - 4im julia> (-1 + 2im)^2.5 -2.7296244647840084 - 6.960664459571898im +2.729624464784009 - 6.9606644595719im julia> (-1 + 2im)^(1 + 1im) -0.27910381075826657 + 0.08708053414102428im diff --git a/test/math.jl b/test/math.jl index 22bb026ceed0c..e93ad225d3111 100644 --- a/test/math.jl +++ b/test/math.jl @@ -155,12 +155,6 @@ end @test x^y === T(big(x)^big(y)) @test x^1 === x @test x^yi === T(big(x)^yi) - # test (-x)^y for y larger than typemax(Int) - @test T(-1)^floatmax(T) === T(1) - @test prevfloat(T(-1))^floatmax(T) === T(Inf) - @test nextfloat(T(-1))^floatmax(T) === T(0.0) - # test for large negative exponent where error compensation matters - @test 0.9999999955206014^-1.0e8 == 1.565084574870928 @test (-x)^yi == x^yi @test (-x)^(yi+1) == -(x^(yi+1)) @test acos(x) ≈ acos(big(x)) @@ -1323,6 +1317,30 @@ end end end +@testset "pow" begin + for T in (Float16, Float32, Float64) + for x in (0.0, -0.0, 1.0, 10.0, 2.0, Inf, NaN, -Inf, -NaN) + for y in (0.0, -0.0, 1.0, -3.0,-10.0 , Inf, NaN, -Inf, -NaN) + got, expected = T(x)^T(y), T(big(x))^T(y) + @test isnan_type(T, got) && isnan_type(T, expected) || (got === expected) + end + end + for _ in 1:2^16 + x=rand(T)*100; y=rand(T)*200-100 + got, expected = x^y, widen(x)^y + if isfinite(eps(T(expected))) + @test abs(expected-got) <= 1.3*eps(T(expected)) || (x,y) + end + end + # test (-x)^y for y larger than typemax(Int) + @test T(-1)^floatmax(T) === T(1) + @test prevfloat(T(-1))^floatmax(T) === T(Inf) + @test nextfloat(T(-1))^floatmax(T) === T(0.0) + end + # test for large negative exponent where error compensation matters + @test 0.9999999955206014^-1.0e8 == 1.565084574870928 +end + # Test that sqrt behaves correctly and doesn't exhibit fp80 double rounding. # This happened on old glibc versions. # Test case from https://sourceware.org/bugzilla/show_bug.cgi?id=14032. From 9b0333f804bd0ea948b72b1f19354f35f704f858 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Fri, 11 Mar 2022 12:10:29 -0500 Subject: [PATCH 067/369] [LLVM/ABI] Don't pass null pointer to byVal attribute (#44555) (cherry picked from commit f5d15571b3f1745f7783509e336c4d9f7246cdd9) --- src/abi_x86_64.cpp | 1 - src/ccall.cpp | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/abi_x86_64.cpp b/src/abi_x86_64.cpp index 2a06ee6be36a6..43e539b8386ce 100644 --- a/src/abi_x86_64.cpp +++ b/src/abi_x86_64.cpp @@ -202,7 +202,6 @@ bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab, LLVMContext &ctx, Type *T else if (jl_is_structtype(dt)) { // spill to memory even though we would ordinarily pass // it in registers - Type* Ty = preferred_llvm_type(dt, false, ctx); ab.addByValAttr(Ty); return true; } diff --git a/src/ccall.cpp b/src/ccall.cpp index 1fc6e5d4d3ece..17f75dfefbc2e 100644 --- a/src/ccall.cpp +++ b/src/ccall.cpp @@ -1089,6 +1089,7 @@ std::string generate_func_sig(const char *fname) } // Whether or not LLVM wants us to emit a pointer to the data + assert(t && "LLVM type should not be null"); bool byRef = abi->needPassByRef((jl_datatype_t*)tti, ab, lrt->getContext(), t); if (jl_is_cpointer_type(tti)) { From b2252f449dd90a4fc63e6237c01fcaf3147839a8 Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Sat, 12 Mar 2022 20:02:00 +0100 Subject: [PATCH 068/369] extend the API for `LazyString` a bit (#44581) (cherry picked from commit e6c1525450fa27c4025094144b742011bb9cbb7e) --- base/strings/lazy.jl | 3 +++ test/strings/basic.jl | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/base/strings/lazy.jl b/base/strings/lazy.jl index b40fd9a5842b3..a2f872c40660e 100644 --- a/base/strings/lazy.jl +++ b/base/strings/lazy.jl @@ -61,3 +61,6 @@ iterate(s::LazyString, i::Integer) = iterate(String(s), i) isequal(a::LazyString, b::LazyString) = isequal(String(a), String(b)) ==(a::LazyString, b::LazyString) = (String(a) == String(b)) ncodeunits(s::LazyString) = ncodeunits(String(s)) +codeunit(s::LazyString) = codeunit(String(s)) +codeunit(s::LazyString, i::Integer) = codeunit(String(s), i) +isvalid(s::LazyString, i::Integer) = isvalid(String(s), i) diff --git a/test/strings/basic.jl b/test/strings/basic.jl index c1df87420d7da..b20c18e636db7 100644 --- a/test/strings/basic.jl +++ b/test/strings/basic.jl @@ -1100,4 +1100,8 @@ end let d = Dict(lazy"$(1+2) is 3" => 3) @test d["3 is 3"] == 3 end + l = lazy"1+2" + @test codeunit(l) == UInt8 + @test codeunit(l,2) == 0x2b + @test isvalid(l, 1) end From 20d32f5bf65dc7811fcb58bfe1257ca932414a1c Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Sat, 12 Mar 2022 19:09:16 -0500 Subject: [PATCH 069/369] inference: refine PartialStruct lattice tmerge (#44404) * inference: fix tmerge lattice over issimpleenoughtype Previously we assumed only union type could have complexity that violated the tmerge lattice requirements, but other types can have that too. This lets us fix an issue with the PartialStruct comparison failing for undefined fields, mentioned in #43784. * inference: refine PartialStruct lattice tmerge Be more aggressive about merging fields to greatly accelerate convergence, but also compute anyrefine more correctly as we do now elsewhere (since #42831, a121721f975fc4105ed24ebd0ad1020d08d07a38) Move the tmeet algorithm, without changes, since it is a precise lattice operation, not a heuristic limit like tmerge. Close #43784 (cherry picked from commit ff88fa446f44b8bcde15cea8c29549a6fff65375) --- base/compiler/typelattice.jl | 86 ++++++++++++++++++++++- base/compiler/typelimits.jl | 132 +++++++++++++++++++++-------------- test/compiler/inference.jl | 28 ++++++-- 3 files changed, 189 insertions(+), 57 deletions(-) diff --git a/base/compiler/typelattice.jl b/base/compiler/typelattice.jl index 1f55ceb94a062..eda1850604306 100644 --- a/base/compiler/typelattice.jl +++ b/base/compiler/typelattice.jl @@ -200,7 +200,7 @@ The non-strict partial order over the type inference lattice. end for i in 1:nfields(a.val) # XXX: let's handle varargs later - isdefined(a.val, i) || return false + isdefined(a.val, i) || continue # since ∀ T Union{} ⊑ T ⊑(Const(getfield(a.val, i)), b.fields[i]) || return false end return true @@ -289,6 +289,48 @@ function is_lattice_equal(@nospecialize(a), @nospecialize(b)) return a ⊑ b && b ⊑ a end +# compute typeintersect over the extended inference lattice, +# as precisely as we can, +# where v is in the extended lattice, and t is a Type. +function tmeet(@nospecialize(v), @nospecialize(t)) + if isa(v, Const) + if !has_free_typevars(t) && !isa(v.val, t) + return Bottom + end + return v + elseif isa(v, PartialStruct) + has_free_typevars(t) && return v + widev = widenconst(v) + if widev <: t + return v + end + ti = typeintersect(widev, t) + valid_as_lattice(ti) || return Bottom + @assert widev <: Tuple + new_fields = Vector{Any}(undef, length(v.fields)) + for i = 1:length(new_fields) + vfi = v.fields[i] + if isvarargtype(vfi) + new_fields[i] = vfi + else + new_fields[i] = tmeet(vfi, widenconst(getfield_tfunc(t, Const(i)))) + if new_fields[i] === Bottom + return Bottom + end + end + end + return tuple_tfunc(new_fields) + elseif isa(v, Conditional) + if !(Bool <: t) + return Bottom + end + return v + end + ti = typeintersect(widenconst(v), t) + valid_as_lattice(ti) || return Bottom + return ti +end + widenconst(c::AnyConditional) = Bool widenconst((; val)::Const) = isa(val, Type) ? Type{val} : typeof(val) widenconst(m::MaybeUndef) = widenconst(m.typ) @@ -425,3 +467,45 @@ function stupdate1!(state::VarTable, change::StateUpdate) end return false end + +# compute typeintersect over the extended inference lattice, +# as precisely as we can, +# where v is in the extended lattice, and t is a Type. +function tmeet(@nospecialize(v), @nospecialize(t)) + if isa(v, Const) + if !has_free_typevars(t) && !isa(v.val, t) + return Bottom + end + return v + elseif isa(v, PartialStruct) + has_free_typevars(t) && return v + widev = widenconst(v) + if widev <: t + return v + end + ti = typeintersect(widev, t) + valid_as_lattice(ti) || return Bottom + @assert widev <: Tuple + new_fields = Vector{Any}(undef, length(v.fields)) + for i = 1:length(new_fields) + vfi = v.fields[i] + if isvarargtype(vfi) + new_fields[i] = vfi + else + new_fields[i] = tmeet(vfi, widenconst(getfield_tfunc(t, Const(i)))) + if new_fields[i] === Bottom + return Bottom + end + end + end + return tuple_tfunc(new_fields) + elseif isa(v, Conditional) + if !(Bool <: t) + return Bottom + end + return v + end + ti = typeintersect(widenconst(v), t) + valid_as_lattice(ti) || return Bottom + return ti +end diff --git a/base/compiler/typelimits.jl b/base/compiler/typelimits.jl index a7989777317c3..d25c77deb6d2e 100644 --- a/base/compiler/typelimits.jl +++ b/base/compiler/typelimits.jl @@ -298,11 +298,57 @@ union_count_abstract(x::Union) = union_count_abstract(x.a) + union_count_abstrac union_count_abstract(@nospecialize(x)) = !isdispatchelem(x) function issimpleenoughtype(@nospecialize t) - t = ignorelimited(t) return unionlen(t) + union_count_abstract(t) <= MAX_TYPEUNION_LENGTH && unioncomplexity(t) <= MAX_TYPEUNION_COMPLEXITY end +# A simplified type_more_complex query over the extended lattice +# (assumes typeb ⊑ typea) +function issimplertype(@nospecialize(typea), @nospecialize(typeb)) + typea = ignorelimited(typea) + typeb = ignorelimited(typeb) + typea isa MaybeUndef && (typea = typea.typ) # n.b. does not appear in inference + typeb isa MaybeUndef && (typeb = typeb.typ) # n.b. does not appear in inference + typea === typeb && return true + if typea isa PartialStruct + aty = widenconst(typea) + for i = 1:length(typea.fields) + ai = typea.fields[i] + bi = fieldtype(aty, i) + is_lattice_equal(ai, bi) && continue + tni = _typename(widenconst(ai)) + if tni isa Const + bi = (tni.val::Core.TypeName).wrapper + is_lattice_equal(ai, bi) && continue + end + bi = getfield_tfunc(typeb, Const(i)) + is_lattice_equal(ai, bi) && continue + # It is not enough for ai to be simpler than bi: it must exactly equal + # (for this, an invariant struct field, by contrast to + # type_more_complex above which handles covariant tuples). + return false + end + elseif typea isa Type + return issimpleenoughtype(typea) + # elseif typea isa Const # fall-through good + elseif typea isa Conditional # follow issubconditional query + typeb isa Const && return true + typeb isa Conditional || return false + is_same_conditionals(typea, typeb) || return false + issimplertype(typea.vtype, typeb.vtype) || return false + issimplertype(typea.elsetype, typeb.elsetype) || return false + elseif typea isa InterConditional # ibid + typeb isa Const && return true + typeb isa InterConditional || return false + is_same_conditionals(typea, typeb) || return false + issimplertype(typea.vtype, typeb.vtype) || return false + issimplertype(typea.elsetype, typeb.elsetype) || return false + elseif typea isa PartialOpaque + # TODO + end + return true +end + # pick a wider type that contains both typea and typeb, # with some limits on how "large" it can get, # but without losing too much precision in common cases @@ -310,11 +356,13 @@ end function tmerge(@nospecialize(typea), @nospecialize(typeb)) typea === Union{} && return typeb typeb === Union{} && return typea + typea === typeb && return typea + suba = typea ⊑ typeb - suba && issimpleenoughtype(typeb) && return typeb + suba && issimplertype(typeb, typea) && return typeb subb = typeb ⊑ typea suba && subb && return typea - subb && issimpleenoughtype(typea) && return typea + subb && issimplertype(typea, typeb) && return typea # type-lattice for LimitedAccuracy wrapper # the merge create a slightly narrower type than needed, but we can't @@ -404,6 +452,7 @@ function tmerge(@nospecialize(typea), @nospecialize(typeb)) aty = widenconst(typea) bty = widenconst(typeb) if aty === bty + # must have egal here, since we do not create PartialStruct for non-concrete types typea_nfields = nfields_tfunc(typea) typeb_nfields = nfields_tfunc(typeb) isa(typea_nfields, Const) || return aty @@ -412,18 +461,40 @@ function tmerge(@nospecialize(typea), @nospecialize(typeb)) type_nfields === typeb_nfields.val::Int || return aty type_nfields == 0 && return aty fields = Vector{Any}(undef, type_nfields) - anyconst = false + anyrefine = false for i = 1:type_nfields ai = getfield_tfunc(typea, Const(i)) bi = getfield_tfunc(typeb, Const(i)) - ity = tmerge(ai, bi) - if ai === Union{} || bi === Union{} - ity = widenconst(ity) + ft = fieldtype(aty, i) + if is_lattice_equal(ai, bi) || is_lattice_equal(ai, ft) + # Since ai===bi, the given type has no restrictions on complexity. + # and can be used to refine ft + tyi = ai + elseif is_lattice_equal(bi, ft) + tyi = bi + else + # Otherwise choose between using the fieldtype or some other simple merged type. + # The wrapper type never has restrictions on complexity, + # so try to use that to refine the estimated type too. + tni = _typename(widenconst(ai)) + if tni isa Const && tni === _typename(widenconst(bi)) + # A tmeet call may cause tyi to become complex, but since the inputs were + # strictly limited to being egal, this has no restrictions on complexity. + # (Otherwise, we would need to use <: and take the narrower one without + # intersection. See the similar comment in abstract_call_method.) + tyi = typeintersect(ft, (tni.val::Core.TypeName).wrapper) + else + # Since aty===bty, the fieldtype has no restrictions on complexity. + tyi = ft + end + end + fields[i] = tyi + if !anyrefine + anyrefine = has_nontrivial_const_info(tyi) || # constant information + tyi ⋤ ft # just a type-level information, but more precise than the declared type end - fields[i] = ity - anyconst |= has_nontrivial_const_info(ity) end - return anyconst ? PartialStruct(aty, fields) : aty + return anyrefine ? PartialStruct(aty, fields) : aty end end if isa(typea, PartialOpaque) && isa(typeb, PartialOpaque) && widenconst(typea) == widenconst(typeb) @@ -610,44 +681,3 @@ function tuplemerge(a::DataType, b::DataType) end return Tuple{p...} end - -# compute typeintersect over the extended inference lattice -# where v is in the extended lattice, and t is a Type -function tmeet(@nospecialize(v), @nospecialize(t)) - if isa(v, Const) - if !has_free_typevars(t) && !isa(v.val, t) - return Bottom - end - return v - elseif isa(v, PartialStruct) - has_free_typevars(t) && return v - widev = widenconst(v) - if widev <: t - return v - end - ti = typeintersect(widev, t) - valid_as_lattice(ti) || return Bottom - @assert widev <: Tuple - new_fields = Vector{Any}(undef, length(v.fields)) - for i = 1:length(new_fields) - vfi = v.fields[i] - if isvarargtype(vfi) - new_fields[i] = vfi - else - new_fields[i] = tmeet(vfi, widenconst(getfield_tfunc(t, Const(i)))) - if new_fields[i] === Bottom - return Bottom - end - end - end - return tuple_tfunc(new_fields) - elseif isa(v, Conditional) - if !(Bool <: t) - return Bottom - end - return v - end - ti = typeintersect(widenconst(v), t) - valid_as_lattice(ti) || return Bottom - return ti -end diff --git a/test/compiler/inference.jl b/test/compiler/inference.jl index 61058f9589f52..218e484b2beca 100644 --- a/test/compiler/inference.jl +++ b/test/compiler/inference.jl @@ -3999,15 +3999,33 @@ end @test ⊑(a, c) @test ⊑(b, c) - @test @eval Module() begin - const ginit = Base.ImmutableDict{Any,Any}() - Base.return_types() do - g = ginit + init = Base.ImmutableDict{Number,Number}() + a = Const(init) + b = Core.PartialStruct(typeof(init), Any[Const(init), Any, ComplexF64]) + c = Core.Compiler.tmerge(a, b) + @test ⊑(a, c) && ⊑(b, c) + @test c === typeof(init) + + a = Core.PartialStruct(typeof(init), Any[Const(init), ComplexF64, ComplexF64]) + c = Core.Compiler.tmerge(a, b) + @test ⊑(a, c) && ⊑(b, c) + @test c.fields[2] === Any # or Number + @test c.fields[3] === ComplexF64 + + b = Core.PartialStruct(typeof(init), Any[Const(init), ComplexF32, Union{ComplexF32,ComplexF64}]) + c = Core.Compiler.tmerge(a, b) + @test ⊑(a, c) + @test ⊑(b, c) + @test c.fields[2] === Complex + @test c.fields[3] === Complex + + global const ginit43784 = Base.ImmutableDict{Any,Any}() + @test Base.return_types() do + g = ginit43784 while true g = Base.ImmutableDict(g, 1=>2) end end |> only === Union{} - end end # Test that purity modeling doesn't accidentally introduce new world age issues From 0e58e8b56e097320ed47f210db1dd8033a8566cc Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki Date: Mon, 14 Mar 2022 15:44:37 +0900 Subject: [PATCH 070/369] take in changes of #44608 and #44609 --- NEWS.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 4783338b4b525..73ca691ab7c3f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -13,7 +13,7 @@ New language features no errors were thrown ([#42211]). * `@inline` and `@noinline` annotations can now be placed within a function body ([#41312]). * `@inline` and `@noinline` annotations can now be applied to a function call site or block - to enforce the involved function calls to be (or not to be) inlined ([#41312]). + to enforce the involved function calls to be (or not to be) inlined ([#41328]). * `∀`, `∃`, and `∄` are now allowed as identifier characters ([#42314]). * Support for Unicode 14.0.0 ([#43443]). * `Module(:name, false, false)` can be used to create a `module` that contains no names @@ -237,7 +237,7 @@ Tooling Improvements * `GC.enable_logging(true)` can be used to log each garbage collection, with the time it took and the amount of memory that was collected ([#43511]). - + [Pkg#2284]: https://github.com/JuliaLang/Pkg.jl/issues/2284 [Pkg#2689]: https://github.com/JuliaLang/Pkg.jl/issues/2689 @@ -263,6 +263,7 @@ Tooling Improvements [#40980]: https://github.com/JuliaLang/julia/issues/40980 [#41085]: https://github.com/JuliaLang/julia/issues/41085 [#41312]: https://github.com/JuliaLang/julia/issues/41312 +[#41328]: https://github.com/JuliaLang/julia/issues/41328 [#41449]: https://github.com/JuliaLang/julia/issues/41449 [#41551]: https://github.com/JuliaLang/julia/issues/41551 [#41576]: https://github.com/JuliaLang/julia/issues/41576 From c790036ad2328543d9f63218320908bfe6159694 Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Thu, 3 Mar 2022 23:18:11 -0500 Subject: [PATCH 071/369] fix error msg test on 32-bit (#44441) (cherry picked from commit 8c4ff5540423a9dd088e4366054a3c83a6f36353) --- test/error.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/error.jl b/test/error.jl index 9b87cb6fff185..913d303496e3e 100644 --- a/test/error.jl +++ b/test/error.jl @@ -93,6 +93,6 @@ end f44319(1) catch e s = sprint(showerror, e) - @test s == "MethodError: no method matching f44319(::Int64)\nClosest candidates are:\n f44319() at none:0" + @test s == "MethodError: no method matching f44319(::Int$(Sys.WORD_SIZE))\nClosest candidates are:\n f44319() at none:0" end end From 510b53f404d23d930b27af85eccfdcba4c49863d Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Tue, 15 Mar 2022 11:04:35 +0900 Subject: [PATCH 072/369] effects: complements #43852, implement effect override mechanisms (#44561) The PR #43852 missed to implement the mechanism to override analyzed effects with effect settings annotated by `Base.@assume_effects`. This commits adds such an mechanism within `finish(::InferenceState, ::AbstractInterpreter)`, just after inference analyzed frame effect. Now we can do something like: ```julia Base.@assume_effects :consistent :effect_free :terminates_globally consteval( f, args...; kwargs...) = f(args...; kwargs...) const ___CONST_DICT___ = Dict{Any,Any}(:a => 1, :b => 2) @test fully_eliminated() do consteval(getindex, ___CONST_DICT___, :a) end ``` --- base/compiler/abstractinterpretation.jl | 17 +++---- base/compiler/inferencestate.jl | 15 +++++++ base/compiler/typeinfer.jl | 28 ++++++++---- base/compiler/types.jl | 60 ++++++++++++++++++------- test/compiler/inline.jl | 7 +++ 5 files changed, 91 insertions(+), 36 deletions(-) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index 14f37ff87c464..770fa51b47966 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -598,10 +598,12 @@ function abstract_call_method(interp::AbstractInterpreter, method::Method, @nosp if edge === nothing edgecycle = edgelimited = true end - if is_effect_overrided(sv, :terminates_globally) + # we look for the termination effect override here as well, since the :terminates effect + # may have been tainted due to recursion at this point even if it's overridden + if is_effect_overridden(sv, :terminates_globally) # this frame is known to terminate edge_effects = Effects(edge_effects, terminates=ALWAYS_TRUE) - elseif is_effect_overrided(method, :terminates_globally) + elseif is_effect_overridden(method, :terminates_globally) # this edge is known to terminate edge_effects = Effects(edge_effects, terminates=ALWAYS_TRUE) elseif edgecycle @@ -612,13 +614,6 @@ function abstract_call_method(interp::AbstractInterpreter, method::Method, @nosp return MethodCallResult(rt, edgecycle, edgelimited, edge, edge_effects) end -is_effect_overrided(sv::InferenceState, effect::Symbol) = is_effect_overrided(sv.linfo, effect) -function is_effect_overrided(linfo::MethodInstance, effect::Symbol) - def = linfo.def - return isa(def, Method) && is_effect_overrided(def, effect) -end -is_effect_overrided(method::Method, effect::Symbol) = getfield(decode_effects_override(method.purity), effect) - # keeps result and context information of abstract method call, will be used by succeeding constant-propagation struct MethodCallResult rt @@ -2093,9 +2088,9 @@ end function handle_control_backedge!(frame::InferenceState, from::Int, to::Int) if from > to - if is_effect_overrided(frame, :terminates_globally) + if is_effect_overridden(frame, :terminates_globally) # this frame is known to terminate - elseif is_effect_overrided(frame, :terminates_locally) + elseif is_effect_overridden(frame, :terminates_locally) # this backedge is known to terminate else tristate_merge!(frame, Effects(EFFECTS_TOTAL, terminates=TRISTATE_UNKNOWN)) diff --git a/base/compiler/inferencestate.jl b/base/compiler/inferencestate.jl index 928811dd63a3b..12de1b6705aa9 100644 --- a/base/compiler/inferencestate.jl +++ b/base/compiler/inferencestate.jl @@ -141,8 +141,23 @@ mutable struct InferenceState return frame end end + Effects(state::InferenceState) = state.ipo_effects +function tristate_merge!(caller::InferenceState, effects::Effects) + caller.ipo_effects = tristate_merge(caller.ipo_effects, effects) +end +tristate_merge!(caller::InferenceState, callee::InferenceState) = + tristate_merge!(caller, Effects(callee)) + +is_effect_overridden(sv::InferenceState, effect::Symbol) = is_effect_overridden(sv.linfo, effect) +function is_effect_overridden(linfo::MethodInstance, effect::Symbol) + def = linfo.def + return isa(def, Method) && is_effect_overridden(def, effect) +end +is_effect_overridden(method::Method, effect::Symbol) = is_effect_overridden(decode_effects_override(method.purity), effect) +is_effect_overridden(override::EffectsOverride, effect::Symbol) = getfield(override, effect) + function any_inbounds(code::Vector{Any}) for i=1:length(code) stmt = code[i] diff --git a/base/compiler/typeinfer.jl b/base/compiler/typeinfer.jl index 4015b7c00bf0d..a047222cbfee0 100644 --- a/base/compiler/typeinfer.jl +++ b/base/compiler/typeinfer.jl @@ -494,7 +494,25 @@ function finish(me::InferenceState, interp::AbstractInterpreter) end me.result.valid_worlds = me.valid_worlds me.result.result = me.bestguess - me.result.ipo_effects = rt_adjust_effects(me.bestguess, me.ipo_effects) + ipo_effects = rt_adjust_effects(me.bestguess, me.ipo_effects) + # override the analyzed effects using manually annotated effect settings + def = me.linfo.def + if isa(def, Method) + override = decode_effects_override(def.purity) + if is_effect_overridden(override, :consistent) + ipo_effects = Effects(ipo_effects; consistent=ALWAYS_TRUE) + end + if is_effect_overridden(override, :effect_free) + ipo_effects = Effects(ipo_effects; effect_free=ALWAYS_TRUE) + end + if is_effect_overridden(override, :nothrow) + ipo_effects = Effects(ipo_effects; nothrow=ALWAYS_TRUE) + end + if is_effect_overridden(override, :terminates_globally) + ipo_effects = Effects(ipo_effects; terminates=ALWAYS_TRUE) + end + end + me.result.ipo_effects = ipo_effects validate_code_in_debug_mode(me.linfo, me.src, "inferred") nothing end @@ -797,14 +815,6 @@ end generating_sysimg() = ccall(:jl_generating_output, Cint, ()) != 0 && JLOptions().incremental == 0 -function tristate_merge!(caller::InferenceState, callee::Effects) - caller.ipo_effects = tristate_merge(caller.ipo_effects, callee) -end - -function tristate_merge!(caller::InferenceState, callee::InferenceState) - tristate_merge!(caller, Effects(callee)) -end - ipo_effects(code::CodeInstance) = decode_effects(code.ipo_purity_bits) # compute (and cache) an inferred AST and return the current best estimate of the result type diff --git a/base/compiler/types.jl b/base/compiler/types.jl index 6d4a650470237..65ce341dd55e1 100644 --- a/base/compiler/types.jl +++ b/base/compiler/types.jl @@ -42,14 +42,33 @@ struct Effects # :consistent before caching. We may want to track it in the future. inbounds_taints_consistency::Bool end -Effects(consistent::TriState, effect_free::TriState, nothrow::TriState, terminates::TriState) = - Effects(consistent, effect_free, nothrow, terminates, false) +function Effects( + consistent::TriState, + effect_free::TriState, + nothrow::TriState, + terminates::TriState) + return Effects( + consistent, + effect_free, + nothrow, + terminates, + false) +end Effects() = Effects(TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, TRISTATE_UNKNOWN) -Effects(e::Effects; consistent::TriState=e.consistent, - effect_free::TriState = e.effect_free, nothrow::TriState=e.nothrow, terminates::TriState=e.terminates, - inbounds_taints_consistency::Bool = e.inbounds_taints_consistency) = - Effects(consistent, effect_free, nothrow, terminates, inbounds_taints_consistency) +function Effects(e::Effects; + consistent::TriState = e.consistent, + effect_free::TriState = e.effect_free, + nothrow::TriState = e.nothrow, + terminates::TriState = e.terminates, + inbounds_taints_consistency::Bool = e.inbounds_taints_consistency) + return Effects( + consistent, + effect_free, + nothrow, + terminates, + inbounds_taints_consistency) +end is_total_or_error(effects::Effects) = effects.consistent === ALWAYS_TRUE && effects.effect_free === ALWAYS_TRUE && @@ -65,15 +84,24 @@ is_removable_if_unused(effects::Effects) = const EFFECTS_TOTAL = Effects(ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE) -encode_effects(e::Effects) = e.consistent.state | (e.effect_free.state << 2) | (e.nothrow.state << 4) | (e.terminates.state << 6) -decode_effects(e::UInt8) = - Effects(TriState(e & 0x3), +function encode_effects(e::Effects) + return e.consistent.state | + (e.effect_free.state << 2) | + (e.nothrow.state << 4) | + (e.terminates.state << 6) +end +function decode_effects(e::UInt8) + return Effects( + TriState(e & 0x3), TriState((e >> 2) & 0x3), TriState((e >> 4) & 0x3), - TriState((e >> 6) & 0x3), false) + TriState((e >> 6) & 0x3), + false) +end function tristate_merge(old::Effects, new::Effects) - Effects(tristate_merge( + return Effects( + tristate_merge( old.consistent, new.consistent), tristate_merge( old.effect_free, new.effect_free), @@ -81,8 +109,7 @@ function tristate_merge(old::Effects, new::Effects) old.nothrow, new.nothrow), tristate_merge( old.terminates, new.terminates), - old.inbounds_taints_consistency || - new.inbounds_taints_consistency) + old.inbounds_taints_consistency | new.inbounds_taints_consistency) end struct EffectsOverride @@ -100,16 +127,17 @@ function encode_effects_override(eo::EffectsOverride) eo.nothrow && (e |= 0x04) eo.terminates_globally && (e |= 0x08) eo.terminates_locally && (e |= 0x10) - e + return e end -decode_effects_override(e::UInt8) = - EffectsOverride( +function decode_effects_override(e::UInt8) + return EffectsOverride( (e & 0x01) != 0x00, (e & 0x02) != 0x00, (e & 0x04) != 0x00, (e & 0x08) != 0x00, (e & 0x10) != 0x00) +end """ InferenceResult diff --git a/test/compiler/inline.jl b/test/compiler/inline.jl index 3259c752d9aa0..1af52422b2f71 100644 --- a/test/compiler/inline.jl +++ b/test/compiler/inline.jl @@ -1088,6 +1088,13 @@ recur_termination22(x) = x * recur_termination21(x-1) recur_termination21(12) + recur_termination22(12) end +const ___CONST_DICT___ = Dict{Any,Any}(:a => 1, :b => 2) +Base.@assume_effects :consistent :effect_free :terminates_globally consteval( + f, args...; kwargs...) = f(args...; kwargs...) +@test fully_eliminated() do + consteval(getindex, ___CONST_DICT___, :a) +end + global x44200::Int = 0 function f44200() global x = 0 From e1e02f6a89f931e996944b31c333ce14e33858a2 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Tue, 15 Mar 2022 18:26:33 +0900 Subject: [PATCH 073/369] Merge pull request #44515 from JuliaLang/avi/partialeval `AbstractInterpreter`: enable selective concrete-evaluation for external `AbstractInterpreter` with overlayed method table --- base/compiler/abstractinterpretation.jl | 120 +++++++++++++++--------- base/compiler/inferencestate.jl | 2 +- base/compiler/methodtable.jl | 60 +++++++----- base/compiler/ssair/show.jl | 1 + base/compiler/tfuncs.jl | 12 ++- base/compiler/typeinfer.jl | 6 +- base/compiler/types.jl | 36 ++++--- base/reflection.jl | 5 +- test/compiler/AbstractInterpreter.jl | 54 ++++++++--- 9 files changed, 192 insertions(+), 104 deletions(-) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index 770fa51b47966..2efb660a32fb5 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -39,15 +39,31 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), # function has not seen any side effects, we would like to make sure there # aren't any in the throw block either to enable other optimizations. add_remark!(interp, sv, "Skipped call in throw block") + overlayed = true + if isoverlayed(method_table(interp)) + if !sv.ipo_effects.overlayed + # as we may want to concrete-evaluate this frame in cases when there are + # no overlayed calls, try an additional effort now to check if this call + # isn't overlayed rather than just handling it conservatively + matches = find_matching_methods(arginfo.argtypes, atype, method_table(interp), + InferenceParams(interp).MAX_UNION_SPLITTING, max_methods) + if !isa(matches, FailedMethodMatch) + overlayed = matches.overlayed + end + end + else + overlayed = false + end # At this point we are guaranteed to end up throwing on this path, # which is all that's required for :consistent-cy. Of course, we don't # know anything else about this statement. - tristate_merge!(sv, Effects(Effects(), consistent=ALWAYS_TRUE)) + tristate_merge!(sv, Effects(; consistent=ALWAYS_TRUE, overlayed)) return CallMeta(Any, false) end argtypes = arginfo.argtypes - matches = find_matching_methods(argtypes, atype, method_table(interp), InferenceParams(interp).MAX_UNION_SPLITTING, max_methods) + matches = find_matching_methods(argtypes, atype, method_table(interp), + InferenceParams(interp).MAX_UNION_SPLITTING, max_methods) if isa(matches, FailedMethodMatch) add_remark!(interp, sv, matches.reason) tristate_merge!(sv, Effects()) @@ -64,6 +80,12 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), any_const_result = false const_results = Union{InferenceResult,Nothing,ConstResult}[] multiple_matches = napplicable > 1 + if matches.overlayed + # currently we don't have a good way to execute the overlayed method definition, + # so we should give up pure/concrete eval when any of the matched methods is overlayed + f = nothing + tristate_merge!(sv, Effects(EFFECTS_TOTAL; overlayed=true)) + end val = pure_eval_call(interp, f, applicable, arginfo, sv) val !== nothing && return CallMeta(val, MethodResultPure(info)) # TODO: add some sort of edge(s) @@ -94,7 +116,8 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), end this_argtypes = isa(matches, MethodMatches) ? argtypes : matches.applicable_argtypes[i] this_arginfo = ArgInfo(fargs, this_argtypes) - const_call_result = abstract_call_method_with_const_args(interp, result, f, this_arginfo, match, sv) + const_call_result = abstract_call_method_with_const_args(interp, result, + f, this_arginfo, match, sv) effects = result.edge_effects const_result = nothing if const_call_result !== nothing @@ -136,7 +159,8 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), # this is in preparation for inlining, or improving the return result this_argtypes = isa(matches, MethodMatches) ? argtypes : matches.applicable_argtypes[i] this_arginfo = ArgInfo(fargs, this_argtypes) - const_call_result = abstract_call_method_with_const_args(interp, result, f, this_arginfo, match, sv) + const_call_result = abstract_call_method_with_const_args(interp, result, + f, this_arginfo, match, sv) effects = result.edge_effects const_result = nothing if const_call_result !== nothing @@ -181,11 +205,11 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), end if seen != napplicable - tristate_merge!(sv, Effects()) + tristate_merge!(sv, Effects(; overlayed=false)) # already accounted for method overlay above elseif isa(matches, MethodMatches) ? (!matches.fullmatch || any_ambig(matches)) : (!_all(b->b, matches.fullmatches) || any_ambig(matches)) # Account for the fact that we may encounter a MethodError with a non-covered or ambiguous signature. - tristate_merge!(sv, Effects(EFFECTS_TOTAL, nothrow=TRISTATE_UNKNOWN)) + tristate_merge!(sv, Effects(EFFECTS_TOTAL; nothrow=TRISTATE_UNKNOWN)) end rettype = from_interprocedural!(rettype, sv, arginfo, conditionals) @@ -220,6 +244,7 @@ struct MethodMatches valid_worlds::WorldRange mt::Core.MethodTable fullmatch::Bool + overlayed::Bool end any_ambig(info::MethodMatchInfo) = info.results.ambig any_ambig(m::MethodMatches) = any_ambig(m.info) @@ -231,6 +256,7 @@ struct UnionSplitMethodMatches valid_worlds::WorldRange mts::Vector{Core.MethodTable} fullmatches::Vector{Bool} + overlayed::Bool end any_ambig(m::UnionSplitMethodMatches) = _any(any_ambig, m.info.matches) @@ -245,16 +271,19 @@ function find_matching_methods(argtypes::Vector{Any}, @nospecialize(atype), meth valid_worlds = WorldRange() mts = Core.MethodTable[] fullmatches = Bool[] + overlayed = false for i in 1:length(split_argtypes) arg_n = split_argtypes[i]::Vector{Any} sig_n = argtypes_to_type(arg_n) mt = ccall(:jl_method_table_for, Any, (Any,), sig_n) mt === nothing && return FailedMethodMatch("Could not identify method table for call") mt = mt::Core.MethodTable - matches = findall(sig_n, method_table; limit = max_methods) - if matches === missing + result = findall(sig_n, method_table; limit = max_methods) + if result === missing return FailedMethodMatch("For one of the union split cases, too many methods matched") end + matches, overlayedᵢ = result + overlayed |= overlayedᵢ push!(infos, MethodMatchInfo(matches)) for m in matches push!(applicable, m) @@ -280,25 +309,28 @@ function find_matching_methods(argtypes::Vector{Any}, @nospecialize(atype), meth UnionSplitInfo(infos), valid_worlds, mts, - fullmatches) + fullmatches, + overlayed) else mt = ccall(:jl_method_table_for, Any, (Any,), atype) if mt === nothing return FailedMethodMatch("Could not identify method table for call") end mt = mt::Core.MethodTable - matches = findall(atype, method_table; limit = max_methods) - if matches === missing + result = findall(atype, method_table; limit = max_methods) + if result === missing # this means too many methods matched # (assume this will always be true, so we don't compute / update valid age in this case) return FailedMethodMatch("Too many methods matched") end + matches, overlayed = result fullmatch = _any(match->(match::MethodMatch).fully_covers, matches) return MethodMatches(matches.matches, MethodMatchInfo(matches), matches.valid_worlds, mt, - fullmatch) + fullmatch, + overlayed) end end @@ -605,11 +637,11 @@ function abstract_call_method(interp::AbstractInterpreter, method::Method, @nosp edge_effects = Effects(edge_effects, terminates=ALWAYS_TRUE) elseif is_effect_overridden(method, :terminates_globally) # this edge is known to terminate - edge_effects = Effects(edge_effects, terminates=ALWAYS_TRUE) + edge_effects = Effects(edge_effects; terminates=ALWAYS_TRUE) elseif edgecycle # Some sort of recursion was detected. Even if we did not limit types, # we cannot guarantee that the call will terminate - edge_effects = Effects(edge_effects, terminates=TRISTATE_UNKNOWN) + edge_effects = Effects(edge_effects; terminates=TRISTATE_UNKNOWN) end return MethodCallResult(rt, edgecycle, edgelimited, edge, edge_effects) end @@ -632,8 +664,8 @@ end function pure_eval_eligible(interp::AbstractInterpreter, @nospecialize(f), applicable::Vector{Any}, arginfo::ArgInfo, sv::InferenceState) - return !isoverlayed(method_table(interp)) && - f !== nothing && + # XXX we need to check that this pure function doesn't call any overlayed method + return f !== nothing && length(applicable) == 1 && is_method_pure(applicable[1]::MethodMatch) && is_all_const_arg(arginfo) @@ -669,8 +701,10 @@ end function concrete_eval_eligible(interp::AbstractInterpreter, @nospecialize(f), result::MethodCallResult, arginfo::ArgInfo, sv::InferenceState) - return !isoverlayed(method_table(interp)) && - f !== nothing && + # disable concrete-evaluation since this function call is tainted by some overlayed + # method and currently there is no direct way to execute overlayed methods + isoverlayed(method_table(interp)) && result.edge_effects.overlayed && return false + return f !== nothing && result.edge !== nothing && is_total_or_error(result.edge_effects) && is_all_const_arg(arginfo) @@ -1469,7 +1503,7 @@ function abstract_invoke(interp::AbstractInterpreter, (; fargs, argtypes)::ArgIn types = rewrap_unionall(Tuple{ft, unwrap_unionall(types).parameters...}, types)::Type nargtype = Tuple{ft, nargtype.parameters...} argtype = Tuple{ft, argtype.parameters...} - match, valid_worlds = findsup(types, method_table(interp)) + match, valid_worlds, overlayed = findsup(types, method_table(interp)) match === nothing && return CallMeta(Any, false) update_valid_age!(sv, valid_worlds) method = match.method @@ -1487,7 +1521,8 @@ function abstract_invoke(interp::AbstractInterpreter, (; fargs, argtypes)::ArgIn # t, a = ti.parameters[i], argtypes′[i] # argtypes′[i] = t ⊑ a ? t : a # end - const_call_result = abstract_call_method_with_const_args(interp, result, singleton_type(ft′), arginfo, match, sv) + const_call_result = abstract_call_method_with_const_args(interp, result, + overlayed ? nothing : singleton_type(ft′), arginfo, match, sv) const_result = nothing if const_call_result !== nothing if const_call_result.rt ⊑ rt @@ -1518,7 +1553,7 @@ function abstract_call_known(interp::AbstractInterpreter, @nospecialize(f), call = abstract_invoke(interp, arginfo, sv) if call.info === false if call.rt === Bottom - tristate_merge!(sv, Effects(EFFECTS_TOTAL, nothrow=ALWAYS_FALSE)) + tristate_merge!(sv, Effects(EFFECTS_TOTAL; nothrow=ALWAYS_FALSE)) else tristate_merge!(sv, Effects()) end @@ -1545,12 +1580,12 @@ function abstract_call_known(interp::AbstractInterpreter, @nospecialize(f), end end end - tristate_merge!(sv, Effects()) # TODO + tristate_merge!(sv, Effects(; overlayed=false)) # TODO return CallMeta(Any, false) elseif f === TypeVar # Manually look through the definition of TypeVar to # make sure to be able to get `PartialTypeVar`s out. - tristate_merge!(sv, Effects()) # TODO + tristate_merge!(sv, Effects(; overlayed=false)) # TODO (la < 2 || la > 4) && return CallMeta(Union{}, false) n = argtypes[2] ub_var = Const(Any) @@ -1563,17 +1598,17 @@ function abstract_call_known(interp::AbstractInterpreter, @nospecialize(f), end return CallMeta(typevar_tfunc(n, lb_var, ub_var), false) elseif f === UnionAll - tristate_merge!(sv, Effects()) # TODO + tristate_merge!(sv, Effects(; overlayed=false)) # TODO return CallMeta(abstract_call_unionall(argtypes), false) elseif f === Tuple && la == 2 - tristate_merge!(sv, Effects()) # TODO + tristate_merge!(sv, Effects(; overlayed=false)) # TODO aty = argtypes[2] ty = isvarargtype(aty) ? unwrapva(aty) : widenconst(aty) if !isconcretetype(ty) return CallMeta(Tuple, false) end elseif is_return_type(f) - tristate_merge!(sv, Effects()) # TODO + tristate_merge!(sv, Effects(; overlayed=false)) # TODO return return_type_tfunc(interp, argtypes, sv) elseif la == 2 && istopfunction(f, :!) # handle Conditional propagation through !Bool @@ -1637,8 +1672,8 @@ function abstract_call_opaque_closure(interp::AbstractInterpreter, closure::Part match = MethodMatch(sig, Core.svec(), closure.source, sig <: rewrap_unionall(sigT, tt)) const_result = nothing if !result.edgecycle - const_call_result = abstract_call_method_with_const_args(interp, result, nothing, - arginfo, match, sv) + const_call_result = abstract_call_method_with_const_args(interp, result, + nothing, arginfo, match, sv) if const_call_result !== nothing if const_call_result.rt ⊑ rt (; rt, const_result) = const_call_result @@ -1825,9 +1860,9 @@ function abstract_eval_statement(interp::AbstractInterpreter, @nospecialize(e), at = tmeet(at, ft) if at === Bottom t = Bottom - tristate_merge!(sv, Effects( - ALWAYS_TRUE, # N.B depends on !ismutabletype(t) above - ALWAYS_TRUE, ALWAYS_FALSE, ALWAYS_TRUE)) + tristate_merge!(sv, Effects(EFFECTS_TOTAL; + # consistent = ALWAYS_TRUE, # N.B depends on !ismutabletype(t) above + nothrow = ALWAYS_FALSE)) @goto t_computed elseif !isa(at, Const) allconst = false @@ -1855,7 +1890,7 @@ function abstract_eval_statement(interp::AbstractInterpreter, @nospecialize(e), else is_nothrow = false end - tristate_merge!(sv, Effects(EFFECTS_TOTAL, + tristate_merge!(sv, Effects(EFFECTS_TOTAL; consistent = !ismutabletype(t) ? ALWAYS_TRUE : ALWAYS_FALSE, nothrow = is_nothrow ? ALWAYS_TRUE : ALWAYS_FALSE)) elseif ehead === :splatnew @@ -1874,7 +1909,7 @@ function abstract_eval_statement(interp::AbstractInterpreter, @nospecialize(e), t = PartialStruct(t, at.fields::Vector{Any}) end end - tristate_merge!(sv, Effects(EFFECTS_TOTAL, + tristate_merge!(sv, Effects(EFFECTS_TOTAL; consistent = ismutabletype(t) ? ALWAYS_FALSE : ALWAYS_TRUE, nothrow = is_nothrow ? ALWAYS_TRUE : ALWAYS_FALSE)) elseif ehead === :new_opaque_closure @@ -1916,20 +1951,21 @@ function abstract_eval_statement(interp::AbstractInterpreter, @nospecialize(e), effects.effect_free ? ALWAYS_TRUE : TRISTATE_UNKNOWN, effects.nothrow ? ALWAYS_TRUE : TRISTATE_UNKNOWN, effects.terminates_globally ? ALWAYS_TRUE : TRISTATE_UNKNOWN, + #=overlayed=#false )) else - tristate_merge!(sv, Effects()) + tristate_merge!(sv, Effects(; overlayed=false)) end elseif ehead === :cfunction - tristate_merge!(sv, Effects()) + tristate_merge!(sv, Effects(; overlayed=false)) t = e.args[1] isa(t, Type) || (t = Any) abstract_eval_cfunction(interp, e, vtypes, sv) elseif ehead === :method - tristate_merge!(sv, Effects()) + tristate_merge!(sv, Effects(; overlayed=false)) t = (length(e.args) == 1) ? Any : Nothing elseif ehead === :copyast - tristate_merge!(sv, Effects()) + tristate_merge!(sv, Effects(; overlayed=false)) t = abstract_eval_value(interp, e.args[1], vtypes, sv) if t isa Const && t.val isa Expr # `copyast` makes copies of Exprs @@ -1999,9 +2035,9 @@ function abstract_eval_global(M::Module, s::Symbol, frame::InferenceState) ty = abstract_eval_global(M, s) isa(ty, Const) && return ty if isdefined(M,s) - tristate_merge!(frame, Effects(EFFECTS_TOTAL, consistent=ALWAYS_FALSE)) + tristate_merge!(frame, Effects(EFFECTS_TOTAL; consistent=ALWAYS_FALSE)) else - tristate_merge!(frame, Effects(EFFECTS_TOTAL, consistent=ALWAYS_FALSE, nothrow=ALWAYS_FALSE)) + tristate_merge!(frame, Effects(EFFECTS_TOTAL; consistent=ALWAYS_FALSE, nothrow=ALWAYS_FALSE)) end return ty end @@ -2093,7 +2129,7 @@ function handle_control_backedge!(frame::InferenceState, from::Int, to::Int) elseif is_effect_overridden(frame, :terminates_locally) # this backedge is known to terminate else - tristate_merge!(frame, Effects(EFFECTS_TOTAL, terminates=TRISTATE_UNKNOWN)) + tristate_merge!(frame, Effects(EFFECTS_TOTAL; terminates=TRISTATE_UNKNOWN)) end end return nothing @@ -2251,11 +2287,11 @@ function typeinf_local(interp::AbstractInterpreter, frame::InferenceState) if isa(lhs, SlotNumber) changes = StateUpdate(lhs, VarState(t, false), changes, false) elseif isa(lhs, GlobalRef) - tristate_merge!(frame, Effects(EFFECTS_TOTAL, + tristate_merge!(frame, Effects(EFFECTS_TOTAL; effect_free=ALWAYS_FALSE, nothrow=TRISTATE_UNKNOWN)) elseif !isa(lhs, SSAValue) - tristate_merge!(frame, Effects()) + tristate_merge!(frame, Effects(; overlayed=false)) end elseif hd === :method stmt = stmt::Expr diff --git a/base/compiler/inferencestate.jl b/base/compiler/inferencestate.jl index 12de1b6705aa9..db6ab574e3859 100644 --- a/base/compiler/inferencestate.jl +++ b/base/compiler/inferencestate.jl @@ -134,7 +134,7 @@ mutable struct InferenceState #=parent=#nothing, #=cached=#cache === :global, #=inferred=#false, #=dont_work_on_me=#false, - #=ipo_effects=#Effects(consistent, ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, inbounds_taints_consistency), + #=ipo_effects=#Effects(consistent, ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, false, inbounds_taints_consistency), interp) result.result = frame cache !== :no && push!(get_inference_cache(interp), result) diff --git a/base/compiler/methodtable.jl b/base/compiler/methodtable.jl index f68cdd52d1b06..da493cf9a9ef5 100644 --- a/base/compiler/methodtable.jl +++ b/base/compiler/methodtable.jl @@ -40,15 +40,18 @@ end getindex(result::MethodLookupResult, idx::Int) = getindex(result.matches, idx)::MethodMatch """ - findall(sig::Type, view::MethodTableView; limit::Int=typemax(Int)) -> MethodLookupResult or missing + findall(sig::Type, view::MethodTableView; limit::Int=typemax(Int)) -> + (matches::MethodLookupResult, overlayed::Bool) or missing -Find all methods in the given method table `view` that are applicable to the -given signature `sig`. If no applicable methods are found, an empty result is -returned. If the number of applicable methods exceeded the specified limit, -`missing` is returned. +Find all methods in the given method table `view` that are applicable to the given signature `sig`. +If no applicable methods are found, an empty result is returned. +If the number of applicable methods exceeded the specified limit, `missing` is returned. +`overlayed` indicates if any matching method is defined in an overlayed method table. """ function findall(@nospecialize(sig::Type), table::InternalMethodTable; limit::Int=Int(typemax(Int32))) - return _findall(sig, nothing, table.world, limit) + result = _findall(sig, nothing, table.world, limit) + result === missing && return missing + return result, false end function findall(@nospecialize(sig::Type), table::OverlayMethodTable; limit::Int=Int(typemax(Int32))) @@ -57,7 +60,7 @@ function findall(@nospecialize(sig::Type), table::OverlayMethodTable; limit::Int nr = length(result) if nr ≥ 1 && result[nr].fully_covers # no need to fall back to the internal method table - return result + return result, true end # fall back to the internal method table fallback_result = _findall(sig, nothing, table.world, limit) @@ -68,7 +71,7 @@ function findall(@nospecialize(sig::Type), table::OverlayMethodTable; limit::Int WorldRange( max(result.valid_worlds.min_world, fallback_result.valid_worlds.min_world), min(result.valid_worlds.max_world, fallback_result.valid_worlds.max_world)), - result.ambig | fallback_result.ambig) + result.ambig | fallback_result.ambig), !isempty(result) end function _findall(@nospecialize(sig::Type), mt::Union{Nothing,Core.MethodTable}, world::UInt, limit::Int) @@ -83,31 +86,38 @@ function _findall(@nospecialize(sig::Type), mt::Union{Nothing,Core.MethodTable}, end """ - findsup(sig::Type, view::MethodTableView) -> Tuple{MethodMatch, WorldRange} or nothing - -Find the (unique) method `m` such that `sig <: m.sig`, while being more -specific than any other method with the same property. In other words, find -the method which is the least upper bound (supremum) under the specificity/subtype -relation of the queried `signature`. If `sig` is concrete, this is equivalent to -asking for the method that will be called given arguments whose types match the -given signature. This query is also used to implement `invoke`. - -Such a method `m` need not exist. It is possible that no method is an -upper bound of `sig`, or it is possible that among the upper bounds, there -is no least element. In both cases `nothing` is returned. + findsup(sig::Type, view::MethodTableView) -> + (match::MethodMatch, valid_worlds::WorldRange, overlayed::Bool) or nothing + +Find the (unique) method such that `sig <: match.method.sig`, while being more +specific than any other method with the same property. In other words, find the method +which is the least upper bound (supremum) under the specificity/subtype relation of +the queried `sig`nature. If `sig` is concrete, this is equivalent to asking for the method +that will be called given arguments whose types match the given signature. +Note that this query is also used to implement `invoke`. + +Such a matching method `match` doesn't necessarily exist. +It is possible that no method is an upper bound of `sig`, or +it is possible that among the upper bounds, there is no least element. +In both cases `nothing` is returned. + +`overlayed` indicates if the matching method is defined in an overlayed method table. """ function findsup(@nospecialize(sig::Type), table::InternalMethodTable) - return _findsup(sig, nothing, table.world) + return (_findsup(sig, nothing, table.world)..., false) end function findsup(@nospecialize(sig::Type), table::OverlayMethodTable) match, valid_worlds = _findsup(sig, table.mt, table.world) - match !== nothing && return match, valid_worlds + match !== nothing && return match, valid_worlds, true # fall back to the internal method table fallback_match, fallback_valid_worlds = _findsup(sig, nothing, table.world) - return fallback_match, WorldRange( - max(valid_worlds.min_world, fallback_valid_worlds.min_world), - min(valid_worlds.max_world, fallback_valid_worlds.max_world)) + return ( + fallback_match, + WorldRange( + max(valid_worlds.min_world, fallback_valid_worlds.min_world), + min(valid_worlds.max_world, fallback_valid_worlds.max_world)), + false) end function _findsup(@nospecialize(sig::Type), mt::Union{Nothing,Core.MethodTable}, world::UInt) diff --git a/base/compiler/ssair/show.jl b/base/compiler/ssair/show.jl index 1e98dda039040..76cbcbd4d5d7d 100644 --- a/base/compiler/ssair/show.jl +++ b/base/compiler/ssair/show.jl @@ -803,6 +803,7 @@ function Base.show(io::IO, e::Core.Compiler.Effects) print(io, ',') printstyled(io, string(tristate_letter(e.terminates), 't'); color=tristate_color(e.terminates)) print(io, ')') + e.overlayed && printstyled(io, '′'; color=:red) end @specialize diff --git a/base/compiler/tfuncs.jl b/base/compiler/tfuncs.jl index 54b89c9a04f43..25f26a20b115a 100644 --- a/base/compiler/tfuncs.jl +++ b/base/compiler/tfuncs.jl @@ -1756,11 +1756,11 @@ function builtin_effects(f::Builtin, argtypes::Vector{Any}, rt) if (f === Core.getfield || f === Core.isdefined) && length(argtypes) >= 3 # consistent if the argtype is immutable if isvarargtype(argtypes[2]) - return Effects(Effects(), effect_free=ALWAYS_TRUE, terminates=ALWAYS_TRUE) + return Effects(; effect_free=ALWAYS_TRUE, terminates=ALWAYS_TRUE, overlayed=false) end s = widenconst(argtypes[2]) if isType(s) || !isa(s, DataType) || isabstracttype(s) - return Effects(Effects(), effect_free=ALWAYS_TRUE, terminates=ALWAYS_TRUE) + return Effects(; effect_free=ALWAYS_TRUE, terminates=ALWAYS_TRUE, overlayed=false) end s = s::DataType ipo_consistent = !ismutabletype(s) @@ -1789,7 +1789,9 @@ function builtin_effects(f::Builtin, argtypes::Vector{Any}, rt) ipo_consistent ? ALWAYS_TRUE : ALWAYS_FALSE, effect_free ? ALWAYS_TRUE : ALWAYS_FALSE, nothrow ? ALWAYS_TRUE : TRISTATE_UNKNOWN, - ALWAYS_TRUE) + #=terminates=#ALWAYS_TRUE, + #=overlayed=#false, + ) end function builtin_nothrow(@nospecialize(f), argtypes::Array{Any, 1}, @nospecialize(rt)) @@ -1970,7 +1972,9 @@ function intrinsic_effects(f::IntrinsicFunction, argtypes::Vector{Any}) ipo_consistent ? ALWAYS_TRUE : ALWAYS_FALSE, effect_free ? ALWAYS_TRUE : ALWAYS_FALSE, nothrow ? ALWAYS_TRUE : TRISTATE_UNKNOWN, - ALWAYS_TRUE) + #=terminates=#ALWAYS_TRUE, + #=overlayed=#false, + ) end # TODO: this function is a very buggy and poor model of the return_type function diff --git a/base/compiler/typeinfer.jl b/base/compiler/typeinfer.jl index a047222cbfee0..1c54345b17de5 100644 --- a/base/compiler/typeinfer.jl +++ b/base/compiler/typeinfer.jl @@ -431,7 +431,7 @@ function rt_adjust_effects(@nospecialize(rt), ipo_effects::Effects) # but we don't currently model idempontency using dataflow, so we don't notice. # Fix that up here to improve precision. if !ipo_effects.inbounds_taints_consistency && rt === Union{} - return Effects(ipo_effects, consistent=ALWAYS_TRUE) + return Effects(ipo_effects; consistent=ALWAYS_TRUE) end return ipo_effects end @@ -755,11 +755,11 @@ function merge_call_chain!(parent::InferenceState, ancestor::InferenceState, chi # and ensure that walking the parent list will get the same result (DAG) from everywhere # Also taint the termination effect, because we can no longer guarantee the absence # of recursion. - tristate_merge!(parent, Effects(EFFECTS_TOTAL, terminates=TRISTATE_UNKNOWN)) + tristate_merge!(parent, Effects(EFFECTS_TOTAL; terminates=TRISTATE_UNKNOWN)) while true add_cycle_backedge!(child, parent, parent.currpc) union_caller_cycle!(ancestor, child) - tristate_merge!(child, Effects(EFFECTS_TOTAL, terminates=TRISTATE_UNKNOWN)) + tristate_merge!(child, Effects(EFFECTS_TOTAL; terminates=TRISTATE_UNKNOWN)) child = parent child === ancestor && break parent = child.parent::InferenceState diff --git a/base/compiler/types.jl b/base/compiler/types.jl index 65ce341dd55e1..282582c016d97 100644 --- a/base/compiler/types.jl +++ b/base/compiler/types.jl @@ -38,6 +38,7 @@ struct Effects effect_free::TriState nothrow::TriState terminates::TriState + overlayed::Bool # This effect is currently only tracked in inference and modified # :consistent before caching. We may want to track it in the future. inbounds_taints_consistency::Bool @@ -46,27 +47,33 @@ function Effects( consistent::TriState, effect_free::TriState, nothrow::TriState, - terminates::TriState) + terminates::TriState, + overlayed::Bool) return Effects( consistent, effect_free, nothrow, terminates, + overlayed, false) end -Effects() = Effects(TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, TRISTATE_UNKNOWN) -function Effects(e::Effects; +const EFFECTS_TOTAL = Effects(ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, false) +const EFFECTS_UNKNOWN = Effects(TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, true) + +function Effects(e::Effects = EFFECTS_UNKNOWN; consistent::TriState = e.consistent, effect_free::TriState = e.effect_free, nothrow::TriState = e.nothrow, terminates::TriState = e.terminates, + overlayed::Bool = e.overlayed, inbounds_taints_consistency::Bool = e.inbounds_taints_consistency) return Effects( consistent, effect_free, nothrow, terminates, + overlayed, inbounds_taints_consistency) end @@ -82,20 +89,20 @@ is_removable_if_unused(effects::Effects) = effects.terminates === ALWAYS_TRUE && effects.nothrow === ALWAYS_TRUE -const EFFECTS_TOTAL = Effects(ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE) - function encode_effects(e::Effects) - return e.consistent.state | - (e.effect_free.state << 2) | - (e.nothrow.state << 4) | - (e.terminates.state << 6) + return (e.consistent.state << 1) | + (e.effect_free.state << 3) | + (e.nothrow.state << 5) | + (e.terminates.state << 7) | + (e.overlayed) end function decode_effects(e::UInt8) return Effects( - TriState(e & 0x3), - TriState((e >> 2) & 0x3), - TriState((e >> 4) & 0x3), - TriState((e >> 6) & 0x3), + TriState((e >> 1) & 0x03), + TriState((e >> 3) & 0x03), + TriState((e >> 5) & 0x03), + TriState((e >> 7) & 0x03), + e & 0x01 ≠ 0x00, false) end @@ -109,6 +116,7 @@ function tristate_merge(old::Effects, new::Effects) old.nothrow, new.nothrow), tristate_merge( old.terminates, new.terminates), + old.overlayed | new.overlayed, old.inbounds_taints_consistency | new.inbounds_taints_consistency) end @@ -158,7 +166,7 @@ mutable struct InferenceResult arginfo#=::Union{Nothing,Tuple{ArgInfo,InferenceState}}=# = nothing) argtypes, overridden_by_const = matching_cache_argtypes(linfo, arginfo) return new(linfo, argtypes, overridden_by_const, Any, nothing, - WorldRange(), Effects(), Effects(), nothing) + WorldRange(), Effects(; overlayed=false), Effects(; overlayed=false), nothing) end end diff --git a/base/reflection.jl b/base/reflection.jl index 95fb81c8859d6..484dc8b586664 100644 --- a/base/reflection.jl +++ b/base/reflection.jl @@ -1291,11 +1291,12 @@ function code_typed_opaque_closure(@nospecialize(closure::Core.OpaqueClosure); end end -function return_types(@nospecialize(f), @nospecialize(types=default_tt(f)), interp=Core.Compiler.NativeInterpreter()) +function return_types(@nospecialize(f), @nospecialize(types=default_tt(f)); + world = get_world_counter(), + interp = Core.Compiler.NativeInterpreter(world)) ccall(:jl_is_in_pure_context, Bool, ()) && error("code reflection cannot be used from generated functions") types = to_tuple_type(types) rt = [] - world = get_world_counter() for match in _methods(f, types, -1, world)::Vector match = match::Core.MethodMatch meth = func_for_method_checked(match.method, types, match.sparams) diff --git a/test/compiler/AbstractInterpreter.jl b/test/compiler/AbstractInterpreter.jl index f1fe4b06dcb63..8d5a50112cbf9 100644 --- a/test/compiler/AbstractInterpreter.jl +++ b/test/compiler/AbstractInterpreter.jl @@ -41,25 +41,53 @@ import Base.Experimental: @MethodTable, @overlay @MethodTable(OverlayedMT) CC.method_table(interp::MTOverlayInterp) = CC.OverlayMethodTable(CC.get_world_counter(interp), OverlayedMT) -@overlay OverlayedMT sin(x::Float64) = 1 -@test Base.return_types((Int,), MTOverlayInterp()) do x - sin(x) -end == Any[Int] -@test Base.return_types((Any,), MTOverlayInterp()) do x - Base.@invoke sin(x::Float64) -end == Any[Int] +strangesin(x) = sin(x) +@overlay OverlayedMT strangesin(x::Float64) = iszero(x) ? nothing : cos(x) +@test Base.return_types((Float64,); interp=MTOverlayInterp()) do x + strangesin(x) +end |> only === Union{Float64,Nothing} +@test Base.return_types((Any,); interp=MTOverlayInterp()) do x + Base.@invoke strangesin(x::Float64) +end |> only === Union{Float64,Nothing} # fallback to the internal method table -@test Base.return_types((Int,), MTOverlayInterp()) do x +@test Base.return_types((Int,); interp=MTOverlayInterp()) do x cos(x) -end == Any[Float64] -@test Base.return_types((Any,), MTOverlayInterp()) do x +end |> only === Float64 +@test Base.return_types((Any,); interp=MTOverlayInterp()) do x Base.@invoke cos(x::Float64) -end == Any[Float64] +end |> only === Float64 # not fully covered overlay method match overlay_match(::Any) = nothing @overlay OverlayedMT overlay_match(::Int) = missing -@test Base.return_types((Any,), MTOverlayInterp()) do x +@test Base.return_types((Any,); interp=MTOverlayInterp()) do x overlay_match(x) -end == Any[Union{Nothing,Missing}] +end |> only === Union{Nothing,Missing} + +# partial pure/concrete evaluation +@test Base.return_types(; interp=MTOverlayInterp()) do + isbitstype(Int) ? nothing : missing +end |> only === Nothing +Base.@assume_effects :terminates_globally function issue41694(x) + res = 1 + 1 < x < 20 || throw("bad") + while x > 1 + res *= x + x -= 1 + end + return res +end +@test Base.return_types(; interp=MTOverlayInterp()) do + issue41694(3) == 6 ? nothing : missing +end |> only === Nothing + +# disable partial pure/concrete evaluation when tainted by any overlayed call +Base.@assume_effects :total totalcall(f, args...) = f(args...) +@test Base.return_types(; interp=MTOverlayInterp()) do + if totalcall(strangesin, 1.0) == cos(1.0) + return nothing + else + return missing + end +end |> only === Nothing From 4969d69d0799c4bcee4c6d731ee97a8071036482 Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Tue, 15 Mar 2022 22:06:28 +0100 Subject: [PATCH 074/369] set VERSION to 1.8.0-beta2 (#44622) --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 7b1cf1d8e357b..495ea0f0c9741 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.8.0-beta1 +1.8.0-beta2 From 6195061764857889a7b66eccc770b924a423f5f7 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Tue, 15 Mar 2022 17:09:51 -0400 Subject: [PATCH 075/369] [`release-1.8` branch] CI (Buildkite): remove the `.buildkite` folder (#44377) * [`release-1.8` branch] CI (Buildkite): remove the `.buildkite` folder * Apply the necessary `.gitignore` fixes --- .buildkite-external-version | 1 + .buildkite/README.md | 7 - .buildkite/cryptic_repo_keys/.gitignore | 5 - .buildkite/cryptic_repo_keys/README.md | 6 - .../cryptic_repo_keys/repo_key.2297e5e7 | Bin 256 -> 0 bytes .buildkite/pipelines/experimental/0_webui.yml | 22 -- .buildkite/pipelines/experimental/README.md | 7 - .../experimental/launch_unsigned_builders.yml | 6 - .buildkite/pipelines/main/0_webui.yml | 23 -- .buildkite/pipelines/main/README.md | 15 -- .../main/launch_unsigned_builders.yml | 33 --- .buildkite/pipelines/main/misc/doctest.yml | 34 --- .buildkite/pipelines/main/misc/embedding.yml | 31 --- .buildkite/pipelines/main/misc/llvmpasses.yml | 48 ---- .buildkite/pipelines/main/misc/sanitizers.yml | 46 ---- .../main/misc/signed_pipeline_test.yml | 18 -- .../misc/signed_pipeline_test.yml.signature | 1 - .buildkite/pipelines/main/misc/whitespace.yml | 21 -- .../main/platforms/package_linux.arches | 7 - .../main/platforms/package_linux.yml | 54 ----- .../main/platforms/tester_linux.arches | 25 -- .../pipelines/main/platforms/tester_linux.yml | 120 --------- .buildkite/pipelines/scheduled/0_webui.yml | 27 --- .buildkite/pipelines/scheduled/README.md | 5 - .../scheduled/coverage/coverage_linux64.yml | 44 ---- .../coverage/coverage_linux64.yml.signature | 1 - .../scheduled/coverage/run_tests_parallel.jl | 29 --- .../scheduled/coverage/upload_coverage.jl | 228 ------------------ .../scheduled/launch_unsigned_jobs.yml | 8 - .../no_bb/no_bb_package_linux.arches | 2 - .../scheduled/no_bb/no_bb_tester_linux.arches | 10 - .buildkite/secrets/.gitignore | 11 - .buildkite/secrets/ssh_docs_deploy.encrypted | Bin 1856 -> 0 bytes .buildkite/secrets/ssh_docs_deploy.pub | 1 - .buildkite/utilities/platforms/platforms.sh | 76 ------ .buildkite/utilities/rr/rr_capture.jl | 201 --------------- .gitignore | 9 +- 37 files changed, 7 insertions(+), 1175 deletions(-) create mode 100644 .buildkite-external-version delete mode 100644 .buildkite/README.md delete mode 100644 .buildkite/cryptic_repo_keys/.gitignore delete mode 100644 .buildkite/cryptic_repo_keys/README.md delete mode 100644 .buildkite/cryptic_repo_keys/repo_key.2297e5e7 delete mode 100644 .buildkite/pipelines/experimental/0_webui.yml delete mode 100644 .buildkite/pipelines/experimental/README.md delete mode 100644 .buildkite/pipelines/experimental/launch_unsigned_builders.yml delete mode 100644 .buildkite/pipelines/main/0_webui.yml delete mode 100644 .buildkite/pipelines/main/README.md delete mode 100644 .buildkite/pipelines/main/launch_unsigned_builders.yml delete mode 100644 .buildkite/pipelines/main/misc/doctest.yml delete mode 100644 .buildkite/pipelines/main/misc/embedding.yml delete mode 100644 .buildkite/pipelines/main/misc/llvmpasses.yml delete mode 100644 .buildkite/pipelines/main/misc/sanitizers.yml delete mode 100644 .buildkite/pipelines/main/misc/signed_pipeline_test.yml delete mode 100644 .buildkite/pipelines/main/misc/signed_pipeline_test.yml.signature delete mode 100644 .buildkite/pipelines/main/misc/whitespace.yml delete mode 100644 .buildkite/pipelines/main/platforms/package_linux.arches delete mode 100644 .buildkite/pipelines/main/platforms/package_linux.yml delete mode 100644 .buildkite/pipelines/main/platforms/tester_linux.arches delete mode 100644 .buildkite/pipelines/main/platforms/tester_linux.yml delete mode 100644 .buildkite/pipelines/scheduled/0_webui.yml delete mode 100644 .buildkite/pipelines/scheduled/README.md delete mode 100644 .buildkite/pipelines/scheduled/coverage/coverage_linux64.yml delete mode 100644 .buildkite/pipelines/scheduled/coverage/coverage_linux64.yml.signature delete mode 100644 .buildkite/pipelines/scheduled/coverage/run_tests_parallel.jl delete mode 100644 .buildkite/pipelines/scheduled/coverage/upload_coverage.jl delete mode 100644 .buildkite/pipelines/scheduled/launch_unsigned_jobs.yml delete mode 100644 .buildkite/pipelines/scheduled/no_bb/no_bb_package_linux.arches delete mode 100644 .buildkite/pipelines/scheduled/no_bb/no_bb_tester_linux.arches delete mode 100644 .buildkite/secrets/.gitignore delete mode 100644 .buildkite/secrets/ssh_docs_deploy.encrypted delete mode 100644 .buildkite/secrets/ssh_docs_deploy.pub delete mode 100755 .buildkite/utilities/platforms/platforms.sh delete mode 100644 .buildkite/utilities/rr/rr_capture.jl diff --git a/.buildkite-external-version b/.buildkite-external-version new file mode 100644 index 0000000000000..ba2906d0666cf --- /dev/null +++ b/.buildkite-external-version @@ -0,0 +1 @@ +main diff --git a/.buildkite/README.md b/.buildkite/README.md deleted file mode 100644 index b3f74f2b23137..0000000000000 --- a/.buildkite/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Buildkite - -This directory contains the Buildkite configuration files for Base Julia CI. - -The rootfs image definitions are located in the [rootfs-images](https://github.com/JuliaCI/rootfs-images) repository. - -The documentation for the Base Julia CI setup is located in the [base-buildkite-docs](https://github.com/JuliaCI/base-buildkite-docs) repository. diff --git a/.buildkite/cryptic_repo_keys/.gitignore b/.buildkite/cryptic_repo_keys/.gitignore deleted file mode 100644 index 8d18931dbcf7c..0000000000000 --- a/.buildkite/cryptic_repo_keys/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -# Ignore the unencrypted repo_key -repo_key - -# Ignore any agent keys (public or private) we have stored -agent_key* diff --git a/.buildkite/cryptic_repo_keys/README.md b/.buildkite/cryptic_repo_keys/README.md deleted file mode 100644 index 93ed17ce4757b..0000000000000 --- a/.buildkite/cryptic_repo_keys/README.md +++ /dev/null @@ -1,6 +0,0 @@ -## Cryptic repository keys - -This folder contains RSA-encrypted symmetric AES keys. -These are used by buildkite agents to decrypt the secrets embedded within this repository. -Each buildkite agent contains an RSA secret key that is used to unlock the symmetric AES key that was used to encrypt the secrets within this repository. -For more information, see the [`cryptic` buildkite plugin repository](https://github.com/staticfloat/cryptic-buildkite-plugin). diff --git a/.buildkite/cryptic_repo_keys/repo_key.2297e5e7 b/.buildkite/cryptic_repo_keys/repo_key.2297e5e7 deleted file mode 100644 index 2ab9198b4ce2d7c7a9327935e18aaef5943629d2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 256 zcmV+b0ssE4{g>pIb#Eq&=vC$Qr^8S_O6!cOYE`=}q%}#an@eaJd$RWGY{B`_JI5h4 zkH`Ok?yS%>4AD6gqiiL&E|`(uBGp1*D8z1}bTOSJGyXKmUCrMUN%Q;gJ{M_gVt6DF z#aRD2;iY!|^9jgEcBXhT=jxw2yplIkGkb~?zh)kpuL|wT!R7{E{^jQhsqTt2Woi5X z6&zlfSSPoyKVU`TIJAL8I6(F*9}>v<(M$c2U_*AHb;CSzxbLIaZK0;0gYIZ?hzwB# zq^tZ&SA{ud8h!8dRd!Rzp7pWdE3F(RM#CkMHZoXOfk*SkHmzrDCiOUb@l`xQjdi^f GB)!2VDuP}B diff --git a/.buildkite/pipelines/experimental/0_webui.yml b/.buildkite/pipelines/experimental/0_webui.yml deleted file mode 100644 index e62750d9d8cd5..0000000000000 --- a/.buildkite/pipelines/experimental/0_webui.yml +++ /dev/null @@ -1,22 +0,0 @@ -# This file represents what is put into the webUI. -# It is purely for keeping track of the changes we make to the webUI configuration; modifying this file has no effect. -# We use the `cryptic` buildkite plugin to provide secrets management, which requires some integration into the WebUI's steps. -agents: - queue: "julia" - sandbox.jl: "true" -steps: - - label: ":unlock: Unlock secrets, launch pipelines" - plugins: - - staticfloat/cryptic#v1: - # Our list of pipelines that should be launched (but don't require a signature) - # These pipelines can be modified by any contributor and CI will still run. - # Build secrets will not be available in these pipelines (or their children) - # but some of our signed pipelines can wait upon the completion of these unsigned - # pipelines. - unsigned_pipelines: - - .buildkite/pipelines/experimental/launch_unsigned_builders.yml - # Our signed pipelines must have a `signature` or `signature_file` parameter that - # verifies the treehash of the pipeline itself and the inputs listed in `inputs` - # signed_pipelines: - # - pipeline: .buildkite/pipelines/experimental/misc/foo_bar_baz.yml - # signature_file: .buildkite/pipelines/experimental/misc/foo_bar_baz.yml.signature diff --git a/.buildkite/pipelines/experimental/README.md b/.buildkite/pipelines/experimental/README.md deleted file mode 100644 index f92aac7a1af02..0000000000000 --- a/.buildkite/pipelines/experimental/README.md +++ /dev/null @@ -1,7 +0,0 @@ -## Experimental pipeline (`master` branch only) - -This is the [`julia-master->experimental`](https://buildkite.com/julialang/julia-master-experimental) pipeline. - -We use this pipeline for builders that are not yet stable enough to go into the main pipeline. - -These builders are triggered by GitHub webhook events, such as pushes and pull requests. diff --git a/.buildkite/pipelines/experimental/launch_unsigned_builders.yml b/.buildkite/pipelines/experimental/launch_unsigned_builders.yml deleted file mode 100644 index 04d82a6e39a5e..0000000000000 --- a/.buildkite/pipelines/experimental/launch_unsigned_builders.yml +++ /dev/null @@ -1,6 +0,0 @@ -steps: - - label: ":buildkite: Launch unsigned pipelines" - commands: | - true - agents: - queue: julia diff --git a/.buildkite/pipelines/main/0_webui.yml b/.buildkite/pipelines/main/0_webui.yml deleted file mode 100644 index bc40534c15dae..0000000000000 --- a/.buildkite/pipelines/main/0_webui.yml +++ /dev/null @@ -1,23 +0,0 @@ -# This file represents what is put into the webUI. -# It is purely for keeping track of the changes we make to the webUI configuration; modifying this file has no effect. -# We use the `cryptic` buildkite plugin to provide secrets management, which requires some integration into the WebUI's steps. -agents: - queue: "julia" - sandbox.jl: "true" -steps: - - label: ":unlock: Unlock secrets, launch pipelines" - plugins: - - staticfloat/cryptici#v1: - # Our list of pipelines that should be launched (but don't require a signature) - # These pipelines can be modified by any contributor and CI will still run. - # Build secrets will not be available in these pipelines (or their children) - # but some of our signed pipelines can wait upon the completion of these unsigned - # pipelines. - unsigned_pipelines: - - .buildkite/pipelines/main/launch_unsigned_builders.yml - - # Our signed pipelines must have a `signature` or `signature_file` parameter that - # verifies the treehash of the pipeline itself and the inputs listed in `inputs` - signed_pipelines: - - pipeline: .buildkite/pipelines/main/misc/signed_pipeline_test.yml - signature_file: .buildkite/pipelines/main/misc/signed_pipeline_test.yml.signature diff --git a/.buildkite/pipelines/main/README.md b/.buildkite/pipelines/main/README.md deleted file mode 100644 index 6b9d67bd7cc3a..0000000000000 --- a/.buildkite/pipelines/main/README.md +++ /dev/null @@ -1,15 +0,0 @@ -## Main pipeline - -This is the main pipeline. It contains most of the builders. These builders are triggered by GitHub webhook events, such as pushes and pull requests. - -We have a different main pipeline for each permanent branch. - -For example: - -| Permanent Branch | Pipeline | -| ---------------- | -------------------------------------------------------------------------------- | -| `master` | [`julia-master`](https://buildkite.com/julialang/julia-master) | -| `release-1.6` | [`julia-release-1.6`](https://buildkite.com/julialang/julia-release-1-dot-6) | -| `release-1.7` | [`julia-release-1.7`](https://buildkite.com/julialang/julia-release-1-dot-7) | - -(This is not a complete list.) diff --git a/.buildkite/pipelines/main/launch_unsigned_builders.yml b/.buildkite/pipelines/main/launch_unsigned_builders.yml deleted file mode 100644 index 2b6794ed13bd1..0000000000000 --- a/.buildkite/pipelines/main/launch_unsigned_builders.yml +++ /dev/null @@ -1,33 +0,0 @@ -# This file launches all the build jobs that _don't_ require secrets access. -# These jobs can pass their output off to jobs that do require secrets access, -# but those privileged steps require signing before they can be run. -# -# Yes, this is creating another layer of indirection; the flow now looks like: -# -# [webui] -> launch_unsigned_builders.yml -> misc/whitespace.yml -# -# when we could theoretically just have the `webui` launch `misc/whitespace.yml`, -# however this raises the bar for contributors to add new (unsigned) steps to -# our CI configuration, so I'd rather live with an extra layer of indirection -# and only need to touch the webui configuration when we need to alter -# something about the privileged steps. - -steps: - - label: ":buildkite: Launch unsigned jobs" - commands: | - # Launch the miscellaneous jobs in alphabetical order. - buildkite-agent pipeline upload .buildkite/pipelines/main/misc/doctest.yml - buildkite-agent pipeline upload .buildkite/pipelines/main/misc/embedding.yml - buildkite-agent pipeline upload .buildkite/pipelines/main/misc/llvmpasses.yml - buildkite-agent pipeline upload .buildkite/pipelines/main/misc/sanitizers.yml - - # Launch all of the platform jobs. - bash .buildkite/utilities/platforms/platforms.sh .buildkite/pipelines/main/platforms/package_linux.arches .buildkite/pipelines/main/platforms/package_linux.yml - bash .buildkite/utilities/platforms/platforms.sh .buildkite/pipelines/main/platforms/tester_linux.arches .buildkite/pipelines/main/platforms/tester_linux.yml - - # Launch the `whitespace` job last. Uploading it last actually causes it to start - # first. We want this job to start first because we want it to finish as quickly - # as possible. - buildkite-agent pipeline upload .buildkite/pipelines/main/misc/whitespace.yml - agents: - queue: julia diff --git a/.buildkite/pipelines/main/misc/doctest.yml b/.buildkite/pipelines/main/misc/doctest.yml deleted file mode 100644 index fd5feb071f076..0000000000000 --- a/.buildkite/pipelines/main/misc/doctest.yml +++ /dev/null @@ -1,34 +0,0 @@ -agents: - queue: "julia" - # Only run on `sandbox.jl` machines (not `docker`-isolated ones) since we need nestable sandboxing - sandbox.jl: "true" - os: "linux" -steps: - - label: "doctest" - key: doctest - plugins: - - JuliaCI/julia#v1: - # Drop default "registries" directory, so it is not persisted from execution to execution - persist_depot_dirs: packages,artifacts,compiled - version: '1.6' - - staticfloat/sandbox#v1.2: - rootfs_url: https://github.com/JuliaCI/rootfs-images/releases/download/v4.8/package_linux.x86_64.tar.gz - rootfs_treehash: "2a058481b567f0e91b9aa3ce4ad4f09e6419355a" - uid: 1000 - gid: 1000 - workspaces: - # Include `/cache/repos` so that our `git` version introspection works. - - "/cache/repos:/cache/repos" - commands: | - echo "--- Build Julia from source" - make --output-sync -j 6 - - echo "--- Print Julia version info" - ./julia -e 'using InteractiveUtils; InteractiveUtils.versioninfo()' - - echo "--- Build Julia docs" - make docs - - echo "--- Run Julia doctests" - JULIA_NUM_THREADS=1 make -C doc doctest=true - timeout_in_minutes: 45 diff --git a/.buildkite/pipelines/main/misc/embedding.yml b/.buildkite/pipelines/main/misc/embedding.yml deleted file mode 100644 index 1b8b84d38358a..0000000000000 --- a/.buildkite/pipelines/main/misc/embedding.yml +++ /dev/null @@ -1,31 +0,0 @@ -agents: - queue: "julia" - # Only run on `sandbox.jl` machines (not `docker`-isolated ones) since we need nestable sandboxing - sandbox.jl: "true" - os: "linux" -steps: - - label: "embedding" - key: "embedding" - plugins: - - JuliaCI/julia#v1: - # Drop default "registries" directory, so it is not persisted from execution to execution - persist_depot_dirs: packages,artifacts,compiled - version: '1.6' - - staticfloat/sandbox#v1.2: - rootfs_url: https://github.com/JuliaCI/rootfs-images/releases/download/v4.8/package_linux.x86_64.tar.gz - rootfs_treehash: "2a058481b567f0e91b9aa3ce4ad4f09e6419355a" - uid: 1000 - gid: 1000 - workspaces: - # Include `/cache/repos` so that our `git` version introspection works. - - "/cache/repos:/cache/repos" - commands: | - prefix="/tmp/prefix" - echo "+++ Build julia, deploy to $${prefix:?}" - make --output-sync -j$${JULIA_CPU_THREADS:?} JULIA_PRECOMPILE=0 prefix=$${prefix:?} install - - embedding_output="/tmp/embedding-test" - echo "+++ Run embedding tests, deploy to $${embedding_output:?}" - mkdir -p "$${embedding_output:?}" - make --output-sync -j$${JULIA_CPU_THREADS:?} -C test/embedding JULIA="$${prefix:?}/bin/julia" BIN="$${embedding_output:?}" - timeout_in_minutes: 60 diff --git a/.buildkite/pipelines/main/misc/llvmpasses.yml b/.buildkite/pipelines/main/misc/llvmpasses.yml deleted file mode 100644 index 3acc4c05c2391..0000000000000 --- a/.buildkite/pipelines/main/misc/llvmpasses.yml +++ /dev/null @@ -1,48 +0,0 @@ -agents: - queue: "julia" - # Only run on `sandbox.jl` machines (not `docker`-isolated ones) since we need nestable sandboxing - sandbox.jl: "true" - os: "linux" -steps: - - label: "analyzegc" - key: "analyzegc" - plugins: - - JuliaCI/julia#v1: - # Drop default "registries" directory, so it is not persisted from execution to execution - persist_depot_dirs: packages,artifacts,compiled - version: '1.6' - - staticfloat/sandbox#v1.2: - rootfs_url: https://github.com/JuliaCI/rootfs-images/releases/download/v4.8/llvm_passes.x86_64.tar.gz - rootfs_treehash: "c7a289a8cc544b234b1e2d7cbcce3e6815359ecd" - workspaces: - # Include `/cache/repos` so that our `git` version introspection works. - - "/cache/repos:/cache/repos" - commands: | - echo "--- Install in-tree LLVM dependencies" - make --output-sync -j$${JULIA_CPU_THREADS:?} -C deps install-llvm install-clang install-llvm-tools install-libuv install-utf8proc install-unwind - echo "+++ run clangsa/analyzegc" - make --output-sync -j$${JULIA_CPU_THREADS:?} -C test/clangsa - make --output-sync -j$${JULIA_CPU_THREADS:?} -C src analyzegc - timeout_in_minutes: 60 - - label: "llvmpasses" - key: "llvmpasses" - plugins: - - JuliaCI/julia#v1: - # Drop default "registries" directory, so it is not persisted from execution to execution - persist_depot_dirs: packages,artifacts,compiled - version: '1.6' - - staticfloat/sandbox#v1.2: - rootfs_url: https://github.com/JuliaCI/rootfs-images/releases/download/v4.8/package_linux.x86_64.tar.gz - rootfs_treehash: "2a058481b567f0e91b9aa3ce4ad4f09e6419355a" - uid: 1000 - gid: 1000 - workspaces: - - "/cache/repos:/cache/repos" - commands: | - echo "--- make release" - make --output-sync -j$${JULIA_CPU_THREADS:?} release JULIA_PRECOMPILE=0 - echo "--- make src/install-analysis-deps" - make --output-sync -j$${JULIA_CPU_THREADS:?} -C src install-analysis-deps - echo "+++ make test/llvmpasses" - make --output-sync -j$${JULIA_CPU_THREADS:?} -C test/llvmpasses - timeout_in_minutes: 60 diff --git a/.buildkite/pipelines/main/misc/sanitizers.yml b/.buildkite/pipelines/main/misc/sanitizers.yml deleted file mode 100644 index d5e83fb91cf68..0000000000000 --- a/.buildkite/pipelines/main/misc/sanitizers.yml +++ /dev/null @@ -1,46 +0,0 @@ -agents: - queue: "julia" - # Only run on `sandbox.jl` machines (not `docker`-isolated ones) since we need nestable sandboxing - sandbox.jl: "true" - os: "linux" -steps: - - label: "asan" - key: "asan" - plugins: - - JuliaCI/julia#v1: - # Drop default "registries" directory, so it is not persisted from execution to execution - persist_depot_dirs: packages,artifacts,compiled - version: '1.6' - - staticfloat/sandbox#v1.2: - rootfs_url: https://github.com/JuliaCI/rootfs-images/releases/download/v4.8/llvm_passes.x86_64.tar.gz - rootfs_treehash: "c7a289a8cc544b234b1e2d7cbcce3e6815359ecd" - uid: 1000 - gid: 1000 - workspaces: - - "/cache/repos:/cache/repos" - timeout_in_minutes: 120 - if: | # We only run the `asan` job on Julia 1.8 and later. - (pipeline.slug != "julia-release-1-dot-6") && (pipeline.slug != "julia-release-1-dot-7") - commands: | - echo "--- Build julia-debug with ASAN" - contrib/asan/build.sh ./tmp/test-asan -j$${JULIA_CPU_THREADS:?} debug - - label: "tsan" - key: "tsan" - plugins: - - JuliaCI/julia#v1: - # Drop default "registries" directory, so it is not persisted from execution to execution - persist_depot_dirs: packages,artifacts,compiled - version: '1.6' - - staticfloat/sandbox#v1.2: - rootfs_url: https://github.com/JuliaCI/rootfs-images/releases/download/v4.8/llvm_passes.x86_64.tar.gz - rootfs_treehash: "c7a289a8cc544b234b1e2d7cbcce3e6815359ecd" - uid: 1000 - gid: 1000 - workspaces: - - "/cache/repos:/cache/repos" - timeout_in_minutes: 120 - if: | # We only run the `tsan` job on Julia 1.8 and later. - (pipeline.slug != "julia-release-1-dot-6") && (pipeline.slug != "julia-release-1-dot-7") - commands: | - echo "--- Build julia-debug runtime with TSAN" - contrib/tsan/build.sh ./tmp/test-tsan -j$${JULIA_CPU_THREADS:?} julia-src-debug diff --git a/.buildkite/pipelines/main/misc/signed_pipeline_test.yml b/.buildkite/pipelines/main/misc/signed_pipeline_test.yml deleted file mode 100644 index 1d59253d43bce..0000000000000 --- a/.buildkite/pipelines/main/misc/signed_pipeline_test.yml +++ /dev/null @@ -1,18 +0,0 @@ -agents: - queue: "julia" - os: "linux" - -## pipeline that showcases decryption of environment variable -steps: - - label: ":lock: :rocket: Signed pipeline test" - # We must accept the signed job id secret in order to propagate secrets - env: - BUILDKITE_PLUGIN_CRYPTIC_BASE64_SIGNED_JOB_ID_SECRET: ${BUILDKITE_PLUGIN_CRYPTIC_BASE64_SIGNED_JOB_ID_SECRET?} - depends_on: - plugins: - - staticfloat/cryptic#v1: - variables: - - SECRET_KEY="U2FsdGVkX18tb7st0SuQAvh4Yv4xENxOAu8q9XkmOeDVKBNY4FngEwK3xmiKUqaS" - commands: | - echo "SECRET_KEY: $${SECRET_KEY}" - diff --git a/.buildkite/pipelines/main/misc/signed_pipeline_test.yml.signature b/.buildkite/pipelines/main/misc/signed_pipeline_test.yml.signature deleted file mode 100644 index b0844748c486f..0000000000000 --- a/.buildkite/pipelines/main/misc/signed_pipeline_test.yml.signature +++ /dev/null @@ -1 +0,0 @@ -Salted__���J0�Q?���rۀ�g�~�d��ۛŧ�ө��o���Ujʀ���p�)�$�U$� ���y@gZM}{�m��,۠�K��e�r� \ No newline at end of file diff --git a/.buildkite/pipelines/main/misc/whitespace.yml b/.buildkite/pipelines/main/misc/whitespace.yml deleted file mode 100644 index b97de3ac677bb..0000000000000 --- a/.buildkite/pipelines/main/misc/whitespace.yml +++ /dev/null @@ -1,21 +0,0 @@ -agents: - queue: "julia" - # Only run on `sandbox.jl` machines (not `docker`-isolated ones) since we need nestable sandboxing - sandbox.jl: "true" - os: "linux" -steps: - - label: "whitespace" - key: "whitespace" - plugins: - - JuliaCI/julia#v1: - # Drop default "registries" directory, so it is not persisted from execution to execution - persist_depot_dirs: packages,artifacts,compiled - version: '1.6' - - staticfloat/sandbox#v1.2: - rootfs_url: https://github.com/JuliaCI/rootfs-images/releases/download/v4.8/package_linux.x86_64.tar.gz - rootfs_treehash: "2a058481b567f0e91b9aa3ce4ad4f09e6419355a" - workspaces: - - "/cache/repos:/cache/repos" - timeout_in_minutes: 10 - commands: | - make --output-sync -j$${JULIA_CPU_THREADS:?} check-whitespace diff --git a/.buildkite/pipelines/main/platforms/package_linux.arches b/.buildkite/pipelines/main/platforms/package_linux.arches deleted file mode 100644 index dec82f530a832..0000000000000 --- a/.buildkite/pipelines/main/platforms/package_linux.arches +++ /dev/null @@ -1,7 +0,0 @@ -# PLATFORM LABEL GROUP ALLOW_FAIL ARCH ARCH_ROOTFS MAKE_FLAGS TIMEOUT_BK TIMEOUT_RR RETRIES IS_RR IS_ST IS_MT ROOTFS_TAG ROOTFS_HASH -linux 32 . . 32 i686 . . . . . . . v4.8 b6dffc772ab4c2cd7fd4f83459308f6f0d89b957 -linux 64 . . 64 x86_64 . . . . . . . v4.8 2a058481b567f0e91b9aa3ce4ad4f09e6419355a -# linux aarch64 . . aarch64 aarch64 . . . . . . . .... ........................................ -# linux armv7l . . armv7l armv7l . . . . . . . .... ........................................ -# linux ppc64le . . ppc64le powerpc64le . . . . . . . .... ........................................ -musl 64 . . 64 x86_64 . . . . . . . v4.8 d13a47c87c38005bd5d97132e51789cafd852f90 diff --git a/.buildkite/pipelines/main/platforms/package_linux.yml b/.buildkite/pipelines/main/platforms/package_linux.yml deleted file mode 100644 index 06245543c73b0..0000000000000 --- a/.buildkite/pipelines/main/platforms/package_linux.yml +++ /dev/null @@ -1,54 +0,0 @@ -agents: - queue: "julia" - # Only run on `sandbox.jl` machines (not `docker`-isolated ones) since we need nestable sandboxing - sandbox.jl: "true" - os: "linux" -steps: - - label: "package_${PLATFORM?}${LABEL?}" - key: package_${PLATFORM?}${LABEL?} - plugins: - - JuliaCI/julia#v1: - # Drop default "registries" directory, so it is not persisted from execution to execution - persist_depot_dirs: packages,artifacts,compiled - version: '1.6' - - staticfloat/sandbox#v1.2: - rootfs_url: https://github.com/JuliaCI/rootfs-images/releases/download/${ROOTFS_TAG?}/package_${PLATFORM?}.${ARCH_ROOTFS?}.tar.gz - rootfs_treehash: "${ROOTFS_HASH?}" - uid: 1000 - gid: 1000 - workspaces: - # Include `/cache/repos` so that our `git` version introspection works. - - "/cache/repos:/cache/repos" - timeout_in_minutes: ${TIMEOUT_BK?} - commands: | - echo "--- Print the full and short commit hashes" - SHORT_COMMIT_LENGTH=10 - SHORT_COMMIT=`echo $${BUILDKITE_COMMIT:?} | cut -c1-$${SHORT_COMMIT_LENGTH:?}` - ARTIFACT_FILE_EXTENSION="tar.gz" - ARTIFACT_FILENAME="julia-$${SHORT_COMMIT:?}-${PLATFORM?}${ARCH?}.$${ARTIFACT_FILE_EXTENSION:?}" - JULIA_BINARYDIST_FILENAME=`make print-JULIA_BINARYDIST_FILENAME ${MAKE_FLAGS?} | cut -c27- | tr -s ' '` - JULIA_BINARYDIST="$${JULIA_BINARYDIST_FILENAME:?}.$${ARTIFACT_FILE_EXTENSION:?}" - - echo "The full commit is: $${BUILDKITE_COMMIT:?}" - echo "The short commit is: $${SHORT_COMMIT:?}" - echo "The artifact filename will be: $${ARTIFACT_FILENAME:?}" - - echo "--- Build Julia from source" - rm -rf $${ARTIFACT_FILENAME:?} - make --output-sync -j 8 ${MAKE_FLAGS?} - - echo "--- Check that the working directory is clean" - if [ -z "$(git status --short)" ]; then echo "INFO: The working directory is clean."; else echo "ERROR: The working directory is dirty."; echo "Output of git status:"; git status; exit 1; fi - - echo "--- Print Julia version info" - ./julia -e 'using InteractiveUtils; InteractiveUtils.versioninfo()' - - echo "--- Create build artifacts" - make --output-sync -j 8 binary-dist ${MAKE_FLAGS?} - ls -l $${JULIA_BINARYDIST:?} - if [[ "$${JULIA_BINARYDIST:?}" != "$${ARTIFACT_FILENAME:?}" ]]; then - mv $${JULIA_BINARYDIST:?} $${ARTIFACT_FILENAME:?} - fi - ls -l $${ARTIFACT_FILENAME:?} - echo "--- Upload build artifacts" - buildkite-agent artifact upload $${ARTIFACT_FILENAME:?} diff --git a/.buildkite/pipelines/main/platforms/tester_linux.arches b/.buildkite/pipelines/main/platforms/tester_linux.arches deleted file mode 100644 index 000bcacd10b8f..0000000000000 --- a/.buildkite/pipelines/main/platforms/tester_linux.arches +++ /dev/null @@ -1,25 +0,0 @@ -# PLATFORM LABEL GROUP ALLOW_FAIL ARCH ARCH_ROOTFS MAKE_FLAGS TIMEOUT_BK TIMEOUT_RR RETRIES IS_RR IS_ST IS_MT ROOTFS_TAG ROOTFS_HASH -linux 32_g1 g1 . 32 i686 . 120 . . . . . v4.8 b6dffc772ab4c2cd7fd4f83459308f6f0d89b957 -linux 32_g2 g2 . 32 i686 . . . 3 . . . v4.8 b6dffc772ab4c2cd7fd4f83459308f6f0d89b957 - -linux 64_g1_mt g1 . 64 x86_64 . . . . . . yes v4.8 2a058481b567f0e91b9aa3ce4ad4f09e6419355a -linux 64_g2_mt g2 . 64 x86_64 . . . 3 . . yes v4.8 2a058481b567f0e91b9aa3ce4ad4f09e6419355a - -linux 64_g1_st g1 . 64 x86_64 . . . . . yes . v4.8 2a058481b567f0e91b9aa3ce4ad4f09e6419355a -linux 64_g2_st g2 . 64 x86_64 . . . 3 . yes . v4.8 2a058481b567f0e91b9aa3ce4ad4f09e6419355a - -linux 64_g1_rrst g1 . 64 x86_64 . 300 240 . yes yes . v4.8 2a058481b567f0e91b9aa3ce4ad4f09e6419355a -linux 64_g2_rrst g2 . 64 x86_64 . 180 120 3 yes yes . v4.8 2a058481b567f0e91b9aa3ce4ad4f09e6419355a -linux 64_g3_st g3 . 64 x86_64 . . . 3 . yes . v4.8 2a058481b567f0e91b9aa3ce4ad4f09e6419355a - -# linux aarch64_g1 g1 true aarch64 aarch64 . . . . . . . ---- ---------------------------------------- -# linux aarch64_g2 g2 true aarch64 aarch64 . . . . . . . ---- ---------------------------------------- - -# linux armv7l_g1 g1 true armv7l armv7l . . . . . . . ---- ---------------------------------------- -# linux armv7l_g2 g2 true armv7l armv7l . . . . . . . ---- ---------------------------------------- - -# linux ppc64le_g1 g1 true ppc64le powerpc64le . . . . . . . ---- ---------------------------------------- -# linux ppc64le_g2 g2 true ppc64le powerpc64le . . . . . . . ---- ---------------------------------------- - -musl 64_g1 g1 true 64 x86_64 . . . . . . . v4.8 d13a47c87c38005bd5d97132e51789cafd852f90 -musl 64_g2 g2 true 64 x86_64 . . . . . . . v4.8 d13a47c87c38005bd5d97132e51789cafd852f90 diff --git a/.buildkite/pipelines/main/platforms/tester_linux.yml b/.buildkite/pipelines/main/platforms/tester_linux.yml deleted file mode 100644 index 9deb81675db1c..0000000000000 --- a/.buildkite/pipelines/main/platforms/tester_linux.yml +++ /dev/null @@ -1,120 +0,0 @@ -agents: - queue: "julia" - # Only run on `sandbox.jl` machines (not `docker`-isolated ones) since we need nestable sandboxing - sandbox.jl: "true" - os: "linux" -steps: - - label: "tester_${PLATFORM?}${LABEL?}" - key: tester_${PLATFORM?}${LABEL?} - depends_on: package_${PLATFORM?}${ARCH?} - plugins: - - JuliaCI/julia#v1: - # Drop default "registries" directory, so it is not persisted from execution to execution - persist_depot_dirs: packages,artifacts,compiled - version: '1.6' - - staticfloat/sandbox#v1.2: - rootfs_url: https://github.com/JuliaCI/rootfs-images/releases/download/${ROOTFS_TAG?}/package_${PLATFORM?}.${ARCH_ROOTFS?}.tar.gz - # rootfs_url: https://github.com/JuliaCI/rootfs-images/releases/download/${ROOTFS_TAG?}/tester${PLATFORM?}.${ARCH_ROOTFS?}.tar.gz - rootfs_treehash: "${ROOTFS_HASH?}" - uid: 1000 - gid: 1000 - workspaces: - # Include `/cache/repos` so that our `git` version introspection works. - - "/cache/repos:/cache/repos" - env: - JULIA_SHELL: "/bin/bash" - timeout_in_minutes: ${TIMEOUT_BK?} - retry: - automatic: - - exit_status: "*" - limit: ${RETRIES?} - soft_fail: ${ALLOW_FAIL?} - commands: | - echo "--- Print the full and short commit hashes" - SHORT_COMMIT_LENGTH=10 - SHORT_COMMIT=`echo $${BUILDKITE_COMMIT:?} | cut -c1-$${SHORT_COMMIT_LENGTH:?}` - JULIA_DIR="julia-$${SHORT_COMMIT:?}" - JULIA_BINARY="$${JULIA_DIR:?}/bin/julia" - ARTIFACT_FILE_EXTENSION="tar.gz" - ARTIFACT_FILENAME="julia-$${SHORT_COMMIT:?}-${PLATFORM?}${ARCH?}.$${ARTIFACT_FILE_EXTENSION:?}" - echo "The full commit is: $${BUILDKITE_COMMIT:?}" - echo "The short commit is: $${SHORT_COMMIT:?}" - echo "The artifact filename will be: $${ARTIFACT_FILENAME:?}" - echo "The Julia directory name will be: $${JULIA_DIR:?}" - echo "The Julia binary will be: $${JULIA_BINARY:?}" - - echo "--- Download build artifacts" - rm -rf $${ARTIFACT_FILENAME:?} - buildkite-agent artifact download $${ARTIFACT_FILENAME:?} . - - echo "--- Extract build artifacts" - rm -rf $${JULIA_DIR:?}/ - tar xzf $${ARTIFACT_FILENAME:?} $${JULIA_DIR:?}/ - - echo "--- Print Julia version info" - $${JULIA_BINARY:?} -e 'using InteractiveUtils; InteractiveUtils.versioninfo()' - echo "JULIA_CPU_THREADS is: $${JULIA_CPU_THREADS:?}" - $${JULIA_BINARY:?} -e '@info "" Sys.CPU_THREADS' - - echo "--- Set some environment variables" - export OPENBLAS_NUM_THREADS=8 - unset JULIA_DEPOT_PATH - unset JULIA_PKG_SERVER - - # Make sure that temp files and temp directories are created in a location that is - # backed by real storage. - export TMPDIR="$(pwd)/tmp" - mkdir -p $${TMPDIR:?} - - export NETWORK_RELATED_TESTS="Artifacts Downloads download LazyArtifacts LibGit2/online Pkg" - - if [[ "${GROUP?}" == "all" ]]; then - export TESTS="all LibGit2/online --ci" - elif [[ "${GROUP?}" == "all_except_pkg" ]]; then - export TESTS="all LibGit2/online --ci --skip Pkg" - elif [[ "${GROUP?}" == "g1" ]]; then - # Group 1: ALL tests EXCEPT the network-related tests. - export TESTS="all --ci --skip $${NETWORK_RELATED_TESTS:?}" - elif [[ "${GROUP?}" == "g2" ]]; then - # Group 2: ONLY the network-related tests. - # In Group 2, we use whatever the default setting is with regards to the Pkg server. - export TESTS="$${NETWORK_RELATED_TESTS:?} --ci" - elif [[ "${GROUP?}" == "g3" ]]; then - # Group 3: only Pkg. - # In Group 3, we explicitly opt-out of the Pkg server. - # The purpose of group 3 is to test the non-Pkg-server codepaths of Pkg. - export TESTS="Pkg --ci" - export JULIA_PKG_SERVER="" - else - echo "Invalid value for GROUP: ${GROUP?}" - exit 1 - fi - - export JULIA_TEST_RR_TIMEOUT="${TIMEOUT_RR?}" - - if [[ "${IS_RR?}" == "yes" ]]; then - export JULIA_CMD_FOR_TESTS="$${JULIA_BINARY:?} .buildkite/utilities/rr/rr_capture.jl $${JULIA_BINARY:?}" - export NCORES_FOR_TESTS="parse(Int, ENV[\"JULIA_RRCAPTURE_NUM_CORES\"])" - else - export JULIA_CMD_FOR_TESTS="$${JULIA_BINARY:?}" - export NCORES_FOR_TESTS="Sys.CPU_THREADS" - fi - - if [[ "${IS_ST?}" == "yes" ]]; then - export JULIA_NUM_THREADS=1 - fi - - if [[ "${IS_MT?}" == "yes" ]]; then - export JULIA_NUM_THREADS=16 - fi - - echo "--- Print the test group, list of test sets, and other useful environment variables" - echo "JULIA_CMD_FOR_TESTS is: $${JULIA_CMD_FOR_TESTS:?}" - echo "JULIA_NUM_THREADS is: $${JULIA_NUM_THREADS}" # Note: this environment variable might not be set - echo "NCORES_FOR_TESTS is: $${NCORES_FOR_TESTS:?}" - echo "OPENBLAS_NUM_THREADS is: $${OPENBLAS_NUM_THREADS:?}" - echo "GROUP is: ${GROUP?}" - echo "TESTS is: $${TESTS:?}" - - echo "--- Run the Julia test suite" - $${JULIA_CMD_FOR_TESTS:?} -e "Base.runtests(\"$${TESTS:?}\"; ncores = $${NCORES_FOR_TESTS:?})" diff --git a/.buildkite/pipelines/scheduled/0_webui.yml b/.buildkite/pipelines/scheduled/0_webui.yml deleted file mode 100644 index ad2216286bda7..0000000000000 --- a/.buildkite/pipelines/scheduled/0_webui.yml +++ /dev/null @@ -1,27 +0,0 @@ -# This file represents what is put into the webUI. -# It is purely for keeping track of the changes we make to the webUI configuration; modifying this file has no effect. -# We use the `cryptic` buildkite plugin to provide secrets management, which requires some integration into the WebUI's steps. -agents: - queue: "julia" - sandbox.jl: "true" -steps: - - label: ":unlock: Unlock secrets, launch pipelines" - plugins: - - staticfloat/cryptic#v1: - # Our list of pipelines that should be launched (but don't require a signature) - # These pipelines can be modified by any contributor and CI will still run. - # Build secrets will not be available in these pipelines (or their children) - # but some of our signed pipelines can wait upon the completion of these unsigned - # pipelines. - unsigned_pipelines: - - .buildkite/pipelines/scheduled/launch_unsigned_jobs.yml - - # Our signed pipelines must have a `signature` or `signature_file` parameter that - # verifies the treehash of the pipeline itself and the inputs listed in `inputs` - signed_pipelines: - - pipeline: .buildkite/pipelines/scheduled/coverage/coverage_linux64.yml - signature_file: .buildkite/pipelines/scheduled/coverage/coverage_linux64.yml.signature - inputs: - - .buildkite/pipelines/scheduled/coverage/coverage_linux64.yml - - .buildkite/pipelines/scheduled/coverage/run_tests_parallel.jl - - .buildkite/pipelines/scheduled/coverage/upload_coverage.jl diff --git a/.buildkite/pipelines/scheduled/README.md b/.buildkite/pipelines/scheduled/README.md deleted file mode 100644 index ca071dceb2a44..0000000000000 --- a/.buildkite/pipelines/scheduled/README.md +++ /dev/null @@ -1,5 +0,0 @@ -## Scheduled pipeline (`master` branch only) - -This is the [`julia-master->scheduled`](https://buildkite.com/julialang/julia-master-scheduled) pipeline. - -We use this pipeline for scheduled builds. The builders in this pipeline run on a schedule once per day. They are not triggered by GitHub webhooks. diff --git a/.buildkite/pipelines/scheduled/coverage/coverage_linux64.yml b/.buildkite/pipelines/scheduled/coverage/coverage_linux64.yml deleted file mode 100644 index 8ebe53d1ab492..0000000000000 --- a/.buildkite/pipelines/scheduled/coverage/coverage_linux64.yml +++ /dev/null @@ -1,44 +0,0 @@ -agents: - queue: "julia" - # Only run on `sandbox.jl` machines (not `docker`-isolated ones) since we need nestable sandboxing - sandbox.jl: "true" - os: "linux" -steps: - - label: ":unlock: :coverage: Run coverage test" - # We must accept the signed job id secret in order to propagate secrets - env: - BUILDKITE_PLUGIN_CRYPTIC_BASE64_SIGNED_JOB_ID_SECRET: ${BUILDKITE_PLUGIN_CRYPTIC_BASE64_SIGNED_JOB_ID_SECRET?} - depends_on: - plugins: - - staticfloat/cryptic#v1: - variables: - - CODECOV_TOKEN="U2FsdGVkX19l0fhdBabbuiEdysyEabkJLRHfxm7CNRkuGbnwPV365sxxC7Czs/CVcws0N1oB4pVwALRRMe36oA==" - - COVERALLS_TOKEN="U2FsdGVkX19zopI0hMNzzi2UUOvNVFD8Y0iisFnO/ryVxU7Tit8ZEaeN+gxodRx4CosUUh192F1+q3dTMWRIvw==" - - JuliaCI/julia#v1: - # Drop default "registries" directory, so it is not persisted from execution to execution - persist_depot_dirs: packages,artifacts,compiled - version: '1.6' - - staticfloat/sandbox#v1: - rootfs_url: https://github.com/JuliaCI/rootfs-images/releases/download/v4.8/package_linux.x86_64.tar.gz - rootfs_treehash: "2a058481b567f0e91b9aa3ce4ad4f09e6419355a" - uid: 1000 - gid: 1000 - timeout_in_minutes: 360 # 360 minutes = 6 hours - commands: | - echo "--- Build Julia from source" - make --output-sync -j 6 - - echo "--- Print Julia version info" - ./julia -e 'using InteractiveUtils; InteractiveUtils.versioninfo()' - ./julia -e '@info "" Sys.CPU_THREADS' - # this is necessary to make sure that the LibGit2 tests passes - git config --global init.defaultBranch master - - echo "--- Run Julia tests in parallel with code coverage enabled" - export JULIA_NUM_THREADS=1 - export JULIA_WORKER_TIMEOUT=1200 # 1200 seconds = 20 minutes - ./julia -e 'import Distributed; @info "" Distributed.worker_timeout()' - ./julia .buildkite/pipelines/scheduled/coverage/run_tests_parallel.jl - - echo "--- Process and upload coverage information" - ./julia .buildkite/pipelines/scheduled/coverage/upload_coverage.jl diff --git a/.buildkite/pipelines/scheduled/coverage/coverage_linux64.yml.signature b/.buildkite/pipelines/scheduled/coverage/coverage_linux64.yml.signature deleted file mode 100644 index 4ecec8e8bb72c..0000000000000 --- a/.buildkite/pipelines/scheduled/coverage/coverage_linux64.yml.signature +++ /dev/null @@ -1 +0,0 @@ -Salted__�I�y�֌��>y�Nc kB�v�n�+�Hvrލ��Ƽ�r����/�uY�����u����I�iiE��(��v�L��!��?��v� \ No newline at end of file diff --git a/.buildkite/pipelines/scheduled/coverage/run_tests_parallel.jl b/.buildkite/pipelines/scheduled/coverage/run_tests_parallel.jl deleted file mode 100644 index b6eed225f652d..0000000000000 --- a/.buildkite/pipelines/scheduled/coverage/run_tests_parallel.jl +++ /dev/null @@ -1,29 +0,0 @@ -# Important note: even if one or more tests fail, we will still exit with status code 0. -# -# The reason for this is that we always want to upload code coverage, even if some of the -# tests fail. Therefore, even if the `coverage_linux64` builder passes, you should not -# assume that all of the tests passed. If you want to know if all of the tests are passing, -# please look at the status of the `tester_*` builders (e.g. `tester_linux64`). - -const ncores = Sys.CPU_THREADS -@info "" Sys.CPU_THREADS -@info "" ncores - -script_native_yes = """ - Base.runtests(["cmdlineargs"]; ncores = $(ncores)) -""" -script_native_no = """ - Base.runtests(["all", "--skip", "cmdlineargs"]; ncores = $(ncores)) -""" - -base_cmd = `$(Base.julia_cmd()) --code-coverage=all` -cmd_native_yes = `$(base_cmd) --sysimage-native-code=yes -e $(script_native_yes)` -cmd_native_no = `$(base_cmd) --sysimage-native-code=no -e $(script_native_no)` - -@info "Running command" cmd_native_yes -p1 = run(pipeline(cmd_native_yes; stdin, stdout, stderr); wait = false) -wait(p1) - -@info "Running command" cmd_native_no -p2 = run(pipeline(cmd_native_no; stdin, stdout, stderr); wait = false) -wait(p2) diff --git a/.buildkite/pipelines/scheduled/coverage/upload_coverage.jl b/.buildkite/pipelines/scheduled/coverage/upload_coverage.jl deleted file mode 100644 index d995e97fc17fb..0000000000000 --- a/.buildkite/pipelines/scheduled/coverage/upload_coverage.jl +++ /dev/null @@ -1,228 +0,0 @@ -empty!(Base.DEPOT_PATH) -push!(Base.DEPOT_PATH, mktempdir(; cleanup = true)) - -import Pkg -import Logging -import TOML - -Pkg.add(; name = "Coverage", uuid = "a2441757-f6aa-5fb2-8edb-039e3f45d037", version = "1") -Pkg.precompile() - -import Coverage - -function process_folders() - # `Coverage.process_folder` will have a LOT of `@info` statements that will make the log - # way too long. So before we run `Coverage.process_folder`, we disable logging for `@info` - # statements. After we run `Coverage.process_folder`, we re-enable logging for `@info` - # statements. - Logging.disable_logging(Logging.Info) - fcs_base = Coverage.process_folder("base"); - fcs_stdlib = Coverage.process_folder("stdlib"); - Logging.disable_logging(Logging.Debug) - - fcs = Coverage.merge_coverage_counts( - fcs_base, - fcs_stdlib, - ); - - return fcs -end - -function get_external_stdlib_names(stdlib_dir::AbstractString) - filename_list = filter(x -> isfile(joinpath(stdlib_dir, x)), readdir(stdlib_dir)) - # find all of the files like `Pkg.version`, `Statistics.version`, etc. - regex_matches_or_nothing = match.(Ref(r"^([\w].*?)\.version$"), filename_list) - regex_matches = filter(x -> x !== nothing, regex_matches_or_nothing) - # get the names of the external stdlibs, like `Pkg`, `Statistics`, etc. - external_stdlib_names = only.(regex_matches) - unique!(external_stdlib_names) - sort!(external_stdlib_names) - @info "# Begin list of external stdlibs" - for (i, x) in enumerate(external_stdlib_names) - @info "$(i). $(x)" - end - @info "# End list of external stdlibs" - return external_stdlib_names -end - -function get_external_stdlib_prefixes(stdlib_dir::AbstractString) - external_stdlib_names = get_external_stdlib_names(stdlib_dir) - prefixes_1 = joinpath.(Ref(stdlib_dir), external_stdlib_names, Ref("")) - prefixes_2 = joinpath.(Ref(stdlib_dir), string.(external_stdlib_names, Ref("-"))) - prefixes = vcat(prefixes_1, prefixes_2) - unique!(prefixes) - sort!(prefixes) - # example of what `prefixes` might look like: - # 4-element Vector{String}: - # "stdlib/Pkg-" - # "stdlib/Pkg/" - # "stdlib/Statistics-" - # "stdlib/Statistics/" - return prefixes -end - -function print_coverage_summary(fc::Coverage.FileCoverage) - cov_lines, tot_lines = Coverage.get_summary(fc) - if cov_lines == tot_lines == 0 - cov_pct = 0 - else - cov_pct = floor(Int, cov_lines/tot_lines * 100) - end - pad_1 = 71 - pad_2 = 15 - pad_3 = 15 - col_1 = rpad(fc.filename, pad_1) - col_2 = rpad(string(cov_pct, " %"), pad_2) - col_3 = string( - rpad(string(cov_lines), pad_3), - string(tot_lines), - ) - @info "$(col_1) $(col_2) $(col_3)" - return nothing -end - -function print_coverage_summary( - fcs::Vector{Coverage.FileCoverage}, description::AbstractString, - ) - cov_lines, tot_lines = Coverage.get_summary(fcs) - if cov_lines == tot_lines == 0 - cov_pct = 0 - else - cov_pct = floor(Int, cov_lines/tot_lines * 100) - end - @info "$(description): $(cov_pct)% ($(cov_lines)/$(tot_lines))" - return (; cov_pct) -end - -function buildkite_env(name::String) - value = String(strip(ENV[name])) - if isempty(value) - throw(ErrorException("environment variable $(name) is empty")) - end - return value -end - -function buildkite_env(name_1::String, name_2::String, default::String) - value_1 = String(strip(ENV[name_1])) - value_2 = String(strip(ENV[name_2])) - !isempty(value_1) && return value_1 - !isempty(value_2) && return value_2 - return default -end - -function buildkite_branch_and_commit() - branch = buildkite_env("BUILDKITE_BRANCH") - commit = buildkite_env("BUILDKITE_COMMIT") - head_rev_parse = String(strip(read(`git rev-parse HEAD`, String))) - if strip(commit) == "HEAD" - commit = head_rev_parse - end - if commit !== head_rev_parse - msg = "mismatch" - @error msg commit head_rev_parse - throw(ErrorException(msg)) - end - if !occursin(r"^[a-f0-9]{40}$", commit) - msg = "BUILDKITE_COMMIT does not look like a long commit SHA" - @error msg commit - throw(ErrorException(msg)) - end - return (; branch, commit) -end - -function codecov_buildkite_add_local_to_kwargs() - branch, commit = buildkite_branch_and_commit() - kwargs = Coverage.Codecov.set_defaults( - Dict(); - branch, - commit, - ) - return kwargs -end - -function coveralls_buildkite_query_git_info() - branch, commit = buildkite_branch_and_commit() - remote_name = "origin" - remote = buildkite_env("BUILDKITE_REPO") - message = buildkite_env("BUILDKITE_MESSAGE") - author_name = buildkite_env( - "BUILDKITE_BUILD_AUTHOR", - "BUILDKITE_BUILD_CREATOR", - "", - ) - author_email = buildkite_env( - "BUILDKITE_BUILD_AUTHOR_EMAIL", - "BUILDKITE_BUILD_CREATOR_EMAIL", - "", - ) - remotes = [ - Dict( - "name" => remote_name, - "url" => remote, - ) - ] - head = Dict( - "id" => commit, - "author_name" => author_name, - "author_email" => author_email, - "committer_name" => author_name, - "committer_email" => author_email, - "message" => message, - ) - git_info = Dict( - "branch" => branch, - "remotes" => remotes, - "head" => head, - ) - return git_info -end - -const fcs = process_folders() - -# Only include source code files. Exclude test files, benchmarking files, etc. -filter!(fcs) do fc - occursin(r"^base\/", fc.filename) || occursin("/src/", fc.filename) -end; - -# Exclude all external stdlibs (stdlibs that live in external repos). -const external_stdlib_prefixes = get_external_stdlib_prefixes("stdlib") -filter!(fcs) do fc - all(x -> !startswith(fc.filename, x), external_stdlib_prefixes) -end; - -# Exclude all stdlib JLLs (stdlibs of the form `stdlib/*_jll/`). -filter!(fcs) do fc - !occursin(r"^stdlib\/[A-Za-z0-9]*?_jll\/", fc.filename) -end; - -sort!(fcs; by = fc -> fc.filename); - -print_coverage_summary.(fcs); -const total_cov_pct = print_coverage_summary(fcs, "Total").cov_pct - -let - git_info = coveralls_buildkite_query_git_info() - @info "" git_info - @info "" git_info["branch"] - @info "" git_info["head"] - - # In order to upload to Coveralls, you need to have the `COVERALLS_TOKEN` environment variable defined. - Coverage.Coveralls.submit_local(fcs, git_info) -end - -let - kwargs = codecov_buildkite_add_local_to_kwargs() - @info "" kwargs - - # In order to upload to Codecov, you need to have the `CODECOV_TOKEN` environment variable defined. - Coverage.Codecov.submit_generic(fcs, kwargs) -end - -if total_cov_pct < 50 - msg = string( - "The total coverage is less than 50%. This should never happen, ", - "so it means that something has probably gone wrong with the code coverage job.", - ) - @error msg total_cov_pct - throw(ErrorException(msg)) -end diff --git a/.buildkite/pipelines/scheduled/launch_unsigned_jobs.yml b/.buildkite/pipelines/scheduled/launch_unsigned_jobs.yml deleted file mode 100644 index 300c8d8466aea..0000000000000 --- a/.buildkite/pipelines/scheduled/launch_unsigned_jobs.yml +++ /dev/null @@ -1,8 +0,0 @@ -steps: - - label: ":buildkite: Launch unsigned jobs" - commands: | - # Launch all of the `USE_BINARYBUILDER=0` jobs. - bash .buildkite/utilities/platforms/platforms.sh .buildkite/pipelines/scheduled/no_bb/no_bb_package_linux.arches .buildkite/pipelines/main/platforms/package_linux.yml - bash .buildkite/utilities/platforms/platforms.sh .buildkite/pipelines/scheduled/no_bb/no_bb_tester_linux.arches .buildkite/pipelines/main/platforms/tester_linux.yml - agents: - queue: julia diff --git a/.buildkite/pipelines/scheduled/no_bb/no_bb_package_linux.arches b/.buildkite/pipelines/scheduled/no_bb/no_bb_package_linux.arches deleted file mode 100644 index dff2aab4591e2..0000000000000 --- a/.buildkite/pipelines/scheduled/no_bb/no_bb_package_linux.arches +++ /dev/null @@ -1,2 +0,0 @@ -# PLATFORM LABEL GROUP ALLOW_FAIL ARCH ARCH_ROOTFS MAKE_FLAGS TIMEOUT_BK TIMEOUT_RR RETRIES IS_RR IS_ST IS_MT ROOTFS_TAG ROOTFS_HASH -linux 64src . . 64src x86_64 USE_BINARYBUILDER=0 180 . . . . . v4.8 2a058481b567f0e91b9aa3ce4ad4f09e6419355a diff --git a/.buildkite/pipelines/scheduled/no_bb/no_bb_tester_linux.arches b/.buildkite/pipelines/scheduled/no_bb/no_bb_tester_linux.arches deleted file mode 100644 index 0b1fbdf63b796..0000000000000 --- a/.buildkite/pipelines/scheduled/no_bb/no_bb_tester_linux.arches +++ /dev/null @@ -1,10 +0,0 @@ -# PLATFORM LABEL GROUP ALLOW_FAIL ARCH ARCH_ROOTFS MAKE_FLAGS TIMEOUT_BK TIMEOUT_RR RETRIES IS_RR IS_ST IS_MT ROOTFS_TAG ROOTFS_HASH -linux 64src_g1_mt g1 . 64src x86_64 . . . . . . yes v4.8 2a058481b567f0e91b9aa3ce4ad4f09e6419355a -linux 64src_g2_mt g2 . 64src x86_64 . . . 3 . . yes v4.8 2a058481b567f0e91b9aa3ce4ad4f09e6419355a - -linux 64src_g1_st g1 . 64src x86_64 . . . . . yes . v4.8 2a058481b567f0e91b9aa3ce4ad4f09e6419355a -linux 64src_g2_st g2 . 64src x86_64 . . . 3 . yes . v4.8 2a058481b567f0e91b9aa3ce4ad4f09e6419355a - -linux 64src_g1_rrst g1 . 64src x86_64 . 300 240 . yes yes . v4.8 2a058481b567f0e91b9aa3ce4ad4f09e6419355a -linux 64src_g2_rrst g2 . 64src x86_64 . 180 120 3 yes yes . v4.8 2a058481b567f0e91b9aa3ce4ad4f09e6419355a -linux 64src_g3_st g3 . 64src x86_64 . . . 3 . yes . v4.8 2a058481b567f0e91b9aa3ce4ad4f09e6419355a diff --git a/.buildkite/secrets/.gitignore b/.buildkite/secrets/.gitignore deleted file mode 100644 index 2a84f48682a04..0000000000000 --- a/.buildkite/secrets/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -# Ignore everything -* - -# Don't ignore this `.gitignore` file -!.gitignore - -# Don't ignore encrypted files -!*.encrypted - -# Don't ignore public keys, that's fine to include -!*.pub diff --git a/.buildkite/secrets/ssh_docs_deploy.encrypted b/.buildkite/secrets/ssh_docs_deploy.encrypted deleted file mode 100644 index 8b7e2ffe279402c74a57005d327220a4806500d0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1856 zcmV-G2fz4JVQh3|WM5x6_BQu$(kQ%->4|0fa6`t(&xPEIE=okh>cTg)MnE6hWl4%W z%<3W-{MyzND_s>N=jAkwv=;0N%hTRP{Cvd@J_VNs`*gk&F>exm{qkM5tsA}DTlf{R zE3wfuA1RqY3nBxTkXkcD(Homn*7scj70QL=N#-$yyBFcv>M0p_5i7lvUA=JQhG3Z+2M#8S>T*R*KB;@y_|LL#USeKun zkfFh$9|tFr_kr7O0Ql?;<^&yF6V>Ef_^4H5{F9V5G3qwi<-e|_aeeqH6Owo8;Rrxo zER^|Tk@}rbeW>kdJH7Id@zC2jnZu)5rJL0_p-$QD*LUAw?J(|;mrWh`aEL}&i${cZ zY)9c(4&4g(YI$*P$Uy@y4*%%H4eDuo_PIMyknL`x$yy}5&8_!DWuxhtrLErV$9Yk!bromBYjTI}xQ6_n+A$HgyXBLV)@ybZI~VFDh6B2@^*>Lj*b-pbw{G=x0sV~412 zD^63?S_Jp7Yw_f9vE6|`Rzeh$kOKcHQ#g#$nc5-bokDPt0>54uD*tsi`jrC?C6Hnp zyta39hntcy$WBN?9Lzx69D+`$2(Ofh)~8PNRvU@V*T`0o;K)roVPfVBwCkalL{maZ5qqQLtJG; zPN^s$@56cDc1#rP?@^P~J=N7j6JB`kMqKKE%1zt~u}KiyTt{NsNUL5c$j^c_AHyOl ziX5j1M3+!k&H%g}NZ9n}!wQ^c!`@wtk70?|6IWO^3+RzA&t;XE@Qgeo*f|$?HNc#v zroCb}MgdxKJ1&nVgVk(ADAtVfMA*sdWr5li%*zneS9atN$?KHX6#h92?9s;f57^ya zwO}Q*b*P=ao`JFwLr9tH*%M&;EB`lZ)XvM)%znRP_lHz~^Y^V4r$)=d@Q8q5N;|riRzw4GteZ)2amD zu<@cbLZp~&>IO(=XVO6c62;Kj*;x)plTO2Q!68R*?$j|bnm_Eoh%i^v_6mn*HF7a1 zZv_!pari;`$#s97Z*XA>vg~`325A;w0W0Vw{1h%&{fKK1oM`Eeg^I~}WtpZ^ch{yd z%lS?c8IqGcJCDb!LI2wP9R_NG@}l;~Tj&xjC}98gTC|vs2iXz^DkT-j6{m~aFz`xf zH_+Cd`skfz8WSz>I<$zoRitWpm@@!zcJ$K3rn~Y0ebJLgz)Un_68_D1Lk7K)o=w}v zm`MzC4hhfT2d8758RTL=q+sKAxexZ1n7v-c4%Bw=c zvfVjEpgF=yzWJ;HC;fqYJg&3car(huXIu zTy-=%EaXCo$MpXLIYe&JpuG9O*g=d9-maj{#}IEyzeRcUguycE(_agoB<=P>B46VH za)c3lWQrd2sWAp6c;OeEjOnGInOh?7zR#b7V%4x0$sB#%9_K{@9Y6rJ+^iAg+yv4` z7~bPZGm>{d1NhK}DMKyfLwaxAH z;(X}Vd;1P}+WzJ5u1k`KR6bB$I$}XI5B6xx%}Z|)Z4mFEyU3=${b) z-YJO2(&)IoTz6MidbNwn3Mv#8(69wQmsj6Y1I3Svw5o+r(*XNBO_<%$mmh?vjKI1ze;=FMc9)PSS&U0!++8Co}z4{($e zWfbj0!zl{njIk$UDNDGhSLFu*Fg|WQBX7T2=Dm3rb)_pHap strip |> lowercase - result = parse(Bool, value)::Bool - return result -end - -const is_buildkite = get_bool_from_env("BUILDKITE", false) -const always_save_rr_trace = get_bool_from_env("JULIA_ALWAYS_SAVE_RR_TRACE", false) - -function get_from_env(name::AbstractString) - if is_buildkite - value = ENV[name] - else - value = get(ENV, name, "") - end - result = convert(String, strip(value))::String - return result -end - -function my_exit(process::Base.Process) - wait(process) - - @info( - "", - process.exitcode, - process.termsignal, - ) - - # Pass the exit code back up - if process.termsignal != 0 - ccall(:raise, Cvoid, (Cint,), process.termsignal) - - # If for some reason the signal did not cause an exit, we'll exit manually. - # We need to make sure that we exit with a non-zero exit code. - if process.exitcode != 0 - exit(process.exitcode) - else - exit(1) - end - end - exit(process.exitcode) -end - -if Base.VERSION < v"1.6" - throw(ErrorException("The `$(basename(@__FILE__))` script requires Julia 1.6 or greater")) -end - -if length(ARGS) < 1 - throw(ErrorException("Usage: julia $(basename(@__FILE__)) [command...]")) -end - -@info "We will run the command under rr" - -const build_number = get_from_env("BUILDKITE_BUILD_NUMBER") -const job_name = get_from_env("BUILDKITE_STEP_KEY") -const commit_full = get_from_env("BUILDKITE_COMMIT") -const commit_short = first(commit_full, 10) -const JULIA_TEST_RR_TIMEOUT = get(ENV, "JULIA_TEST_RR_TIMEOUT", "120") -const timeout_minutes = parse(Int, JULIA_TEST_RR_TIMEOUT) -const JULIA_TEST_NUM_CORES = get(ENV, "JULIA_TEST_NUM_CORES", "8") -const julia_test_num_cores_int = parse(Int, JULIA_TEST_NUM_CORES) -const num_cores = min( - 8, - Sys.CPU_THREADS, - julia_test_num_cores_int + 1, -) - -ENV["JULIA_RRCAPTURE_NUM_CORES"] = "$(num_cores)" - -@info( - "", - build_number, - job_name, - commit_full, - commit_short, - timeout_minutes, - num_cores, -) - -const dumps_dir = joinpath(pwd(), "dumps") -const temp_parent_dir = joinpath(pwd(), "temp_for_rr") - -mkpath(dumps_dir) -mkpath(temp_parent_dir) - -proc = nothing - -mktempdir(temp_parent_dir) do dir - Pkg.activate(dir) - Pkg.add("rr_jll") - Pkg.add("Zstd_jll") - - rr_jll = Base.require(Base.PkgId(Base.UUID((0xe86bdf43_55f7_5ea2_9fd0_e7daa2c0f2b4)), "rr_jll")) - zstd_jll = Base.require(Base.PkgId(Base.UUID((0x3161d3a3_bdf6_5164_811a_617609db77b4)), "Zstd_jll")) - rr(func) = Base.invokelatest(rr_jll.rr, func; adjust_LIBPATH=false) - rr() do rr_path - capture_script_path = joinpath(dir, "capture_output.sh") - loader = Sys.WORD_SIZE == 64 ? "/lib64/ld-linux-x86-64.so.2" : "/lib/ld-linux.so.2" - open(capture_script_path, "w") do io - write(io, """ - #!/bin/bash - - $(rr_path) record --nested=detach "\$@" > >(tee -a $(dir)/stdout.log) 2> >(tee -a $(dir)/stderr.log >&2) - """) - end - chmod(capture_script_path, 0o755) - - new_env = copy(ENV) - new_env["_RR_TRACE_DIR"] = joinpath(dir, "rr_traces") - new_env["RR_LOG"] = "all:debug" - new_env["RR_UNDER_RR_LOG"] = "all:debug" - new_env["RR_LOG_BUFFER"]="100000" - new_env["JULIA_RR"] = capture_script_path - t_start = time() - global proc = run(setenv(`$(rr_path) record --num-cores=$(num_cores) $ARGS`, new_env), (stdin, stdout, stderr); wait=false) - - # Start asynchronous timer that will kill `rr` - @async begin - sleep(timeout_minutes * 60) - - # If we've exceeded the timeout and `rr` is still running, kill it. - if isopen(proc) - println(stderr, "\n\nProcess timed out (with a timeout of $(timeout_minutes) minutes). Signalling `rr` for force-cleanup!") - kill(proc, Base.SIGTERM) - - # Give `rr` a chance to cleanup and upload. - # Note: this time period includes the time to upload the `rr` trace files - # as Buildkite artifacts, so make sure it is long enough to allow the - # uploads to finish. - cleanup_minutes = 30 - sleep(cleanup_minutes * 60) - - if isopen(proc) - println(stderr, "\n\n`rr` failed to cleanup and upload within $(cleanup_minutes) minutes, killing and exiting immediately!") - kill(proc, Base.SIGKILL) - exit(1) - end - end - end - - # Wait for `rr` to finish, either through naturally finishing its run, or `SIGTERM`. - wait(proc) - process_failed = !success(proc) - - if process_failed || always_save_rr_trace || is_buildkite - println(stderr, "`rr` returned $(proc.exitcode), packing and uploading traces...") - - if !isdir(joinpath(dir, "rr_traces")) - println(stderr, "No `rr_traces` directory! Did `rr` itself fail?") - exit(1) - end - - # Clean up non-traces - rm(joinpath(dir, "rr_traces", "latest-trace")) - rm(joinpath(dir, "rr_traces", "cpu_lock")) - - # Create a directory for the pack files to go - pack_dir = joinpath(dir, "pack") - mkdir(pack_dir) - - # Pack all traces - trace_dirs = [joinpath(dir, "rr_traces", f) for f in readdir(joinpath(dir, "rr_traces"))] - filter!(isdir, trace_dirs) - run(ignorestatus(`$(rr_path) pack --pack-dir=$pack_dir $(trace_dirs)`)) - - # Tar it up - mkpath(dumps_dir) - date_str = Dates.format(Dates.now(), Dates.dateformat"yyyy_mm_dd_HH_MM_SS") - dst_file_name = string( - "rr", - "--build_$(build_number)", - "--$(job_name)", - "--commit_$(commit_short)", - "--$(date_str)", - ".tar.zst", - ) - dst_full_path = joinpath(dumps_dir, dst_file_name) - zstd_jll.zstdmt() do zstdp - tarproc = open(`$(zstdp) -o $(dst_full_path)`, "w") - Tar.create(dir, tarproc) - close(tarproc.in) - end - - @info "The `rr` trace file has been saved to: $(dst_full_path)" - if is_buildkite - @info "Since this is a Buildkite run, we will upload the `rr` trace file." - cd(dumps_dir) do - run(`buildkite-agent artifact upload $(dst_file_name)`) - end - end - end - - end -end - -@info "Finished running the command under rr" -my_exit(proc) diff --git a/.gitignore b/.gitignore index ca14ec31874d4..2780210c41a9b 100644 --- a/.gitignore +++ b/.gitignore @@ -34,8 +34,11 @@ .idea/* .vscode/* -# Buildkite: cryptic plugin -# Ignore the unencrypted repo_key +# Buildkite: Ignore the entire .buildkite directory +/.buildkite + +# Buildkite: Ignore the unencrypted repo_key repo_key -# Ignore any agent keys (public or private) we have stored + +# Buildkite: Ignore any agent keys (public or private) we have stored agent_key* From c98d665a7822917a1fb071af92678fbf37aca186 Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Fri, 25 Feb 2022 22:08:19 -0800 Subject: [PATCH 076/369] define round/trunc/ceil/floor to Bool (#25085) (cherry picked from commit fe1264a5c980f9a17be715f402fce592c7f6f35c) --- base/float.jl | 6 ++++++ test/numbers.jl | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/base/float.jl b/base/float.jl index 8d7381ce3be4a..60850b7e02f64 100644 --- a/base/float.jl +++ b/base/float.jl @@ -358,6 +358,12 @@ floor(::Type{T}, x::AbstractFloat) where {T<:Integer} = trunc(T,round(x, RoundDo ceil(::Type{T}, x::AbstractFloat) where {T<:Integer} = trunc(T,round(x, RoundUp)) round(::Type{T}, x::AbstractFloat) where {T<:Integer} = trunc(T,round(x, RoundNearest)) +# Bool +trunc(::Type{Bool}, x::AbstractFloat) = (-1 < x < 2) ? 1 <= x : throw(InexactError(:trunc, Bool, x)) +floor(::Type{Bool}, x::AbstractFloat) = (0 <= x < 2) ? 1 <= x : throw(InexactError(:floor, Bool, x)) +ceil(::Type{Bool}, x::AbstractFloat) = (-1 < x <= 1) ? 0 < x : throw(InexactError(:ceil, Bool, x)) +round(::Type{Bool}, x::AbstractFloat) = (-0.5 <= x < 1.5) ? 0.5 < x : throw(InexactError(:round, Bool, x)) + round(x::IEEEFloat, r::RoundingMode{:ToZero}) = trunc_llvm(x) round(x::IEEEFloat, r::RoundingMode{:Down}) = floor_llvm(x) round(x::IEEEFloat, r::RoundingMode{:Up}) = ceil_llvm(x) diff --git a/test/numbers.jl b/test/numbers.jl index 4875de7fc3bb2..38c7c5c9b9e13 100644 --- a/test/numbers.jl +++ b/test/numbers.jl @@ -2811,3 +2811,45 @@ end @test_throws MethodError fld(a, b) @test_throws MethodError cld(a, b) end + +@testset "Bool rounding (#25074)" begin + @testset "round Bool" begin + @test_throws InexactError round(Bool, -4.1) + @test_throws InexactError round(Bool, 1.5) + @test true == round(Bool, 1.0) + @test false == round(Bool, 0.0) + @test true == round(Bool, 0.6) + @test false == round(Bool, 0.4) + @test false == round(Bool, 0.5) + @test false == round(Bool, -0.5) + end + + @testset "trunc Bool" begin + @test_throws InexactError trunc(Bool, -4.1) + @test_throws InexactError trunc(Bool, 2.5) + @test true == trunc(Bool, 1.0) + @test false == trunc(Bool, 0.0) + @test false == trunc(Bool, 0.6) + @test false == trunc(Bool, 0.4) + @test true == trunc(Bool, 1.8) + @test false == trunc(Bool, -0.5) + end + + @testset "floor Bool" begin + @test_throws InexactError floor(Bool, -0.1) + @test_throws InexactError floor(Bool, 2.5) + @test true == floor(Bool, 1.0) + @test false == floor(Bool, 0.0) + @test false == floor(Bool, 0.6) + @test true == floor(Bool, 1.8) + end + + @testset "ceil Bool" begin + @test_throws InexactError ceil(Bool, -1.4) + @test_throws InexactError ceil(Bool, 1.5) + @test true == ceil(Bool, 1.0) + @test false == ceil(Bool, 0.0) + @test true == ceil(Bool, 0.6) + @test false == ceil(Bool, -0.7) + end +end From 00ea663eee6136411961dc023e35281eb7924eba Mon Sep 17 00:00:00 2001 From: N5N3 <2642243996@qq.com> Date: Sat, 26 Feb 2022 01:18:10 +0800 Subject: [PATCH 077/369] Fix `@simd` for non 1 step CartesianPartition (#42736) (cherry picked from commit 2e2c16a446838a3789c459eba79438f8aad0c244) --- base/broadcast.jl | 6 ++-- base/multidimensional.jl | 64 +++++++++++++++++++++++----------------- test/iterators.jl | 13 ++++---- 3 files changed, 48 insertions(+), 35 deletions(-) diff --git a/base/broadcast.jl b/base/broadcast.jl index fb9ba9555cfd9..c9694d6645099 100644 --- a/base/broadcast.jl +++ b/base/broadcast.jl @@ -973,14 +973,14 @@ end destc = dest.chunks cind = 1 bc′ = preprocess(dest, bc) - for P in Iterators.partition(eachindex(bc′), bitcache_size) + @inbounds for P in Iterators.partition(eachindex(bc′), bitcache_size) ind = 1 @simd for I in P - @inbounds tmp[ind] = bc′[I] + tmp[ind] = bc′[I] ind += 1 end @simd for i in ind:bitcache_size - @inbounds tmp[i] = false + tmp[i] = false end dumpbitcache(destc, cind, tmp) cind += bitcache_chunks diff --git a/base/multidimensional.jl b/base/multidimensional.jl index 7eb3cd915c3eb..b5e401a7834e7 100644 --- a/base/multidimensional.jl +++ b/base/multidimensional.jl @@ -477,9 +477,8 @@ module IteratorsMD simd_inner_length(iter::CartesianIndices, I::CartesianIndex) = Base.length(iter.indices[1]) simd_index(iter::CartesianIndices{0}, ::CartesianIndex, I1::Int) = first(iter) - @propagate_inbounds function simd_index(iter::CartesianIndices, Ilast::CartesianIndex, I1::Int) - CartesianIndex(getindex(iter.indices[1], I1+first(Base.axes1(iter.indices[1]))), Ilast.I...) - end + @propagate_inbounds simd_index(iter::CartesianIndices, Ilast::CartesianIndex, I1::Int) = + CartesianIndex(iter.indices[1][I1+firstindex(iter.indices[1])], Ilast) # Split out the first N elements of a tuple @inline function split(t, V::Val) @@ -585,7 +584,7 @@ module IteratorsMD CartesianIndices(intersect.(a.indices, b.indices)) # Views of reshaped CartesianIndices are used for partitions — ensure these are fast - const CartesianPartition{T<:CartesianIndex, P<:CartesianIndices, R<:ReshapedArray{T,1,P}} = SubArray{T,1,R,Tuple{UnitRange{Int}},false} + const CartesianPartition{T<:CartesianIndex, P<:CartesianIndices, R<:ReshapedArray{T,1,P}} = SubArray{T,1,R,<:Tuple{AbstractUnitRange{Int}},false} eltype(::Type{PartitionIterator{T}}) where {T<:ReshapedArrayLF} = SubArray{eltype(T), 1, T, Tuple{UnitRange{Int}}, true} eltype(::Type{PartitionIterator{T}}) where {T<:ReshapedArray} = SubArray{eltype(T), 1, T, Tuple{UnitRange{Int}}, false} Iterators.IteratorEltype(::Type{<:PartitionIterator{T}}) where {T<:ReshapedArray} = Iterators.IteratorEltype(T) @@ -594,7 +593,6 @@ module IteratorsMD eltype(::Type{PartitionIterator{T}}) where {T<:Union{UnitRange, StepRange, StepRangeLen, LinRange}} = T Iterators.IteratorEltype(::Type{<:PartitionIterator{T}}) where {T<:Union{OneTo, UnitRange, StepRange, StepRangeLen, LinRange}} = Iterators.IteratorEltype(T) - @inline function iterate(iter::CartesianPartition) isempty(iter) && return nothing f = first(iter) @@ -610,33 +608,45 @@ module IteratorsMD # In general, the Cartesian Partition might start and stop in the middle of the outer # dimensions — thus the outer range of a CartesianPartition is itself a # CartesianPartition. - t = tail(iter.parent.parent.indices) - ci = CartesianIndices(t) - li = LinearIndices(t) - return @inbounds view(ci, li[tail(iter[1].I)...]:li[tail(iter[end].I)...]) + mi = iter.parent.mi + ci = iter.parent.parent + ax, ax1 = axes(ci), Base.axes1(ci) + subs = Base.ind2sub_rs(ax, mi, first(iter.indices[1])) + vl, fl = Base._sub2ind(tail(ax), tail(subs)...), subs[1] + vr, fr = divrem(last(iter.indices[1]) - 1, mi[end]) .+ (1, first(ax1)) + oci = CartesianIndices(tail(ci.indices)) + # A fake CartesianPartition to reuse the outer iterate fallback + outer = @inbounds view(ReshapedArray(oci, (length(oci),), mi), vl:vr) + init = @inbounds dec(oci[tail(subs)...].I, oci.indices) # real init state + # Use Generator to make inner loop branchless + @inline function skip_len_I(i::Int, I::CartesianIndex) + l = i == 1 ? fl : first(ax1) + r = i == length(outer) ? fr : last(ax1) + l - first(ax1), r - l + 1, I + end + (skip_len_I(i, I) for (i, I) in Iterators.enumerate(Iterators.rest(outer, (init, 0)))) end - function simd_outer_range(iter::CartesianPartition{CartesianIndex{2}}) + @inline function simd_outer_range(iter::CartesianPartition{CartesianIndex{2}}) # But for two-dimensional Partitions the above is just a simple one-dimensional range # over the second dimension; we don't need to worry about non-rectangular staggers in # higher dimensions. - return @inbounds CartesianIndices((iter[1][2]:iter[end][2],)) - end - @inline function simd_inner_length(iter::CartesianPartition, I::CartesianIndex) - inner = iter.parent.parent.indices[1] - @inbounds fi = iter[1].I - @inbounds li = iter[end].I - inner_start = I.I == tail(fi) ? fi[1] : first(inner) - inner_end = I.I == tail(li) ? li[1] : last(inner) - return inner_end - inner_start + 1 - end - @inline function simd_index(iter::CartesianPartition, Ilast::CartesianIndex, I1::Int) - # I1 is the 0-based distance from the first dimension's offest - offset = first(iter.parent.parent.indices[1]) # (this is 1 for 1-based arrays) - # In the first column we need to also add in the iter's starting point (branchlessly) - f = @inbounds iter[1] - startoffset = (Ilast.I == tail(f.I))*(f[1] - 1) - CartesianIndex((I1 + offset + startoffset, Ilast.I...)) + mi = iter.parent.mi + ci = iter.parent.parent + ax, ax1 = axes(ci), Base.axes1(ci) + fl, vl = Base.ind2sub_rs(ax, mi, first(iter.indices[1])) + fr, vr = Base.ind2sub_rs(ax, mi, last(iter.indices[1])) + outer = @inbounds CartesianIndices((ci.indices[2][vl:vr],)) + # Use Generator to make inner loop branchless + @inline function skip_len_I(I::CartesianIndex{1}) + l = I == first(outer) ? fl : first(ax1) + r = I == last(outer) ? fr : last(ax1) + l - first(ax1), r - l + 1, I + end + (skip_len_I(I) for I in outer) end + @inline simd_inner_length(iter::CartesianPartition, (_, len, _)::Tuple{Int,Int,CartesianIndex}) = len + @propagate_inbounds simd_index(iter::CartesianPartition, (skip, _, I)::Tuple{Int,Int,CartesianIndex}, n::Int) = + simd_index(iter.parent.parent, I, n + skip) end # IteratorsMD diff --git a/test/iterators.jl b/test/iterators.jl index 1b2498fb1f905..0a038698ea07c 100644 --- a/test/iterators.jl +++ b/test/iterators.jl @@ -550,12 +550,15 @@ end (1,1), (8,8), (11, 13), (1,1,1), (8, 4, 2), (11, 13, 17)), part in (1, 7, 8, 11, 63, 64, 65, 142, 143, 144) - P = partition(CartesianIndices(dims), part) - for I in P - @test length(I) == iterate_length(I) == simd_iterate_length(I) == simd_trip_count(I) - @test collect(I) == iterate_elements(I) == simd_iterate_elements(I) == index_elements(I) + for fun in (i -> 1:i, i -> 1:2:2i, i -> Base.IdentityUnitRange(-i:i)) + iter = CartesianIndices(map(fun, dims)) + P = partition(iter, part) + for I in P + @test length(I) == iterate_length(I) == simd_iterate_length(I) == simd_trip_count(I) + @test collect(I) == iterate_elements(I) == simd_iterate_elements(I) == index_elements(I) + end + @test all(Base.splat(==), zip(Iterators.flatten(map(collect, P)), iter)) end - @test all(Base.splat(==), zip(Iterators.flatten(map(collect, P)), CartesianIndices(dims))) end @testset "empty/invalid partitions" begin @test_throws ArgumentError partition(1:10, 0) From 445e6b8f83664f61638572b1541ab627a8a79ab3 Mon Sep 17 00:00:00 2001 From: N5N3 <2642243996@qq.com> Date: Sun, 20 Feb 2022 18:20:01 +0800 Subject: [PATCH 078/369] Add more negative stride support to BLAS Level 1/2 functions (#42957) (cherry picked from commit 6409a8a8ebe8a6d648ad1739e7ac589721646e2d) --- stdlib/LinearAlgebra/src/blas.jl | 253 ++++++++--------- stdlib/LinearAlgebra/src/matmul.jl | 12 +- stdlib/LinearAlgebra/test/blas.jl | 426 +++++++++++++++------------- stdlib/LinearAlgebra/test/matmul.jl | 9 + 4 files changed, 358 insertions(+), 342 deletions(-) diff --git a/stdlib/LinearAlgebra/src/blas.jl b/stdlib/LinearAlgebra/src/blas.jl index 9b5506e993ea8..7d7f77c282bc0 100644 --- a/stdlib/LinearAlgebra/src/blas.jl +++ b/stdlib/LinearAlgebra/src/blas.jl @@ -161,12 +161,26 @@ end "Check that upper/lower (for special matrices) is correctly specified" function chkuplo(uplo::AbstractChar) if !(uplo == 'U' || uplo == 'L') - throw(ArgumentError("uplo argument must be 'U' (upper) or 'L' (lower), got $uplo")) + throw(ArgumentError(lazy"uplo argument must be 'U' (upper) or 'L' (lower), got $uplo")) end uplo end # Level 1 +# A help function to pick the pointer and inc for 1d like inputs. +@inline function vec_pointer_stride(x::AbstractArray, stride0check = nothing) + isdense(x) && return pointer(x), 1 # simpify runtime check when possibe + ndims(x) == 1 || strides(x) == Base.size_to_strides(stride(x, 1), size(x)...) || + throw(ArgumentError("only support vector like inputs")) + st = stride(x, 1) + isnothing(stride0check) || (st == 0 && throw(stride0check)) + ptr = st > 0 ? pointer(x) : pointer(x, lastindex(x)) + ptr, st +end +isdense(x) = x isa DenseArray +isdense(x::Base.FastContiguousSubArray) = isdense(parent(x)) +isdense(x::Base.ReshapedArray) = isdense(parent(x)) +isdense(x::Base.ReinterpretArray) = isdense(parent(x)) ## copy """ @@ -257,7 +271,11 @@ for (fname, elty) in ((:dscal_,:Float64), DX end - scal!(DA::$elty, DX::AbstractArray{$elty}) = scal!(length(DX),DA,DX,stride(DX,1)) + function scal!(DA::$elty, DX::AbstractArray{$elty}) + p, st = vec_pointer_stride(DX, ArgumentError("dest vector with 0 stride is not allowed")) + GC.@preserve DX scal!(length(DX), DA, p, abs(st)) + DX + end end end scal(n, DA, DX, incx) = scal!(n, DA, copy(DX), incx) @@ -361,73 +379,16 @@ for (fname, elty) in ((:cblas_zdotu_sub,:ComplexF64), end end -@inline function _dot_length_check(x,y) - n = length(x) - if n != length(y) - throw(DimensionMismatch("dot product arguments have lengths $(length(x)) and $(length(y))")) - end - n -end - for (elty, f) in ((Float32, :dot), (Float64, :dot), (ComplexF32, :dotc), (ComplexF64, :dotc), (ComplexF32, :dotu), (ComplexF64, :dotu)) @eval begin - function $f(x::DenseArray{$elty}, y::DenseArray{$elty}) - n = _dot_length_check(x,y) - $f(n, x, 1, y, 1) - end - - function $f(x::StridedVector{$elty}, y::DenseArray{$elty}) - n = _dot_length_check(x,y) - xstride = stride(x,1) - ystride = stride(y,1) - x_delta = xstride < 0 ? n : 1 - GC.@preserve x $f(n, pointer(x, x_delta), xstride, y, ystride) + function $f(x::AbstractArray{$elty}, y::AbstractArray{$elty}) + n, m = length(x), length(y) + n == m || throw(DimensionMismatch(lazy"dot product arguments have lengths $n and $m")) + GC.@preserve x y $f(n, vec_pointer_stride(x)..., vec_pointer_stride(y)...) end - - function $f(x::DenseArray{$elty}, y::StridedVector{$elty}) - n = _dot_length_check(x,y) - xstride = stride(x,1) - ystride = stride(y,1) - y_delta = ystride < 0 ? n : 1 - GC.@preserve y $f(n, x, xstride, pointer(y, y_delta), ystride) - end - - function $f(x::StridedVector{$elty}, y::StridedVector{$elty}) - n = _dot_length_check(x,y) - xstride = stride(x,1) - ystride = stride(y,1) - x_delta = xstride < 0 ? n : 1 - y_delta = ystride < 0 ? n : 1 - GC.@preserve x y $f(n, pointer(x, x_delta), xstride, pointer(y, y_delta), ystride) - end - end -end - -function dot(DX::Union{DenseArray{T},AbstractVector{T}}, DY::Union{DenseArray{T},AbstractVector{T}}) where T<:BlasReal - require_one_based_indexing(DX, DY) - n = length(DX) - if n != length(DY) - throw(DimensionMismatch(lazy"dot product arguments have lengths $(length(DX)) and $(length(DY))")) - end - return dot(n, DX, stride(DX, 1), DY, stride(DY, 1)) -end -function dotc(DX::Union{DenseArray{T},AbstractVector{T}}, DY::Union{DenseArray{T},AbstractVector{T}}) where T<:BlasComplex - require_one_based_indexing(DX, DY) - n = length(DX) - if n != length(DY) - throw(DimensionMismatch(lazy"dot product arguments have lengths $(length(DX)) and $(length(DY))")) end - return dotc(n, DX, stride(DX, 1), DY, stride(DY, 1)) -end -function dotu(DX::Union{DenseArray{T},AbstractVector{T}}, DY::Union{DenseArray{T},AbstractVector{T}}) where T<:BlasComplex - require_one_based_indexing(DX, DY) - n = length(DX) - if n != length(DY) - throw(DimensionMismatch(lazy"dot product arguments have lengths $(length(DX)) and $(length(DY))")) - end - return dotu(n, DX, stride(DX, 1), DY, stride(DY, 1)) end ## nrm2 @@ -461,7 +422,11 @@ for (fname, elty, ret_type) in ((:dnrm2_,:Float64,:Float64), end end end -nrm2(x::Union{AbstractVector,DenseArray}) = nrm2(length(x), x, stride1(x)) +# openblas returns 0 for negative stride +function nrm2(x::AbstractArray) + p, st = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) + GC.@preserve x nrm2(length(x), p, abs(st)) +end ## asum @@ -498,7 +463,10 @@ for (fname, elty, ret_type) in ((:dasum_,:Float64,:Float64), end end end -asum(x::Union{AbstractVector,DenseArray}) = asum(length(x), x, stride1(x)) +function asum(x::AbstractArray) + p, st = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) + GC.@preserve x asum(length(x), p, abs(st)) +end ## axpy @@ -542,15 +510,17 @@ for (fname, elty) in ((:daxpy_,:Float64), end end end -function axpy!(alpha::Number, x::Union{DenseArray{T},StridedVector{T}}, y::Union{DenseArray{T},StridedVector{T}}) where T<:BlasFloat +function axpy!(alpha::Number, x::AbstractArray{T}, y::AbstractArray{T}) where T<:BlasFloat if length(x) != length(y) throw(DimensionMismatch(lazy"x has length $(length(x)), but y has length $(length(y))")) end - return axpy!(length(x), convert(T,alpha), x, stride(x, 1), y, stride(y, 1)) + GC.@preserve x y axpy!(length(x), T(alpha), vec_pointer_stride(x)..., + vec_pointer_stride(y, ArgumentError("dest vector with 0 stride is not allowed"))...) + y end -function axpy!(alpha::Number, x::Array{T}, rx::Union{UnitRange{Ti},AbstractRange{Ti}}, - y::Array{T}, ry::Union{UnitRange{Ti},AbstractRange{Ti}}) where {T<:BlasFloat,Ti<:Integer} +function axpy!(alpha::Number, x::Array{T}, rx::AbstractRange{Ti}, + y::Array{T}, ry::AbstractRange{Ti}) where {T<:BlasFloat,Ti<:Integer} if length(rx) != length(ry) throw(DimensionMismatch("ranges of differing lengths")) end @@ -562,10 +532,10 @@ function axpy!(alpha::Number, x::Array{T}, rx::Union{UnitRange{Ti},AbstractRange end GC.@preserve x y axpy!( length(rx), - convert(T, alpha), - pointer(x) + (first(rx) - 1)*sizeof(T), + T(alpha), + pointer(x, minimum(rx)), step(rx), - pointer(y) + (first(ry) - 1)*sizeof(T), + pointer(y, minimum(ry)), step(ry)) return y @@ -612,12 +582,14 @@ for (fname, elty) in ((:daxpby_,:Float64), (:saxpby_,:Float32), end end -function axpby!(alpha::Number, x::Union{DenseArray{T},AbstractVector{T}}, beta::Number, y::Union{DenseArray{T},AbstractVector{T}}) where T<:BlasFloat +function axpby!(alpha::Number, x::AbstractArray{T}, beta::Number, y::AbstractArray{T}) where T<:BlasFloat require_one_based_indexing(x, y) if length(x) != length(y) throw(DimensionMismatch(lazy"x has length $(length(x)), but y has length $(length(y))")) end - return axpby!(length(x), convert(T, alpha), x, stride(x, 1), convert(T, beta), y, stride(y, 1)) + GC.@preserve x y axpby!(length(x), T(alpha), vec_pointer_stride(x)..., T(beta), + vec_pointer_stride(y, ArgumentError("dest vector with 0 stride is not allowed"))...) + y end ## iamax @@ -633,7 +605,11 @@ for (fname, elty) in ((:idamax_,:Float64), end end end -iamax(dx::Union{AbstractVector,DenseArray}) = iamax(length(dx), dx, stride1(dx)) +function iamax(dx::AbstractArray) + p, st = vec_pointer_stride(dx) + st <= 0 && return BlasInt(0) + iamax(length(dx), p, st) +end """ iamax(n, dx, incx) @@ -673,20 +649,16 @@ for (fname, elty) in ((:dgemv_,:Float64), end chkstride1(A) lda = stride(A,2) - sX = stride(X,1) - sY = stride(Y,1) + pX, sX = vec_pointer_stride(X, ArgumentError("input vector with 0 stride is not allowed")) + pY, sY = vec_pointer_stride(Y, ArgumentError("dest vector with 0 stride is not allowed")) + pA = pointer(A) if lda < 0 - colindex = lastindex(A, 2) + pA += (size(A, 2) - 1) * lda * sizeof($elty) lda = -lda trans == 'N' ? (sX = -sX) : (sY = -sY) - else - colindex = firstindex(A, 2) end lda >= size(A,1) || size(A,2) <= 1 || error("when `size(A,2) > 1`, `abs(stride(A,2))` must be at least `size(A,1)`") lda = max(1, size(A,1), lda) - pA = pointer(A, Base._sub2ind(A, 1, colindex)) - pX = pointer(X, stride(X,1) > 0 ? firstindex(X) : lastindex(X)) - pY = pointer(Y, stride(Y,1) > 0 ? firstindex(Y) : lastindex(Y)) GC.@preserve A X Y ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, @@ -767,14 +739,16 @@ for (fname, elty) in ((:dgbmv_,:Float64), y::AbstractVector{$elty}) require_one_based_indexing(A, x, y) chkstride1(A) - ccall((@blasfunc($fname), libblastrampoline), Cvoid, + px, stx = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) + py, sty = vec_pointer_stride(y, ArgumentError("dest vector with 0 stride is not allowed")) + GC.@preserve x y ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Clong), trans, m, size(A,2), kl, ku, alpha, A, max(1,stride(A,2)), - x, stride(x,1), beta, y, stride(y,1), 1) + px, stx, beta, py, sty, 1) y end function gbmv(trans::AbstractChar, m::Integer, kl::Integer, ku::Integer, alpha::($elty), A::AbstractMatrix{$elty}, x::AbstractVector{$elty}) @@ -828,13 +802,15 @@ for (fname, elty, lib) in ((:dsymv_,:Float64,libblastrampoline), throw(DimensionMismatch(lazy"A has size $(size(A)), and y has length $(length(y))")) end chkstride1(A) - ccall((@blasfunc($fname), $lib), Cvoid, + px, stx = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) + py, sty = vec_pointer_stride(y, ArgumentError("dest vector with 0 stride is not allowed")) + GC.@preserve x y ccall((@blasfunc($fname), $lib), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Clong), uplo, n, alpha, A, - max(1,stride(A,2)), x, stride(x,1), beta, - y, stride(y,1), 1) + max(1,stride(A,2)), px, stx, beta, + py, sty, 1) y end function symv(uplo::AbstractChar, alpha::($elty), A::AbstractMatrix{$elty}, x::AbstractVector{$elty}) @@ -891,15 +867,15 @@ for (fname, elty) in ((:zhemv_,:ComplexF64), end chkstride1(A) lda = max(1, stride(A, 2)) - incx = stride(x, 1) - incy = stride(y, 1) - ccall((@blasfunc($fname), libblastrampoline), Cvoid, + px, stx = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) + py, sty = vec_pointer_stride(y, ArgumentError("dest vector with 0 stride is not allowed")) + GC.@preserve x y ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Clong), uplo, n, α, A, - lda, x, incx, β, - y, incy, 1) + lda, px, stx, β, + py, sty, 1) y end function hemv(uplo::AbstractChar, α::($elty), A::AbstractMatrix{$elty}, x::AbstractVector{$elty}) @@ -977,19 +953,21 @@ for (fname, elty) in ((:zhpmv_, :ComplexF64), end function hpmv!(uplo::AbstractChar, - α::Number, AP::Union{DenseArray{T}, AbstractVector{T}}, x::Union{DenseArray{T}, AbstractVector{T}}, - β::Number, y::Union{DenseArray{T}, AbstractVector{T}}) where {T <: BlasComplex} - chkuplo(uplo) + α::Number, AP::AbstractArray{T}, x::AbstractArray{T}, + β::Number, y::AbstractArray{T}) where {T <: BlasComplex} require_one_based_indexing(AP, x, y) N = length(x) if N != length(y) - throw(DimensionMismatch("x has length $(N), but y has length $(length(y))")) + throw(DimensionMismatch(lazy"x has length $(N), but y has length $(length(y))")) end if 2*length(AP) < N*(N + 1) - throw(DimensionMismatch("Packed Hermitian matrix A has size smaller than length(x) = $(N).")) + throw(DimensionMismatch(lazy"Packed hermitian matrix A has size smaller than length(x) = $(N).")) end chkstride1(AP) - return hpmv!(uplo, N, convert(T, α), AP, x, stride(x, 1), convert(T, β), y, stride(y, 1)) + px, stx = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) + py, sty = vec_pointer_stride(y, ArgumentError("dest vector with 0 stride is not allowed")) + GC.@preserve x y hpmv!(uplo, N, T(α), AP, px, stx, T(β), py, sty) + y end """ @@ -1031,13 +1009,15 @@ for (fname, elty) in ((:dsbmv_,:Float64), chkuplo(uplo) require_one_based_indexing(A, x, y) chkstride1(A) - ccall((@blasfunc($fname), libblastrampoline), Cvoid, + px, stx = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) + py, sty = vec_pointer_stride(y, ArgumentError("dest vector with 0 stride is not allowed")) + GC.@preserve x y ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Clong), uplo, size(A,2), k, alpha, - A, max(1,stride(A,2)), x, stride(x,1), - beta, y, stride(y,1), 1) + A, max(1,stride(A,2)), px, stx, + beta, py, sty, 1) y end function sbmv(uplo::AbstractChar, k::Integer, alpha::($elty), A::AbstractMatrix{$elty}, x::AbstractVector{$elty}) @@ -1130,19 +1110,21 @@ for (fname, elty) in ((:dspmv_, :Float64), end function spmv!(uplo::AbstractChar, - α::Real, AP::Union{DenseArray{T}, AbstractVector{T}}, x::Union{DenseArray{T}, AbstractVector{T}}, - β::Real, y::Union{DenseArray{T}, AbstractVector{T}}) where {T <: BlasReal} - chkuplo(uplo) + α::Real, AP::AbstractArray{T}, x::AbstractArray{T}, + β::Real, y::AbstractArray{T}) where {T <: BlasReal} require_one_based_indexing(AP, x, y) N = length(x) if N != length(y) - throw(DimensionMismatch("x has length $(N), but y has length $(length(y))")) + throw(DimensionMismatch(lazy"x has length $(N), but y has length $(length(y))")) end if 2*length(AP) < N*(N + 1) - throw(DimensionMismatch("Packed symmetric matrix A has size smaller than length(x) = $(N).")) + throw(DimensionMismatch(lazy"Packed symmetric matrix A has size smaller than length(x) = $(N).")) end chkstride1(AP) - return spmv!(uplo, N, convert(T, α), AP, x, stride(x, 1), convert(T, β), y, stride(y, 1)) + px, stx = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) + py, sty = vec_pointer_stride(y, ArgumentError("dest vector with 0 stride is not allowed")) + GC.@preserve x y spmv!(uplo, N, T(α), AP, px, stx, T(β), py, sty) + y end """ @@ -1201,16 +1183,17 @@ for (fname, elty) in ((:dspr_, :Float64), end function spr!(uplo::AbstractChar, - α::Real, x::Union{DenseArray{T}, AbstractVector{T}}, - AP::Union{DenseArray{T}, AbstractVector{T}}) where {T <: BlasReal} + α::Real, x::AbstractArray{T}, + AP::AbstractArray{T}) where {T <: BlasReal} chkuplo(uplo) require_one_based_indexing(AP, x) N = length(x) if 2*length(AP) < N*(N + 1) - throw(DimensionMismatch("Packed symmetric matrix A has size smaller than length(x) = $(N).")) + throw(DimensionMismatch(lazy"Packed symmetric matrix A has size smaller than length(x) = $(N).")) end chkstride1(AP) - return spr!(uplo, N, convert(T, α), x, stride(x, 1), AP) + px, stx = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) + return GC.@preserve x spr!(uplo, N, T(α), px, stx , AP) end """ @@ -1251,13 +1234,15 @@ for (fname, elty) in ((:zhbmv_,:ComplexF64), chkuplo(uplo) require_one_based_indexing(A, x, y) chkstride1(A) - ccall((@blasfunc($fname), libblastrampoline), Cvoid, + px, stx = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) + py, sty = vec_pointer_stride(y, ArgumentError("dest vector with 0 stride is not allowed")) + GC.@preserve x y ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Clong), uplo, size(A,2), k, alpha, - A, max(1,stride(A,2)), x, stride(x,1), - beta, y, stride(y,1), 1) + A, max(1,stride(A,2)), px, stx, + beta, py, sty, 1) y end function hbmv(uplo::AbstractChar, k::Integer, alpha::($elty), A::AbstractMatrix{$elty}, x::AbstractVector{$elty}) @@ -1312,12 +1297,13 @@ for (fname, elty) in ((:dtrmv_,:Float64), throw(DimensionMismatch(lazy"A has size ($n,$n), x has length $(length(x))")) end chkstride1(A) - ccall((@blasfunc($fname), libblastrampoline), Cvoid, + px, stx = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) + GC.@preserve x ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Clong, Clong, Clong), uplo, trans, diag, n, - A, max(1,stride(A,2)), x, max(1,stride(x, 1)), 1, 1, 1) + A, max(1,stride(A,2)), px, stx, 1, 1, 1) x end function trmv(uplo::AbstractChar, trans::AbstractChar, diag::AbstractChar, A::AbstractMatrix{$elty}, x::AbstractVector{$elty}) @@ -1368,12 +1354,13 @@ for (fname, elty) in ((:dtrsv_,:Float64), throw(DimensionMismatch(lazy"size of A is $n != length(x) = $(length(x))")) end chkstride1(A) - ccall((@blasfunc($fname), libblastrampoline), Cvoid, + px, stx = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) + GC.@preserve x ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Clong, Clong, Clong), uplo, trans, diag, n, - A, max(1,stride(A,2)), x, stride(x, 1), 1, 1, 1) + A, max(1,stride(A,2)), px, stx, 1, 1, 1) x end function trsv(uplo::AbstractChar, trans::AbstractChar, diag::AbstractChar, A::AbstractMatrix{$elty}, x::AbstractVector{$elty}) @@ -1402,13 +1389,13 @@ for (fname, elty) in ((:dger_,:Float64), if m != length(x) || n != length(y) throw(DimensionMismatch(lazy"A has size ($m,$n), x has length $(length(x)), y has length $(length(y))")) end - ccall((@blasfunc($fname), libblastrampoline), Cvoid, + px, stx = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) + py, sty = vec_pointer_stride(y, ArgumentError("input vector with 0 stride is not allowed")) + GC.@preserve x y ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), - m, n, α, x, - stride(x, 1), y, stride(y, 1), A, - max(1,stride(A,2))) + m, n, α, px, stx, py, sty, A, max(1,stride(A,2))) A end end @@ -1436,11 +1423,11 @@ for (fname, elty, lib) in ((:dsyr_,:Float64,libblastrampoline), if length(x) != n throw(DimensionMismatch(lazy"A has size ($n,$n), x has length $(length(x))")) end - ccall((@blasfunc($fname), $lib), Cvoid, + px, stx = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) + GC.@preserve x ccall((@blasfunc($fname), $lib), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), - uplo, n, α, x, - stride(x, 1), A, max(1,stride(A, 2))) + uplo, n, α, px, stx, A, max(1,stride(A, 2))) A end end @@ -1467,11 +1454,11 @@ for (fname, elty, relty) in ((:zher_,:ComplexF64, :Float64), if length(x) != n throw(DimensionMismatch(lazy"A has size ($n,$n), x has length $(length(x))")) end - ccall((@blasfunc($fname), libblastrampoline), Cvoid, + px, stx = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) + GC.@preserve x ccall((@blasfunc($fname), libblastrampoline), Cvoid, (Ref{UInt8}, Ref{BlasInt}, Ref{$relty}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Clong), - uplo, n, α, x, - stride(x, 1), A, max(1,stride(A,2)), 1) + uplo, n, α, px, stx, A, max(1,stride(A,2)), 1) A end end @@ -2085,8 +2072,8 @@ end end # module -function copyto!(dest::Array{T}, rdest::Union{UnitRange{Ti},AbstractRange{Ti}}, - src::Array{T}, rsrc::Union{UnitRange{Ti},AbstractRange{Ti}}) where {T<:BlasFloat,Ti<:Integer} +function copyto!(dest::Array{T}, rdest::AbstractRange{Ti}, + src::Array{T}, rsrc::AbstractRange{Ti}) where {T<:BlasFloat,Ti<:Integer} if minimum(rdest) < 1 || maximum(rdest) > length(dest) throw(ArgumentError(lazy"range out of bounds for dest, of length $(length(dest))")) end @@ -2098,9 +2085,9 @@ function copyto!(dest::Array{T}, rdest::Union{UnitRange{Ti},AbstractRange{Ti}}, end GC.@preserve src dest BLAS.blascopy!( length(rsrc), - pointer(src) + (first(rsrc) - 1) * sizeof(T), + pointer(src, minimum(rsrc)), step(rsrc), - pointer(dest) + (first(rdest) - 1) * sizeof(T), + pointer(dest, minimum(rdest)), step(rdest)) return dest diff --git a/stdlib/LinearAlgebra/src/matmul.jl b/stdlib/LinearAlgebra/src/matmul.jl index f27a3a768b866..80d9872fdca6e 100644 --- a/stdlib/LinearAlgebra/src/matmul.jl +++ b/stdlib/LinearAlgebra/src/matmul.jl @@ -498,7 +498,8 @@ function gemv!(y::StridedVector{T}, tA::AbstractChar, A::StridedVecOrMat{T}, x:: nA == 0 && return _rmul_or_fill!(y, β) alpha, beta = promote(α, β, zero(T)) if alpha isa Union{Bool,T} && beta isa Union{Bool,T} && - stride(A, 1) == 1 && stride(A, 2) >= size(A, 1) + stride(A, 1) == 1 && abs(stride(A, 2)) >= size(A, 1) && + !iszero(stride(x, 1)) # We only check input's stride here. return BLAS.gemv!(tA, alpha, A, x, beta, y) else return generic_matvecmul!(y, tA, A, x, MulAddMul(α, β)) @@ -516,8 +517,9 @@ function gemv!(y::StridedVector{Complex{T}}, tA::AbstractChar, A::StridedVecOrMa nA == 0 && return _rmul_or_fill!(y, β) alpha, beta = promote(α, β, zero(T)) if alpha isa Union{Bool,T} && beta isa Union{Bool,T} && - stride(A, 1) == 1 && stride(A, 2) >= size(A, 1) && - stride(y, 1) == 1 && tA == 'N' # reinterpret-based optimization is valid only for contiguous `y` + stride(A, 1) == 1 && abs(stride(A, 2)) >= size(A, 1) && + stride(y, 1) == 1 && tA == 'N' && # reinterpret-based optimization is valid only for contiguous `y` + !iszero(stride(x, 1)) BLAS.gemv!(tA, alpha, reinterpret(T, A), x, beta, reinterpret(T, y)) return y else @@ -535,7 +537,9 @@ function gemv!(y::StridedVector{Complex{T}}, tA::AbstractChar, A::StridedVecOrMa mA == 0 && return y nA == 0 && return _rmul_or_fill!(y, β) alpha, beta = promote(α, β, zero(T)) - @views if alpha isa Union{Bool,T} && beta isa Union{Bool,T} && stride(A, 1) == 1 && stride(A, 2) >= size(A, 1) + @views if alpha isa Union{Bool,T} && beta isa Union{Bool,T} && + stride(A, 1) == 1 && abs(stride(A, 2)) >= size(A, 1) && + !iszero(stride(x, 1)) xfl = reinterpret(reshape, T, x) # Use reshape here. yfl = reinterpret(reshape, T, y) BLAS.gemv!(tA, alpha, A, xfl[1, :], beta, yfl[1, :]) diff --git a/stdlib/LinearAlgebra/test/blas.jl b/stdlib/LinearAlgebra/test/blas.jl index 54b227bca7685..d39f7c45ba205 100644 --- a/stdlib/LinearAlgebra/test/blas.jl +++ b/stdlib/LinearAlgebra/test/blas.jl @@ -4,20 +4,31 @@ module TestBLAS using Test, LinearAlgebra, Random using LinearAlgebra: BlasReal, BlasComplex +fabs(x::Real) = abs(x) +fabs(x::Complex) = abs(real(x)) + abs(imag(x)) + +# help function to build packed storage +function pack(A, uplo) + AP = eltype(A)[] + n = size(A, 1) + for j in 1:n, i in (uplo==:L ? (j:n) : (1:j)) + push!(AP, A[i,j]) + end + return AP +end +@testset "vec_pointer_stride" begin + a = zeros(4,4,4) + @test BLAS.asum(view(a,1:2:4,:,:)) == 0 # vector like + @test_throws ArgumentError BLAS.asum(view(a,1:3:4,:,:)) # non-vector like +end Random.seed!(100) ## BLAS tests - testing the interface code to BLAS routines @testset for elty in [Float32, Float64, ComplexF32, ComplexF64] @testset "syr2k!" begin - U = randn(5,2) - V = randn(5,2) - if elty == ComplexF32 || elty == ComplexF64 - U = complex.(U, U) - V = complex.(V, V) - end - U = convert(Array{elty, 2}, U) - V = convert(Array{elty, 2}, V) + U = randn(elty, 5, 2) + V = randn(elty, 5, 2) @test tril(LinearAlgebra.BLAS.syr2k('L','N',U,V)) ≈ tril(U*transpose(V) + V*transpose(U)) @test triu(LinearAlgebra.BLAS.syr2k('U','N',U,V)) ≈ triu(U*transpose(V) + V*transpose(U)) @test tril(LinearAlgebra.BLAS.syr2k('L','T',U,V)) ≈ tril(transpose(U)*V + transpose(V)*U) @@ -26,12 +37,8 @@ Random.seed!(100) if elty in (ComplexF32, ComplexF64) @testset "her2k!" begin - U = randn(5,2) - V = randn(5,2) - U = complex.(U, U) - V = complex.(V, V) - U = convert(Array{elty, 2}, U) - V = convert(Array{elty, 2}, V) + U = randn(elty, 5, 2) + V = randn(elty, 5, 2) @test tril(LinearAlgebra.BLAS.her2k('L','N',U,V)) ≈ tril(U*V' + V*U') @test triu(LinearAlgebra.BLAS.her2k('U','N',U,V)) ≈ triu(U*V' + V*U') @test tril(LinearAlgebra.BLAS.her2k('L','C',U,V)) ≈ tril(U'*V + V'*U) @@ -48,21 +55,21 @@ Random.seed!(100) U4 = triu(fill(elty(1), 4,4)) Z4 = zeros(elty, (4,4)) - elm1 = convert(elty, -1) - el2 = convert(elty, 2) - v14 = convert(Vector{elty}, [1:4;]) - v41 = convert(Vector{elty}, [4:-1:1;]) + elm1 = elty(-1) + el2 = elty(2) + v14 = elty[1:4;] + v41 = elty[4:-1:1;] let n = 10 @testset "dot products" begin if elty <: Real - x1 = convert(Vector{elty}, randn(n)) - x2 = convert(Vector{elty}, randn(n)) + x1 = randn(elty, n) + x2 = randn(elty, n) @test BLAS.dot(x1,x2) ≈ sum(x1.*x2) @test_throws DimensionMismatch BLAS.dot(x1,rand(elty, n + 1)) else - z1 = convert(Vector{elty}, complex.(randn(n),randn(n))) - z2 = convert(Vector{elty}, complex.(randn(n),randn(n))) + z1 = randn(elty, n) + z2 = randn(elty, n) @test BLAS.dotc(z1,z2) ≈ sum(conj(z1).*z2) @test BLAS.dotu(z1,z2) ≈ sum(z1.*z2) @test_throws DimensionMismatch BLAS.dotc(z1,rand(elty, n + 1)) @@ -70,92 +77,60 @@ Random.seed!(100) end end @testset "iamax" begin - if elty <: Real - x = convert(Vector{elty}, randn(n)) - @test BLAS.iamax(x) == argmax(abs.(x)) - else - z = convert(Vector{elty}, complex.(randn(n),randn(n))) - @test BLAS.iamax(z) == argmax(map(x -> abs(real(x)) + abs(imag(x)), z)) - end + x = randn(elty, n) + @test BLAS.iamax(x) == findmax(fabs, x)[2] end @testset "rot!" begin - if elty <: Real - x = convert(Vector{elty}, randn(n)) - y = convert(Vector{elty}, randn(n)) - c = rand(elty) - s = rand(elty) + x = randn(elty, n) + y = randn(elty, n) + c = rand(real(elty)) + for sty in unique!([real(elty), elty]) + s = rand(sty) x2 = copy(x) y2 = copy(y) BLAS.rot!(n, x, 1, y, 1, c, s) @test x ≈ c*x2 + s*y2 - @test y ≈ -s*x2 + c*y2 - else - x = convert(Vector{elty}, complex.(randn(n),rand(n))) - y = convert(Vector{elty}, complex.(randn(n),rand(n))) - cty = (elty == ComplexF32) ? Float32 : Float64 - c = rand(cty) - for sty in [cty, elty] - s = rand(sty) - x2 = copy(x) - y2 = copy(y) - BLAS.rot!(n, x, 1, y, 1, c, s) - @test x ≈ c*x2 + s*y2 - @test y ≈ -conj(s)*x2 + c*y2 - end + @test y ≈ -conj(s)*x2 + c*y2 end end @testset "axp(b)y" begin - if elty <: Real - x1 = convert(Vector{elty}, randn(n)) - x2 = convert(Vector{elty}, randn(n)) - α = rand(elty) - β = rand(elty) - @test BLAS.axpy!(α,copy(x1),copy(x2)) ≈ α*x1 + x2 - @test BLAS.axpby!(α,copy(x1),β,copy(x2)) ≈ α*x1 + β*x2 - @test_throws DimensionMismatch BLAS.axpy!(α, copy(x1), rand(elty, n + 1)) - @test_throws DimensionMismatch BLAS.axpby!(α, copy(x1), β, rand(elty, n + 1)) - @test_throws DimensionMismatch BLAS.axpy!(α, copy(x1), 1:div(n,2), copy(x2), 1:n) - @test_throws ArgumentError BLAS.axpy!(α, copy(x1), 0:div(n,2), copy(x2), 1:(div(n, 2) + 1)) - @test_throws ArgumentError BLAS.axpy!(α, copy(x1), 1:div(n,2), copy(x2), 0:(div(n, 2) - 1)) - @test BLAS.axpy!(α,copy(x1),1:n,copy(x2),1:n) ≈ x2 + α*x1 - else - z1 = convert(Vector{elty}, complex.(randn(n), randn(n))) - z2 = convert(Vector{elty}, complex.(randn(n), randn(n))) - α = rand(elty) - @test BLAS.axpy!(α, copy(z1), copy(z2)) ≈ z2 + α * z1 - @test_throws DimensionMismatch BLAS.axpy!(α, copy(z1), rand(elty, n + 1)) - @test_throws DimensionMismatch BLAS.axpy!(α, copy(z1), 1:div(n, 2), copy(z2), 1:(div(n, 2) + 1)) - @test_throws ArgumentError BLAS.axpy!(α, copy(z1), 0:div(n,2), copy(z2), 1:(div(n, 2) + 1)) - @test_throws ArgumentError BLAS.axpy!(α, copy(z1), 1:div(n,2), copy(z2), 0:(div(n, 2) - 1)) - @test BLAS.axpy!(α,copy(z1),1:n,copy(z2),1:n) ≈ z2 + α*z1 + x1 = randn(elty, n) + x2 = randn(elty, n) + α = rand(elty) + β = rand(elty) + for X1 in (x1, view(x1,n:-1:1)), X2 in (x2, view(x2, n:-1:1)) + @test BLAS.axpy!(α,deepcopy(X1),deepcopy(X2)) ≈ α*X1 + X2 + @test BLAS.axpby!(α,deepcopy(X1),β,deepcopy(X2)) ≈ α*X1 + β*X2 end + for ind1 in (1:n, n:-1:1), ind2 in (1:n, n:-1:1) + @test BLAS.axpy!(α,copy(x1),ind1,copy(x2),ind2) ≈ x2 + α*(ind1 == ind2 ? x1 : reverse(x1)) + end + @test_throws DimensionMismatch BLAS.axpy!(α, copy(x1), rand(elty, n + 1)) + @test_throws DimensionMismatch BLAS.axpby!(α, copy(x1), β, rand(elty, n + 1)) + @test_throws DimensionMismatch BLAS.axpy!(α, copy(x1), 1:div(n,2), copy(x2), 1:n) + @test_throws ArgumentError BLAS.axpy!(α, copy(x1), 0:div(n,2), copy(x2), 1:(div(n, 2) + 1)) + @test_throws ArgumentError BLAS.axpy!(α, copy(x1), 1:div(n,2), copy(x2), 0:(div(n, 2) - 1)) end @testset "nrm2, iamax, and asum for StridedVectors" begin a = rand(elty,n) - b = view(a,2:2:n,1) - @test BLAS.nrm2(b) ≈ norm(b) - if elty <: Real - @test BLAS.asum(b) ≈ sum(abs.(b)) - @test BLAS.iamax(b) ≈ argmax(abs.(b)) - else - @test BLAS.asum(b) ≈ sum(abs.(real(b))) + sum(abs.(imag(b))) - @test BLAS.iamax(b) == argmax(map(x -> abs(real(x)) + abs(imag(x)), b)) + for ind in (2:2:n, n:-2:2) + b = view(a, ind, 1) + @test BLAS.nrm2(b) ≈ sqrt(sum(abs2, b)) + @test BLAS.asum(b) ≈ sum(fabs, b) + @test BLAS.iamax(b) == findmax(fabs, b)[2] * (step(ind) >= 0) end end - # scal - α = rand(elty) - a = rand(elty,n) - @test BLAS.scal(n,α,a,1) ≈ α * a - - @testset "trsv" begin - A = triu(rand(elty,n,n)) - @testset "Vector and SubVector" for x in (rand(elty, n), view(rand(elty,2n),1:2:2n)) - @test A\x ≈ BLAS.trsv('U','N','N',A,x) - @test_throws DimensionMismatch BLAS.trsv('U','N','N',A,Vector{elty}(undef,n+1)) + @testset "scal" begin + α = rand(elty) + a = rand(elty,n) + @test BLAS.scal(n,α,a,1) ≈ α * a + for v in (a, view(a, n:-1:1)) + @test BLAS.scal!(α, deepcopy(v)) ≈ α * v end end - @testset "ger, her, syr" for x in (rand(elty, n), view(rand(elty,2n), 1:2:2n)), - y in (rand(elty,n), view(rand(elty,3n), 1:3:3n)) + + @testset "ger, her, syr" for x in (rand(elty, n), view(rand(elty,2n), 1:2:2n), view(rand(elty,n), n:-1:1)), + y in (rand(elty,n), view(rand(elty,3n), 1:3:3n), view(rand(elty,2n), 2n:-2:2)) A = rand(elty,n,n) α = rand(elty) @@ -178,32 +153,66 @@ Random.seed!(100) end end @testset "copy" begin - x1 = convert(Vector{elty}, randn(n)) - x2 = convert(Vector{elty}, randn(n)) - BLAS.copyto!(x2, 1:n, x1, 1:n) - @test x2 == x1 + x1 = randn(elty, n) + x2 = randn(elty, n) + for ind1 in (1:n, n:-1:1), ind2 in (1:n, n:-1:1) + @test x2 === BLAS.copyto!(x2, ind1, x1, ind2) == (ind1 == ind2 ? x1 : reverse(x1)) + end @test_throws DimensionMismatch BLAS.copyto!(x2, 1:n, x1, 1:(n - 1)) @test_throws ArgumentError BLAS.copyto!(x1, 0:div(n, 2), x2, 1:(div(n, 2) + 1)) @test_throws ArgumentError BLAS.copyto!(x1, 1:(div(n, 2) + 1), x2, 0:div(n, 2)) end - # trmv - A = triu(rand(elty,n,n)) - x = rand(elty,n) - @test BLAS.trmv('U','N','N',A,x) ≈ A*x + @testset "trmv and trsv" begin + A = rand(elty,n,n) + x = rand(elty,n) + xerr = Vector{elty}(undef,n+1) + for uplo in ('U', 'L'), diag in ('U','N'), trans in ('N', 'T', 'C') + Wrapper = if uplo == 'U' + diag == 'U' ? UnitUpperTriangular : UpperTriangular + else + diag == 'U' ? UnitLowerTriangular : LowerTriangular + end + fun = trans == 'N' ? identity : trans == 'T' ? transpose : adjoint + fullA = collect(fun(Wrapper(A))) + @testset "trmv" begin + @test BLAS.trmv(uplo,trans,diag,A,x) ≈ fullA * x + @test_throws DimensionMismatch BLAS.trmv(uplo,trans,diag,A,xerr) + for xx in (x, view(x, n:-1:1)) + @test BLAS.trmv!(uplo,trans,diag,A,deepcopy(xx)) ≈ fullA * xx + end + end + @testset "trsv" begin + @test BLAS.trsv(uplo,trans,diag,A,x) ≈ fullA \ x + @test_throws DimensionMismatch BLAS.trsv(uplo,trans,diag,A,xerr) + for xx in (x, view(x, n:-1:1)) + @test BLAS.trsv!(uplo,trans,diag,A,deepcopy(xx)) ≈ fullA \ xx + end + end + end + end @testset "symmetric/Hermitian multiplication" begin x = rand(elty,n) A = rand(elty,n,n) + y = rand(elty, n) + α = randn(elty) + β = randn(elty) Aherm = A + A' Asymm = A + transpose(A) - @testset "symv and hemv" begin - @test BLAS.symv('U',Asymm,x) ≈ Asymm*x - offsizevec, offsizemat = Array{elty}.(undef,(n+1, (n,n+1))) - @test_throws DimensionMismatch BLAS.symv!('U',one(elty),Asymm,x,one(elty),offsizevec) - @test_throws DimensionMismatch BLAS.symv('U',offsizemat,x) + offsizevec, offsizemat = Array{elty}.(undef,(n+1, (n,n+1))) + @testset "symv and hemv" for uplo in ('U', 'L') + @test BLAS.symv(uplo,Asymm,x) ≈ Asymm*x + for xx in (x, view(x, n:-1:1)), yy in (y, view(y, n:-1:1)) + @test BLAS.symv!(uplo,α,Asymm,xx,β,deepcopy(yy)) ≈ α * Asymm * xx + β * yy + end + @test_throws DimensionMismatch BLAS.symv!(uplo,α,Asymm,x,β,offsizevec) + @test_throws DimensionMismatch BLAS.symv(uplo,offsizemat,x) if elty <: BlasComplex - @test BLAS.hemv('U',Aherm,x) ≈ Aherm*x - @test_throws DimensionMismatch BLAS.hemv('U',offsizemat,x) - @test_throws DimensionMismatch BLAS.hemv!('U',one(elty),Aherm,x,one(elty),offsizevec) + @test BLAS.hemv(uplo,Aherm,x) ≈ Aherm*x + for xx in (x, view(x, n:-1:1)), yy in (y, view(y, n:-1:1)) + @test BLAS.hemv!(uplo,α,Aherm,xx,β,deepcopy(yy)) ≈ α * Aherm * xx + β * yy + end + @test_throws DimensionMismatch BLAS.hemv(uplo,offsizemat,x) + @test_throws DimensionMismatch BLAS.hemv!(uplo,one(elty),Aherm,x,one(elty),offsizevec) end end @@ -233,40 +242,24 @@ Random.seed!(100) # Both matrix dimensions n coincide, as we have Hermitian matrices. # Define the inputs and outputs of hpmv!, y = α*A*x+β*y α = rand(elty) - M = rand(elty, n, n) - AL = Hermitian(M, :L) - AU = Hermitian(M, :U) + A = rand(elty, n, n) x = rand(elty, n) β = rand(elty) y = rand(elty, n) - - y_result_julia_lower = α*AL*x + β*y - - # Create lower triangular packing of AL - AP = typeof(AL[1,1])[] - for j in 1:n - for i in j:n - push!(AP, AL[i,j]) + for uplo in (:L, :U) + Cuplo = String(uplo)[1] + AH = Hermitian(A, uplo) + # Create lower/upper triangular packing of AL + AP = pack(AH, uplo) + for xx in (x, view(x,n:-1:1)), yy in (y, view(y,n:-1:1)) + @test BLAS.hpmv!(Cuplo, α, AP, xx, β, deepcopy(yy)) ≈ α*AH*xx + β*yy end + AP′ = view(zeros(elty, n*(n+1)),1:2:n*(n+1)) + @test_throws ErrorException BLAS.hpmv!(Cuplo, α, AP′, x, β, y) + AP′ = view(AP, 1:length(AP′) - 1) + @test_throws DimensionMismatch BLAS.hpmv!(Cuplo, α, AP′, x, β, y) + @test_throws DimensionMismatch BLAS.hpmv!(Cuplo, α, AP′, x, β, view(y,1:n-1)) end - - y_result_blas_lower = copy(y) - BLAS.hpmv!('L', α, AP, x, β, y_result_blas_lower) - @test y_result_julia_lower ≈ y_result_blas_lower - - y_result_julia_upper = α*AU*x + β*y - - # Create upper triangular packing of AU - AP = typeof(AU[1,1])[] - for j in 1:n - for i in 1:j - push!(AP, AU[i,j]) - end - end - - y_result_blas_upper = copy(y) - BLAS.hpmv!('U', α, AP, x, β, y_result_blas_upper) - @test y_result_julia_upper ≈ y_result_blas_upper end end @@ -276,41 +269,24 @@ Random.seed!(100) # Both matrix dimensions n coincide, as we have symmetric matrices. # Define the inputs and outputs of spmv!, y = α*A*x+β*y α = rand(elty) - M = rand(elty, n, n) - AL = Symmetric(M, :L) - AU = Symmetric(M, :U) + A = rand(elty, n, n) x = rand(elty, n) β = rand(elty) y = rand(elty, n) - - y_result_julia_lower = α*AL*x + β*y - - # Create lower triangular packing of AL - AP = typeof(M[1,1])[] - for j in 1:n - for i in j:n - push!(AP, AL[i,j]) - end - end - - y_result_blas_lower = copy(y) - BLAS.spmv!('L', α, AP, x, β, y_result_blas_lower) - @test y_result_julia_lower ≈ y_result_blas_lower - - - y_result_julia_upper = α*AU*x + β*y - - # Create upper triangular packing of AU - AP = typeof(M[1,1])[] - for j in 1:n - for i in 1:j - push!(AP, AU[i,j]) + for uplo in (:L, :U) + Cuplo = String(uplo)[1] + AS = Symmetric(A, uplo) + # Create lower/upper triangular packing of AL + AP = pack(AS, uplo) + for xx in (x, view(x,n:-1:1)), yy in (y, view(y,n:-1:1)) + @test BLAS.spmv!(Cuplo, α, AP, xx, β, deepcopy(yy)) ≈ α*AS*xx + β*yy end + AP′ = view(zeros(elty, n*(n+1)),1:2:n*(n+1)) + @test_throws ErrorException BLAS.spmv!(Cuplo, α, AP′, x, β, y) + AP′ = view(AP, 1:length(AP′) - 1) + @test_throws DimensionMismatch BLAS.spmv!(Cuplo, α, AP′, x, β, y) + @test_throws DimensionMismatch BLAS.spmv!(Cuplo, α, AP′, x, β, view(y,1:n-1)) end - - y_result_blas_upper = copy(y) - BLAS.spmv!('U', α, AP, x, β, y_result_blas_upper) - @test y_result_julia_upper ≈ y_result_blas_upper end end @@ -321,39 +297,29 @@ Random.seed!(100) M = rand(elty, n, n) AL = Symmetric(M, :L) AU = Symmetric(M, :U) - x = rand(elty, n) - - function pack(A, uplo) - AP = elty[] - for j in 1:n - for i in (uplo==:L ? (j:n) : (1:j)) - push!(AP, A[i,j]) - end - end - return AP + for x in (rand(elty, n), view(rand(elty, n), n:-1:1)) + ALP_result_julia_lower = pack(α*x*x' + AL, :L) + ALP_result_blas_lower = pack(AL, :L) + BLAS.spr!('L', α, x, ALP_result_blas_lower) + @test ALP_result_julia_lower ≈ ALP_result_blas_lower + ALP_result_blas_lower = append!(pack(AL, :L), ones(elty, 10)) + BLAS.spr!('L', α, x, ALP_result_blas_lower) + @test ALP_result_julia_lower ≈ ALP_result_blas_lower[1:end-10] + ALP_result_blas_lower = reshape(pack(AL, :L), 1, length(ALP_result_julia_lower), 1) + BLAS.spr!('L', α, x, ALP_result_blas_lower) + @test ALP_result_julia_lower ≈ vec(ALP_result_blas_lower) + + AUP_result_julia_upper = pack(α*x*x' + AU, :U) + AUP_result_blas_upper = pack(AU, :U) + BLAS.spr!('U', α, x, AUP_result_blas_upper) + @test AUP_result_julia_upper ≈ AUP_result_blas_upper + AUP_result_blas_upper = append!(pack(AU, :U), ones(elty, 10)) + BLAS.spr!('U', α, x, AUP_result_blas_upper) + @test AUP_result_julia_upper ≈ AUP_result_blas_upper[1:end-10] + AUP_result_blas_upper = reshape(pack(AU, :U), 1, length(AUP_result_julia_upper), 1) + BLAS.spr!('U', α, x, AUP_result_blas_upper) + @test AUP_result_julia_upper ≈ vec(AUP_result_blas_upper) end - - ALP_result_julia_lower = pack(α*x*x' + AL, :L) - ALP_result_blas_lower = pack(AL, :L) - BLAS.spr!('L', α, x, ALP_result_blas_lower) - @test ALP_result_julia_lower ≈ ALP_result_blas_lower - ALP_result_blas_lower = append!(pack(AL, :L), ones(elty, 10)) - BLAS.spr!('L', α, x, ALP_result_blas_lower) - @test ALP_result_julia_lower ≈ ALP_result_blas_lower[1:end-10] - ALP_result_blas_lower = reshape(pack(AL, :L), 1, length(ALP_result_julia_lower), 1) - BLAS.spr!('L', α, x, ALP_result_blas_lower) - @test ALP_result_julia_lower ≈ vec(ALP_result_blas_lower) - - AUP_result_julia_upper = pack(α*x*x' + AU, :U) - AUP_result_blas_upper = pack(AU, :U) - BLAS.spr!('U', α, x, AUP_result_blas_upper) - @test AUP_result_julia_upper ≈ AUP_result_blas_upper - AUP_result_blas_upper = append!(pack(AU, :U), ones(elty, 10)) - BLAS.spr!('U', α, x, AUP_result_blas_upper) - @test AUP_result_julia_upper ≈ AUP_result_blas_upper[1:end-10] - AUP_result_blas_upper = reshape(pack(AU, :U), 1, length(AUP_result_julia_upper), 1) - BLAS.spr!('U', α, x, AUP_result_blas_upper) - @test AUP_result_julia_upper ≈ vec(AUP_result_blas_upper) end end @@ -365,33 +331,51 @@ Random.seed!(100) #will work for SymTridiagonal,Tridiagonal,Bidiagonal! @testset "banded matrix mv" begin @testset "gbmv" begin - TD = Tridiagonal(rand(elty,n-1),rand(elty,n),rand(elty,n-1)) - x = rand(elty,n) + TD = Tridiagonal(rand(elty,n-1),rand(elty,n),rand(elty,n-1)) + x = rand(elty, n) #put TD into the BLAS format! fTD = zeros(elty,3,n) fTD[1,2:n] = TD.du fTD[2,:] = TD.d fTD[3,1:n-1] = TD.dl @test BLAS.gbmv('N',n,1,1,fTD,x) ≈ TD*x + y = rand(elty, n) + α = randn(elty) + β = randn(elty) + for xx in (x, view(x, n:-1:1)), yy in (y, view(y, n:-1:1)) + @test BLAS.gbmv!('N',n,1,1,α,fTD,xx,β,deepcopy(yy)) ≈ α * TD * xx + β * yy + end end #will work for SymTridiagonal only! - @testset "sbmv" begin + @testset "sbmv and hbmv" begin + x = rand(elty,n) if elty <: BlasReal ST = SymTridiagonal(rand(elty,n),rand(elty,n-1)) - x = rand(elty,n) #put TD into the BLAS format! fST = zeros(elty,2,n) fST[1,2:n] = ST.ev fST[2,:] = ST.dv @test BLAS.sbmv('U',1,fST,x) ≈ ST*x + y = rand(elty, n) + α = randn(elty) + β = randn(elty) + for xx in (x, view(x, n:-1:1)), yy in (y, view(y, n:-1:1)) + @test BLAS.sbmv!('U',1,α,fST,xx,β,deepcopy(yy)) ≈ α * ST * xx + β * yy + end else - dv = real(rand(elty,n)) + dv = rand(real(elty),n) ev = rand(elty,n-1) bH = zeros(elty,2,n) bH[1,2:n] = ev bH[2,:] = dv fullH = diagm(0 => dv, -1 => conj(ev), 1 => ev) @test BLAS.hbmv('U',1,bH,x) ≈ fullH*x + y = rand(elty, n) + α = randn(elty) + β = randn(elty) + for xx in (x, view(x, n:-1:1)), yy in (y, view(y, n:-1:1)) + @test BLAS.hbmv!('U',1,α,bH,xx,β,deepcopy(yy)) ≈ α * fullH * xx + β * yy + end end end end @@ -595,8 +579,8 @@ end @test BLAS.iamax(x) == 2 M = fill(elty(1.0), 3, 3) - BLAS.scal!(elty(2), view(M,:,2)) - BLAS.scal!(elty(3), view(M,3,:)) + @test BLAS.scal!(elty(2), view(M,:,2)) === view(M,:,2) + @test BLAS.scal!(elty(3), view(M,3,:)) === view(M,3,:) @test M == elty[1. 2. 1.; 1. 2. 1.; 3. 6. 3.] # Level 2 A = WrappedArray(elty[1 2; 3 4]) @@ -688,4 +672,36 @@ end @test LinearAlgebra.BLAS.libblas == "libblastrampoline" @test LinearAlgebra.BLAS.liblapack == "libblastrampoline" +@testset "test for 0-strides" for elty in (Float32, Float64, ComplexF32, ComplexF64) + A = randn(elty, 10, 10); + a = view([randn(elty)], 1 .+ 0(1:10)) + b = view([randn(elty)], 1 .+ 0(1:10)) + α, β = randn(elty), randn(elty) + @testset "dot/dotc/dotu" begin + if elty <: Real + @test BLAS.dot(a,b) ≈ sum(a.*b) + else + @test BLAS.dotc(a,b) ≈ sum(conj(a).*b) + @test BLAS.dotu(a,b) ≈ sum(a.*b) + end + end + @testset "axp(b)y!" begin + @test BLAS.axpy!(α,a,copy(b)) ≈ α*a + b + @test BLAS.axpby!(α,a,β,copy(b)) ≈ α*a + β*b + @test_throws "dest" BLAS.axpy!(α,a,b) + @test_throws "dest" BLAS.axpby!(α,a,β,b) + end + @test BLAS.iamax(a) == 0 + @test_throws "dest" BLAS.scal!(b[1], a) + @testset "nrm2/asum" begin # OpenBLAS allways return 0.0 + @test_throws "input" BLAS.nrm2(a) + @test_throws "input" BLAS.asum(a) + end + # All level2 reject 0-stride array. + @testset "gemv!" begin + @test_throws "input" BLAS.gemv!('N', true, A, a, false, copy(b)) + @test_throws "dest" BLAS.gemv!('N', true, A, copy(a), false, b) + end +end + end # module TestBLAS diff --git a/stdlib/LinearAlgebra/test/matmul.jl b/stdlib/LinearAlgebra/test/matmul.jl index 1c482f8cae97a..ea73814a2848b 100644 --- a/stdlib/LinearAlgebra/test/matmul.jl +++ b/stdlib/LinearAlgebra/test/matmul.jl @@ -297,6 +297,15 @@ end end end +@testset "matrix x vector with negative lda or 0 stride" for T in (Float32, Float64) + for TA in (T, complex(T)), TB in (T, complex(T)) + A = view(randn(TA, 10, 10), 1:10, 10:-1:1) # negative lda + v = view([randn(TB)], 1 .+ 0(1:10)) # 0 stride + Ad, vd = copy(A), copy(v) + @test Ad * vd ≈ A * vd ≈ Ad * v ≈ A * v + end +end + @testset "issue #15286" begin A = reshape(map(Float64, 1:20), 5, 4) C = zeros(8, 8) From 0f04c8e9492bd5a5e5d071418c316795ac33d400 Mon Sep 17 00:00:00 2001 From: Paul Berg Date: Mon, 28 Feb 2022 02:32:35 +0100 Subject: [PATCH 079/369] use name in source module when importing an aliased binding (#43291) Co-authored-by: Simeon David Schaub (cherry picked from commit 2338f5d3040ced10d69f4d15cca5fdca03364d9a) --- src/module.c | 2 +- test/syntax.jl | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/module.c b/src/module.c index 8f37cc00b1bd6..63dff3ae6deb7 100644 --- a/src/module.c +++ b/src/module.c @@ -528,7 +528,7 @@ static void module_import_(jl_module_t *to, jl_module_t *from, jl_sym_t *s, jl_s } } else { - jl_binding_t *nb = new_binding(s); + jl_binding_t *nb = new_binding(b->name); nb->owner = b->owner; nb->imported = (explici!=0); nb->deprecated = b->deprecated; diff --git a/test/syntax.jl b/test/syntax.jl index 2f95b9505d056..ff392d5069708 100644 --- a/test/syntax.jl +++ b/test/syntax.jl @@ -2514,6 +2514,7 @@ end end module Mod2 +import ..Mod.x as x_from_mod const y = 2 end @@ -2554,6 +2555,11 @@ import .Mod.@mac as @m @test_throws ErrorException eval(:(import .Mod.func as @notmacro)) @test_throws ErrorException eval(:(using .Mod: @mac as notmacro)) @test_throws ErrorException eval(:(using .Mod: func as @notmacro)) + +import .Mod2.x_from_mod + +@test @isdefined(x_from_mod) +@test x_from_mod == Mod.x end import .TestImportAs.Mod2 as M2 From 484b622e2ffd541666ed079e9955020b6e9af084 Mon Sep 17 00:00:00 2001 From: 2005m Date: Mon, 14 Mar 2022 11:56:41 +0000 Subject: [PATCH 080/369] avoid warning about macro redefinition on Windows + clang: (#44412) (cherry picked from commit 529ac5170277cdb654ce03698675ef27d99d1fab) --- src/support/dirpath.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/support/dirpath.h b/src/support/dirpath.h index 57c7927f14d55..b2314d571c649 100644 --- a/src/support/dirpath.h +++ b/src/support/dirpath.h @@ -6,14 +6,17 @@ #ifdef _OS_WINDOWS_ #define PATHSEPSTRING "\\" #define PATHLISTSEPSTRING ";" +#if defined(PATH_MAX) #define JL_PATH_MAX PATH_MAX -#if defined(_COMPILER_CLANG_) +#else // _COMPILER_CLANG_ may have the name reversed #define JL_PATH_MAX MAX_PATH #endif #else #define PATHSEPSTRING "/" #define PATHLISTSEPSTRING ":" -#ifndef JL_PATH_MAX // many platforms don't have a max path, we define one anyways +#if defined(PATH_MAX) +#define JL_PATH_MAX PATH_MAX +#else // many platforms don't have a max path, we define one anyways #define JL_PATH_MAX 1024 #endif #endif From 065e41dff5e7dabe48afe26e856729ca57dc7919 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Wed, 16 Mar 2022 01:31:45 +0900 Subject: [PATCH 081/369] follow up #44404, remove duplicated `tmeet` definition (#44617) --- base/compiler/typelattice.jl | 42 ------------------------------------ 1 file changed, 42 deletions(-) diff --git a/base/compiler/typelattice.jl b/base/compiler/typelattice.jl index eda1850604306..b0dc3490ee003 100644 --- a/base/compiler/typelattice.jl +++ b/base/compiler/typelattice.jl @@ -467,45 +467,3 @@ function stupdate1!(state::VarTable, change::StateUpdate) end return false end - -# compute typeintersect over the extended inference lattice, -# as precisely as we can, -# where v is in the extended lattice, and t is a Type. -function tmeet(@nospecialize(v), @nospecialize(t)) - if isa(v, Const) - if !has_free_typevars(t) && !isa(v.val, t) - return Bottom - end - return v - elseif isa(v, PartialStruct) - has_free_typevars(t) && return v - widev = widenconst(v) - if widev <: t - return v - end - ti = typeintersect(widev, t) - valid_as_lattice(ti) || return Bottom - @assert widev <: Tuple - new_fields = Vector{Any}(undef, length(v.fields)) - for i = 1:length(new_fields) - vfi = v.fields[i] - if isvarargtype(vfi) - new_fields[i] = vfi - else - new_fields[i] = tmeet(vfi, widenconst(getfield_tfunc(t, Const(i)))) - if new_fields[i] === Bottom - return Bottom - end - end - end - return tuple_tfunc(new_fields) - elseif isa(v, Conditional) - if !(Bool <: t) - return Bottom - end - return v - end - ti = typeintersect(widenconst(v), t) - valid_as_lattice(ti) || return Bottom - return ti -end From 953d5d3675e167cad9c172a830cadbd5c9ba1ff2 Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Tue, 15 Mar 2022 17:53:37 -0700 Subject: [PATCH 082/369] [LibGit2] Teach tests to be resilient to `init.defaultBranch` (#44629) If a user runs the tests with a `~/.gitconfig` that provides an `init.defaultBranch` that is not `master`, our tests fail. Let's adjust to the user's configuration as appropriate. We'll also rename this to `default_branch` to signify that it may not be called `master` anymore. (cherry picked from commit ac1d69302ce8e682bef3108296f5a6c182b62e5f) --- stdlib/LibGit2/test/libgit2.jl | 38 +++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/stdlib/LibGit2/test/libgit2.jl b/stdlib/LibGit2/test/libgit2.jl index 2357536e19b5c..2a74ed4908dfc 100644 --- a/stdlib/LibGit2/test/libgit2.jl +++ b/stdlib/LibGit2/test/libgit2.jl @@ -634,7 +634,7 @@ mktempdir() do dir commit_oid1 = LibGit2.GitHash() commit_oid2 = LibGit2.GitHash() commit_oid3 = LibGit2.GitHash() - master_branch = "master" + default_branch = LibGit2.getconfig("init.defaultBranch", "master") test_branch = "test_branch" test_branch2 = "test_branch_two" tag1 = "tag1" @@ -958,19 +958,19 @@ mktempdir() do dir # various branch properties @test LibGit2.isbranch(brref) @test !LibGit2.isremote(brref) - @test LibGit2.name(brref) == "refs/heads/master" - @test LibGit2.shortname(brref) == master_branch + @test LibGit2.name(brref) == "refs/heads/$(default_branch)" + @test LibGit2.shortname(brref) == default_branch @test LibGit2.ishead(brref) @test LibGit2.upstream(brref) === nothing # showing the GitReference to this branch show_strs = split(sprint(show, brref), "\n") @test show_strs[1] == "GitReference:" - @test show_strs[2] == "Branch with name refs/heads/master" + @test show_strs[2] == "Branch with name refs/heads/$(default_branch)" @test show_strs[3] == "Branch is HEAD." @test repo.ptr == LibGit2.repository(brref).ptr - @test brnch == master_branch - @test LibGit2.headname(repo) == master_branch + @test brnch == default_branch + @test LibGit2.headname(repo) == default_branch # create a branch *without* setting its tip as HEAD LibGit2.branch!(repo, test_branch, string(commit_oid1), set_head=false) @@ -991,7 +991,7 @@ mktempdir() do dir end end branches = map(b->LibGit2.shortname(b[1]), LibGit2.GitBranchIter(repo)) - @test master_branch in branches + @test default_branch in branches @test test_branch in branches end end @@ -1050,7 +1050,7 @@ mktempdir() do dir @test tag2 in tags refs = LibGit2.ref_list(repo) - @test refs == ["refs/heads/master", "refs/heads/test_branch", "refs/tags/tag1", "refs/tags/tag2"] + @test refs == ["refs/heads/$(default_branch)", "refs/heads/test_branch", "refs/tags/tag1", "refs/tags/tag2"] # test deleting a tag LibGit2.tag_delete(repo, tag1) tags = LibGit2.tag_list(repo) @@ -1334,7 +1334,7 @@ mktempdir() do dir add_and_commit_file(repo, "file1", "111\n") # switch back, add a commit, try to merge # from branch/merge_a - LibGit2.branch!(repo, "master") + LibGit2.branch!(repo, default_branch) # test for showing a Reference to a non-HEAD branch brref = LibGit2.GitReference(repo, "refs/heads/branch/merge_a") @@ -1347,7 +1347,7 @@ mktempdir() do dir add_and_commit_file(repo, "file2", "222\n") upst_ann = LibGit2.GitAnnotated(repo, "branch/merge_a") - head_ann = LibGit2.GitAnnotated(repo, "master") + head_ann = LibGit2.GitAnnotated(repo, default_branch) # (fail to) merge them because we can't fastforward @test_logs (:warn,"Cannot perform fast-forward merge") !LibGit2.merge!(repo, [upst_ann], true) @@ -1360,7 +1360,7 @@ mktempdir() do dir mv(joinpath(LibGit2.path(repo),"file1"),joinpath(LibGit2.path(repo),"mvfile1")) LibGit2.add!(repo, "mvfile1") LibGit2.commit(repo, "move file1") - LibGit2.branch!(repo, "master") + LibGit2.branch!(repo, default_branch) upst_ann = LibGit2.GitAnnotated(repo, "branch/merge_b") rename_flag = Cint(0) rename_flag = LibGit2.toggle(rename_flag, Cint(0)) # turns on the find renames opt @@ -1438,14 +1438,14 @@ mktempdir() do dir # the rebase should fail. @test_throws LibGit2.GitError LibGit2.rebase!(repo) # Try rebasing on master instead - newhead = LibGit2.rebase!(repo, master_branch) + newhead = LibGit2.rebase!(repo, default_branch) @test newhead == head_oid # Switch to the master branch - LibGit2.branch!(repo, master_branch) + LibGit2.branch!(repo, default_branch) fetch_heads = LibGit2.fetchheads(repo) - @test fetch_heads[1].name == "refs/heads/master" + @test fetch_heads[1].name == "refs/heads/$(default_branch)" @test fetch_heads[1].ismerge == true # we just merged master @test fetch_heads[2].name == "refs/heads/test_branch" @test fetch_heads[2].ismerge == false @@ -1485,7 +1485,7 @@ mktempdir() do dir # all tag in place branches = map(b->LibGit2.shortname(b[1]), LibGit2.GitBranchIter(repo)) - @test master_branch in branches + @test default_branch in branches @test test_branch in branches # issue #16337 @@ -1683,7 +1683,7 @@ mktempdir() do dir # add yet another file add_and_commit_file(repo, "file4", "444\n") # rebase with onto - newhead = LibGit2.rebase!(repo, "branch/a", "master") + newhead = LibGit2.rebase!(repo, "branch/a", default_branch) newerhead = LibGit2.head_oid(repo) @test newerhead == newhead @@ -1693,7 +1693,7 @@ mktempdir() do dir pre_abort_head = add_and_commit_file(repo, "file6", "666\n") # Rebase type head_ann = LibGit2.GitAnnotated(repo, "branch/a") - upst_ann = LibGit2.GitAnnotated(repo, "master") + upst_ann = LibGit2.GitAnnotated(repo, default_branch) rb = LibGit2.GitRebase(repo, head_ann, upst_ann) @test_throws BoundsError rb[3] @test_throws BoundsError rb[0] @@ -1718,7 +1718,7 @@ mktempdir() do dir a_head = LibGit2.head_oid(repo) add_and_commit_file(repo, "merge_file1", "111\n") - LibGit2.branch!(repo, "master") + LibGit2.branch!(repo, default_branch) a_head_ann = LibGit2.GitAnnotated(repo, "branch/merge_a") # merge returns true if successful @test_logs (:info,"Review and commit merged changes") LibGit2.merge!(repo, [a_head_ann]) @@ -1751,7 +1751,7 @@ mktempdir() do dir close(repo_file) # and checkout HEAD once more LibGit2.checkout_head(repo, options=LibGit2.CheckoutOptions(checkout_strategy=LibGit2.Consts.CHECKOUT_FORCE)) - @test LibGit2.headname(repo) == master_branch + @test LibGit2.headname(repo) == default_branch @test !LibGit2.isdirty(repo) end end From 1c1d99c55a606a9ab1a355701979eaaaa6212ef0 Mon Sep 17 00:00:00 2001 From: Alex Arslan Date: Wed, 16 Mar 2022 14:09:28 -0700 Subject: [PATCH 083/369] Ignore potential errors during dbg-related object construction on Darwin. (#44637) (#44644) (cherry picked from commit efa2430a2264fa3f159deb63b01a275d0b637b05) Co-authored-by: Tim Besard --- src/debuginfo.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/debuginfo.cpp b/src/debuginfo.cpp index 53105feb81bfe..263e506355d69 100644 --- a/src/debuginfo.cpp +++ b/src/debuginfo.cpp @@ -814,8 +814,10 @@ static objfileentry_t &find_object_file(uint64_t fbase, StringRef fname) JL_NOTS StringRef((const char *)fbase, msize), "", false); auto origerrorobj = llvm::object::ObjectFile::createObjectFile( membuf->getMemBufferRef(), file_magic::unknown); - if (!origerrorobj) + if (!origerrorobj) { + ignoreError(origerrorobj); return entry; + } llvm::object::MachOObjectFile *morigobj = (llvm::object::MachOObjectFile*) origerrorobj.get().get(); From e077335b93fb1c3575a587c9b9d795290100c394 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Thu, 17 Mar 2022 10:07:14 +0900 Subject: [PATCH 084/369] inference: follow up #44515, correctly encode `Effects.overlayed` effect (#44634) xref: --- base/boot.jl | 4 ++-- base/compiler/compiler.jl | 3 +++ base/compiler/types.jl | 28 +++++++++++++++------------- src/dump.c | 8 ++++---- src/gf.c | 4 ++-- src/jltypes.c | 2 +- src/julia.h | 6 ++++-- src/serialize.h | 12 ++++++++++++ 8 files changed, 43 insertions(+), 24 deletions(-) diff --git a/base/boot.jl b/base/boot.jl index 90322b69a54d9..2476114b62d70 100644 --- a/base/boot.jl +++ b/base/boot.jl @@ -421,10 +421,10 @@ eval(Core, quote function CodeInstance( mi::MethodInstance, @nospecialize(rettype), @nospecialize(inferred_const), @nospecialize(inferred), const_flags::Int32, min_world::UInt, max_world::UInt, - ipo_effects::UInt8, effects::UInt8, @nospecialize(argescapes#=::Union{Nothing,Vector{ArgEscapeInfo}}=#), + ipo_effects::UInt32, effects::UInt32, @nospecialize(argescapes#=::Union{Nothing,Vector{ArgEscapeInfo}}=#), relocatability::UInt8) return ccall(:jl_new_codeinst, Ref{CodeInstance}, - (Any, Any, Any, Any, Int32, UInt, UInt, UInt8, UInt8, Any, UInt8), + (Any, Any, Any, Any, Int32, UInt, UInt, UInt32, UInt32, Any, UInt8), mi, rettype, inferred_const, inferred, const_flags, min_world, max_world, ipo_effects, effects, argescapes, relocatability) diff --git a/base/compiler/compiler.jl b/base/compiler/compiler.jl index 18232b37008f6..6991e2d38437b 100644 --- a/base/compiler/compiler.jl +++ b/base/compiler/compiler.jl @@ -58,6 +58,9 @@ include("operators.jl") include("pointer.jl") include("refvalue.jl") +# the same constructor as defined in float.jl, but with a different name to avoid redefinition +_Bool(x::Real) = x==0 ? false : x==1 ? true : throw(InexactError(:Bool, Bool, x)) + # checked arithmetic const checked_add = + const checked_sub = - diff --git a/base/compiler/types.jl b/base/compiler/types.jl index 282582c016d97..5e2c7ed46a98d 100644 --- a/base/compiler/types.jl +++ b/base/compiler/types.jl @@ -78,11 +78,13 @@ function Effects(e::Effects = EFFECTS_UNKNOWN; end is_total_or_error(effects::Effects) = - effects.consistent === ALWAYS_TRUE && effects.effect_free === ALWAYS_TRUE && + effects.consistent === ALWAYS_TRUE && + effects.effect_free === ALWAYS_TRUE && effects.terminates === ALWAYS_TRUE is_total(effects::Effects) = - is_total_or_error(effects) && effects.nothrow === ALWAYS_TRUE + is_total_or_error(effects) && + effects.nothrow === ALWAYS_TRUE is_removable_if_unused(effects::Effects) = effects.effect_free === ALWAYS_TRUE && @@ -90,19 +92,19 @@ is_removable_if_unused(effects::Effects) = effects.nothrow === ALWAYS_TRUE function encode_effects(e::Effects) - return (e.consistent.state << 1) | - (e.effect_free.state << 3) | - (e.nothrow.state << 5) | - (e.terminates.state << 7) | - (e.overlayed) + return (e.consistent.state << 0) | + (e.effect_free.state << 2) | + (e.nothrow.state << 4) | + (e.terminates.state << 6) | + (UInt32(e.overlayed) << 8) end -function decode_effects(e::UInt8) +function decode_effects(e::UInt32) return Effects( - TriState((e >> 1) & 0x03), - TriState((e >> 3) & 0x03), - TriState((e >> 5) & 0x03), - TriState((e >> 7) & 0x03), - e & 0x01 ≠ 0x00, + TriState((e >> 0) & 0x03), + TriState((e >> 2) & 0x03), + TriState((e >> 4) & 0x03), + TriState((e >> 6) & 0x03), + _Bool( (e >> 8) & 0x01), false) end diff --git a/src/dump.c b/src/dump.c index 956466ac765b2..f04a6b27d8099 100644 --- a/src/dump.c +++ b/src/dump.c @@ -618,8 +618,8 @@ static void jl_serialize_code_instance(jl_serializer_state *s, jl_code_instance_ write_uint8(s->s, TAG_CODE_INSTANCE); write_uint8(s->s, flags); - write_uint8(s->s, codeinst->ipo_purity_bits); - write_uint8(s->s, codeinst->purity_bits); + write_uint32(s->s, codeinst->ipo_purity_bits); + write_uint32(s->s, codeinst->purity_bits); jl_serialize_value(s, (jl_value_t*)codeinst->def); if (write_ret_type) { jl_serialize_value(s, codeinst->inferred); @@ -1829,8 +1829,8 @@ static jl_value_t *jl_deserialize_value_code_instance(jl_serializer_state *s, jl int flags = read_uint8(s->s); int validate = (flags >> 0) & 3; int constret = (flags >> 2) & 1; - codeinst->ipo_purity_bits = read_uint8(s->s); - codeinst->purity_bits = read_uint8(s->s); + codeinst->ipo_purity_bits = read_uint32(s->s); + codeinst->purity_bits = read_uint32(s->s); codeinst->def = (jl_method_instance_t*)jl_deserialize_value(s, (jl_value_t**)&codeinst->def); jl_gc_wb(codeinst, codeinst->def); codeinst->inferred = jl_deserialize_value(s, &codeinst->inferred); diff --git a/src/gf.c b/src/gf.c index 964e4d1e01963..a37883251e9c2 100644 --- a/src/gf.c +++ b/src/gf.c @@ -220,7 +220,7 @@ JL_DLLEXPORT jl_code_instance_t* jl_new_codeinst( jl_method_instance_t *mi, jl_value_t *rettype, jl_value_t *inferred_const, jl_value_t *inferred, int32_t const_flags, size_t min_world, size_t max_world, - uint8_t ipo_effects, uint8_t effects, jl_value_t *argescapes, + uint32_t ipo_effects, uint32_t effects, jl_value_t *argescapes, uint8_t relocatability); JL_DLLEXPORT void jl_mi_cache_insert(jl_method_instance_t *mi JL_ROOTING_ARGUMENT, jl_code_instance_t *ci JL_ROOTED_ARGUMENT JL_MAYBE_UNROOTED); @@ -390,7 +390,7 @@ JL_DLLEXPORT jl_code_instance_t *jl_new_codeinst( jl_method_instance_t *mi, jl_value_t *rettype, jl_value_t *inferred_const, jl_value_t *inferred, int32_t const_flags, size_t min_world, size_t max_world, - uint8_t ipo_effects, uint8_t effects, jl_value_t *argescapes, + uint32_t ipo_effects, uint32_t effects, jl_value_t *argescapes, uint8_t relocatability /*, jl_array_t *edges, int absolute_max*/) { diff --git a/src/jltypes.c b/src/jltypes.c index e19b4c536d94d..7d8b1ac6bb32b 100644 --- a/src/jltypes.c +++ b/src/jltypes.c @@ -2520,7 +2520,7 @@ void jl_init_types(void) JL_GC_DISABLED jl_any_type, //jl_any_type, //jl_bool_type, - jl_uint8_type, jl_uint8_type, + jl_uint32_type, jl_uint32_type, jl_any_type, jl_bool_type, jl_bool_type, diff --git a/src/julia.h b/src/julia.h index 5e22c262fb47d..b15008dee91e3 100644 --- a/src/julia.h +++ b/src/julia.h @@ -394,21 +394,23 @@ typedef struct _jl_code_instance_t { // purity results union { - uint8_t ipo_purity_bits; + uint32_t ipo_purity_bits; struct { uint8_t ipo_consistent:2; uint8_t ipo_effect_free:2; uint8_t ipo_nothrow:2; uint8_t ipo_terminates:2; + uint8_t ipo_overlayed:1; } ipo_purity_flags; }; union { - uint8_t purity_bits; + uint32_t purity_bits; struct { uint8_t consistent:2; uint8_t effect_free:2; uint8_t nothrow:2; uint8_t terminates:2; + uint8_t overlayed:1; } purity_flags; }; jl_value_t *argescapes; // escape information of call arguments diff --git a/src/serialize.h b/src/serialize.h index 63d7c2d360951..817591b989f93 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -109,6 +109,18 @@ static uint16_t read_uint16(ios_t *s) JL_NOTSAFEPOINT return x; } +static void write_uint32(ios_t *s, uint32_t i) JL_NOTSAFEPOINT +{ + ios_write(s, (char*)&i, 4); +} + +static uint32_t read_uint32(ios_t *s) JL_NOTSAFEPOINT +{ + uint32_t x = 0; + ios_read(s, (char*)&x, 4); + return x; +} + void *jl_lookup_ser_tag(jl_value_t *v); void *jl_lookup_common_symbol(jl_value_t *v); jl_value_t *jl_deser_tag(uint8_t tag); From e191c6e9357969e36562258ede4741d34d3d1815 Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Thu, 17 Mar 2022 06:35:26 -0500 Subject: [PATCH 085/369] logging: string->String (#44567) --- base/logging.jl | 2 +- stdlib/Logging/src/ConsoleLogger.jl | 2 +- test/corelogging.jl | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/base/logging.jl b/base/logging.jl index 667b8ddead983..9e40f2231b035 100644 --- a/base/logging.jl +++ b/base/logging.jl @@ -674,7 +674,7 @@ function handle_message(logger::SimpleLogger, level::LogLevel, message, _module, end iob = IOContext(buf, stream) levelstr = level == Warn ? "Warning" : string(level) - msglines = eachsplit(chomp(string(message)::String), '\n') + msglines = eachsplit(chomp(convert(String, string(message))::String), '\n') msg1, rest = Iterators.peel(msglines) println(iob, "┌ ", levelstr, ": ", msg1) for msg in rest diff --git a/stdlib/Logging/src/ConsoleLogger.jl b/stdlib/Logging/src/ConsoleLogger.jl index 4e32b6b71f656..86e3d587eb452 100644 --- a/stdlib/Logging/src/ConsoleLogger.jl +++ b/stdlib/Logging/src/ConsoleLogger.jl @@ -116,7 +116,7 @@ function handle_message(logger::ConsoleLogger, level::LogLevel, message, _module # Generate a text representation of the message and all key value pairs, # split into lines. - msglines = [(indent=0, msg=l) for l in split(chomp(string(message)::String), '\n')] + msglines = [(indent=0, msg=l) for l in split(chomp(convert(String, string(message))::String), '\n')] stream = logger.stream if !isopen(stream) stream = stderr diff --git a/test/corelogging.jl b/test/corelogging.jl index 9c5102d848013..3fce2dd593595 100644 --- a/test/corelogging.jl +++ b/test/corelogging.jl @@ -151,6 +151,21 @@ end @test_throws MethodError @macrocall(@error) end +@testset "Any type" begin + @test_logs (:info, sum) @info sum + # TODO: make this work (here we want `@test_logs` to fail) + # @test_fails @test_logs (:info, "sum") @info sum # `sum` works, `"sum"` does not + + # check that the message delivered to the user works + mktempdir() do dir + path_stdout = joinpath(dir, "stdout.txt") + path_stderr = joinpath(dir, "stderr.txt") + redirect_stdio(stdout=path_stdout, stderr=path_stderr) do + @info sum + end + @test occursin("Info: sum", read(path_stderr, String)) + end +end #------------------------------------------------------------------------------- # Early log level filtering From dc3f456ea1873df83aff1b7446b552da4c3a94e5 Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Fri, 18 Mar 2022 23:03:10 -0400 Subject: [PATCH 086/369] Also record overriden ipo effects in InferenceState (#44672) Otherwise the first time a new method is inferred, `typeinf_edge` will not respect the override, leading to lots of confusion. --- base/compiler/typeinfer.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/compiler/typeinfer.jl b/base/compiler/typeinfer.jl index 1c54345b17de5..c20fcd14be0ef 100644 --- a/base/compiler/typeinfer.jl +++ b/base/compiler/typeinfer.jl @@ -512,7 +512,7 @@ function finish(me::InferenceState, interp::AbstractInterpreter) ipo_effects = Effects(ipo_effects; terminates=ALWAYS_TRUE) end end - me.result.ipo_effects = ipo_effects + me.ipo_effects = me.result.ipo_effects = ipo_effects validate_code_in_debug_mode(me.linfo, me.src, "inferred") nothing end From 70ce9b3027d9c63554553bfe1668cd27e5abbda3 Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Sun, 20 Mar 2022 21:28:31 -0400 Subject: [PATCH 087/369] Fix code coverage in specific path mode (#44625) (cherry picked from commit feb7b774525830096b6a8a592becdd73f8789415) --- base/compiler/optimize.jl | 11 ++++++++++- base/compiler/ssair/inlining.jl | 5 +++++ base/compiler/utilities.jl | 4 ++-- base/options.jl | 4 ++++ src/init.c | 7 +++++++ test/cmdlineargs.jl | 4 ---- 6 files changed, 28 insertions(+), 7 deletions(-) diff --git a/base/compiler/optimize.jl b/base/compiler/optimize.jl index 0616204dce748..cd27dbb01b625 100644 --- a/base/compiler/optimize.jl +++ b/base/compiler/optimize.jl @@ -558,12 +558,21 @@ function convert_to_ircode(ci::CodeInfo, sv::OptimizationState) idx = 1 oldidx = 1 changemap = fill(0, length(code)) - labelmap = coverage ? fill(0, length(code)) : changemap prevloc = zero(eltype(ci.codelocs)) stmtinfo = sv.stmt_info codelocs = ci.codelocs ssavaluetypes = ci.ssavaluetypes::Vector{Any} ssaflags = ci.ssaflags + if !coverage && JLOptions().code_coverage == 3 # path-specific coverage mode + for line in ci.linetable + if is_file_tracked(line.file) + # if any line falls in a tracked file enable coverage for all + coverage = true + break + end + end + end + labelmap = coverage ? fill(0, length(code)) : changemap while idx <= length(code) codeloc = codelocs[idx] if coverage && codeloc != prevloc && codeloc != 0 diff --git a/base/compiler/ssair/inlining.jl b/base/compiler/ssair/inlining.jl index 510c3bdaf5b03..a5b68d6d5198d 100644 --- a/base/compiler/ssair/inlining.jl +++ b/base/compiler/ssair/inlining.jl @@ -319,10 +319,15 @@ function ir_inline_item!(compact::IncrementalCompact, idx::Int, argexprs::Vector inlined_at = Int(compact.result[idx][:line]) topline::Int32 = linetable_offset + Int32(1) coverage = coverage_enabled(def.module) + coverage_by_path = JLOptions().code_coverage == 3 push!(linetable, LineInfoNode(def.module, def.name, def.file, Int(def.line), inlined_at)) oldlinetable = spec.ir.linetable for oldline in 1:length(oldlinetable) entry = oldlinetable[oldline] + if !coverage && coverage_by_path && is_file_tracked(entry.file) + # include topline coverage entry if in path-specific coverage mode, and any file falls under path + coverage = true + end newentry = LineInfoNode(entry.module, entry.method, entry.file, entry.line, (entry.inlined_at > 0 ? entry.inlined_at + linetable_offset + (oldline == 1) : inlined_at)) if oldline == 1 diff --git a/base/compiler/utilities.jl b/base/compiler/utilities.jl index 9b1106e964919..f7ff32ecbaefe 100644 --- a/base/compiler/utilities.jl +++ b/base/compiler/utilities.jl @@ -359,12 +359,12 @@ inlining_enabled() = (JLOptions().can_inline == 1) function coverage_enabled(m::Module) ccall(:jl_generating_output, Cint, ()) == 0 || return false # don't alter caches cov = JLOptions().code_coverage - if cov == 1 + if cov == 1 # user m = moduleroot(m) m === Core && return false isdefined(Main, :Base) && m === Main.Base && return false return true - elseif cov == 2 + elseif cov == 2 # all return true end return false diff --git a/base/options.jl b/base/options.jl index 52bfb1237a858..9d08af940136f 100644 --- a/base/options.jl +++ b/base/options.jl @@ -89,3 +89,7 @@ function unsafe_load_commands(v::Ptr{Ptr{UInt8}}) end return cmds end + +function is_file_tracked(file::Symbol) + return ccall(:jl_is_file_tracked, Cint, (Any,), file) == 1 +end diff --git a/src/init.c b/src/init.c index 6bebffdcf326c..98d5081c1daaf 100644 --- a/src/init.c +++ b/src/init.c @@ -597,6 +597,13 @@ static void jl_resolve_sysimg_location(JL_IMAGE_SEARCH rel) } } +JL_DLLEXPORT int jl_is_file_tracked(jl_sym_t *path) +{ + const char* path_ = jl_symbol_name(path); + int tpath_len = strlen(jl_options.tracked_path); + return (strlen(path_) >= tpath_len) && (strncmp(path_, jl_options.tracked_path, tpath_len) == 0); +} + static void jl_set_io_wait(int v) { jl_task_t *ct = jl_current_task; diff --git a/test/cmdlineargs.jl b/test/cmdlineargs.jl index 43d3728dcb988..8d58672d30f09 100644 --- a/test/cmdlineargs.jl +++ b/test/cmdlineargs.jl @@ -328,10 +328,6 @@ let exename = `$(Base.julia_cmd()) --startup-file=no --color=no` @test_broken occursin(expected_good, got) # Ask for coverage in specific file - # TODO: Figure out why asking for a specific file/dir means some lines are under-counted - # NOTE that a different expected reference is loaded here - expected = replace(read(joinpath(helperdir, "coverage_file.info.bad2"), String), - "" => realpath(inputfile)) tfile = realpath(inputfile) @test readchomp(`$exename -E "(Base.JLOptions().code_coverage, unsafe_string(Base.JLOptions().tracked_path))" -L $inputfile --code-coverage=$covfile --code-coverage=@$tfile`) == "(3, $(repr(tfile)))" From 70dfbf68588f3571a320ad1435c93396da8b962c Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Wed, 16 Mar 2022 16:49:19 +0100 Subject: [PATCH 088/369] Ignore potential errors during dbg-related object construction on Darwin. (#44637) (cherry picked from commit efa2430a2264fa3f159deb63b01a275d0b637b05) --- src/debuginfo.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/debuginfo.cpp b/src/debuginfo.cpp index 53105feb81bfe..263e506355d69 100644 --- a/src/debuginfo.cpp +++ b/src/debuginfo.cpp @@ -814,8 +814,10 @@ static objfileentry_t &find_object_file(uint64_t fbase, StringRef fname) JL_NOTS StringRef((const char *)fbase, msize), "", false); auto origerrorobj = llvm::object::ObjectFile::createObjectFile( membuf->getMemBufferRef(), file_magic::unknown); - if (!origerrorobj) + if (!origerrorobj) { + ignoreError(origerrorobj); return entry; + } llvm::object::MachOObjectFile *morigobj = (llvm::object::MachOObjectFile*) origerrorobj.get().get(); From 470d7a6cd98e71826d6f3f67d0511b813f7170d6 Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Fri, 11 Mar 2022 23:14:23 -0800 Subject: [PATCH 089/369] Bump libblastrampoline to v5.1.0 (#44574) This should fix some serious issues with calling {c,z}dot{c,u} on Windows x86_64. See [0] for more details, and [1] for a test case. [0] https://github.com/JuliaLinearAlgebra/libblastrampoline/commit/082924837dec5df66eb08e19aec0bf81ac78c3be [1] https://github.com/JuliaLinearAlgebra/libblastrampoline/commit/2ef456212b4765e97d9557f35adc2c52a3aac346 (cherry picked from commit 3c34dac8b04bd44cf5df19735dcbcc9f55b4d7d3) --- deps/Versions.make | 2 +- deps/checksums/blastrampoline | 64 +++++++++++------------ stdlib/libblastrampoline_jll/Project.toml | 2 +- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/deps/Versions.make b/deps/Versions.make index 1d510ee4911b6..77d568ee7c6b5 100644 --- a/deps/Versions.make +++ b/deps/Versions.make @@ -75,7 +75,7 @@ OBJCONV_JLL_NAME := Objconv OBJCONV_JLL_VER := 2.49.1+0 # blastrampoline -BLASTRAMPOLINE_VER := 5.0.1 +BLASTRAMPOLINE_VER := 5.1.0 BLASTRAMPOLINE_JLL_NAME := libblastrampoline # OpenBLAS diff --git a/deps/checksums/blastrampoline b/deps/checksums/blastrampoline index d97f2fedd926b..3b5e4359e43ec 100644 --- a/deps/checksums/blastrampoline +++ b/deps/checksums/blastrampoline @@ -1,34 +1,34 @@ blastrampoline-d32042273719672c6669f6442a0be5605d434b70.tar.gz/md5/f380e4238a2dec186ecfe9598f75b824 blastrampoline-d32042273719672c6669f6442a0be5605d434b70.tar.gz/sha512/00437a96b57d99cef946257480e38e1dfdf325c46bc4a1619f5067565dfb7d9f668b0c8415badb0879b933cb1972f3c4e6be4c9e63a8a85728033e2183373819 -libblastrampoline.v5.0.1+0.aarch64-apple-darwin.tar.gz/md5/8b2b28517ef5db95a0b440f1a936422e -libblastrampoline.v5.0.1+0.aarch64-apple-darwin.tar.gz/sha512/3d479efc47b8c81fa85fd4d2a868a48304051432b92af90a2bcd2142673f2c422419731b8941f987aed429064532e8634ce3ea8f8d71222cf2d9b9e1e8ba2f7f -libblastrampoline.v5.0.1+0.aarch64-linux-gnu.tar.gz/md5/23e53049a0c30c8d24482a25954ee497 -libblastrampoline.v5.0.1+0.aarch64-linux-gnu.tar.gz/sha512/c5ba3609e5c47066d8a10acdd1c13e25a78bea6003a39a354000c832aeb1cf04a29392089600b10f0d6e5544aa910412bb50f238ac1f81d55ac15f70aaeb3161 -libblastrampoline.v5.0.1+0.aarch64-linux-musl.tar.gz/md5/5b6770a56cf3632473726a6da3da8ac4 -libblastrampoline.v5.0.1+0.aarch64-linux-musl.tar.gz/sha512/13f01e51b754a7bb4f78d0217380923e353499815872694718922a842fb1d41774e83ec07305b0ca9df2b054e26a626c20e685127e467b3bbb5adb3b9de3c7d3 -libblastrampoline.v5.0.1+0.armv6l-linux-gnueabihf.tar.gz/md5/32f33430008184705b37afcce7d09fdc -libblastrampoline.v5.0.1+0.armv6l-linux-gnueabihf.tar.gz/sha512/2af9ce233b473f2c81c4ba2e82253a88a519e4cbfa2cd410b27b1f1d7d06559376dd3743951105dbaa784310cce378516978b0d56bd8a196e2eb6c5fb7e6e969 -libblastrampoline.v5.0.1+0.armv6l-linux-musleabihf.tar.gz/md5/52da6ab8b5a9e03aebb032441b668d65 -libblastrampoline.v5.0.1+0.armv6l-linux-musleabihf.tar.gz/sha512/a6f1a375b61642e0b2fd235e27b5bf7e0cd1ff308cdfef27b904f62dfb9ac2bc8fa4e9a7869851310da90af4797994d86d581354070810ffedf3deea5afcc388 -libblastrampoline.v5.0.1+0.armv7l-linux-gnueabihf.tar.gz/md5/08fe2bf27a14e6a6fc4f6b394051aac9 -libblastrampoline.v5.0.1+0.armv7l-linux-gnueabihf.tar.gz/sha512/fdf8d054c67ca3e60dfc7739e02e28817d4510558341d9666b3ccc35818d1ea835a30676cfbe66bbb119c5574c683f1626088119dfc672bf730c87811835e48e -libblastrampoline.v5.0.1+0.armv7l-linux-musleabihf.tar.gz/md5/836fdbe9e759c71b3c7ae6be2ff6cd6a -libblastrampoline.v5.0.1+0.armv7l-linux-musleabihf.tar.gz/sha512/6333f8b9270f51c9e520ef8eee52c1796659bd7574c4e8cc04774d3b5e0574af63e5b252cc3340a62bf44771970331839083a528f402bc7929f32cffdbeba876 -libblastrampoline.v5.0.1+0.i686-linux-gnu.tar.gz/md5/11f127c422a4b51d6cd0abe370176c25 -libblastrampoline.v5.0.1+0.i686-linux-gnu.tar.gz/sha512/ad8510a804637ed144ee931a11629ee86e3c29e36be394c1f020a04e68b64a04a0eaa976961a993be0693b1f57b687f18dd25d3313aafa217a9140913dc9849d -libblastrampoline.v5.0.1+0.i686-linux-musl.tar.gz/md5/c865cd79d083de137714df55dfd015c9 -libblastrampoline.v5.0.1+0.i686-linux-musl.tar.gz/sha512/99f4938626f84e5636231f34842c6877be5ac0d528f7bcae6b15d51b82d0daa06eb7d086a28f2c516234a989dd384f932886303f13cbac33f972fbf64b16dfb9 -libblastrampoline.v5.0.1+0.i686-w64-mingw32.tar.gz/md5/e9e2cbb1c90b691fd06f4df81674d36a -libblastrampoline.v5.0.1+0.i686-w64-mingw32.tar.gz/sha512/c32a7449476f994f8d1bdb576959d6cc54018ac33be2d691b8627467ff5870deac7427e83f275db9b675c5d92bd13254979b06da33b782d6de3b49b1a6dda19c -libblastrampoline.v5.0.1+0.powerpc64le-linux-gnu.tar.gz/md5/5904dce9e258e4bdf71493e6cdc5fb20 -libblastrampoline.v5.0.1+0.powerpc64le-linux-gnu.tar.gz/sha512/e10761289aaf985e96e0c908f988218450b54b78a5ba0ca67b509d63c422849471b38e952b93e1de0ffa92d9b8e76b16cfd733a05940203213f7f10cdb953dc9 -libblastrampoline.v5.0.1+0.x86_64-apple-darwin.tar.gz/md5/2d15a24ce47dc67ef575ca514530734e -libblastrampoline.v5.0.1+0.x86_64-apple-darwin.tar.gz/sha512/5209953e6ed72c5840b926c2c50e67f3ef2e8612877e5c6c4962e687870a9c4f95ab83fab1db77419ffdd21e303e5a951a86d21979cbd2e2e8b9d65a2b86a693 -libblastrampoline.v5.0.1+0.x86_64-linux-gnu.tar.gz/md5/67092e794898efbe1d75bbaf19912538 -libblastrampoline.v5.0.1+0.x86_64-linux-gnu.tar.gz/sha512/cc117c4d6d7a34fc7abfff4d40584f63b3ed80a2aa8be887f22a65b25e9196a2173d624bda77e8a1f2c401792c090948ad0a9069af3e48ee886664e1b2dd771f -libblastrampoline.v5.0.1+0.x86_64-linux-musl.tar.gz/md5/32f65fa0681d81ab4f5a84d18ec0ef40 -libblastrampoline.v5.0.1+0.x86_64-linux-musl.tar.gz/sha512/177f25c3108af15653726871b110d77e0a5e94b06bd6996503f83b7dd7c0d9877beff5eeadbdff4952ac606fcec426c04a97566efc2d88d75ed380e566ffe0c0 -libblastrampoline.v5.0.1+0.x86_64-unknown-freebsd.tar.gz/md5/12494ac279b869c740712b8f774edadf -libblastrampoline.v5.0.1+0.x86_64-unknown-freebsd.tar.gz/sha512/6b896996f20552bb05d22fb314b6b9ad8e4359aec31f90fe7029cd13d37e6db1c305a87d9622ff4b036b155a12a5b305a8fd56e4074149bad8c3e6a225c70c5d -libblastrampoline.v5.0.1+0.x86_64-w64-mingw32.tar.gz/md5/4fdbfc6384ba4dbc74eda97dff919511 -libblastrampoline.v5.0.1+0.x86_64-w64-mingw32.tar.gz/sha512/e752486b9e6f6ed293a42337f432c8dcb86246523864674be5ff35fcc49f8cc848f77c41b2af1903959938f620d68b1de6028afc662f9e893045308eef72d624 +libblastrampoline.v5.1.0+0.aarch64-apple-darwin.tar.gz/md5/edf090a17d862c33d611875058438757 +libblastrampoline.v5.1.0+0.aarch64-apple-darwin.tar.gz/sha512/a3413c7d46c04318a5bebf10d6f930d04b5997d4be6be4e2748a7b60f968d2f2be7de140eee6c699962a12e8439f68f144e5323dea17d91587e82f97aaaaaa24 +libblastrampoline.v5.1.0+0.aarch64-linux-gnu.tar.gz/md5/fe88a410d795f805756488915679edbd +libblastrampoline.v5.1.0+0.aarch64-linux-gnu.tar.gz/sha512/cbd31304278ea67ddc0f766c4647275c87829cf5377c3851153b7568015f4f016fd0f3e095f479c33d23a50f4af8c38bae4555b02dcbf45a04b6e5a0dd3504a8 +libblastrampoline.v5.1.0+0.aarch64-linux-musl.tar.gz/md5/d4d8c393eb28953297b37a7bae79ed2e +libblastrampoline.v5.1.0+0.aarch64-linux-musl.tar.gz/sha512/3b5dca87e089ac10486f75663b4cf7d404c71b040231b04e1ec5110d13f30ac620b4cb880040106273866d465da9bdda5643887534de8e35668a7ab545422216 +libblastrampoline.v5.1.0+0.armv6l-linux-gnueabihf.tar.gz/md5/8b5f2fbd5442bf31bd10836ffd177968 +libblastrampoline.v5.1.0+0.armv6l-linux-gnueabihf.tar.gz/sha512/f1d6314c785afc0aaa3ebcf8a532312e676ca41d427b9c2abdea88c700df4d6a7cb5cfa54d65493e5c3d711a64062a20a5de7e3b75feee0653115cee7de05446 +libblastrampoline.v5.1.0+0.armv6l-linux-musleabihf.tar.gz/md5/8ed3013c644ab3be5dce013fb23fd413 +libblastrampoline.v5.1.0+0.armv6l-linux-musleabihf.tar.gz/sha512/da40cbb0114d46a66ae41284d36dc855aa52dcd3993643858308f18c5d8eedbf92fc8ee57d3e3cc2153f29670b40bc03a8dd01d5b49dde210c8a7a2d471a59b7 +libblastrampoline.v5.1.0+0.armv7l-linux-gnueabihf.tar.gz/md5/23b8ef9ea92a8d474646d814c0c91577 +libblastrampoline.v5.1.0+0.armv7l-linux-gnueabihf.tar.gz/sha512/97789adc18a54b953ce8696b484a4314e734a8092a27f81f43c1ae269b592b18ba7c67082396220a1906ffb075895c34462be976e0059aded9f6a6948abb1672 +libblastrampoline.v5.1.0+0.armv7l-linux-musleabihf.tar.gz/md5/d5a47ebe37a4a234ee6a4f3cf830e8c5 +libblastrampoline.v5.1.0+0.armv7l-linux-musleabihf.tar.gz/sha512/65366692c074576733e3b3f15d011e326d6a1e2357055a1a0159db31cdd7d5ff0e9aba9a33c1f2a949e128ac10b72776a3f76907df4cadcf7e67ace934cf4ef0 +libblastrampoline.v5.1.0+0.i686-linux-gnu.tar.gz/md5/14a342ab1bd16ef61d747e99acc97e6a +libblastrampoline.v5.1.0+0.i686-linux-gnu.tar.gz/sha512/8eca984912e69af769f06cd2b38d1df9d724e4e42d6d5b2fcb77a8e74b2aa9f9c31beb36d634e5da28d4d2f0838957f5c5cd336db616768d8ffb60217fe92edc +libblastrampoline.v5.1.0+0.i686-linux-musl.tar.gz/md5/201e6c737df0c0e2f4327c395133969f +libblastrampoline.v5.1.0+0.i686-linux-musl.tar.gz/sha512/778daa7a0d3a6fb8d6480a14123e874009f0fdc5f1d3411518f8d9975c45ca418e88d71db72af8465d4064f4c177d0abb70bc568df3a4c765eed7c5aeddca428 +libblastrampoline.v5.1.0+0.i686-w64-mingw32.tar.gz/md5/8ddf4dec49fac4888f94f90143126e5f +libblastrampoline.v5.1.0+0.i686-w64-mingw32.tar.gz/sha512/388b797f4c86f0ea090058acaff0eed34c42d45092c001410d11a4a4da93668c1729453290872cd44615ee517d62546f4dc42005240a6c36e40e7152f5c9cf5c +libblastrampoline.v5.1.0+0.powerpc64le-linux-gnu.tar.gz/md5/db626123ab94b489ac8b4d395b2f5cf4 +libblastrampoline.v5.1.0+0.powerpc64le-linux-gnu.tar.gz/sha512/8c96f518dea82057fe85bdb2ee867cc7abc33e9c53fe94dd84d097a16268630c22082db7fc003dadfc4749400f3465564088e05cabd6844c31b870319432c433 +libblastrampoline.v5.1.0+0.x86_64-apple-darwin.tar.gz/md5/65b9aae2f749ec608b61412aa1921d65 +libblastrampoline.v5.1.0+0.x86_64-apple-darwin.tar.gz/sha512/38e974c9260614d855b0b13f78e72bbd65aa889e88101d25441dd4e78ce37baf81bab7de1950d71d8e35b32d62fb88ac9c3f39ab5a4aff11d00619441bc003f8 +libblastrampoline.v5.1.0+0.x86_64-linux-gnu.tar.gz/md5/0ab01f256277b4ea96f6d83c50891b99 +libblastrampoline.v5.1.0+0.x86_64-linux-gnu.tar.gz/sha512/2b2178d74beb1c12e348f6469777d31116f26229c243d5e08a6ac36a74c3eb38854c1d82429d0e7cabee259d0d5220c47c334a561ea5caac6f61d91aa6b34f52 +libblastrampoline.v5.1.0+0.x86_64-linux-musl.tar.gz/md5/52a9da4586daa6572b8fe2c13db6268a +libblastrampoline.v5.1.0+0.x86_64-linux-musl.tar.gz/sha512/04abc5a0b6f80f10d1fccceee8a0e1c58aba76a45e3f6662ce4115d9d39d20dd05b3859434037d21bf6c5088a5a428565cd86e1cf6d1676666ce7e3eb1921b80 +libblastrampoline.v5.1.0+0.x86_64-unknown-freebsd.tar.gz/md5/f2b66517937a7647086ba96acc81c6a6 +libblastrampoline.v5.1.0+0.x86_64-unknown-freebsd.tar.gz/sha512/c19654b97928bdba36ccf3dbecf8ca994a46929c29c5c120d2d17062128a3df8927230fe7c418d6f780557abb8ce94b6a6a023bddcd3aeb91c8302cdbfe2b39e +libblastrampoline.v5.1.0+0.x86_64-w64-mingw32.tar.gz/md5/4b50ad8399c733ee5d60ce1ad00e1e5e +libblastrampoline.v5.1.0+0.x86_64-w64-mingw32.tar.gz/sha512/6a0f1d061350d53dd2a030ba11a0ac02c5ae598cd2c21dda39f95d81a2b0f43a454d60cf32c2fc0546df074181100e2d247d229d62c4a6b94bc7b697b02f0e0e diff --git a/stdlib/libblastrampoline_jll/Project.toml b/stdlib/libblastrampoline_jll/Project.toml index 26c67dae8dffd..8b93e368f8f59 100644 --- a/stdlib/libblastrampoline_jll/Project.toml +++ b/stdlib/libblastrampoline_jll/Project.toml @@ -1,6 +1,6 @@ name = "libblastrampoline_jll" uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" -version = "5.0.1+0" +version = "5.1.0+0" [deps] Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" From a00e1f1e9a61549820083e9292a6648e851814b1 Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Wed, 16 Mar 2022 11:07:12 -0700 Subject: [PATCH 090/369] [build] Silence non-fatal `gfortran: command not found` errors (#44554) We build without `gfortran` pretty regularly these days, let's make it slightly less annoying to build without a `gfortran` available on the path. (cherry picked from commit 5ab5f9858d811bc65723ab3f440d7c58cb014d0d) --- Make.inc | 4 ++-- deps/csl.mk | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Make.inc b/Make.inc index a143b871efecb..228cd99823c48 100644 --- a/Make.inc +++ b/Make.inc @@ -652,8 +652,8 @@ ifeq ($(OS),FreeBSD) ifneq (,$(findstring gfortran,$(FC))) # First let's figure out what version of GCC we're dealing with -_GCCMAJOR := $(shell $(FC) -dumpversion | cut -d'.' -f1) -_GCCMINOR := $(shell $(FC) -dumpversion | cut -d'.' -f2) +_GCCMAJOR := $(shell $(FC) -dumpversion 2>/dev/null | cut -d'.' -f1) +_GCCMINOR := $(shell $(FC) -dumpversion 2>/dev/null | cut -d'.' -f2) # The ports system uses major and minor for GCC < 5 (e.g. gcc49 for GCC 4.9), otherwise major only ifeq ($(_GCCMAJOR),4) diff --git a/deps/csl.mk b/deps/csl.mk index 9f95c00f3cfe7..1940984fdc199 100644 --- a/deps/csl.mk +++ b/deps/csl.mk @@ -1,6 +1,6 @@ # Interrogate the fortran compiler (which is always GCC based) on where it is keeping its libraries -STD_LIB_PATH := $(shell LANG=C $(FC) -print-search-dirs | grep '^programs: =' | sed -e "s/^programs: =//") -STD_LIB_PATH += :$(shell LANG=C $(FC) -print-search-dirs | grep '^libraries: =' | sed -e "s/^libraries: =//") +STD_LIB_PATH := $(shell LANG=C $(FC) -print-search-dirs 2>/dev/null | grep '^programs: =' | sed -e "s/^programs: =//") +STD_LIB_PATH += :$(shell LANG=C $(FC) -print-search-dirs 2>/dev/null | grep '^libraries: =' | sed -e "s/^libraries: =//") ifneq (,$(findstring CYGWIN,$(BUILD_OS))) # the cygwin-mingw32 compiler lies about it search directory paths STD_LIB_PATH := $(shell echo '$(STD_LIB_PATH)' | sed -e "s!/lib/!/bin/!g") endif From 795607a3529bcdeea14c8ce51cf35793dd986128 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 19 Feb 2022 16:41:17 +0100 Subject: [PATCH 091/369] Fix get/set_fpcr_aarch64 (#44256) On Aarch64, the `fpcr` register is 64bit wide, although the top 32bit are currently unused and reserved for future usage. Nevertheless, we should safe and restore the full 64 bit, not just 32 bit. This also silences a compiler warning about this. Reference: (cherry picked from commit 5bd0545fb05b1930f38bdd0ee93c3603b89cbc5f) --- src/processor_arm.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/processor_arm.cpp b/src/processor_arm.cpp index f5cc2a42a4870..ea8dddf629d62 100644 --- a/src/processor_arm.cpp +++ b/src/processor_arm.cpp @@ -1843,20 +1843,20 @@ extern "C" int jl_test_cpu_feature(jl_cpu_feature_t feature) #ifdef _CPU_AARCH64_ // FPCR FZ, bit [24] -static constexpr uint32_t fpcr_fz_mask = 1 << 24; +static constexpr uint64_t fpcr_fz_mask = 1 << 24; // FPCR FZ16, bit [19] -static constexpr uint32_t fpcr_fz16_mask = 1 << 19; +static constexpr uint64_t fpcr_fz16_mask = 1 << 19; // FPCR DN, bit [25] -static constexpr uint32_t fpcr_dn_mask = 1 << 25; +static constexpr uint64_t fpcr_dn_mask = 1 << 25; -static inline uint32_t get_fpcr_aarch64(void) +static inline uint64_t get_fpcr_aarch64(void) { - uint32_t fpcr; + uint64_t fpcr; asm volatile("mrs %0, fpcr" : "=r"(fpcr)); return fpcr; } -static inline void set_fpcr_aarch64(uint32_t fpcr) +static inline void set_fpcr_aarch64(uint64_t fpcr) { asm volatile("msr fpcr, %0" :: "r"(fpcr)); } @@ -1868,8 +1868,8 @@ extern "C" JL_DLLEXPORT int32_t jl_get_zero_subnormals(void) extern "C" JL_DLLEXPORT int32_t jl_set_zero_subnormals(int8_t isZero) { - uint32_t fpcr = get_fpcr_aarch64(); - static uint32_t mask = fpcr_fz_mask | (jl_test_cpu_feature(JL_AArch64_fullfp16) ? fpcr_fz16_mask : 0); + uint64_t fpcr = get_fpcr_aarch64(); + static uint64_t mask = fpcr_fz_mask | (jl_test_cpu_feature(JL_AArch64_fullfp16) ? fpcr_fz16_mask : 0); fpcr = isZero ? (fpcr | mask) : (fpcr & ~mask); set_fpcr_aarch64(fpcr); return 0; @@ -1882,7 +1882,7 @@ extern "C" JL_DLLEXPORT int32_t jl_get_default_nans(void) extern "C" JL_DLLEXPORT int32_t jl_set_default_nans(int8_t isDefault) { - uint32_t fpcr = get_fpcr_aarch64(); + uint64_t fpcr = get_fpcr_aarch64(); fpcr = isDefault ? (fpcr | fpcr_dn_mask) : (fpcr & ~fpcr_dn_mask); set_fpcr_aarch64(fpcr); return 0; From 01a01ef063c6d6e7d81cd663e85cc4af034585f1 Mon Sep 17 00:00:00 2001 From: Denis Barucic Date: Mon, 21 Mar 2022 13:06:29 +0100 Subject: [PATCH 092/369] MPFR: Fix `round(Integer, big(Inf))` (#44676) It also fixes `round(Integer, big(NaN))`. Solves #44662 (cherry picked from commit ecf3558c94898ddd4272b319d3405cf7256c6db7) --- base/mpfr.jl | 9 ++++++++- test/mpfr.jl | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/base/mpfr.jl b/base/mpfr.jl index e85f281619ac0..60f59cdb0af7e 100644 --- a/base/mpfr.jl +++ b/base/mpfr.jl @@ -294,7 +294,14 @@ function round(::Type{T}, x::BigFloat, r::Union{RoundingMode, MPFRRoundingMode}) end return unsafe_trunc(T, res) end -round(::Type{BigInt}, x::BigFloat, r::Union{RoundingMode, MPFRRoundingMode}) = _unchecked_cast(BigInt, x, r) + +function round(::Type{BigInt}, x::BigFloat, r::Union{RoundingMode, MPFRRoundingMode}) + clear_flags() + res = _unchecked_cast(BigInt, x, r) + had_range_exception() && throw(InexactError(:round, BigInt, x)) + return res +end + round(::Type{T}, x::BigFloat, r::RoundingMode) where T<:Union{Signed, Unsigned} = invoke(round, Tuple{Type{<:Union{Signed, Unsigned}}, BigFloat, Union{RoundingMode, MPFRRoundingMode}}, T, x, r) round(::Type{BigInt}, x::BigFloat, r::RoundingMode) = diff --git a/test/mpfr.jl b/test/mpfr.jl index a1039a7c5a810..1a0a0041bf94e 100644 --- a/test/mpfr.jl +++ b/test/mpfr.jl @@ -653,6 +653,10 @@ end @test typeof(round(Int64, x)) == Int64 && round(Int64, x) == 42 @test typeof(round(Int, x)) == Int && round(Int, x) == 42 @test typeof(round(UInt, x)) == UInt && round(UInt, x) == 0x2a + + # Issue #44662 + @test_throws InexactError round(Integer, big(Inf)) + @test_throws InexactError round(Integer, big(NaN)) end @testset "string representation" begin str = "1.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012" From c5ac53c1498a5ad83892235b8ab6ee39fecfbab3 Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Tue, 22 Mar 2022 10:03:13 -0400 Subject: [PATCH 093/369] Add system info to start of testsuite. Profile: don't spawn profile listener on windows (#44639) (cherry picked from commit 95da0d81729a1cc414b1e6a06601f8152861af6f) --- stdlib/Profile/src/Profile.jl | 9 ++++++--- stdlib/Profile/test/runtests.jl | 10 ++++++++-- test/runtests.jl | 9 +++++++++ 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/stdlib/Profile/src/Profile.jl b/stdlib/Profile/src/Profile.jl index b11dfb488c373..d3d5300c87527 100644 --- a/stdlib/Profile/src/Profile.jl +++ b/stdlib/Profile/src/Profile.jl @@ -140,9 +140,12 @@ function __init__() delay = 0.001 end init(n, delay, limitwarn = false) - PROFILE_PRINT_COND[] = Base.AsyncCondition() - ccall(:jl_set_peek_cond, Cvoid, (Ptr{Cvoid},), PROFILE_PRINT_COND[].handle) - errormonitor(Threads.@spawn(profile_printing_listener())) + @static if !Sys.iswindows() + # triggering a profile via signals is not implemented on windows + PROFILE_PRINT_COND[] = Base.AsyncCondition() + ccall(:jl_set_peek_cond, Cvoid, (Ptr{Cvoid},), PROFILE_PRINT_COND[].handle) + errormonitor(Threads.@spawn(profile_printing_listener())) + end end """ diff --git a/stdlib/Profile/test/runtests.jl b/stdlib/Profile/test/runtests.jl index c6f78cbed0522..f8f8c52b93123 100644 --- a/stdlib/Profile/test/runtests.jl +++ b/stdlib/Profile/test/runtests.jl @@ -170,7 +170,11 @@ let cmd = Base.julia_cmd() script = """ using Profile f(::Val) = GC.safepoint() - @profile for i = 1:10^3; f(Val(i)); end + @profile for i = 1:10^3 + println(i) + f(Val(i)) + end + println("done") print(Profile.len_data()) """ p = open(`$cmd -e $script`) @@ -184,7 +188,9 @@ let cmd = Base.julia_cmd() s = read(p, String) close(t) @test success(p) - @test parse(Int, s) > 100 + @test !isempty(s) + @test occursin("done", s) + @test parse(Int, split(s, '\n')[end]) > 100 end if Sys.isbsd() || Sys.islinux() diff --git a/test/runtests.jl b/test/runtests.jl index aa9e101fa2182..4c9ac1cfd869c 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -124,6 +124,15 @@ cd(@__DIR__) do Distributed.remotecall_eval(Main, workers(), revise_init_expr) end + println(""" + Running parallel tests with: + nworkers() = $(nworkers()) + nthreads() = $(Threads.nthreads()) + Sys.CPU_THREADS = $(Sys.CPU_THREADS) + Sys.total_memory() = $(Base.format_bytes(Sys.total_memory())) + Sys.free_memory() = $(Base.format_bytes(Sys.free_memory())) + """) + #pretty print the information about gc and mem usage testgroupheader = "Test" workerheader = "(Worker)" From c004dccd65f5cfe91ec6b6fc9b28fdae63214afd Mon Sep 17 00:00:00 2001 From: Daniel Karrasch Date: Tue, 22 Mar 2022 21:44:56 +0100 Subject: [PATCH 094/369] Fix performance bug for `*` with `AbstractQ` (#44615) (cherry picked from commit fc9c280584f63236a1b97da4178a41eba65b6da2) --- stdlib/LinearAlgebra/src/bidiag.jl | 10 ++-- stdlib/LinearAlgebra/src/diagonal.jl | 12 ++++- stdlib/LinearAlgebra/src/special.jl | 69 ++++++++++++++++++++++++---- stdlib/LinearAlgebra/src/tridiag.jl | 9 ++-- stdlib/LinearAlgebra/test/special.jl | 32 +++++++------ 5 files changed, 96 insertions(+), 36 deletions(-) diff --git a/stdlib/LinearAlgebra/src/bidiag.jl b/stdlib/LinearAlgebra/src/bidiag.jl index 243553ebc64c6..dfcbec69c6de2 100644 --- a/stdlib/LinearAlgebra/src/bidiag.jl +++ b/stdlib/LinearAlgebra/src/bidiag.jl @@ -168,15 +168,13 @@ end function Matrix{T}(A::Bidiagonal) where T n = size(A, 1) B = zeros(T, n, n) - if n == 0 - return B - end - for i = 1:n - 1 + n == 0 && return B + @inbounds for i = 1:n - 1 B[i,i] = A.dv[i] if A.uplo == 'U' - B[i, i + 1] = A.ev[i] + B[i,i+1] = A.ev[i] else - B[i + 1, i] = A.ev[i] + B[i+1,i] = A.ev[i] end end B[n,n] = A.dv[n] diff --git a/stdlib/LinearAlgebra/src/diagonal.jl b/stdlib/LinearAlgebra/src/diagonal.jl index 4b7d9bd9d4af1..11f3fff9cb3e2 100644 --- a/stdlib/LinearAlgebra/src/diagonal.jl +++ b/stdlib/LinearAlgebra/src/diagonal.jl @@ -77,8 +77,16 @@ Diagonal{T}(D::Diagonal{T}) where {T} = D Diagonal{T}(D::Diagonal) where {T} = Diagonal{T}(D.diag) AbstractMatrix{T}(D::Diagonal) where {T} = Diagonal{T}(D) -Matrix(D::Diagonal) = diagm(0 => D.diag) -Array(D::Diagonal) = Matrix(D) +Matrix(D::Diagonal{T}) where {T} = Matrix{T}(D) +Array(D::Diagonal{T}) where {T} = Matrix{T}(D) +function Matrix{T}(D::Diagonal) where {T} + n = size(D, 1) + B = zeros(T, n, n) + @inbounds for i in 1:n + B[i,i] = D.diag[i] + end + return B +end """ Diagonal{T}(undef, n) diff --git a/stdlib/LinearAlgebra/src/special.jl b/stdlib/LinearAlgebra/src/special.jl index 39b62d5e3ca03..beac0c524f2f4 100644 --- a/stdlib/LinearAlgebra/src/special.jl +++ b/stdlib/LinearAlgebra/src/special.jl @@ -292,16 +292,65 @@ function (-)(A::UniformScaling, B::Diagonal{<:Number}) Diagonal(A.λ .- B.diag) end -rmul!(A::AbstractTriangular, adjB::Adjoint{<:Any,<:Union{QRCompactWYQ,QRPackedQ}}) = - rmul!(full!(A), adjB) -*(A::AbstractTriangular, adjB::Adjoint{<:Any,<:Union{QRCompactWYQ,QRPackedQ}}) = - *(copyto!(similar(parent(A)), A), adjB) -*(A::BiTriSym, adjB::Adjoint{<:Any,<:Union{QRCompactWYQ, QRPackedQ}}) = - rmul!(copyto!(Array{promote_type(eltype(A), eltype(adjB))}(undef, size(A)...), A), adjB) -*(adjA::Adjoint{<:Any,<:Union{QRCompactWYQ, QRPackedQ}}, B::Diagonal) = - lmul!(adjA, copyto!(Array{promote_type(eltype(adjA), eltype(B))}(undef, size(B)...), B)) -*(adjA::Adjoint{<:Any,<:Union{QRCompactWYQ, QRPackedQ}}, B::BiTriSym) = - lmul!(adjA, copyto!(Array{promote_type(eltype(adjA), eltype(B))}(undef, size(B)...), B)) +lmul!(Q::AbstractQ, B::AbstractTriangular) = lmul!(Q, full!(B)) +lmul!(Q::QRPackedQ, B::AbstractTriangular) = lmul!(Q, full!(B)) # disambiguation +lmul!(Q::Adjoint{<:Any,<:AbstractQ}, B::AbstractTriangular) = lmul!(Q, full!(B)) +lmul!(Q::Adjoint{<:Any,<:QRPackedQ}, B::AbstractTriangular) = lmul!(Q, full!(B)) # disambiguation + +function _qlmul(Q::AbstractQ, B) + TQB = promote_type(eltype(Q), eltype(B)) + if size(Q.factors, 1) == size(B, 1) + Bnew = Matrix{TQB}(B) + elseif size(Q.factors, 2) == size(B, 1) + Bnew = [Matrix{TQB}(B); zeros(TQB, size(Q.factors, 1) - size(B,1), size(B, 2))] + else + throw(DimensionMismatch("first dimension of matrix must have size either $(size(Q.factors, 1)) or $(size(Q.factors, 2))")) + end + lmul!(convert(AbstractMatrix{TQB}, Q), Bnew) +end +function _qlmul(adjQ::Adjoint{<:Any,<:AbstractQ}, B) + TQB = promote_type(eltype(adjQ), eltype(B)) + lmul!(adjoint(convert(AbstractMatrix{TQB}, parent(adjQ))), Matrix{TQB}(B)) +end + +*(Q::AbstractQ, B::AbstractTriangular) = _qlmul(Q, B) +*(Q::Adjoint{<:Any,<:AbstractQ}, B::AbstractTriangular) = _qlmul(Q, B) +*(Q::AbstractQ, B::BiTriSym) = _qlmul(Q, B) +*(Q::Adjoint{<:Any,<:AbstractQ}, B::BiTriSym) = _qlmul(Q, B) +*(Q::AbstractQ, B::Diagonal) = _qlmul(Q, B) +*(Q::Adjoint{<:Any,<:AbstractQ}, B::Diagonal) = _qlmul(Q, B) + +rmul!(A::AbstractTriangular, Q::AbstractQ) = rmul!(full!(A), Q) +rmul!(A::AbstractTriangular, Q::Adjoint{<:Any,<:AbstractQ}) = rmul!(full!(A), Q) + +function _qrmul(A, Q::AbstractQ) + TAQ = promote_type(eltype(A), eltype(Q)) + return rmul!(Matrix{TAQ}(A), convert(AbstractMatrix{TAQ}, Q)) +end +function _qrmul(A, adjQ::Adjoint{<:Any,<:AbstractQ}) + Q = adjQ.parent + TAQ = promote_type(eltype(A), eltype(Q)) + if size(A,2) == size(Q.factors, 1) + Anew = Matrix{TAQ}(A) + elseif size(A,2) == size(Q.factors,2) + Anew = [Matrix{TAQ}(A) zeros(TAQ, size(A, 1), size(Q.factors, 1) - size(Q.factors, 2))] + else + throw(DimensionMismatch("matrix A has dimensions $(size(A)) but matrix B has dimensions $(size(Q))")) + end + return rmul!(Anew, adjoint(convert(AbstractMatrix{TAQ}, Q))) +end + +*(A::AbstractTriangular, Q::AbstractQ) = _qrmul(A, Q) +*(A::AbstractTriangular, Q::Adjoint{<:Any,<:AbstractQ}) = _qrmul(A, Q) +*(A::BiTriSym, Q::AbstractQ) = _qrmul(A, Q) +*(A::BiTriSym, Q::Adjoint{<:Any,<:AbstractQ}) = _qrmul(A, Q) +*(A::Diagonal, Q::AbstractQ) = _qrmul(A, Q) +*(A::Diagonal, Q::Adjoint{<:Any,<:AbstractQ}) = _qrmul(A, Q) + +*(Q::AbstractQ, B::AbstractQ) = _qlmul(Q, B) +*(Q::Adjoint{<:Any,<:AbstractQ}, B::AbstractQ) = _qrmul(Q, B) +*(Q::AbstractQ, B::Adjoint{<:Any,<:AbstractQ}) = _qlmul(Q, B) +*(Q::Adjoint{<:Any,<:AbstractQ}, B::Adjoint{<:Any,<:AbstractQ}) = _qrmul(Q, B) # fill[stored]! methods fillstored!(A::Diagonal, x) = (fill!(A.diag, x); A) diff --git a/stdlib/LinearAlgebra/src/tridiag.jl b/stdlib/LinearAlgebra/src/tridiag.jl index 5a3c7612f6784..4b1d3add5df5b 100644 --- a/stdlib/LinearAlgebra/src/tridiag.jl +++ b/stdlib/LinearAlgebra/src/tridiag.jl @@ -571,15 +571,16 @@ function size(M::Tridiagonal, d::Integer) end end -function Matrix{T}(M::Tridiagonal{T}) where T +function Matrix{T}(M::Tridiagonal) where {T} A = zeros(T, size(M)) - for i = 1:length(M.d) + n = length(M.d) + n == 0 && return A + for i in 1:n-1 A[i,i] = M.d[i] - end - for i = 1:length(M.d)-1 A[i+1,i] = M.dl[i] A[i,i+1] = M.du[i] end + A[n,n] = M.d[n] A end Matrix(M::Tridiagonal{T}) where {T} = Matrix{T}(M) diff --git a/stdlib/LinearAlgebra/test/special.jl b/stdlib/LinearAlgebra/test/special.jl index ced2681ff0969..84c1bb006280b 100644 --- a/stdlib/LinearAlgebra/test/special.jl +++ b/stdlib/LinearAlgebra/test/special.jl @@ -188,16 +188,21 @@ end @testset "Triangular Types and QR" begin - for typ in [UpperTriangular,LowerTriangular,LinearAlgebra.UnitUpperTriangular,LinearAlgebra.UnitLowerTriangular] + for typ in (UpperTriangular, LowerTriangular, UnitUpperTriangular, UnitLowerTriangular) a = rand(n,n) atri = typ(a) + matri = Matrix(atri) b = rand(n,n) qrb = qr(b, ColumnNorm()) - @test *(atri, adjoint(qrb.Q)) ≈ Matrix(atri) * qrb.Q' - @test rmul!(copy(atri), adjoint(qrb.Q)) ≈ Matrix(atri) * qrb.Q' + @test atri * qrb.Q ≈ matri * qrb.Q ≈ rmul!(copy(atri), qrb.Q) + @test atri * qrb.Q' ≈ matri * qrb.Q' ≈ rmul!(copy(atri), qrb.Q') + @test qrb.Q * atri ≈ qrb.Q * matri ≈ lmul!(qrb.Q, copy(atri)) + @test qrb.Q' * atri ≈ qrb.Q' * matri ≈ lmul!(qrb.Q', copy(atri)) qrb = qr(b, NoPivot()) - @test *(atri, adjoint(qrb.Q)) ≈ Matrix(atri) * qrb.Q' - @test rmul!(copy(atri), adjoint(qrb.Q)) ≈ Matrix(atri) * qrb.Q' + @test atri * qrb.Q ≈ matri * qrb.Q ≈ rmul!(copy(atri), qrb.Q) + @test atri * qrb.Q' ≈ matri * qrb.Q' ≈ rmul!(copy(atri), qrb.Q') + @test qrb.Q * atri ≈ qrb.Q * matri ≈ lmul!(qrb.Q, copy(atri)) + @test qrb.Q' * atri ≈ qrb.Q' * matri ≈ lmul!(qrb.Q', copy(atri)) end end @@ -421,19 +426,18 @@ end end @testset "BiTriSym*Q' and Q'*BiTriSym" begin - dl = [1, 1, 1]; - d = [1, 1, 1, 1]; - Tri = Tridiagonal(dl, d, dl) + dl = [1, 1, 1] + d = [1, 1, 1, 1] + D = Diagonal(d) Bi = Bidiagonal(d, dl, :L) + Tri = Tridiagonal(dl, d, dl) Sym = SymTridiagonal(d, dl) F = qr(ones(4, 1)) A = F.Q' - @test Tri*A ≈ Matrix(Tri)*A - @test A*Tri ≈ A*Matrix(Tri) - @test Bi*A ≈ Matrix(Bi)*A - @test A*Bi ≈ A*Matrix(Bi) - @test Sym*A ≈ Matrix(Sym)*A - @test A*Sym ≈ A*Matrix(Sym) + for A in (F.Q, F.Q'), B in (D, Bi, Tri, Sym) + @test B*A ≈ Matrix(B)*A + @test A*B ≈ A*Matrix(B) + end end @testset "Ops on SymTridiagonal ev has the same length as dv" begin From 5005faedb73b47c7514ccecf6795896a2e6819a3 Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Mon, 21 Mar 2022 13:33:24 -0700 Subject: [PATCH 095/369] More flexible test affinity setting (#44677) * More flexibly test affinity setting When running on a machine with `cpusets` applied, we are unable to assign CPU affinity to CPUs 1 and 2; we may be locked to CPUs 9-16, for example. So we must inspect what our current cpumask is, and from that select CPUs that we can safely assign affinity to in our tests. * Import `uv_thread_getaffinity` from `print_process_affinity.jl` * Call `uv_thread_getaffinity` only if `AFFINITY_SUPPORTED` * Fix a syntax error Co-authored-by: Takafumi Arakaki (cherry picked from commit 32b1305c78c353c7b9241a2f1bac43788041240f) --- test/threads.jl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/test/threads.jl b/test/threads.jl index 718358f847dd5..8322bcfa2ebbd 100644 --- a/test/threads.jl +++ b/test/threads.jl @@ -4,6 +4,8 @@ using Test using Base.Threads +include("print_process_affinity.jl") # import `uv_thread_getaffinity` + # simple sanity tests for locks under cooperative concurrent access let lk = ReentrantLock() c1 = Event() @@ -93,10 +95,13 @@ else end # Note also that libuv does not support affinity in macOS and it is known to # hang in FreeBSD. So, it's tested only in Linux and Windows: -if Sys.islinux() || Sys.iswindows() - if Sys.CPU_THREADS > 1 && !running_under_rr() - @test run_with_affinity([2]) == "2" - @test run_with_affinity([1, 2]) == "1,2" +const AFFINITY_SUPPORTED = (Sys.islinux() || Sys.iswindows()) && !running_under_rr() + +if AFFINITY_SUPPORTED + allowed_cpus = findall(uv_thread_getaffinity()) + if length(allowed_cpus) ≥ 2 + @test run_with_affinity(allowed_cpus[1:1]) == "$(allowed_cpus[1])" + @test run_with_affinity(allowed_cpus[1:2]) == "$(allowed_cpus[1]),$(allowed_cpus[2])" end end From f9176aedb4c346bf29626a0a4ee0998b5dcea75e Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Tue, 15 Mar 2022 15:18:41 -0400 Subject: [PATCH 096/369] make fieldtype computation stable/pure (cherry picked from commit 99bdd00183d77c9ce15877dc524d0029f2087e8a) --- src/datatype.c | 4 ++-- src/jl_exported_funcs.inc | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/datatype.c b/src/datatype.c index e7f1ab22365b8..eca51949cd40e 100644 --- a/src/datatype.c +++ b/src/datatype.c @@ -1787,9 +1787,9 @@ JL_DLLEXPORT int jl_field_isdefined(jl_value_t *v, size_t i) JL_NOTSAFEPOINT return fval != NULL ? 1 : 0; } -JL_DLLEXPORT size_t jl_get_field_offset(jl_datatype_t *ty, int field) JL_NOTSAFEPOINT +JL_DLLEXPORT size_t jl_get_field_offset(jl_datatype_t *ty, int field) { - if (ty->layout == NULL || field > jl_datatype_nfields(ty) || field < 1) + if (!jl_struct_try_layout(ty) || field > jl_datatype_nfields(ty) || field < 1) jl_bounds_error_int((jl_value_t*)ty, field); return jl_field_offset(ty, field - 1); } diff --git a/src/jl_exported_funcs.inc b/src/jl_exported_funcs.inc index d63500fe21736..614ed0d9d16af 100644 --- a/src/jl_exported_funcs.inc +++ b/src/jl_exported_funcs.inc @@ -214,7 +214,6 @@ XX(jl_get_excstack) \ XX(jl_get_fenv_consts) \ XX(jl_get_field) \ - XX(jl_get_field_offset) \ XX(jl_get_global) \ XX(jl_get_image_file) \ XX(jl_get_JIT) \ From 9b7990d8c909901c9ba410469df2fcf36e0f4e35 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Tue, 15 Mar 2022 15:59:57 -0400 Subject: [PATCH 097/369] types: fix layout issues for Tuple Fix #44614 (cherry picked from commit e9ba166674e46d4082495993a70095ecea340d84) --- src/jltypes.c | 12 ++++++++++-- test/core.jl | 23 +++++++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/jltypes.c b/src/jltypes.c index 7d8b1ac6bb32b..bb1cdd6c49b97 100644 --- a/src/jltypes.c +++ b/src/jltypes.c @@ -63,6 +63,12 @@ static int layout_uses_free_typevars(jl_value_t *v, jl_typeenv_t *env) return 0; if (dt->name == jl_namedtuple_typename) return layout_uses_free_typevars(jl_tparam0(dt), env) || layout_uses_free_typevars(jl_tparam1(dt), env); + if (dt->name == jl_tuple_typename) + // conservative, since we don't want to inline an abstract tuple, + // and we currently declare !has_fixed_layout for these, but that + // means we also won't be able to inline a tuple which is concrete + // except for the use of free type-vars + return 1; jl_svec_t *types = jl_get_fieldtypes(dt); size_t i, l = jl_svec_len(types); for (i = 0; i < l; i++) { @@ -227,8 +233,10 @@ int jl_has_fixed_layout(jl_datatype_t *dt) return 1; if (dt->name->abstract) return 0; - if (jl_is_tuple_type(dt) || jl_is_namedtuple_type(dt)) - return 0; // TODO: relax more? + if (dt->name == jl_namedtuple_typename) + return !layout_uses_free_typevars(jl_tparam0(dt), NULL) && !layout_uses_free_typevars(jl_tparam1(dt), NULL); + if (dt->name == jl_tuple_typename) + return 0; jl_svec_t *types = jl_get_fieldtypes(dt); size_t i, l = jl_svec_len(types); for (i = 0; i < l; i++) { diff --git a/test/core.jl b/test/core.jl index 93ba97df60420..0294a61c7d146 100644 --- a/test/core.jl +++ b/test/core.jl @@ -7336,6 +7336,29 @@ struct A43411{S, T} end @test isbitstype(A43411{(:a,), Tuple{Int}}) +# issue #44614 +struct T44614_1{T} + m::T +end +struct T44614_2{L} + tuple::NTuple{3, Int64} + T44614_2{L}(t::NTuple{3, Int64}) where {L} = new{sum(t)}(t) +end +struct T44614_3{L, N} + a::Tuple{T44614_2{L}} + param::NTuple{N, T44614_1} + T44614_3(a::Tuple{T44614_2{L}}, pars::NTuple{N, T44614_1}) where {L, N} = new{L, N}(a, pars) +end +@test sizeof((T44614_2{L} where L).body) == 24 +let T = T44614_3{L,2} where L + # these values are computable, but we currently don't know how to compute them properly + ex = ErrorException("Argument is an incomplete T44614_3 type and does not have a definite size.") + @test_throws ex sizeof(T.body) + @test_throws ex sizeof(T) + @test_throws BoundsError fieldoffset(T.body, 2) + @test fieldoffset(T{1}, 2) == 24 +end + # Issue #34206/34207 function mre34206(a, n) va = view(a, :) From 94b7154a089b17bca235bc346a8b8d41f4f71e79 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Tue, 22 Mar 2022 11:44:08 +0900 Subject: [PATCH 098/369] inference: override `InterConditional` result with `Const` carefully (#44668) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I found that a tricky thing can happen when constant inference derives `Const`-result while non-constant inference has derived (non-constant) `InterConditional` result beforehand. In such a case, currently we discard the result with constant inference (since `!(Const ⊑ InterConditional)`), but we can achieve more accuracy by not discarding that `Const`-information, e.g.: ```julia julia> iszero_simple(x) = x === 0 iszero_simple (generic function with 1 method) julia> @test Base.return_types() do iszero_simple(0) ? nothing : missing end |> only === Nothing Test Passed ``` --- base/compiler/abstractinterpretation.jl | 31 ++++++++++++++----------- test/compiler/inference.jl | 7 ++++++ 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index 2efb660a32fb5..3cc709bc35849 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -110,10 +110,9 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), splitsigs = switchtupleunion(sig) for sig_n in splitsigs result = abstract_call_method(interp, method, sig_n, svec(), multiple_matches, sv) - rt, edge = result.rt, result.edge - if edge !== nothing - push!(edges, edge) - end + rt = result.rt + edge = result.edge + edge !== nothing && push!(edges, edge) this_argtypes = isa(matches, MethodMatches) ? argtypes : matches.applicable_argtypes[i] this_arginfo = ArgInfo(fargs, this_argtypes) const_call_result = abstract_call_method_with_const_args(interp, result, @@ -121,8 +120,10 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), effects = result.edge_effects const_result = nothing if const_call_result !== nothing - if const_call_result.rt ⊑ rt - (; rt, effects, const_result) = const_call_result + const_rt = const_call_result.rt + if const_rt ⊑ rt + rt = const_rt + (; effects, const_result) = const_call_result end end tristate_merge!(sv, effects) @@ -135,6 +136,8 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), break end end + this_conditional = ignorelimited(this_rt) + this_rt = widenwrappedconditional(this_rt) else if infer_compilation_signature(interp) # Also infer the compilation signature for this method, so it's available @@ -151,10 +154,10 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), end result = abstract_call_method(interp, method, sig, match.sparams, multiple_matches, sv) - this_rt, edge = result.rt, result.edge - if edge !== nothing - push!(edges, edge) - end + this_conditional = ignorelimited(result.rt) + this_rt = widenwrappedconditional(result.rt) + edge = result.edge + edge !== nothing && push!(edges, edge) # try constant propagation with argtypes for this match # this is in preparation for inlining, or improving the return result this_argtypes = isa(matches, MethodMatches) ? argtypes : matches.applicable_argtypes[i] @@ -164,10 +167,12 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), effects = result.edge_effects const_result = nothing if const_call_result !== nothing - this_const_rt = const_call_result.rt - # return type of const-prop' inference can be wider than that of non const-prop' inference + this_const_conditional = ignorelimited(const_call_result.rt) + this_const_rt = widenwrappedconditional(const_call_result.rt) + # return type of const-prop' inference can be wider than that of non const-prop' inference # e.g. in cases when there are cycles but cached result is still accurate if this_const_rt ⊑ this_rt + this_conditional = this_const_conditional this_rt = this_const_rt (; effects, const_result) = const_call_result end @@ -178,8 +183,6 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), any_const_result = true end end - this_conditional = ignorelimited(this_rt) - this_rt = widenwrappedconditional(this_rt) @assert !(this_conditional isa Conditional) "invalid lattice element returned from inter-procedural context" seen += 1 rettype = tmerge(rettype, this_rt) diff --git a/test/compiler/inference.jl b/test/compiler/inference.jl index 218e484b2beca..e6f113f2b9062 100644 --- a/test/compiler/inference.jl +++ b/test/compiler/inference.jl @@ -2032,6 +2032,13 @@ end end @test ts == Any[Any] end + + # a tricky case: if constant inference derives `Const` while non-constant inference has + # derived `InterConditional`, we should not discard that constant information + iszero_simple(x) = x === 0 + @test Base.return_types() do + iszero_simple(0) ? nothing : missing + end |> only === Nothing end @testset "branching on conditional object" begin From b5ca35b08e717a857974ea5ea9d2887a5ae0348b Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Wed, 23 Mar 2022 11:14:15 +0100 Subject: [PATCH 099/369] avoid using `@sync_add` on remotecalls (#44671) * avoid using `@sync_add` on remotecalls It seems like @sync_add adds the Futures to a queue (Channel) for @sync, which in turn calls wait() for all the futures synchronously. Not only that is slightly detrimental for network operations (latencies add up), but in case of Distributed the call to wait() may actually cause some compilation on remote processes, which is also wait()ed for. In result, some operations took a great amount of "serial" processing time if executed on many workers at once. For me, this closes #44645. The major change can be illustrated as follows: First add some workers: ``` using Distributed addprocs(10) ``` and then trigger something that, for example, causes package imports on the workers: ``` using SomeTinyPackage ``` In my case (importing UnicodePlots on 10 workers), this improves the loading time over 10 workers from ~11s to ~5.5s. This is a far bigger issue when worker count gets high. The time of the processing on each worker is usually around 0.3s, so triggering this problem even on a relatively small cluster (64 workers) causes a really annoying delay, and running `@everywhere` for the first time on reasonable clusters (I tested with 1024 workers, see #44645) usually takes more than 5 minutes. Which sucks. Anyway, on 64 workers this reduces the "first import" time from ~30s to ~6s, and on 1024 workers this seems to reduce the time from over 5 minutes (I didn't bother to measure that precisely now, sorry) to ~11s. Related issues: - Probably fixes #39291. - #42156 is a kinda complementary -- it removes the most painful source of slowness (the 0.3s precompilation on the workers), but the fact that the wait()ing is serial remains a problem if the network latencies are high. May help with #38931 Co-authored-by: Valentin Churavy (cherry picked from commit 62e0729dbc5f9d5d93d14dcd49457f02a0c6d3a7) --- base/task.jl | 37 +++++++++++++++++++++- stdlib/Distributed/src/Distributed.jl | 4 +-- stdlib/Distributed/src/clusterserialize.jl | 2 +- stdlib/Distributed/src/macros.jl | 4 +-- 4 files changed, 41 insertions(+), 6 deletions(-) diff --git a/base/task.jl b/base/task.jl index 90dea508383b1..dc08a0257a376 100644 --- a/base/task.jl +++ b/base/task.jl @@ -471,6 +471,12 @@ isolating the asynchronous code from changes to the variable's value in the curr Interpolating values via `\$` is available as of Julia 1.4. """ macro async(expr) + do_async_macro(expr) +end + +# generate the code for @async, possibly wrapping the task in something before +# pushing it to the wait queue. +function do_async_macro(expr; wrap=identity) letargs = Base._lift_one_interp!(expr) thunk = esc(:(()->($expr))) @@ -479,7 +485,7 @@ macro async(expr) let $(letargs...) local task = Task($thunk) if $(Expr(:islocal, var)) - put!($var, task) + put!($var, $(wrap(:task))) end schedule(task) task @@ -487,6 +493,35 @@ macro async(expr) end end +# task wrapper that doesn't create exceptions wrapped in TaskFailedException +struct UnwrapTaskFailedException + task::Task +end + +# common code for wait&fetch for UnwrapTaskFailedException +function unwrap_task_failed(f::Function, t::UnwrapTaskFailedException) + try + f(t.task) + catch ex + if ex isa TaskFailedException + throw(ex.task.exception) + else + rethrow() + end + end +end + +# the unwrapping for above task wrapper (gets triggered in sync_end()) +wait(t::UnwrapTaskFailedException) = unwrap_task_failed(wait, t) + +# same for fetching the tasks, for convenience +fetch(t::UnwrapTaskFailedException) = unwrap_task_failed(fetch, t) + +# macro for running async code that doesn't throw wrapped exceptions +macro async_unwrap(expr) + do_async_macro(expr, wrap=task->:(Base.UnwrapTaskFailedException($task))) +end + """ errormonitor(t::Task) diff --git a/stdlib/Distributed/src/Distributed.jl b/stdlib/Distributed/src/Distributed.jl index d428a6df0e683..3bcbc7b67f60d 100644 --- a/stdlib/Distributed/src/Distributed.jl +++ b/stdlib/Distributed/src/Distributed.jl @@ -10,7 +10,7 @@ import Base: getindex, wait, put!, take!, fetch, isready, push!, length, hash, ==, kill, close, isopen, showerror # imports for use -using Base: Process, Semaphore, JLOptions, buffer_writes, @sync_add, +using Base: Process, Semaphore, JLOptions, buffer_writes, @async_unwrap, VERSION_STRING, binding_module, atexit, julia_exename, julia_cmd, AsyncGenerator, acquire, release, invokelatest, shell_escape_posixly, shell_escape_csh, @@ -76,7 +76,7 @@ function _require_callback(mod::Base.PkgId) # broadcast top-level (e.g. from Main) import/using from node 1 (only) @sync for p in procs() p == 1 && continue - @sync_add remotecall(p) do + @async_unwrap remotecall_wait(p) do Base.require(mod) nothing end diff --git a/stdlib/Distributed/src/clusterserialize.jl b/stdlib/Distributed/src/clusterserialize.jl index e37987c5bf875..28025ae867c78 100644 --- a/stdlib/Distributed/src/clusterserialize.jl +++ b/stdlib/Distributed/src/clusterserialize.jl @@ -243,7 +243,7 @@ An exception is raised if a global constant is requested to be cleared. """ function clear!(syms, pids=workers(); mod=Main) @sync for p in pids - @sync_add remotecall(clear_impl!, p, syms, mod) + @async_unwrap remotecall_wait(clear_impl!, p, syms, mod) end end clear!(sym::Symbol, pid::Int; mod=Main) = clear!([sym], [pid]; mod=mod) diff --git a/stdlib/Distributed/src/macros.jl b/stdlib/Distributed/src/macros.jl index 0a62fdd5439f0..a767c7a40d9c9 100644 --- a/stdlib/Distributed/src/macros.jl +++ b/stdlib/Distributed/src/macros.jl @@ -222,10 +222,10 @@ function remotecall_eval(m::Module, procs, ex) if pid == myid() run_locally += 1 else - @sync_add remotecall(Core.eval, pid, m, ex) + @async_unwrap remotecall_wait(Core.eval, pid, m, ex) end end - yield() # ensure that the remotecall_fetch have had a chance to start + yield() # ensure that the remotecalls have had a chance to start # execute locally last as we do not want local execution to block serialization # of the request to remote nodes. From 50a722b04eb723db4e2af8a77a2f90acd5760a4e Mon Sep 17 00:00:00 2001 From: Daniel Karrasch Date: Thu, 24 Mar 2022 10:09:05 +0100 Subject: [PATCH 100/369] Make `Matrix` cntr work for structured matrices for `zero(T) !isa T` (#44707) (cherry picked from commit 20999873e8aa78f41555ea4ca63f6d89db43376d) --- stdlib/LinearAlgebra/src/bidiag.jl | 2 +- stdlib/LinearAlgebra/src/dense.jl | 9 +++++++++ stdlib/LinearAlgebra/src/diagonal.jl | 4 ++-- stdlib/LinearAlgebra/src/tridiag.jl | 4 ++-- stdlib/LinearAlgebra/test/special.jl | 22 ++++++++++++++++++++++ 5 files changed, 36 insertions(+), 5 deletions(-) diff --git a/stdlib/LinearAlgebra/src/bidiag.jl b/stdlib/LinearAlgebra/src/bidiag.jl index dfcbec69c6de2..317ed15af770c 100644 --- a/stdlib/LinearAlgebra/src/bidiag.jl +++ b/stdlib/LinearAlgebra/src/bidiag.jl @@ -180,7 +180,7 @@ function Matrix{T}(A::Bidiagonal) where T B[n,n] = A.dv[n] return B end -Matrix(A::Bidiagonal{T}) where {T} = Matrix{T}(A) +Matrix(A::Bidiagonal{T}) where {T} = Matrix{promote_type(T, typeof(zero(T)))}(A) Array(A::Bidiagonal) = Matrix(A) promote_rule(::Type{Matrix{T}}, ::Type{<:Bidiagonal{S}}) where {T,S} = @isdefined(T) && @isdefined(S) ? Matrix{promote_type(T,S)} : Matrix diff --git a/stdlib/LinearAlgebra/src/dense.jl b/stdlib/LinearAlgebra/src/dense.jl index ffcd9e64e0752..249010adb4e5c 100644 --- a/stdlib/LinearAlgebra/src/dense.jl +++ b/stdlib/LinearAlgebra/src/dense.jl @@ -257,6 +257,8 @@ Vector `kv.second` will be placed on the `kv.first` diagonal. By default the matrix is square and its size is inferred from `kv`, but a non-square size `m`×`n` (padded with zeros as needed) can be specified by passing `m,n` as the first arguments. +For repeated diagonal indices `kv.first` the values in the corresponding +vectors `kv.second` will be added. `diagm` constructs a full matrix; if you want storage-efficient versions with fast arithmetic, see [`Diagonal`](@ref), [`Bidiagonal`](@ref) @@ -277,6 +279,13 @@ julia> diagm(1 => [1,2,3], -1 => [4,5]) 4 0 2 0 0 5 0 3 0 0 0 0 + +julia> diagm(1 => [1,2,3], 1 => [1,2,3]) +4×4 Matrix{Int64}: + 0 2 0 0 + 0 0 4 0 + 0 0 0 6 + 0 0 0 0 ``` """ diagm(kv::Pair{<:Integer,<:AbstractVector}...) = _diagm(nothing, kv...) diff --git a/stdlib/LinearAlgebra/src/diagonal.jl b/stdlib/LinearAlgebra/src/diagonal.jl index 11f3fff9cb3e2..5d17049cfa4e1 100644 --- a/stdlib/LinearAlgebra/src/diagonal.jl +++ b/stdlib/LinearAlgebra/src/diagonal.jl @@ -77,8 +77,8 @@ Diagonal{T}(D::Diagonal{T}) where {T} = D Diagonal{T}(D::Diagonal) where {T} = Diagonal{T}(D.diag) AbstractMatrix{T}(D::Diagonal) where {T} = Diagonal{T}(D) -Matrix(D::Diagonal{T}) where {T} = Matrix{T}(D) -Array(D::Diagonal{T}) where {T} = Matrix{T}(D) +Matrix(D::Diagonal{T}) where {T} = Matrix{promote_type(T, typeof(zero(T)))}(D) +Array(D::Diagonal{T}) where {T} = Matrix(D) function Matrix{T}(D::Diagonal) where {T} n = size(D, 1) B = zeros(T, n, n) diff --git a/stdlib/LinearAlgebra/src/tridiag.jl b/stdlib/LinearAlgebra/src/tridiag.jl index 4b1d3add5df5b..e5c31856d3f0a 100644 --- a/stdlib/LinearAlgebra/src/tridiag.jl +++ b/stdlib/LinearAlgebra/src/tridiag.jl @@ -134,7 +134,7 @@ function Matrix{T}(M::SymTridiagonal) where T Mf[n,n] = symmetric(M.dv[n], :U) return Mf end -Matrix(M::SymTridiagonal{T}) where {T} = Matrix{T}(M) +Matrix(M::SymTridiagonal{T}) where {T} = Matrix{promote_type(T, typeof(zero(T)))}(M) Array(M::SymTridiagonal) = Matrix(M) size(A::SymTridiagonal) = (length(A.dv), length(A.dv)) @@ -583,7 +583,7 @@ function Matrix{T}(M::Tridiagonal) where {T} A[n,n] = M.d[n] A end -Matrix(M::Tridiagonal{T}) where {T} = Matrix{T}(M) +Matrix(M::Tridiagonal{T}) where {T} = Matrix{promote_type(T, typeof(zero(T)))}(M) Array(M::Tridiagonal) = Matrix(M) similar(M::Tridiagonal, ::Type{T}) where {T} = Tridiagonal(similar(M.dl, T), similar(M.d, T), similar(M.du, T)) diff --git a/stdlib/LinearAlgebra/test/special.jl b/stdlib/LinearAlgebra/test/special.jl index 84c1bb006280b..277c51bb9f7bb 100644 --- a/stdlib/LinearAlgebra/test/special.jl +++ b/stdlib/LinearAlgebra/test/special.jl @@ -104,6 +104,28 @@ Random.seed!(1) @test LowerTriangular(C) == LowerTriangular(Cdense) end end + + @testset "Matrix constructor for !isa(zero(T), T)" begin + # the following models JuMP.jl's VariableRef and AffExpr, resp. + struct TypeWithoutZero end + struct TypeWithZero end + Base.promote_rule(::Type{TypeWithoutZero}, ::Type{TypeWithZero}) = TypeWithZero + Base.convert(::Type{TypeWithZero}, ::TypeWithoutZero) = TypeWithZero() + Base.zero(::Type{<:Union{TypeWithoutZero, TypeWithZero}}) = TypeWithZero() + LinearAlgebra.symmetric(::TypeWithoutZero, ::Symbol) = TypeWithoutZero() + Base.transpose(::TypeWithoutZero) = TypeWithoutZero() + d = fill(TypeWithoutZero(), 3) + du = fill(TypeWithoutZero(), 2) + dl = fill(TypeWithoutZero(), 2) + D = Diagonal(d) + Bu = Bidiagonal(d, du, :U) + Bl = Bidiagonal(d, dl, :L) + Tri = Tridiagonal(dl, d, du) + Sym = SymTridiagonal(d, dl) + for M in (D, Bu, Bl, Tri, Sym) + @test Matrix(M) == zeros(TypeWithZero, 3, 3) + end + end end @testset "Binary ops among special types" begin From a3c8e37c4e7f609f3fa2d86430ebcc38db04aa1b Mon Sep 17 00:00:00 2001 From: N5N3 <2642243996@qq.com> Date: Fri, 25 Mar 2022 16:15:18 +0800 Subject: [PATCH 101/369] Recover 1.7's behavior (#44736) Fix #44734. (cherry picked from commit 68e2969217112c6a9ee576183af20101a6132b71) --- stdlib/LinearAlgebra/src/blas.jl | 7 +++++-- stdlib/LinearAlgebra/test/generic.jl | 8 ++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/stdlib/LinearAlgebra/src/blas.jl b/stdlib/LinearAlgebra/src/blas.jl index 7d7f77c282bc0..caa61cf94a52d 100644 --- a/stdlib/LinearAlgebra/src/blas.jl +++ b/stdlib/LinearAlgebra/src/blas.jl @@ -510,7 +510,9 @@ for (fname, elty) in ((:daxpy_,:Float64), end end end -function axpy!(alpha::Number, x::AbstractArray{T}, y::AbstractArray{T}) where T<:BlasFloat + +#TODO: replace with `x::AbstractArray{T}` once we separate `BLAS.axpy!` and `LinearAlgebra.axpy!` +function axpy!(alpha::Number, x::Union{DenseArray{T},StridedVector{T}}, y::Union{DenseArray{T},StridedVector{T}}) where T<:BlasFloat if length(x) != length(y) throw(DimensionMismatch(lazy"x has length $(length(x)), but y has length $(length(y))")) end @@ -582,7 +584,8 @@ for (fname, elty) in ((:daxpby_,:Float64), (:saxpby_,:Float32), end end -function axpby!(alpha::Number, x::AbstractArray{T}, beta::Number, y::AbstractArray{T}) where T<:BlasFloat +#TODO: replace with `x::AbstractArray{T}` once we separate `BLAS.axpby!` and `LinearAlgebra.axpby!` +function axpby!(alpha::Number, x::Union{DenseArray{T},AbstractVector{T}}, beta::Number, y::Union{DenseArray{T},AbstractVector{T}},) where T<:BlasFloat require_one_based_indexing(x, y) if length(x) != length(y) throw(DimensionMismatch(lazy"x has length $(length(x)), but y has length $(length(y))")) diff --git a/stdlib/LinearAlgebra/test/generic.jl b/stdlib/LinearAlgebra/test/generic.jl index b56edf9439fe0..cd52d30da6c8d 100644 --- a/stdlib/LinearAlgebra/test/generic.jl +++ b/stdlib/LinearAlgebra/test/generic.jl @@ -295,6 +295,14 @@ end @test LinearAlgebra.axpy!(α, x, rx, y, ry) == [1 1 1 1; 11 1 1 26] end +@testset "LinearAlgebra.axp(b)y! for non strides input" begin + a = rand(5, 5) + @test LinearAlgebra.axpby!(1, Hermitian(a), 1, zeros(size(a))) == Hermitian(a) + @test_broken LinearAlgebra.axpby!(1, 1.:5, 1, zeros(5)) == 1.:5 + @test LinearAlgebra.axpy!(1, Hermitian(a), zeros(size(a))) == Hermitian(a) + @test LinearAlgebra.axpy!(1, 1.:5, zeros(5)) == 1.:5 +end + @testset "norm and normalize!" begin vr = [3.0, 4.0] for Tr in (Float32, Float64) From 730edd49b72f142a4ac27b49d370bd6e11f9f9c2 Mon Sep 17 00:00:00 2001 From: Sheehan Olver Date: Fri, 25 Mar 2022 20:14:50 +0000 Subject: [PATCH 102/369] Avoid copy in getindex(::AbstractQ, ...) (#44729) (cherry picked from commit ea82910042ff6e5e34e96a2a8711c3087bc7b209) --- stdlib/LinearAlgebra/src/qr.jl | 5 +++-- stdlib/LinearAlgebra/test/qr.jl | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/stdlib/LinearAlgebra/src/qr.jl b/stdlib/LinearAlgebra/src/qr.jl index 16e066ed1e030..4e1cc83b468f5 100644 --- a/stdlib/LinearAlgebra/src/qr.jl +++ b/stdlib/LinearAlgebra/src/qr.jl @@ -582,8 +582,9 @@ size(F::Union{QR,QRCompactWY,QRPivoted}) = size(getfield(F, :factors)) size(Q::AbstractQ, dim::Integer) = size(getfield(Q, :factors), dim == 2 ? 1 : dim) size(Q::AbstractQ) = size(Q, 1), size(Q, 2) -copy(Q::AbstractQ{T}) where {T} = lmul!(Q, Matrix{T}(I, size(Q))) -getindex(Q::AbstractQ, inds...) = copy(Q)[inds...] +copymutable(Q::AbstractQ{T}) where {T} = lmul!(Q, Matrix{T}(I, size(Q))) +copy(Q::AbstractQ) = copymutable(Q) +getindex(Q::AbstractQ, inds...) = copymutable(Q)[inds...] getindex(Q::AbstractQ, ::Colon, ::Colon) = copy(Q) function getindex(Q::AbstractQ, ::Colon, j::Int) diff --git a/stdlib/LinearAlgebra/test/qr.jl b/stdlib/LinearAlgebra/test/qr.jl index f9acbdb376465..a7b24f08385f2 100644 --- a/stdlib/LinearAlgebra/test/qr.jl +++ b/stdlib/LinearAlgebra/test/qr.jl @@ -449,6 +449,12 @@ end @test Q2[:, :] ≈ M[:, :] @test Q2[:, :, :] ≈ M[:, :, :] end + # Check that getindex works if copy returns itself (#44729) + struct MyIdentity{T} <: LinearAlgebra.AbstractQ{T} end + Base.size(::MyIdentity, dim::Integer) = dim in (1,2) ? 2 : 1 + Base.copy(J::MyIdentity) = J + LinearAlgebra.lmul!(::MyIdentity{T}, M::Array{T}) where {T} = M + @test MyIdentity{Float64}()[1,:] == [1.0, 0.0] end end # module TestQR From 6a88865f231e188ddba89a5a19fae274b7c2be8a Mon Sep 17 00:00:00 2001 From: Simeon Schaub Date: Sun, 27 Mar 2022 02:05:55 -0400 Subject: [PATCH 103/369] fix oc lowering with return type annotations (#44727) fixes #44723 Co-authored-by: Takafumi Arakaki (cherry picked from commit 19eb3073561266f5e1699e9f4f9d52c65b42d76f) --- src/julia-syntax.scm | 20 ++++++++++++-------- test/syntax.jl | 4 ++++ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/julia-syntax.scm b/src/julia-syntax.scm index 0f0e5c032d377..7538b89d32cb3 100644 --- a/src/julia-syntax.scm +++ b/src/julia-syntax.scm @@ -4105,7 +4105,7 @@ f(x) = yt(x) (cons (car e) (map-cl-convert (cdr e) fname lam namemap defined toplevel interp opaq globals)))))))) -(define (closure-convert e) (cl-convert e #f #f #f #f #f #f #f)) +(define (closure-convert e) (cl-convert e #f #f (table) (table) #f #f #f)) ;; pass 5: convert to linear IR @@ -4205,17 +4205,21 @@ f(x) = yt(x) (loop (cdr s)))))) `(pop_exception ,restore-token)))) (define (emit-return x) - (define (actually-return x) - (let* ((x (if rett - (compile (convert-for-type-decl x rett) '() #t #f) - x)) - (tmp (if ((if (null? catch-token-stack) valid-ir-return? simple-atom?) x) + (define (emit- x) + (let* ((tmp (if ((if (null? catch-token-stack) valid-ir-return? simple-atom?) x) #f (make-ssavalue)))) - (if tmp (emit `(= ,tmp ,x))) + (if tmp + (begin (emit `(= ,tmp ,x)) tmp) + x))) + (define (actually-return x) + (let* ((x (if rett + (compile (convert-for-type-decl (emit- x) rett) '() #t #f) + x)) + (x (emit- x))) (let ((pexc (pop-exc-expr catch-token-stack '()))) (if pexc (emit pexc))) - (emit `(return ,(or tmp x))))) + (emit `(return ,x)))) (if x (if (> handler-level 0) (let ((tmp (cond ((and (simple-atom? x) (or (not (ssavalue? x)) (not finally-handler))) #f) diff --git a/test/syntax.jl b/test/syntax.jl index ff392d5069708..805d006f971ba 100644 --- a/test/syntax.jl +++ b/test/syntax.jl @@ -3265,3 +3265,7 @@ end @test m.Foo.bar === 1 @test Core.get_binding_type(m.Foo, :bar) == Any end + +# issue 44723 +demo44723()::Any = Base.Experimental.@opaque () -> true ? 1 : 2 +@test demo44723()() == 1 From 680f7fc49e0da8f48e1303f006e61737d6ac92d5 Mon Sep 17 00:00:00 2001 From: Alex Arslan Date: Mon, 28 Mar 2022 13:48:23 -0700 Subject: [PATCH 104/369] Distributed test suite: wrap another non-thread-safe test in `poll_while` (#44280) (#44779) (cherry picked from commit e4920250cea633e5460384b7529c7554d96b73a5) Co-authored-by: Dilum Aluthge --- stdlib/Distributed/test/distributed_exec.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/Distributed/test/distributed_exec.jl b/stdlib/Distributed/test/distributed_exec.jl index 69d9fb47eccc5..d2d46aebf0f1b 100644 --- a/stdlib/Distributed/test/distributed_exec.jl +++ b/stdlib/Distributed/test/distributed_exec.jl @@ -298,7 +298,7 @@ let wid1 = workers()[1], end remotecall_fetch(r -> (finalize(take!(r)); yield(); nothing), wid2, fstore) # finalize remotely sleep(0.5) # to ensure that wid2 messages have been executed on wid1 - @test remotecall_fetch(k -> haskey(Distributed.PGRP.refs, k), wid1, rrid) == false + @test poll_while(() -> remotecall_fetch(k -> haskey(Distributed.PGRP.refs, k), wid1, rrid)) end # Tests for issue #23109 - should not hang. From c38e89295aa19aa2b1c3ea897bce2fe9aaaf10fa Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Tue, 22 Feb 2022 14:19:29 -0500 Subject: [PATCH 105/369] Distributed test suite: wrap another non-thread-safe test in `poll_while` (#44280) (cherry picked from commit e4920250cea633e5460384b7529c7554d96b73a5) --- stdlib/Distributed/test/distributed_exec.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/Distributed/test/distributed_exec.jl b/stdlib/Distributed/test/distributed_exec.jl index 69d9fb47eccc5..d2d46aebf0f1b 100644 --- a/stdlib/Distributed/test/distributed_exec.jl +++ b/stdlib/Distributed/test/distributed_exec.jl @@ -298,7 +298,7 @@ let wid1 = workers()[1], end remotecall_fetch(r -> (finalize(take!(r)); yield(); nothing), wid2, fstore) # finalize remotely sleep(0.5) # to ensure that wid2 messages have been executed on wid1 - @test remotecall_fetch(k -> haskey(Distributed.PGRP.refs, k), wid1, rrid) == false + @test poll_while(() -> remotecall_fetch(k -> haskey(Distributed.PGRP.refs, k), wid1, rrid)) end # Tests for issue #23109 - should not hang. From 9daeaddae0d6459bb43f16de0e3d4077c7a52632 Mon Sep 17 00:00:00 2001 From: Ian Atol Date: Mon, 28 Mar 2022 12:34:45 -0700 Subject: [PATCH 106/369] Pass around effects during cacheing (#44777) (cherry picked from commit d7782de62f974202f6be63f888bc173b8af7dddc) --- base/compiler/typeinfer.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/base/compiler/typeinfer.jl b/base/compiler/typeinfer.jl index c20fcd14be0ef..c72d03a226472 100644 --- a/base/compiler/typeinfer.jl +++ b/base/compiler/typeinfer.jl @@ -356,7 +356,8 @@ function maybe_compress_codeinfo(interp::AbstractInterpreter, linfo::MethodInsta end function transform_result_for_cache(interp::AbstractInterpreter, linfo::MethodInstance, - valid_worlds::WorldRange, @nospecialize(inferred_result)) + valid_worlds::WorldRange, @nospecialize(inferred_result), + ipo_effects::Effects) # If we decided not to optimize, drop the OptimizationState now. # External interpreters can override as necessary to cache additional information if inferred_result isa OptimizationState @@ -391,7 +392,7 @@ function cache_result!(interp::AbstractInterpreter, result::InferenceResult) # TODO: also don't store inferred code if we've previously decided to interpret this function if !already_inferred - inferred_result = transform_result_for_cache(interp, linfo, valid_worlds, result.src) + inferred_result = transform_result_for_cache(interp, linfo, valid_worlds, result.src, result.ipo_effects) code_cache(interp)[linfo] = CodeInstance(result, inferred_result, valid_worlds) if track_newly_inferred[] m = linfo.def From dc89240c653db9303f58b993858b9317812a5c38 Mon Sep 17 00:00:00 2001 From: Simeon Schaub Date: Mon, 28 Mar 2022 15:35:10 -0400 Subject: [PATCH 107/369] errors: fix handling of `.op` in lowering (#44770) Discovered while running the syntax tests with lines 25-28 of `jlfrontend.scm` commented out. Turned out we didn't handle `.op` correctly in neither `check-dotop` nor in `deparse`. This meant we just got `error: malformed expression` instead of an actually useful error message. (cherry picked from commit 9112135140efe9ebd39727054e904bd881d46289) --- src/ast.scm | 18 ++++++++++-------- test/syntax.jl | 7 ++++++- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/ast.scm b/src/ast.scm index 688b4e852e7c4..04438e50692f9 100644 --- a/src/ast.scm +++ b/src/ast.scm @@ -79,13 +79,15 @@ ((char? e) (string "'" e "'")) ((atom? e) (string e)) ((eq? (car e) '|.|) - (string (deparse (cadr e)) '|.| - (cond ((and (pair? (caddr e)) (memq (caaddr e) '(quote inert))) - (deparse-colon-dot (cadr (caddr e)))) - ((and (pair? (caddr e)) (eq? (caaddr e) 'copyast)) - (deparse-colon-dot (cadr (cadr (caddr e))))) - (else - (string #\( (deparse (caddr e)) #\)))))) + (if (length= e 2) + (string "(." (deparse (cadr e)) ")") + (string (deparse (cadr e)) '|.| + (cond ((and (pair? (caddr e)) (memq (caaddr e) '(quote inert))) + (deparse-colon-dot (cadr (caddr e)))) + ((and (pair? (caddr e)) (eq? (caaddr e) 'copyast)) + (deparse-colon-dot (cadr (cadr (caddr e))))) + (else + (string #\( (deparse (caddr e)) #\))))))) ((memq (car e) '(... |'|)) (string (deparse (cadr e)) (car e))) ((or (syntactic-op? (car e)) (eq? (car e) '|<:|) (eq? (car e) '|>:|) (eq? (car e) '-->)) @@ -445,7 +447,7 @@ (if (dotop-named? e) (error (string "invalid function name \"" (deparse e) "\"")) (if (pair? e) - (if (eq? (car e) '|.|) + (if (and (eq? (car e) '|.|) (length= e 3)) (check-dotop (caddr e)) (if (quoted? e) (check-dotop (cadr e)))))) diff --git a/test/syntax.jl b/test/syntax.jl index 805d006f971ba..8320060678d16 100644 --- a/test/syntax.jl +++ b/test/syntax.jl @@ -1909,7 +1909,12 @@ f31404(a, b; kws...) = (a, b, values(kws)) # issue #28992 macro id28992(x) x end @test @id28992(1 .+ 2) == 3 -@test Meta.isexpr(Meta.lower(@__MODULE__, :(@id28992((.+)(a,b) = 0))), :error) +@test Meta.@lower(.+(a,b) = 0) == Expr(:error, "invalid function name \".+\"") +@test Meta.@lower((.+)(a,b) = 0) == Expr(:error, "invalid function name \"(.+)\"") +let m = @__MODULE__ + @test Meta.lower(m, :($m.@id28992(.+(a,b) = 0))) == Expr(:error, "invalid function name \"$(nameof(m)).:.+\"") + @test Meta.lower(m, :($m.@id28992((.+)(a,b) = 0))) == Expr(:error, "invalid function name \"(.$(nameof(m)).+)\"") +end @test @id28992([1] .< [2] .< [3]) == [true] @test @id28992(2 ^ -2) == 0.25 @test @id28992(2 .^ -2) == 0.25 From 807b74cab20c5e34167a379ab2c6f65bc9a30763 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Tue, 29 Mar 2022 15:53:13 +0900 Subject: [PATCH 108/369] fix #44732, propagate effects of a thrown concrete call correctly (#44762) (cherry picked from commit f86b4ef88f487337d61eb373f3ec8ddbde76c78c) --- base/compiler/abstractinterpretation.jl | 33 +++++++++++-------------- base/compiler/ssair/inlining.jl | 6 ++--- base/compiler/stmtinfo.jl | 5 ++-- test/compiler/inline.jl | 22 +++++++++++++++++ 4 files changed, 43 insertions(+), 23 deletions(-) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index 3cc709bc35849..e7a38b258e9bb 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -128,9 +128,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), end tristate_merge!(sv, effects) push!(const_results, const_result) - if const_result !== nothing - any_const_result = true - end + any_const_result |= const_result !== nothing this_rt = tmerge(this_rt, rt) if bail_out_call(interp, this_rt, sv) break @@ -179,9 +177,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), end tristate_merge!(sv, effects) push!(const_results, const_result) - if const_result !== nothing - any_const_result = true - end + any_const_result |= const_result !== nothing end @assert !(this_conditional isa Conditional) "invalid lattice element returned from inter-procedural context" seen += 1 @@ -694,12 +690,12 @@ function pure_eval_call(interp::AbstractInterpreter, end function _pure_eval_call(@nospecialize(f), arginfo::ArgInfo) args = collect_const_args(arginfo) - try - value = Core._apply_pure(f, args) - return Const(value) + value = try + Core._apply_pure(f, args) catch return nothing end + return Const(value) end function concrete_eval_eligible(interp::AbstractInterpreter, @@ -733,17 +729,18 @@ function concrete_eval_call(interp::AbstractInterpreter, @nospecialize(f), result::MethodCallResult, arginfo::ArgInfo, sv::InferenceState) concrete_eval_eligible(interp, f, result, arginfo, sv) || return nothing args = collect_const_args(arginfo) - try - value = Core._call_in_world_total(get_world_counter(interp), f, args...) - if is_inlineable_constant(value) || call_result_unused(sv) - # If the constant is not inlineable, still do the const-prop, since the - # code that led to the creation of the Const may be inlineable in the same - # circumstance and may be optimizable. - return ConstCallResults(Const(value), ConstResult(result.edge, value), EFFECTS_TOTAL) - end + world = get_world_counter(interp) + value = try + Core._call_in_world_total(world, f, args...) catch # The evaulation threw. By :consistent-cy, we're guaranteed this would have happened at runtime - return ConstCallResults(Union{}, ConstResult(result.edge), result.edge_effects) + return ConstCallResults(Union{}, ConstResult(result.edge, result.edge_effects), result.edge_effects) + end + if is_inlineable_constant(value) || call_result_unused(sv) + # If the constant is not inlineable, still do the const-prop, since the + # code that led to the creation of the Const may be inlineable in the same + # circumstance and may be optimizable. + return ConstCallResults(Const(value), ConstResult(result.edge, EFFECTS_TOTAL, value), EFFECTS_TOTAL) end return nothing end diff --git a/base/compiler/ssair/inlining.jl b/base/compiler/ssair/inlining.jl index a5b68d6d5198d..5e3ad4febe60f 100644 --- a/base/compiler/ssair/inlining.jl +++ b/base/compiler/ssair/inlining.jl @@ -1310,10 +1310,10 @@ end function const_result_item(result::ConstResult, state::InliningState) if !isdefined(result, :result) || !is_inlineable_constant(result.result) - return compileable_specialization(state.et, result.mi, EFFECTS_TOTAL) - else - return ConstantCase(quoted(result.result)) + return compileable_specialization(state.et, result.mi, result.effects) end + @assert result.effects === EFFECTS_TOTAL + return ConstantCase(quoted(result.result)) end function handle_cases!(ir::IRCode, idx::Int, stmt::Expr, @nospecialize(atype), diff --git a/base/compiler/stmtinfo.jl b/base/compiler/stmtinfo.jl index e3f69b2c43e54..3eeff0c2c86a8 100644 --- a/base/compiler/stmtinfo.jl +++ b/base/compiler/stmtinfo.jl @@ -49,9 +49,10 @@ end struct ConstResult mi::MethodInstance + effects::Effects result - ConstResult(mi::MethodInstance) = new(mi) - ConstResult(mi::MethodInstance, @nospecialize val) = new(mi, val) + ConstResult(mi::MethodInstance, effects::Effects) = new(mi, effects) + ConstResult(mi::MethodInstance, effects::Effects, @nospecialize val) = new(mi, effects, val) end """ diff --git a/test/compiler/inline.jl b/test/compiler/inline.jl index 1af52422b2f71..59604bd317f2e 100644 --- a/test/compiler/inline.jl +++ b/test/compiler/inline.jl @@ -1095,6 +1095,28 @@ Base.@assume_effects :consistent :effect_free :terminates_globally consteval( consteval(getindex, ___CONST_DICT___, :a) end +# https://github.com/JuliaLang/julia/issues/44732 +struct Component44732 + v +end +struct Container44732 + x::Union{Nothing,Component44732} +end + +# NOTE make sure to prevent inference bail out +validate44732(::Component44732) = nothing +validate44732(::Any) = error("don't erase this error!") + +function issue44732(c::Container44732) + validate44732(c.x) + return nothing +end + +let src = code_typed1(issue44732, (Container44732,)) + @test any(isinvoke(:validate44732), src.code) +end +@test_throws ErrorException("don't erase this error!") issue44732(Container44732(nothing)) + global x44200::Int = 0 function f44200() global x = 0 From f560674e7849419c77d88b33d0fa997d6d051b6c Mon Sep 17 00:00:00 2001 From: Jerry Ling Date: Tue, 29 Mar 2022 10:01:32 -0400 Subject: [PATCH 109/369] fix `===` when encountering null pointer (#44749) (cherry picked from commit 1a7355b3866fecfebdcb1923cfd691b48fe5a762) --- src/builtins.c | 21 +++++++++++++-------- test/core.jl | 14 ++++++++++++++ 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/src/builtins.c b/src/builtins.c index 11da13285e9ca..64f0755182816 100644 --- a/src/builtins.c +++ b/src/builtins.c @@ -94,20 +94,25 @@ static int NOINLINE compare_fields(const jl_value_t *a, const jl_value_t *b, jl_ else { jl_datatype_t *ft = (jl_datatype_t*)jl_field_type_concrete(dt, f); if (jl_is_uniontype(ft)) { - uint8_t asel = ((uint8_t*)ao)[jl_field_size(dt, f) - 1]; - uint8_t bsel = ((uint8_t*)bo)[jl_field_size(dt, f) - 1]; + size_t idx = jl_field_size(dt, f) - 1; + uint8_t asel = ((uint8_t*)ao)[idx]; + uint8_t bsel = ((uint8_t*)bo)[idx]; if (asel != bsel) return 0; ft = (jl_datatype_t*)jl_nth_union_component((jl_value_t*)ft, asel); } else if (ft->layout->first_ptr >= 0) { - // If the field is a inline immutable that can be can be undef - // we need to check to check for undef first since undef struct + // If the field is a inline immutable that can be undef + // we need to check for undef first since undef struct // may have fields that are different but should still be treated as equal. - jl_value_t *ptra = ((jl_value_t**)ao)[ft->layout->first_ptr]; - jl_value_t *ptrb = ((jl_value_t**)bo)[ft->layout->first_ptr]; - if (ptra == NULL && ptrb == NULL) { - return 1; + int32_t idx = ft->layout->first_ptr; + jl_value_t *ptra = ((jl_value_t**)ao)[idx]; + jl_value_t *ptrb = ((jl_value_t**)bo)[idx]; + if ((ptra == NULL) != (ptrb == NULL)) { + return 0; + } + else if (ptra == NULL) { // implies ptrb == NULL + continue; // skip this field (it is #undef) } } if (!ft->layout->haspadding) { diff --git a/test/core.jl b/test/core.jl index 0294a61c7d146..985c15781e45c 100644 --- a/test/core.jl +++ b/test/core.jl @@ -92,6 +92,20 @@ let abcd = ABCDconst(1, 2, 3, 4) @test (1, 2, "not constant", 4) === (abcd.a, abcd.b, abcd.c, abcd.d) end +# test `===` handling null pointer in struct #44712 +struct N44712 + a::Some{Any} + b::Int + N44712() = new() +end +let a = Int[0, 1], b = Int[0, 2] + GC.@preserve a b begin + @test unsafe_load(Ptr{N44712}(pointer(a))) !== unsafe_load(Ptr{N44712}(pointer(b))) + end +end + +# another possible issue in #44712 +@test (("", 0),) !== (("", 1),) f47(x::Vector{Vector{T}}) where {T} = 0 @test_throws MethodError f47(Vector{Vector}()) From c4a53a8412b8abafe389d07e76a6e1f6f82cfb9c Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Tue, 29 Mar 2022 06:11:38 +0900 Subject: [PATCH 110/369] inference: implement missing effects propagation from `abstract_invoke` (#44764) Fix #44763 (cherry picked from commit 9d35089b32ed11edd39c114d3efc4e91e710f50e) --- base/compiler/abstractinterpretation.jl | 29 ++++++++++--------------- base/compiler/types.jl | 1 + test/compiler/inference.jl | 9 ++++++++ 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index e7a38b258e9bb..cf39d622bf72f 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -1490,25 +1490,26 @@ end function abstract_invoke(interp::AbstractInterpreter, (; fargs, argtypes)::ArgInfo, sv::InferenceState) ft′ = argtype_by_index(argtypes, 2) ft = widenconst(ft′) - ft === Bottom && return CallMeta(Bottom, false) + ft === Bottom && return CallMeta(Bottom, false), EFFECTS_THROWN (types, isexact, isconcrete, istype) = instanceof_tfunc(argtype_by_index(argtypes, 3)) - types === Bottom && return CallMeta(Bottom, false) - isexact || return CallMeta(Any, false) + types === Bottom && return CallMeta(Bottom, false), EFFECTS_THROWN + isexact || return CallMeta(Any, false), Effects() argtype = argtypes_to_type(argtype_tail(argtypes, 4)) nargtype = typeintersect(types, argtype) - nargtype === Bottom && return CallMeta(Bottom, false) - nargtype isa DataType || return CallMeta(Any, false) # other cases are not implemented below - isdispatchelem(ft) || return CallMeta(Any, false) # check that we might not have a subtype of `ft` at runtime, before doing supertype lookup below + nargtype === Bottom && return CallMeta(Bottom, false), EFFECTS_THROWN + nargtype isa DataType || return CallMeta(Any, false), Effects() # other cases are not implemented below + isdispatchelem(ft) || return CallMeta(Any, false), Effects() # check that we might not have a subtype of `ft` at runtime, before doing supertype lookup below ft = ft::DataType types = rewrap_unionall(Tuple{ft, unwrap_unionall(types).parameters...}, types)::Type nargtype = Tuple{ft, nargtype.parameters...} argtype = Tuple{ft, argtype.parameters...} match, valid_worlds, overlayed = findsup(types, method_table(interp)) - match === nothing && return CallMeta(Any, false) + match === nothing && return CallMeta(Any, false), Effects() update_valid_age!(sv, valid_worlds) method = match.method (ti, env::SimpleVector) = ccall(:jl_type_intersection_with_env, Any, (Any, Any), nargtype, method.sig)::SimpleVector (; rt, edge) = result = abstract_call_method(interp, method, ti, env, false, sv) + effects = result.edge_effects edge !== nothing && add_backedge!(edge::MethodInstance, sv) match = MethodMatch(ti, env, method, argtype <: method.sig) res = nothing @@ -1526,10 +1527,10 @@ function abstract_invoke(interp::AbstractInterpreter, (; fargs, argtypes)::ArgIn const_result = nothing if const_call_result !== nothing if const_call_result.rt ⊑ rt - (; rt, const_result) = const_call_result + (; rt, effects, const_result) = const_call_result end end - return CallMeta(from_interprocedural!(rt, sv, arginfo, sig), InvokeCallInfo(match, const_result)) + return CallMeta(from_interprocedural!(rt, sv, arginfo, sig), InvokeCallInfo(match, const_result)), effects end function invoke_rewrite(xs::Vector{Any}) @@ -1550,14 +1551,8 @@ function abstract_call_known(interp::AbstractInterpreter, @nospecialize(f), if f === _apply_iterate return abstract_apply(interp, argtypes, sv, max_methods) elseif f === invoke - call = abstract_invoke(interp, arginfo, sv) - if call.info === false - if call.rt === Bottom - tristate_merge!(sv, Effects(EFFECTS_TOTAL; nothrow=ALWAYS_FALSE)) - else - tristate_merge!(sv, Effects()) - end - end + call, effects = abstract_invoke(interp, arginfo, sv) + tristate_merge!(sv, effects) return call elseif f === modifyfield! tristate_merge!(sv, Effects()) # TODO diff --git a/base/compiler/types.jl b/base/compiler/types.jl index 5e2c7ed46a98d..50ae8ecba6705 100644 --- a/base/compiler/types.jl +++ b/base/compiler/types.jl @@ -59,6 +59,7 @@ function Effects( end const EFFECTS_TOTAL = Effects(ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, false) +const EFFECTS_THROWN = Effects(ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_FALSE, ALWAYS_TRUE, false) const EFFECTS_UNKNOWN = Effects(TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, true) function Effects(e::Effects = EFFECTS_UNKNOWN; diff --git a/test/compiler/inference.jl b/test/compiler/inference.jl index e6f113f2b9062..bf4f8391012b7 100644 --- a/test/compiler/inference.jl +++ b/test/compiler/inference.jl @@ -4055,3 +4055,12 @@ end @test Tuple{} <: code_typed(f_boundscheck_elim, Tuple{Int})[1][2] @test !Core.Compiler.builtin_nothrow(Core.get_binding_type, Any[Rational{Int}, Core.Const(:foo)], Any) + +# https://github.com/JuliaLang/julia/issues/44763 +global x44763::Int = 0 +increase_x44763!(n) = (global x44763; x44763 += n) +invoke44763(x) = Base.@invoke increase_x44763!(x) +@test Base.return_types() do + invoke44763(42) +end |> only === Int +@test x44763 == 0 From 3e092a25212c819b05b2e1d131a5ab28bce5722a Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Tue, 29 Mar 2022 17:42:21 +0200 Subject: [PATCH 111/369] set VERSION to 1.8.0-beta3 (#44774) --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 495ea0f0c9741..431eaf9f034e2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.8.0-beta2 +1.8.0-beta3 From e71e722f58c87b640b94ad4428a66cc1e83f2917 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Wed, 30 Mar 2022 20:12:11 +0900 Subject: [PATCH 112/369] effects: change the `overlayed::Bool` property to `nonoverlayed::Bool` (#44786) The current naming of `overlayed` is a bit confusing since `overlayed === true`, which is the conservative default value, actually means "it _may_ be overlayed" while `overlayed === false` means "this is absolutely not overlayed". I think it should be named as `nonoverlayed`, and then a query name like `is_nonoverlayed` would be more sensible than the alternative `is_overlayed`, which actually should be something like `can_be_overlayed`. --- base/compiler/abstractinterpretation.jl | 77 +++++++++++++------------ base/compiler/inferencestate.jl | 2 +- base/compiler/methodtable.jl | 10 ++-- base/compiler/ssair/show.jl | 2 +- base/compiler/tfuncs.jl | 40 +++++-------- base/compiler/types.jl | 25 ++++---- src/julia.h | 4 +- 7 files changed, 77 insertions(+), 83 deletions(-) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index cf39d622bf72f..06d1a2c7d3e58 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -39,25 +39,23 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), # function has not seen any side effects, we would like to make sure there # aren't any in the throw block either to enable other optimizations. add_remark!(interp, sv, "Skipped call in throw block") - overlayed = true - if isoverlayed(method_table(interp)) - if !sv.ipo_effects.overlayed - # as we may want to concrete-evaluate this frame in cases when there are - # no overlayed calls, try an additional effort now to check if this call - # isn't overlayed rather than just handling it conservatively - matches = find_matching_methods(arginfo.argtypes, atype, method_table(interp), - InferenceParams(interp).MAX_UNION_SPLITTING, max_methods) - if !isa(matches, FailedMethodMatch) - overlayed = matches.overlayed - end + nonoverlayed = false + if isoverlayed(method_table(interp)) && sv.ipo_effects.nonoverlayed + # as we may want to concrete-evaluate this frame in cases when there are + # no overlayed calls, try an additional effort now to check if this call + # isn't overlayed rather than just handling it conservatively + matches = find_matching_methods(arginfo.argtypes, atype, method_table(interp), + InferenceParams(interp).MAX_UNION_SPLITTING, max_methods) + if !isa(matches, FailedMethodMatch) + nonoverlayed = matches.nonoverlayed end else - overlayed = false + nonoverlayed = true end # At this point we are guaranteed to end up throwing on this path, # which is all that's required for :consistent-cy. Of course, we don't # know anything else about this statement. - tristate_merge!(sv, Effects(; consistent=ALWAYS_TRUE, overlayed)) + tristate_merge!(sv, Effects(; consistent=ALWAYS_TRUE, nonoverlayed)) return CallMeta(Any, false) end @@ -80,11 +78,11 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), any_const_result = false const_results = Union{InferenceResult,Nothing,ConstResult}[] multiple_matches = napplicable > 1 - if matches.overlayed + if !matches.nonoverlayed # currently we don't have a good way to execute the overlayed method definition, # so we should give up pure/concrete eval when any of the matched methods is overlayed f = nothing - tristate_merge!(sv, Effects(EFFECTS_TOTAL; overlayed=true)) + tristate_merge!(sv, Effects(EFFECTS_TOTAL; nonoverlayed=false)) end val = pure_eval_call(interp, f, applicable, arginfo, sv) @@ -204,7 +202,9 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), end if seen != napplicable - tristate_merge!(sv, Effects(; overlayed=false)) # already accounted for method overlay above + # there may be unanalyzed effects within unseen dispatch candidate, + # but we can still ignore nonoverlayed effect here since we already accounted for it + tristate_merge!(sv, EFFECTS_UNKNOWN) elseif isa(matches, MethodMatches) ? (!matches.fullmatch || any_ambig(matches)) : (!_all(b->b, matches.fullmatches) || any_ambig(matches)) # Account for the fact that we may encounter a MethodError with a non-covered or ambiguous signature. @@ -243,7 +243,7 @@ struct MethodMatches valid_worlds::WorldRange mt::Core.MethodTable fullmatch::Bool - overlayed::Bool + nonoverlayed::Bool end any_ambig(info::MethodMatchInfo) = info.results.ambig any_ambig(m::MethodMatches) = any_ambig(m.info) @@ -255,7 +255,7 @@ struct UnionSplitMethodMatches valid_worlds::WorldRange mts::Vector{Core.MethodTable} fullmatches::Vector{Bool} - overlayed::Bool + nonoverlayed::Bool end any_ambig(m::UnionSplitMethodMatches) = _any(any_ambig, m.info.matches) @@ -270,7 +270,7 @@ function find_matching_methods(argtypes::Vector{Any}, @nospecialize(atype), meth valid_worlds = WorldRange() mts = Core.MethodTable[] fullmatches = Bool[] - overlayed = false + nonoverlayed = true for i in 1:length(split_argtypes) arg_n = split_argtypes[i]::Vector{Any} sig_n = argtypes_to_type(arg_n) @@ -281,8 +281,8 @@ function find_matching_methods(argtypes::Vector{Any}, @nospecialize(atype), meth if result === missing return FailedMethodMatch("For one of the union split cases, too many methods matched") end - matches, overlayedᵢ = result - overlayed |= overlayedᵢ + matches, overlayed = result + nonoverlayed &= !overlayed push!(infos, MethodMatchInfo(matches)) for m in matches push!(applicable, m) @@ -309,7 +309,7 @@ function find_matching_methods(argtypes::Vector{Any}, @nospecialize(atype), meth valid_worlds, mts, fullmatches, - overlayed) + nonoverlayed) else mt = ccall(:jl_method_table_for, Any, (Any,), atype) if mt === nothing @@ -329,7 +329,7 @@ function find_matching_methods(argtypes::Vector{Any}, @nospecialize(atype), meth matches.valid_worlds, mt, fullmatch, - overlayed) + !overlayed) end end @@ -702,7 +702,7 @@ function concrete_eval_eligible(interp::AbstractInterpreter, @nospecialize(f), result::MethodCallResult, arginfo::ArgInfo, sv::InferenceState) # disable concrete-evaluation since this function call is tainted by some overlayed # method and currently there is no direct way to execute overlayed methods - isoverlayed(method_table(interp)) && result.edge_effects.overlayed && return false + isoverlayed(method_table(interp)) && !result.edge_effects.nonoverlayed && return false return f !== nothing && result.edge !== nothing && is_total_or_error(result.edge_effects) && @@ -1490,13 +1490,13 @@ end function abstract_invoke(interp::AbstractInterpreter, (; fargs, argtypes)::ArgInfo, sv::InferenceState) ft′ = argtype_by_index(argtypes, 2) ft = widenconst(ft′) - ft === Bottom && return CallMeta(Bottom, false), EFFECTS_THROWN + ft === Bottom && return CallMeta(Bottom, false), EFFECTS_THROWS (types, isexact, isconcrete, istype) = instanceof_tfunc(argtype_by_index(argtypes, 3)) - types === Bottom && return CallMeta(Bottom, false), EFFECTS_THROWN + types === Bottom && return CallMeta(Bottom, false), EFFECTS_THROWS isexact || return CallMeta(Any, false), Effects() argtype = argtypes_to_type(argtype_tail(argtypes, 4)) nargtype = typeintersect(types, argtype) - nargtype === Bottom && return CallMeta(Bottom, false), EFFECTS_THROWN + nargtype === Bottom && return CallMeta(Bottom, false), EFFECTS_THROWS nargtype isa DataType || return CallMeta(Any, false), Effects() # other cases are not implemented below isdispatchelem(ft) || return CallMeta(Any, false), Effects() # check that we might not have a subtype of `ft` at runtime, before doing supertype lookup below ft = ft::DataType @@ -1530,6 +1530,7 @@ function abstract_invoke(interp::AbstractInterpreter, (; fargs, argtypes)::ArgIn (; rt, effects, const_result) = const_call_result end end + effects = Effects(effects; nonoverlayed=!overlayed) return CallMeta(from_interprocedural!(rt, sv, arginfo, sig), InvokeCallInfo(match, const_result)), effects end @@ -1575,12 +1576,12 @@ function abstract_call_known(interp::AbstractInterpreter, @nospecialize(f), end end end - tristate_merge!(sv, Effects(; overlayed=false)) # TODO + tristate_merge!(sv, EFFECTS_UNKNOWN) # TODO return CallMeta(Any, false) elseif f === TypeVar # Manually look through the definition of TypeVar to # make sure to be able to get `PartialTypeVar`s out. - tristate_merge!(sv, Effects(; overlayed=false)) # TODO + tristate_merge!(sv, EFFECTS_UNKNOWN) # TODO (la < 2 || la > 4) && return CallMeta(Union{}, false) n = argtypes[2] ub_var = Const(Any) @@ -1593,17 +1594,17 @@ function abstract_call_known(interp::AbstractInterpreter, @nospecialize(f), end return CallMeta(typevar_tfunc(n, lb_var, ub_var), false) elseif f === UnionAll - tristate_merge!(sv, Effects(; overlayed=false)) # TODO + tristate_merge!(sv, EFFECTS_UNKNOWN) # TODO return CallMeta(abstract_call_unionall(argtypes), false) elseif f === Tuple && la == 2 - tristate_merge!(sv, Effects(; overlayed=false)) # TODO + tristate_merge!(sv, EFFECTS_UNKNOWN) # TODO aty = argtypes[2] ty = isvarargtype(aty) ? unwrapva(aty) : widenconst(aty) if !isconcretetype(ty) return CallMeta(Tuple, false) end elseif is_return_type(f) - tristate_merge!(sv, Effects(; overlayed=false)) # TODO + tristate_merge!(sv, EFFECTS_UNKNOWN) # TODO return return_type_tfunc(interp, argtypes, sv) elseif la == 2 && istopfunction(f, :!) # handle Conditional propagation through !Bool @@ -1946,21 +1947,21 @@ function abstract_eval_statement(interp::AbstractInterpreter, @nospecialize(e), effects.effect_free ? ALWAYS_TRUE : TRISTATE_UNKNOWN, effects.nothrow ? ALWAYS_TRUE : TRISTATE_UNKNOWN, effects.terminates_globally ? ALWAYS_TRUE : TRISTATE_UNKNOWN, - #=overlayed=#false + #=nonoverlayed=#true )) else - tristate_merge!(sv, Effects(; overlayed=false)) + tristate_merge!(sv, EFFECTS_UNKNOWN) end elseif ehead === :cfunction - tristate_merge!(sv, Effects(; overlayed=false)) + tristate_merge!(sv, EFFECTS_UNKNOWN) t = e.args[1] isa(t, Type) || (t = Any) abstract_eval_cfunction(interp, e, vtypes, sv) elseif ehead === :method - tristate_merge!(sv, Effects(; overlayed=false)) + tristate_merge!(sv, EFFECTS_UNKNOWN) t = (length(e.args) == 1) ? Any : Nothing elseif ehead === :copyast - tristate_merge!(sv, Effects(; overlayed=false)) + tristate_merge!(sv, EFFECTS_UNKNOWN) t = abstract_eval_value(interp, e.args[1], vtypes, sv) if t isa Const && t.val isa Expr # `copyast` makes copies of Exprs @@ -2286,7 +2287,7 @@ function typeinf_local(interp::AbstractInterpreter, frame::InferenceState) effect_free=ALWAYS_FALSE, nothrow=TRISTATE_UNKNOWN)) elseif !isa(lhs, SSAValue) - tristate_merge!(frame, Effects(; overlayed=false)) + tristate_merge!(frame, EFFECTS_UNKNOWN) end elseif hd === :method stmt = stmt::Expr diff --git a/base/compiler/inferencestate.jl b/base/compiler/inferencestate.jl index db6ab574e3859..c920a0a64e17f 100644 --- a/base/compiler/inferencestate.jl +++ b/base/compiler/inferencestate.jl @@ -134,7 +134,7 @@ mutable struct InferenceState #=parent=#nothing, #=cached=#cache === :global, #=inferred=#false, #=dont_work_on_me=#false, - #=ipo_effects=#Effects(consistent, ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, false, inbounds_taints_consistency), + #=ipo_effects=#Effects(EFFECTS_TOTAL; consistent, inbounds_taints_consistency), interp) result.result = frame cache !== :no && push!(get_inference_cache(interp), result) diff --git a/base/compiler/methodtable.jl b/base/compiler/methodtable.jl index da493cf9a9ef5..f2e7a4ec2cb2c 100644 --- a/base/compiler/methodtable.jl +++ b/base/compiler/methodtable.jl @@ -46,7 +46,7 @@ getindex(result::MethodLookupResult, idx::Int) = getindex(result.matches, idx):: Find all methods in the given method table `view` that are applicable to the given signature `sig`. If no applicable methods are found, an empty result is returned. If the number of applicable methods exceeded the specified limit, `missing` is returned. -`overlayed` indicates if any matching method is defined in an overlayed method table. +`overlayed` indicates if any of the matching methods comes from an overlayed method table. """ function findall(@nospecialize(sig::Type), table::InternalMethodTable; limit::Int=Int(typemax(Int32))) result = _findall(sig, nothing, table.world, limit) @@ -101,15 +101,15 @@ It is possible that no method is an upper bound of `sig`, or it is possible that among the upper bounds, there is no least element. In both cases `nothing` is returned. -`overlayed` indicates if the matching method is defined in an overlayed method table. +`overlayed` indicates if any of the matching methods comes from an overlayed method table. """ function findsup(@nospecialize(sig::Type), table::InternalMethodTable) - return (_findsup(sig, nothing, table.world)..., false) + return (_findsup(sig, nothing, table.world)..., true) end function findsup(@nospecialize(sig::Type), table::OverlayMethodTable) match, valid_worlds = _findsup(sig, table.mt, table.world) - match !== nothing && return match, valid_worlds, true + match !== nothing && return match, valid_worlds, false # fall back to the internal method table fallback_match, fallback_valid_worlds = _findsup(sig, nothing, table.world) return ( @@ -117,7 +117,7 @@ function findsup(@nospecialize(sig::Type), table::OverlayMethodTable) WorldRange( max(valid_worlds.min_world, fallback_valid_worlds.min_world), min(valid_worlds.max_world, fallback_valid_worlds.max_world)), - false) + true) end function _findsup(@nospecialize(sig::Type), mt::Union{Nothing,Core.MethodTable}, world::UInt) diff --git a/base/compiler/ssair/show.jl b/base/compiler/ssair/show.jl index 76cbcbd4d5d7d..f4c826a45156f 100644 --- a/base/compiler/ssair/show.jl +++ b/base/compiler/ssair/show.jl @@ -803,7 +803,7 @@ function Base.show(io::IO, e::Core.Compiler.Effects) print(io, ',') printstyled(io, string(tristate_letter(e.terminates), 't'); color=tristate_color(e.terminates)) print(io, ')') - e.overlayed && printstyled(io, '′'; color=:red) + e.nonoverlayed || printstyled(io, '′'; color=:red) end @specialize diff --git a/base/compiler/tfuncs.jl b/base/compiler/tfuncs.jl index 25f26a20b115a..a92a2bc977262 100644 --- a/base/compiler/tfuncs.jl +++ b/base/compiler/tfuncs.jl @@ -1756,11 +1756,11 @@ function builtin_effects(f::Builtin, argtypes::Vector{Any}, rt) if (f === Core.getfield || f === Core.isdefined) && length(argtypes) >= 3 # consistent if the argtype is immutable if isvarargtype(argtypes[2]) - return Effects(; effect_free=ALWAYS_TRUE, terminates=ALWAYS_TRUE, overlayed=false) + return Effects(; effect_free=ALWAYS_TRUE, terminates=ALWAYS_TRUE, nonoverlayed=true) end s = widenconst(argtypes[2]) if isType(s) || !isa(s, DataType) || isabstracttype(s) - return Effects(; effect_free=ALWAYS_TRUE, terminates=ALWAYS_TRUE, overlayed=false) + return Effects(; effect_free=ALWAYS_TRUE, terminates=ALWAYS_TRUE, nonoverlayed=true) end s = s::DataType ipo_consistent = !ismutabletype(s) @@ -1785,13 +1785,10 @@ function builtin_effects(f::Builtin, argtypes::Vector{Any}, rt) end effect_free = contains_is(_EFFECT_FREE_BUILTINS, f) || contains_is(_PURE_BUILTINS, f) - return Effects( - ipo_consistent ? ALWAYS_TRUE : ALWAYS_FALSE, - effect_free ? ALWAYS_TRUE : ALWAYS_FALSE, - nothrow ? ALWAYS_TRUE : TRISTATE_UNKNOWN, - #=terminates=#ALWAYS_TRUE, - #=overlayed=#false, - ) + return Effects(EFFECTS_TOTAL; + consistent = ipo_consistent ? ALWAYS_TRUE : ALWAYS_FALSE, + effect_free = effect_free ? ALWAYS_TRUE : ALWAYS_FALSE, + nothrow = nothrow ? ALWAYS_TRUE : TRISTATE_UNKNOWN) end function builtin_nothrow(@nospecialize(f), argtypes::Array{Any, 1}, @nospecialize(rt)) @@ -1957,24 +1954,19 @@ function intrinsic_effects(f::IntrinsicFunction, argtypes::Vector{Any}) return Effects() end - ipo_consistent = !(f === Intrinsics.pointerref || # this one is volatile - f === Intrinsics.arraylen || # this one is volatile + ipo_consistent = !( + f === Intrinsics.pointerref || # this one is volatile + f === Intrinsics.arraylen || # this one is volatile f === Intrinsics.sqrt_llvm_fast || # this one may differ at runtime (by a few ulps) - f === Intrinsics.have_fma || # this one depends on the runtime environment - f === Intrinsics.cglobal) # cglobal lookup answer changes at runtime - + f === Intrinsics.have_fma || # this one depends on the runtime environment + f === Intrinsics.cglobal) # cglobal lookup answer changes at runtime effect_free = !(f === Intrinsics.pointerset) + nothrow = !isvarargtype(argtypes[end]) && intrinsic_nothrow(f, argtypes[2:end]) - nothrow = isvarargtype(argtypes[end]) ? false : - intrinsic_nothrow(f, argtypes[2:end]) - - return Effects( - ipo_consistent ? ALWAYS_TRUE : ALWAYS_FALSE, - effect_free ? ALWAYS_TRUE : ALWAYS_FALSE, - nothrow ? ALWAYS_TRUE : TRISTATE_UNKNOWN, - #=terminates=#ALWAYS_TRUE, - #=overlayed=#false, - ) + return Effects(EFFECTS_TOTAL; + consistent = ipo_consistent ? ALWAYS_TRUE : ALWAYS_FALSE, + effect_free = effect_free ? ALWAYS_TRUE : ALWAYS_FALSE, + nothrow = nothrow ? ALWAYS_TRUE : TRISTATE_UNKNOWN) end # TODO: this function is a very buggy and poor model of the return_type function diff --git a/base/compiler/types.jl b/base/compiler/types.jl index 50ae8ecba6705..492cc22dfe3e1 100644 --- a/base/compiler/types.jl +++ b/base/compiler/types.jl @@ -38,7 +38,7 @@ struct Effects effect_free::TriState nothrow::TriState terminates::TriState - overlayed::Bool + nonoverlayed::Bool # This effect is currently only tracked in inference and modified # :consistent before caching. We may want to track it in the future. inbounds_taints_consistency::Bool @@ -48,33 +48,34 @@ function Effects( effect_free::TriState, nothrow::TriState, terminates::TriState, - overlayed::Bool) + nonoverlayed::Bool) return Effects( consistent, effect_free, nothrow, terminates, - overlayed, + nonoverlayed, false) end -const EFFECTS_TOTAL = Effects(ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, false) -const EFFECTS_THROWN = Effects(ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_FALSE, ALWAYS_TRUE, false) -const EFFECTS_UNKNOWN = Effects(TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, true) +const EFFECTS_TOTAL = Effects(ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, true) +const EFFECTS_THROWS = Effects(ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_FALSE, ALWAYS_TRUE, true) +const EFFECTS_UNKNOWN = Effects(TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, true) # mostly unknown, but it's not overlayed at least (e.g. it's not a call) +const EFFECTS_UNKNOWN′ = Effects(TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, false) # unknown, really -function Effects(e::Effects = EFFECTS_UNKNOWN; +function Effects(e::Effects = EFFECTS_UNKNOWN′; consistent::TriState = e.consistent, effect_free::TriState = e.effect_free, nothrow::TriState = e.nothrow, terminates::TriState = e.terminates, - overlayed::Bool = e.overlayed, + nonoverlayed::Bool = e.nonoverlayed, inbounds_taints_consistency::Bool = e.inbounds_taints_consistency) return Effects( consistent, effect_free, nothrow, terminates, - overlayed, + nonoverlayed, inbounds_taints_consistency) end @@ -97,7 +98,7 @@ function encode_effects(e::Effects) (e.effect_free.state << 2) | (e.nothrow.state << 4) | (e.terminates.state << 6) | - (UInt32(e.overlayed) << 8) + (UInt32(e.nonoverlayed) << 8) end function decode_effects(e::UInt32) return Effects( @@ -119,7 +120,7 @@ function tristate_merge(old::Effects, new::Effects) old.nothrow, new.nothrow), tristate_merge( old.terminates, new.terminates), - old.overlayed | new.overlayed, + old.nonoverlayed & new.nonoverlayed, old.inbounds_taints_consistency | new.inbounds_taints_consistency) end @@ -169,7 +170,7 @@ mutable struct InferenceResult arginfo#=::Union{Nothing,Tuple{ArgInfo,InferenceState}}=# = nothing) argtypes, overridden_by_const = matching_cache_argtypes(linfo, arginfo) return new(linfo, argtypes, overridden_by_const, Any, nothing, - WorldRange(), Effects(; overlayed=false), Effects(; overlayed=false), nothing) + WorldRange(), Effects(), Effects(), nothing) end end diff --git a/src/julia.h b/src/julia.h index b15008dee91e3..f88371e561ca3 100644 --- a/src/julia.h +++ b/src/julia.h @@ -400,7 +400,7 @@ typedef struct _jl_code_instance_t { uint8_t ipo_effect_free:2; uint8_t ipo_nothrow:2; uint8_t ipo_terminates:2; - uint8_t ipo_overlayed:1; + uint8_t ipo_nonoverlayed:1; } ipo_purity_flags; }; union { @@ -410,7 +410,7 @@ typedef struct _jl_code_instance_t { uint8_t effect_free:2; uint8_t nothrow:2; uint8_t terminates:2; - uint8_t overlayed:1; + uint8_t nonoverlayed:1; } purity_flags; }; jl_value_t *argescapes; // escape information of call arguments From 0b1be4bc056874224c5a852c890f50243de1e4de Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Thu, 31 Mar 2022 16:28:03 +0900 Subject: [PATCH 113/369] effects: add reflection utility for the new effect analysis (#44785) This commit adds new reflection utility named `Base.infer_effects` that works in the same way as `Base.return_types` but returns inferred effects instead. It would be helpful to test that certain method call has an expected effects. For example, we can now remove `Base.@pure` annotation from the definition of `BroadcastStyle(a::A, b::B) where {A<:AbstractArrayStyle{M},B<:AbstractArrayStyle{N}} where {M,N}` and checks it's still eligible for concrete evaluation like this (see for the context): ```julia julia> import Base.Broadcast: AbstractArrayStyle, DefaultArrayStyle, Unknown julia> function BroadcastStyle(a::A, b::B) where {A<:AbstractArrayStyle{M},B<:AbstractArrayStyle{N}} where {M,N} if Base.typename(A) === Base.typename(B) return A(Val(max(M, N))) end return Unknown() end BroadcastStyle (generic function with 1 method) julia> # test that the above definition is eligible for concrete evaluation @test Base.infer_effects(BroadcastStyle, (DefaultArrayStyle{1},DefaultArrayStyle{2},)) |> Core.Compiler.is_total_or_error Test Passed ``` Co-authored-by: Takafumi Arakaki --- base/compiler/abstractinterpretation.jl | 4 ++-- base/compiler/typeinfer.jl | 15 +++++++++--- base/compiler/types.jl | 20 ++++++++++------ base/reflection.jl | 29 ++++++++++++++++++++++ test/reflection.jl | 32 +++++++++++++++++++++++++ 5 files changed, 88 insertions(+), 12 deletions(-) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index 06d1a2c7d3e58..aea731c43d1dc 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -40,7 +40,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), # aren't any in the throw block either to enable other optimizations. add_remark!(interp, sv, "Skipped call in throw block") nonoverlayed = false - if isoverlayed(method_table(interp)) && sv.ipo_effects.nonoverlayed + if isoverlayed(method_table(interp)) && is_nonoverlayed(sv.ipo_effects) # as we may want to concrete-evaluate this frame in cases when there are # no overlayed calls, try an additional effort now to check if this call # isn't overlayed rather than just handling it conservatively @@ -702,7 +702,7 @@ function concrete_eval_eligible(interp::AbstractInterpreter, @nospecialize(f), result::MethodCallResult, arginfo::ArgInfo, sv::InferenceState) # disable concrete-evaluation since this function call is tainted by some overlayed # method and currently there is no direct way to execute overlayed methods - isoverlayed(method_table(interp)) && !result.edge_effects.nonoverlayed && return false + isoverlayed(method_table(interp)) && !is_nonoverlayed(result.edge_effects) && return false return f !== nothing && result.edge !== nothing && is_total_or_error(result.edge_effects) && diff --git a/base/compiler/typeinfer.jl b/base/compiler/typeinfer.jl index c72d03a226472..7f7770e6f9f4b 100644 --- a/base/compiler/typeinfer.jl +++ b/base/compiler/typeinfer.jl @@ -891,15 +891,24 @@ end # compute an inferred AST and return type function typeinf_code(interp::AbstractInterpreter, method::Method, @nospecialize(atype), sparams::SimpleVector, run_optimizer::Bool) + frame = typeinf_frame(interp, method, atype, sparams, run_optimizer) + frame === nothing && return nothing, Any + frame.inferred || return nothing, Any + code = frame.src + rt = widenconst(ignorelimited(frame.result.result)) + return code, rt +end + +# compute an inferred frame +function typeinf_frame(interp::AbstractInterpreter, method::Method, @nospecialize(atype), sparams::SimpleVector, run_optimizer::Bool) mi = specialize_method(method, atype, sparams)::MethodInstance ccall(:jl_typeinf_begin, Cvoid, ()) result = InferenceResult(mi) frame = InferenceState(result, run_optimizer ? :global : :no, interp) - frame === nothing && return (nothing, Any) + frame === nothing && return nothing typeinf(interp, frame) ccall(:jl_typeinf_end, Cvoid, ()) - frame.inferred || return (nothing, Any) - return (frame.src, widenconst(ignorelimited(result.result))) + return frame end # compute (and cache) an inferred AST and return type diff --git a/base/compiler/types.jl b/base/compiler/types.jl index 492cc22dfe3e1..b5ae060dd5394 100644 --- a/base/compiler/types.jl +++ b/base/compiler/types.jl @@ -79,19 +79,25 @@ function Effects(e::Effects = EFFECTS_UNKNOWN′; inbounds_taints_consistency) end +is_consistent(effects::Effects) = effects.consistent === ALWAYS_TRUE +is_effect_free(effects::Effects) = effects.effect_free === ALWAYS_TRUE +is_nothrow(effects::Effects) = effects.nothrow === ALWAYS_TRUE +is_terminates(effects::Effects) = effects.terminates === ALWAYS_TRUE +is_nonoverlayed(effects::Effects) = effects.nonoverlayed + is_total_or_error(effects::Effects) = - effects.consistent === ALWAYS_TRUE && - effects.effect_free === ALWAYS_TRUE && - effects.terminates === ALWAYS_TRUE + is_consistent(effects) && + is_effect_free(effects) && + is_terminates(effects) is_total(effects::Effects) = is_total_or_error(effects) && - effects.nothrow === ALWAYS_TRUE + is_nothrow(effects) is_removable_if_unused(effects::Effects) = - effects.effect_free === ALWAYS_TRUE && - effects.terminates === ALWAYS_TRUE && - effects.nothrow === ALWAYS_TRUE + is_effect_free(effects) && + is_terminates(effects) && + is_nothrow(effects) function encode_effects(e::Effects) return (e.consistent.state << 0) | diff --git a/base/reflection.jl b/base/reflection.jl index 484dc8b586664..d15b3e84cc43d 100644 --- a/base/reflection.jl +++ b/base/reflection.jl @@ -1306,6 +1306,35 @@ function return_types(@nospecialize(f), @nospecialize(types=default_tt(f)); return rt end +function infer_effects(@nospecialize(f), @nospecialize(types=default_tt(f)); + world = get_world_counter(), + interp = Core.Compiler.NativeInterpreter(world)) + ccall(:jl_is_in_pure_context, Bool, ()) && error("code reflection cannot be used from generated functions") + types = to_tuple_type(types) + if isa(f, Core.Builtin) + args = Any[types.parameters...] + rt = Core.Compiler.builtin_tfunction(interp, f, args, nothing) + return Core.Compiler.builtin_effects(f, args, rt) + else + effects = Core.Compiler.EFFECTS_TOTAL + matches = _methods(f, types, -1, world)::Vector + if isempty(matches) + # although this call is known to throw MethodError (thus `nothrow=ALWAYS_FALSE`), + # still mark it `TRISTATE_UNKNOWN` just in order to be consistent with a result + # derived by the effect analysis, which can't prove guaranteed throwness at this moment + return Core.Compiler.Effects(effects; nothrow=Core.Compiler.TRISTATE_UNKNOWN) + end + for match in matches + match = match::Core.MethodMatch + frame = Core.Compiler.typeinf_frame(interp, + match.method, match.spec_types, match.sparams, #=run_optimizer=#false) + frame === nothing && return Core.Compiler.Effects() + effects = Core.Compiler.tristate_merge(effects, frame.ipo_effects) + end + return effects + end +end + """ print_statement_costs(io::IO, f, types) diff --git a/test/reflection.jl b/test/reflection.jl index b1a5b6eb822a3..10973f4679380 100644 --- a/test/reflection.jl +++ b/test/reflection.jl @@ -964,3 +964,35 @@ end @eval m f4(a) = return @test Base.default_tt(m.f4) == Tuple end + +Base.@assume_effects :terminates_locally function issue41694(x::Int) + res = 1 + 1 < x < 20 || throw("bad") + while x > 1 + res *= x + x -= 1 + end + return res +end +maybe_effectful(x::Int) = 42 +maybe_effectful(x::Any) = unknown_operation() +function f_no_methods end + +@testset "infer_effects" begin + @test Base.infer_effects(issue41694, (Int,)) |> Core.Compiler.is_terminates + @test Base.infer_effects((Int,)) do x + issue41694(x) + end |> Core.Compiler.is_terminates + @test Base.infer_effects(issue41694) |> Core.Compiler.is_terminates # use `default_tt` + let effects = Base.infer_effects(maybe_effectful, (Any,)) # union split + @test !Core.Compiler.is_consistent(effects) + @test !Core.Compiler.is_effect_free(effects) + @test !Core.Compiler.is_nothrow(effects) + @test !Core.Compiler.is_terminates(effects) + @test !Core.Compiler.is_nonoverlayed(effects) + end + @test Base.infer_effects(f_no_methods) |> !Core.Compiler.is_nothrow + # builtins + @test Base.infer_effects(typeof, (Any,)) |> Core.Compiler.is_total + @test Base.infer_effects(===, (Any,Any)) |> Core.Compiler.is_total +end From 1693503783d137ef08ededcef9ad397a188f6091 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Fri, 1 Apr 2022 10:01:45 +0900 Subject: [PATCH 114/369] follow up #44786, fix `findsup` to return correct `overlayed` value (#44804) --- base/compiler/methodtable.jl | 6 +++--- test/compiler/AbstractInterpreter.jl | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/base/compiler/methodtable.jl b/base/compiler/methodtable.jl index f2e7a4ec2cb2c..7aa686009c1af 100644 --- a/base/compiler/methodtable.jl +++ b/base/compiler/methodtable.jl @@ -104,12 +104,12 @@ In both cases `nothing` is returned. `overlayed` indicates if any of the matching methods comes from an overlayed method table. """ function findsup(@nospecialize(sig::Type), table::InternalMethodTable) - return (_findsup(sig, nothing, table.world)..., true) + return (_findsup(sig, nothing, table.world)..., false) end function findsup(@nospecialize(sig::Type), table::OverlayMethodTable) match, valid_worlds = _findsup(sig, table.mt, table.world) - match !== nothing && return match, valid_worlds, false + match !== nothing && return match, valid_worlds, true # fall back to the internal method table fallback_match, fallback_valid_worlds = _findsup(sig, nothing, table.world) return ( @@ -117,7 +117,7 @@ function findsup(@nospecialize(sig::Type), table::OverlayMethodTable) WorldRange( max(valid_worlds.min_world, fallback_valid_worlds.min_world), min(valid_worlds.max_world, fallback_valid_worlds.max_world)), - true) + false) end function _findsup(@nospecialize(sig::Type), mt::Union{Nothing,Core.MethodTable}, world::UInt) diff --git a/test/compiler/AbstractInterpreter.jl b/test/compiler/AbstractInterpreter.jl index 8d5a50112cbf9..9d1be42891042 100644 --- a/test/compiler/AbstractInterpreter.jl +++ b/test/compiler/AbstractInterpreter.jl @@ -43,6 +43,8 @@ CC.method_table(interp::MTOverlayInterp) = CC.OverlayMethodTable(CC.get_world_co strangesin(x) = sin(x) @overlay OverlayedMT strangesin(x::Float64) = iszero(x) ? nothing : cos(x) + +# inference should use the overlayed method table @test Base.return_types((Float64,); interp=MTOverlayInterp()) do x strangesin(x) end |> only === Union{Float64,Nothing} @@ -50,6 +52,22 @@ end |> only === Union{Float64,Nothing} Base.@invoke strangesin(x::Float64) end |> only === Union{Float64,Nothing} +# effect analysis should figure out that the overlayed method is used +@test Base.infer_effects((Float64,); interp=MTOverlayInterp()) do x + strangesin(x) +end |> !Core.Compiler.is_nonoverlayed +@test Base.infer_effects((Any,); interp=MTOverlayInterp()) do x + Base.@invoke strangesin(x::Float64) +end |> !Core.Compiler.is_nonoverlayed + +# but it should never apply for the native compilation +@test Base.infer_effects((Float64,)) do x + strangesin(x) +end |> Core.Compiler.is_nonoverlayed +@test Base.infer_effects((Any,)) do x + Base.@invoke strangesin(x::Float64) +end |> Core.Compiler.is_nonoverlayed + # fallback to the internal method table @test Base.return_types((Int,); interp=MTOverlayInterp()) do x cos(x) From 5ff15cbe319c58c476a6004dc074a61e236f3dce Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Fri, 1 Apr 2022 13:54:43 +0900 Subject: [PATCH 115/369] effects: replaces usages of `ALWAYS_FALSE` with `TRISTATE_UNKNOWN` (#44808) Although they are basically equivalent in the current implementation, it would be more correct conceptually if we propagate `TRISTATE_UNKNOWN` instead of `ALWAYS_TRUE`, as it is hard or impossible to derive a global conclusion from a local analysis on each statement in most places. This commit also adds a docstring that simply explains the design of the effect analysis. --- base/compiler/abstractinterpretation.jl | 18 ++++++++------- base/compiler/tfuncs.jl | 8 +++---- base/compiler/types.jl | 30 ++++++++++++++++++++++++- 3 files changed, 43 insertions(+), 13 deletions(-) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index aea731c43d1dc..5252e41244ccc 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -1858,7 +1858,7 @@ function abstract_eval_statement(interp::AbstractInterpreter, @nospecialize(e), t = Bottom tristate_merge!(sv, Effects(EFFECTS_TOTAL; # consistent = ALWAYS_TRUE, # N.B depends on !ismutabletype(t) above - nothrow = ALWAYS_FALSE)) + nothrow = TRISTATE_UNKNOWN)) @goto t_computed elseif !isa(at, Const) allconst = false @@ -1887,8 +1887,8 @@ function abstract_eval_statement(interp::AbstractInterpreter, @nospecialize(e), is_nothrow = false end tristate_merge!(sv, Effects(EFFECTS_TOTAL; - consistent = !ismutabletype(t) ? ALWAYS_TRUE : ALWAYS_FALSE, - nothrow = is_nothrow ? ALWAYS_TRUE : ALWAYS_FALSE)) + consistent = !ismutabletype(t) ? ALWAYS_TRUE : TRISTATE_UNKNOWN, + nothrow = is_nothrow ? ALWAYS_TRUE : TRISTATE_UNKNOWN)) elseif ehead === :splatnew t, isexact = instanceof_tfunc(abstract_eval_value(interp, e.args[1], vtypes, sv)) is_nothrow = false # TODO: More precision @@ -1906,8 +1906,8 @@ function abstract_eval_statement(interp::AbstractInterpreter, @nospecialize(e), end end tristate_merge!(sv, Effects(EFFECTS_TOTAL; - consistent = ismutabletype(t) ? ALWAYS_FALSE : ALWAYS_TRUE, - nothrow = is_nothrow ? ALWAYS_TRUE : ALWAYS_FALSE)) + consistent = ismutabletype(t) ? TRISTATE_UNKNOWN : ALWAYS_TRUE, + nothrow = is_nothrow ? ALWAYS_TRUE : TRISTATE_UNKNOWN)) elseif ehead === :new_opaque_closure tristate_merge!(sv, Effects()) # TODO t = Union{} @@ -2031,9 +2031,11 @@ function abstract_eval_global(M::Module, s::Symbol, frame::InferenceState) ty = abstract_eval_global(M, s) isa(ty, Const) && return ty if isdefined(M,s) - tristate_merge!(frame, Effects(EFFECTS_TOTAL; consistent=ALWAYS_FALSE)) + tristate_merge!(frame, Effects(EFFECTS_TOTAL; consistent=TRISTATE_UNKNOWN)) else - tristate_merge!(frame, Effects(EFFECTS_TOTAL; consistent=ALWAYS_FALSE, nothrow=ALWAYS_FALSE)) + tristate_merge!(frame, Effects(EFFECTS_TOTAL; + consistent=TRISTATE_UNKNOWN, + nothrow=TRISTATE_UNKNOWN)) end return ty end @@ -2284,7 +2286,7 @@ function typeinf_local(interp::AbstractInterpreter, frame::InferenceState) changes = StateUpdate(lhs, VarState(t, false), changes, false) elseif isa(lhs, GlobalRef) tristate_merge!(frame, Effects(EFFECTS_TOTAL; - effect_free=ALWAYS_FALSE, + effect_free=TRISTATE_UNKNOWN, nothrow=TRISTATE_UNKNOWN)) elseif !isa(lhs, SSAValue) tristate_merge!(frame, EFFECTS_UNKNOWN) diff --git a/base/compiler/tfuncs.jl b/base/compiler/tfuncs.jl index a92a2bc977262..23a18ae8d8aeb 100644 --- a/base/compiler/tfuncs.jl +++ b/base/compiler/tfuncs.jl @@ -1786,8 +1786,8 @@ function builtin_effects(f::Builtin, argtypes::Vector{Any}, rt) effect_free = contains_is(_EFFECT_FREE_BUILTINS, f) || contains_is(_PURE_BUILTINS, f) return Effects(EFFECTS_TOTAL; - consistent = ipo_consistent ? ALWAYS_TRUE : ALWAYS_FALSE, - effect_free = effect_free ? ALWAYS_TRUE : ALWAYS_FALSE, + consistent = ipo_consistent ? ALWAYS_TRUE : TRISTATE_UNKNOWN, + effect_free = effect_free ? ALWAYS_TRUE : TRISTATE_UNKNOWN, nothrow = nothrow ? ALWAYS_TRUE : TRISTATE_UNKNOWN) end @@ -1964,8 +1964,8 @@ function intrinsic_effects(f::IntrinsicFunction, argtypes::Vector{Any}) nothrow = !isvarargtype(argtypes[end]) && intrinsic_nothrow(f, argtypes[2:end]) return Effects(EFFECTS_TOTAL; - consistent = ipo_consistent ? ALWAYS_TRUE : ALWAYS_FALSE, - effect_free = effect_free ? ALWAYS_TRUE : ALWAYS_FALSE, + consistent = ipo_consistent ? ALWAYS_TRUE : TRISTATE_UNKNOWN, + effect_free = effect_free ? ALWAYS_TRUE : TRISTATE_UNKNOWN, nothrow = nothrow ? ALWAYS_TRUE : TRISTATE_UNKNOWN) end diff --git a/base/compiler/types.jl b/base/compiler/types.jl index b5ae060dd5394..94b6a1c4c8743 100644 --- a/base/compiler/types.jl +++ b/base/compiler/types.jl @@ -33,6 +33,34 @@ function tristate_merge(old::TriState, new::TriState) return new end +""" + effects::Effects + +Represents computational effects of a method call. + +The effects are composed of the following set of different properties: +- `effects.consistent::TriState`: this method is guaranteed to return or terminate consistently +- `effect_free::TriState`: this method is free from externally semantically visible side effects +- `nothrow::TriState`: this method is guaranteed to not throw an exception +- `terminates::TriState`: this method is guaranteed to terminate +- `nonoverlayed::Bool`: indicates that any methods that may be called within this method + are not defined in an [overlayed method table](@ref OverlayMethodTable) +See [`Base.@assume_effects`](@ref) for more detailed explanation on the definitions of these properties. + +Along the abstract interpretation, `Effects` at each statement are analyzed locally and +they are merged into the single global `Effects` that represents the entire effects of +the analyzed method (see `tristate_merge!`). +Each effect property is represented as tri-state and managed separately. +The tri-state consists of `ALWAYS_TRUE`, `TRISTATE_UNKNOWN` and `ALWAYS_FALSE`. +An effect property is initialized with `ALWAYS_TRUE` and then transitioned towards +`TRISTATE_UNKNOWN` or `ALWAYS_FALSE`. When we find a statement that has some effect, +`ALWAYS_TRUE` is propagated if that effect is known to _always_ happen, otherwise +`TRISTATE_UNKNOWN` is propagated. If a property is known to be `ALWAYS_FALSE`, +there is no need to do additional analysis as it can not be refined anyway. +Note that however, within the current data-flow analysis design, it is hard to derive a global +conclusion from a local analysis on each statement, and as a result, the effect analysis +usually propagates `TRISTATE_UNKNOWN` currently. +""" struct Effects consistent::TriState effect_free::TriState @@ -59,7 +87,7 @@ function Effects( end const EFFECTS_TOTAL = Effects(ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, true) -const EFFECTS_THROWS = Effects(ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_FALSE, ALWAYS_TRUE, true) +const EFFECTS_THROWS = Effects(ALWAYS_TRUE, ALWAYS_TRUE, TRISTATE_UNKNOWN, ALWAYS_TRUE, true) const EFFECTS_UNKNOWN = Effects(TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, true) # mostly unknown, but it's not overlayed at least (e.g. it's not a call) const EFFECTS_UNKNOWN′ = Effects(TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, false) # unknown, really From 87ea300f25ceefbec30e9d9d0ebfb2b51e9a5042 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Sat, 2 Apr 2022 07:39:36 +0900 Subject: [PATCH 116/369] add new `:total_may_throw` utility setting for `@assume_effects` (#44775) This setting is particularly useful since it allows the compiler to evaluate a call of the applied method when all the call arguments are fully known, no matter if the call results in an error or not. This commit also adds some more explanations on the difference between `@pure` and `@assume_effects`. --- base/compiler/abstractinterpretation.jl | 2 +- base/compiler/types.jl | 4 +- base/expr.jl | 61 +++++++++++++++++++++---- test/compiler/inline.jl | 6 +-- 4 files changed, 59 insertions(+), 14 deletions(-) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index 5252e41244ccc..1b7a02dbb01f9 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -705,7 +705,7 @@ function concrete_eval_eligible(interp::AbstractInterpreter, isoverlayed(method_table(interp)) && !is_nonoverlayed(result.edge_effects) && return false return f !== nothing && result.edge !== nothing && - is_total_or_error(result.edge_effects) && + is_concrete_eval_eligible(result.edge_effects) && is_all_const_arg(arginfo) end diff --git a/base/compiler/types.jl b/base/compiler/types.jl index 94b6a1c4c8743..75c2da979179d 100644 --- a/base/compiler/types.jl +++ b/base/compiler/types.jl @@ -113,13 +113,13 @@ is_nothrow(effects::Effects) = effects.nothrow === ALWAYS_TRUE is_terminates(effects::Effects) = effects.terminates === ALWAYS_TRUE is_nonoverlayed(effects::Effects) = effects.nonoverlayed -is_total_or_error(effects::Effects) = +is_concrete_eval_eligible(effects::Effects) = is_consistent(effects) && is_effect_free(effects) && is_terminates(effects) is_total(effects::Effects) = - is_total_or_error(effects) && + is_concrete_eval_eligible(effects) && is_nothrow(effects) is_removable_if_unused(effects::Effects) = diff --git a/base/expr.jl b/base/expr.jl index 38e89d284c989..9e603885a0037 100644 --- a/base/expr.jl +++ b/base/expr.jl @@ -337,12 +337,17 @@ end """ @pure ex - @pure(ex) `@pure` gives the compiler a hint for the definition of a pure function, helping for type inference. -This macro is intended for internal compiler use and may be subject to changes. +!!! warning + This macro is intended for internal compiler use and may be subject to changes. + +!!! warning + In Julia 1.8 and higher, it is favorable to use [`@assume_effects`](@ref) instead of `@pure`. + This is because `@assume_effects` allows a finer grained control over Julia's purity + modeling and the effect system enables a wider range of optimizations. """ macro pure(ex) esc(isa(ex, Expr) ? pushmeta!(ex, :pure) : ex) @@ -350,7 +355,6 @@ end """ @constprop setting ex - @constprop(setting, ex) `@constprop` controls the mode of interprocedural constant propagation for the annotated function. Two `setting`s are supported: @@ -373,11 +377,35 @@ end """ @assume_effects setting... ex - @assume_effects(setting..., ex) `@assume_effects` overrides the compiler's effect modeling for the given method. `ex` must be a method definition or `@ccall` expression. +```jldoctest +julia> Base.@assume_effects :terminates_locally function pow(x) + # this :terminates_locally allows `pow` to be constant-folded + res = 1 + 1 < x < 20 || error("bad pow") + while x > 1 + res *= x + x -= 1 + end + return res + end +pow (generic function with 1 method) + +julia> code_typed() do + pow(12) + end +1-element Vector{Any}: + CodeInfo( +1 ─ return 479001600 +) => Int64 + +julia> Base.@assume_effects :total_may_throw @ccall jl_type_intersection(Vector{Int}::Any, Vector{<:Integer}::Any)::Any +Vector{Int64} (alias for Array{Int64, 1}) +``` + !!! warning Improper use of this macro causes undefined behavior (including crashes, incorrect answers, or other hard to track bugs). Use with care and only if @@ -512,11 +540,26 @@ This `setting` combines the following other assertions: - `:terminates_globally` and is a convenient shortcut. +--- +# `:total_may_throw` + +This `setting` combines the following other assertions: +- `:consistent` +- `:effect_free` +- `:terminates_globally` +and is a convenient shortcut. + !!! note - `@assume_effects :total` is similar to `@Base.pure` with the primary + This setting is particularly useful since it allows the compiler to evaluate a call of + the applied method when all the call arguments are fully known to be constant, no matter + if the call results in an error or not. + + `@assume_effects :total_may_throw` is similar to [`@pure`](@ref) with the primary distinction that the `:consistent`-cy requirement applies world-age wise rather than globally as described above. However, in particular, a method annotated - `@Base.pure` is always `:total`. + `@pure` should always be `:total` or `:total_may_throw`. + Another advantage is that effects introduced by `@assume_effects` are propagated to + callers interprocedurally while a purity defined by `@pure` is not. """ macro assume_effects(args...) (consistent, effect_free, nothrow, terminates_globally, terminates_locally) = @@ -537,12 +580,14 @@ macro assume_effects(args...) terminates_locally = true elseif setting === :total consistent = effect_free = nothrow = terminates_globally = true + elseif setting === :total_may_throw + consistent = effect_free = terminates_globally = true else throw(ArgumentError("@assume_effects $setting not supported")) end end ex = args[end] - isa(ex, Expr) || throw(ArgumentError("Bad expression `$ex` in @constprop [settings] ex")) + isa(ex, Expr) || throw(ArgumentError("Bad expression `$ex` in `@assume_effects [settings] ex`")) if ex.head === :macrocall && ex.args[1] == Symbol("@ccall") ex.args[1] = GlobalRef(Base, Symbol("@ccall_effects")) insert!(ex.args, 3, Core.Compiler.encode_effects_override(Core.Compiler.EffectsOverride( @@ -725,7 +770,7 @@ end """ @generated f - @generated(f) + `@generated` is used to annotate a function which will be generated. In the body of the generated function, only types of arguments can be read (not the values). The function returns a quoted expression evaluated when the diff --git a/test/compiler/inline.jl b/test/compiler/inline.jl index 59604bd317f2e..c3a8499b621a5 100644 --- a/test/compiler/inline.jl +++ b/test/compiler/inline.jl @@ -1088,11 +1088,11 @@ recur_termination22(x) = x * recur_termination21(x-1) recur_termination21(12) + recur_termination22(12) end -const ___CONST_DICT___ = Dict{Any,Any}(:a => 1, :b => 2) -Base.@assume_effects :consistent :effect_free :terminates_globally consteval( +const ___CONST_DICT___ = Dict{Any,Any}(Symbol(c) => i for (i, c) in enumerate('a':'z')) +Base.@assume_effects :total_may_throw concrete_eval( f, args...; kwargs...) = f(args...; kwargs...) @test fully_eliminated() do - consteval(getindex, ___CONST_DICT___, :a) + concrete_eval(getindex, ___CONST_DICT___, :a) end # https://github.com/JuliaLang/julia/issues/44732 From 520c089b2b81e6f5754acd1613534506272490bf Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Fri, 8 Apr 2022 10:42:38 +0900 Subject: [PATCH 117/369] remove `isvarargtype` assertions from `subtype` and `intersect` (#44761) fix #44735 --- base/reflection.jl | 4 ++-- src/subtype.c | 2 -- test/subtype.jl | 6 ++++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/base/reflection.jl b/base/reflection.jl index d15b3e84cc43d..223d5fab040e3 100644 --- a/base/reflection.jl +++ b/base/reflection.jl @@ -675,12 +675,12 @@ struct type with no fields. issingletontype(@nospecialize(t)) = (@_pure_meta; isa(t, DataType) && isdefined(t, :instance)) """ - typeintersect(T, S) + typeintersect(T::Type, S::Type) Compute a type that contains the intersection of `T` and `S`. Usually this will be the smallest such type or one close to it. """ -typeintersect(@nospecialize(a), @nospecialize(b)) = (@_pure_meta; ccall(:jl_type_intersection, Any, (Any, Any), a, b)) +typeintersect(@nospecialize(a), @nospecialize(b)) = (@_pure_meta; ccall(:jl_type_intersection, Any, (Any, Any), a::Type, b::Type)) morespecific(@nospecialize(a), @nospecialize(b)) = ccall(:jl_type_morespecific, Cint, (Any, Any), a, b) != 0 diff --git a/src/subtype.c b/src/subtype.c index eb668645552d7..c43d307e6d421 100644 --- a/src/subtype.c +++ b/src/subtype.c @@ -1258,7 +1258,6 @@ static int subtype(jl_value_t *x, jl_value_t *y, jl_stenv_t *e, int param) } if (jl_is_unionall(y)) return subtype_unionall(x, (jl_unionall_t*)y, e, 1, param); - assert(!jl_is_vararg(x) && !jl_is_vararg(y)); if (jl_is_datatype(x) && jl_is_datatype(y)) { if (x == y) return 1; if (y == (jl_value_t*)jl_any_type) return 1; @@ -3107,7 +3106,6 @@ static jl_value_t *intersect(jl_value_t *x, jl_value_t *y, jl_stenv_t *e, int pa } if (jl_is_unionall(y)) return intersect_unionall(x, (jl_unionall_t*)y, e, 1, param); - assert(!jl_is_vararg(x) && !jl_is_vararg(y)); if (jl_is_datatype(x) && jl_is_datatype(y)) { jl_datatype_t *xd = (jl_datatype_t*)x, *yd = (jl_datatype_t*)y; if (param < 2) { diff --git a/test/subtype.jl b/test/subtype.jl index 3eca685aee84c..eff2c021b481f 100644 --- a/test/subtype.jl +++ b/test/subtype.jl @@ -1976,3 +1976,9 @@ end @testintersect(Tuple{Type{Pair{_A, S} where S<:AbstractArray{<:_A, 2}}, Dict} where _A, Tuple{Type{Pair{_A, S} where S<:AbstractArray{<:_A, 2}} where _A, Union{Array, Pair}}, Bottom) + +# https://github.com/JuliaLang/julia/issues/44735 +@test_throws TypeError(:typeassert, Type, Vararg{Int}) typeintersect(Vararg{Int}, Int) +@test_throws TypeError(:typeassert, Type, Vararg{Int}) typeintersect(Int, Vararg{Int}) +@test_throws TypeError(:typeassert, Type, 1) typeintersect(1, Int) +@test_throws TypeError(:typeassert, Type, 1) typeintersect(Int, 1) From 27fc73ef84501d4bd0ef432af37efb1e8cd896f7 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki Date: Wed, 13 Apr 2022 16:20:55 +0900 Subject: [PATCH 118/369] inference: properly compare vararg-tuple `PartialStruct`s fix #44965 --- base/compiler/typelimits.jl | 2 +- test/compiler/inference.jl | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/base/compiler/typelimits.jl b/base/compiler/typelimits.jl index d25c77deb6d2e..2c5adb92e5a09 100644 --- a/base/compiler/typelimits.jl +++ b/base/compiler/typelimits.jl @@ -313,7 +313,7 @@ function issimplertype(@nospecialize(typea), @nospecialize(typeb)) if typea isa PartialStruct aty = widenconst(typea) for i = 1:length(typea.fields) - ai = typea.fields[i] + ai = unwrapva(typea.fields[i]) bi = fieldtype(aty, i) is_lattice_equal(ai, bi) && continue tni = _typename(widenconst(ai)) diff --git a/test/compiler/inference.jl b/test/compiler/inference.jl index bf4f8391012b7..9624c35bac13d 100644 --- a/test/compiler/inference.jl +++ b/test/compiler/inference.jl @@ -4056,6 +4056,11 @@ end @test !Core.Compiler.builtin_nothrow(Core.get_binding_type, Any[Rational{Int}, Core.Const(:foo)], Any) +# https://github.com/JuliaLang/julia/issues/44965 +let t = Core.Compiler.tuple_tfunc(Any[Core.Const(42), Vararg{Any}]) + @test Core.Compiler.issimplertype(t, t) +end + # https://github.com/JuliaLang/julia/issues/44763 global x44763::Int = 0 increase_x44763!(n) = (global x44763; x44763 += n) From 72f36437efb5a38bd90907569d03429155b175fc Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki Date: Wed, 13 Apr 2022 16:22:32 +0900 Subject: [PATCH 119/369] inference: more `Vararg` handling Just found this case from code review, but this `Vararg` should be widened. --- base/compiler/abstractinterpretation.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index 1b7a02dbb01f9..cf483b4f4ff73 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -1270,7 +1270,6 @@ function abstract_apply(interp::AbstractInterpreter, argtypes::Vector{Any}, sv:: # This is vararg, we're not gonna be able to do any inling, # drop the info info = nothing - tail = tuple_tail_elem(unwrapva(ct[end]), cti) push!(ctypes´, push!(ct[1:(end - 1)], tail)) else @@ -1290,8 +1289,9 @@ function abstract_apply(interp::AbstractInterpreter, argtypes::Vector{Any}, sv:: lct = length(ct) # truncate argument list at the first Vararg for i = 1:lct-1 - if isvarargtype(ct[i]) - ct[i] = tuple_tail_elem(ct[i], ct[(i+1):lct]) + cti = ct[i] + if isvarargtype(cti) + ct[i] = tuple_tail_elem(unwrapva(cti), ct[(i+1):lct]) resize!(ct, i) break end From 9d56f9a4cfbdf2826c2a1f7ca4387553963489cb Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Tue, 19 Apr 2022 10:54:36 +0900 Subject: [PATCH 120/369] inference: don't forget to add backedge for effect-free frame (#45017) Now our abstract interpretation system caches two separate lattice properties return type and call effects, and the previous optimization to avoid adding backedge for a frame whose return type is `Any` turns out to be insufficient -- now we also need to make sure that the inferred effects don't provide any useful IPO information. Example: ```julia julia> const CONST_DICT = let d = Dict() for c in 'A':'z' push!(d, c => Int(c)) end d end; julia> Base.@assume_effects :total_may_throw getcharid(c) = CONST_DICT[c]; julia> @noinline callf(f, args...) = f(args...); julia> function entry_to_be_invalidated(c) return callf(getcharid, c) end; julia> @test Base.infer_effects((Char,)) do x entry_to_be_invalidated(x) end |> Core.Compiler.is_concrete_eval_eligible Test Passed julia> @test fully_eliminated(; retval=97) do entry_to_be_invalidated('a') end Test Passed julia> getcharid(c) = CONST_DICT[c]; # now this is not eligible for concrete evaluation julia> @test Base.infer_effects((Char,)) do x entry_to_be_invalidated(x) end |> !Core.Compiler.is_concrete_eval_eligible Test Failed at REPL[10]:1 Expression: Base.infer_effects((Char,)) do x entry_to_be_invalidated(x) end |> !(Core.Compiler.is_concrete_eval_eligible) ERROR: There was an error during testing julia> @test !fully_eliminated() do entry_to_be_invalidated('a') end Test Failed at REPL[11]:1 Expression: !(fully_eliminated() do entry_to_be_invalidated('a') end) ERROR: There was an error during testing ``` --- base/compiler/abstractinterpretation.jl | 32 +++++++++++++++---------- test/compiler/inference.jl | 28 ++++++++++++++++++++++ 2 files changed, 48 insertions(+), 12 deletions(-) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index cf483b4f4ff73..b65a9751d394f 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -78,17 +78,19 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), any_const_result = false const_results = Union{InferenceResult,Nothing,ConstResult}[] multiple_matches = napplicable > 1 + fargs = arginfo.fargs + all_effects = EFFECTS_TOTAL if !matches.nonoverlayed # currently we don't have a good way to execute the overlayed method definition, # so we should give up pure/concrete eval when any of the matched methods is overlayed f = nothing - tristate_merge!(sv, Effects(EFFECTS_TOTAL; nonoverlayed=false)) + all_effects = Effects(all_effects; nonoverlayed=false) end + # try pure-evaluation val = pure_eval_call(interp, f, applicable, arginfo, sv) val !== nothing && return CallMeta(val, MethodResultPure(info)) # TODO: add some sort of edge(s) - fargs = arginfo.fargs for i in 1:napplicable match = applicable[i]::MethodMatch method = match.method @@ -124,7 +126,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), (; effects, const_result) = const_call_result end end - tristate_merge!(sv, effects) + all_effects = tristate_merge(all_effects, effects) push!(const_results, const_result) any_const_result |= const_result !== nothing this_rt = tmerge(this_rt, rt) @@ -173,7 +175,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), (; effects, const_result) = const_call_result end end - tristate_merge!(sv, effects) + all_effects = tristate_merge(all_effects, effects) push!(const_results, const_result) any_const_result |= const_result !== nothing end @@ -204,11 +206,11 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), if seen != napplicable # there may be unanalyzed effects within unseen dispatch candidate, # but we can still ignore nonoverlayed effect here since we already accounted for it - tristate_merge!(sv, EFFECTS_UNKNOWN) + all_effects = tristate_merge(all_effects, EFFECTS_UNKNOWN) elseif isa(matches, MethodMatches) ? (!matches.fullmatch || any_ambig(matches)) : (!_all(b->b, matches.fullmatches) || any_ambig(matches)) # Account for the fact that we may encounter a MethodError with a non-covered or ambiguous signature. - tristate_merge!(sv, Effects(EFFECTS_TOTAL; nothrow=TRISTATE_UNKNOWN)) + all_effects = Effects(all_effects; nothrow=TRISTATE_UNKNOWN) end rettype = from_interprocedural!(rettype, sv, arginfo, conditionals) @@ -223,13 +225,14 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), # and avoid keeping track of a more complex result type. rettype = Any end - add_call_backedges!(interp, rettype, edges, matches, atype, sv) + add_call_backedges!(interp, rettype, all_effects, edges, matches, atype, sv) if !isempty(sv.pclimitations) # remove self, if present delete!(sv.pclimitations, sv) for caller in sv.callers_in_cycle delete!(sv.pclimitations, caller) end end + tristate_merge!(sv, all_effects) return CallMeta(rettype, info) end @@ -444,11 +447,16 @@ function conditional_argtype(@nospecialize(rt), @nospecialize(sig), argtypes::Ve end end -function add_call_backedges!(interp::AbstractInterpreter, @nospecialize(rettype), edges::Vector{MethodInstance}, - matches::Union{MethodMatches,UnionSplitMethodMatches}, @nospecialize(atype), - sv::InferenceState) - # for `NativeInterpreter`, we don't add backedges when a new method couldn't refine (widen) this type - rettype === Any && return +function add_call_backedges!(interp::AbstractInterpreter, + @nospecialize(rettype), all_effects::Effects, + edges::Vector{MethodInstance}, matches::Union{MethodMatches,UnionSplitMethodMatches}, @nospecialize(atype), + sv::InferenceState) + if rettype === Any && all_effects === Effects() + # for `NativeInterpreter`, we don't need to add backedges when: + # - a new method couldn't refine (widen) this type and + # - the effects don't provide any useful information for interprocedural optimization + return + end for edge in edges add_backedge!(edge, sv) end diff --git a/test/compiler/inference.jl b/test/compiler/inference.jl index 9624c35bac13d..e36ec80b9e728 100644 --- a/test/compiler/inference.jl +++ b/test/compiler/inference.jl @@ -7,6 +7,8 @@ isdispatchelem(@nospecialize x) = !isa(x, Type) || Core.Compiler.isdispatchelem( using Random, Core.IR using InteractiveUtils: code_llvm +include("irutils.jl") + f39082(x::Vararg{T}) where {T <: Number} = x[1] let ast = only(code_typed(f39082, Tuple{Vararg{Rational}}))[1] @test ast.slottypes == Any[Const(f39082), Tuple{Vararg{Rational}}] @@ -4069,3 +4071,29 @@ invoke44763(x) = Base.@invoke increase_x44763!(x) invoke44763(42) end |> only === Int @test x44763 == 0 + +# backedge insertion for Any-typed, effect-free frame +const CONST_DICT = let d = Dict() + for c in 'A':'z' + push!(d, c => Int(c)) + end + d +end +Base.@assume_effects :total_may_throw getcharid(c) = CONST_DICT[c] +@noinline callf(f, args...) = f(args...) +function entry_to_be_invalidated(c) + return callf(getcharid, c) +end +@test Base.infer_effects((Char,)) do x + entry_to_be_invalidated(x) +end |> Core.Compiler.is_concrete_eval_eligible +@test fully_eliminated(; retval=97) do + entry_to_be_invalidated('a') +end +getcharid(c) = CONST_DICT[c] # now this is not eligible for concrete evaluation +@test Base.infer_effects((Char,)) do x + entry_to_be_invalidated(x) +end |> !Core.Compiler.is_concrete_eval_eligible +@test !fully_eliminated() do + entry_to_be_invalidated('a') +end From d49e0651b46a2ff52608484d868c7e198742803a Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Wed, 16 Mar 2022 05:38:41 -0500 Subject: [PATCH 121/369] Improve inference for string operations (#44500) This reduces invalidations when loading packages that define new AbstractString types. (cherry picked from commit 515a24240fcebc246d2bddbebd91c3800fc1fb3a) --- base/binaryplatforms.jl | 4 ++- base/io.jl | 10 ++++---- base/iostream.jl | 3 ++- base/logging.jl | 2 +- base/process.jl | 25 ++++++++++--------- base/show.jl | 4 +-- base/strings/substring.jl | 13 +++++++++- stdlib/REPL/src/LineEdit.jl | 2 +- stdlib/REPL/src/TerminalMenus/AbstractMenu.jl | 2 +- stdlib/p7zip_jll/src/p7zip_jll.jl | 2 +- 10 files changed, 41 insertions(+), 26 deletions(-) diff --git a/base/binaryplatforms.jl b/base/binaryplatforms.jl index 87c7f029f0563..e2dda00bf58e7 100644 --- a/base/binaryplatforms.jl +++ b/base/binaryplatforms.jl @@ -667,7 +667,7 @@ const libstdcxx_version_mapping = Dict{String,String}( Parses a string platform triplet back into a `Platform` object. """ -function Base.parse(::Type{Platform}, triplet::AbstractString; validate_strict::Bool = false) +function Base.parse(::Type{Platform}, triplet::String; validate_strict::Bool = false) # Helper function to collapse dictionary of mappings down into a regex of # named capture groups joined by "|" operators c(mapping) = string("(",join(["(?<$k>$v)" for (k, v) in mapping], "|"), ")") @@ -751,6 +751,8 @@ function Base.parse(::Type{Platform}, triplet::AbstractString; validate_strict:: end throw(ArgumentError("Platform `$(triplet)` is not an officially supported platform")) end +Base.parse(::Type{Platform}, triplet::AbstractString; kwargs...) = + parse(Platform, convert(String, triplet)::String; kwargs...) function Base.tryparse(::Type{Platform}, triplet::AbstractString) try diff --git a/base/io.jl b/base/io.jl index 69972249be02f..3fac2287bdabf 100644 --- a/base/io.jl +++ b/base/io.jl @@ -445,7 +445,7 @@ wait_close(io::AbstractPipe) = (wait_close(pipe_writer(io)::IO); wait_close(pipe # Exception-safe wrappers (io = open(); try f(io) finally close(io)) -write(filename::AbstractString, a1, args...) = open(io->write(io, a1, args...), filename, "w") +write(filename::AbstractString, a1, args...) = open(io->write(io, a1, args...), convert(String, filename)::String, "w") """ read(filename::AbstractString, args...) @@ -457,9 +457,9 @@ Open a file and read its contents. `args` is passed to `read`: this is equivalen Read the entire contents of a file as a string. """ -read(filename::AbstractString, args...) = open(io->read(io, args...), filename) +read(filename::AbstractString, args...) = open(io->read(io, args...), convert(String, filename)::String) -read(filename::AbstractString, ::Type{T}) where {T} = open(io->read(io, T), filename) +read(filename::AbstractString, ::Type{T}) where {T} = open(io->read(io, T), convert(String, filename)::String) """ read!(stream::IO, array::AbstractArray) @@ -469,7 +469,7 @@ Read binary data from an I/O stream or file, filling in `array`. """ function read! end -read!(filename::AbstractString, a) = open(io->read!(io, a), filename) +read!(filename::AbstractString, a) = open(io->read!(io, a), convert(String, filename)::String) """ readuntil(stream::IO, delim; keep::Bool = false) @@ -496,7 +496,7 @@ julia> readuntil("my_file.txt", '.', keep = true) julia> rm("my_file.txt") ``` """ -readuntil(filename::AbstractString, args...; kw...) = open(io->readuntil(io, args...; kw...), filename) +readuntil(filename::AbstractString, args...; kw...) = open(io->readuntil(io, args...; kw...), convert(String, filename)::String) """ readline(io::IO=stdin; keep::Bool=false) diff --git a/base/iostream.jl b/base/iostream.jl index 0af0e244cf357..23dfb53256e82 100644 --- a/base/iostream.jl +++ b/base/iostream.jl @@ -272,7 +272,7 @@ safe multi-threaded access. !!! compat "Julia 1.5" The `lock` argument is available as of Julia 1.5. """ -function open(fname::AbstractString; lock = true, +function open(fname::String; lock = true, read :: Union{Bool,Nothing} = nothing, write :: Union{Bool,Nothing} = nothing, create :: Union{Bool,Nothing} = nothing, @@ -299,6 +299,7 @@ function open(fname::AbstractString; lock = true, end return s end +open(fname::AbstractString; kwargs...) = open(convert(String, fname)::String; kwargs...) """ open(filename::AbstractString, [mode::AbstractString]; lock = true) -> IOStream diff --git a/base/logging.jl b/base/logging.jl index 9e40f2231b035..1b8e5e0f54192 100644 --- a/base/logging.jl +++ b/base/logging.jl @@ -457,7 +457,7 @@ end msg = try "Exception while generating log record in module $_module at $filepath:$line" catch ex - "Exception handling log message: $ex" + LazyString("Exception handling log message: ", ex) end bt = real ? catch_backtrace() : backtrace() handle_message( diff --git a/base/process.jl b/base/process.jl index cbc251ed6dbca..876eb74fbd413 100644 --- a/base/process.jl +++ b/base/process.jl @@ -74,7 +74,8 @@ function _uv_hook_close(proc::Process) nothing end -const SpawnIOs = Vector{Any} # convenience name for readability +const SpawnIO = Union{IO, RawFD, OS_HANDLE} +const SpawnIOs = Vector{SpawnIO} # convenience name for readability function as_cpumask(cpus::Vector{UInt16}) n = max(Int(maximum(cpus)), Int(ccall(:uv_cpumask_size, Cint, ()))) @@ -129,7 +130,7 @@ end return pp end -_spawn(cmds::AbstractCmd) = _spawn(cmds, Any[]) +_spawn(cmds::AbstractCmd) = _spawn(cmds, SpawnIO[]) # optimization: we can spawn `Cmd` directly without allocating the ProcessChain function _spawn(cmd::Cmd, stdios::SpawnIOs) @@ -213,7 +214,7 @@ end # open the child end of each element of `stdios`, and initialize the parent end function setup_stdios(f, stdios::SpawnIOs) nstdio = length(stdios) - open_io = Vector{Any}(undef, nstdio) + open_io = SpawnIOs(undef, nstdio) close_io = falses(nstdio) try for i in 1:nstdio @@ -324,19 +325,19 @@ close_stdio(stdio) = close(stdio) # - An Filesystem.File or IOStream object to redirect the output to # - A FileRedirect, containing a string specifying a filename to be opened for the child -spawn_opts_swallow(stdios::StdIOSet) = Any[stdios...] -spawn_opts_inherit(stdios::StdIOSet) = Any[stdios...] +spawn_opts_swallow(stdios::StdIOSet) = SpawnIO[stdios...] +spawn_opts_inherit(stdios::StdIOSet) = SpawnIO[stdios...] spawn_opts_swallow(in::Redirectable=devnull, out::Redirectable=devnull, err::Redirectable=devnull) = - Any[in, out, err] + SpawnIO[in, out, err] # pass original descriptors to child processes by default, because we might # have already exhausted and closed the libuv object for our standard streams. # ref issue #8529 spawn_opts_inherit(in::Redirectable=RawFD(0), out::Redirectable=RawFD(1), err::Redirectable=RawFD(2)) = - Any[in, out, err] + SpawnIO[in, out, err] function eachline(cmd::AbstractCmd; keep::Bool=false) out = PipeEndpoint() - processes = _spawn(cmd, Any[devnull, out, stderr]) + processes = _spawn(cmd, SpawnIO[devnull, out, stderr]) # if the user consumes all the data, also check process exit status for success ondone = () -> (success(processes) || pipeline_error(processes); nothing) return EachLine(out, keep=keep, ondone=ondone)::EachLine @@ -384,20 +385,20 @@ function open(cmds::AbstractCmd, stdio::Redirectable=devnull; write::Bool=false, stdio === devnull || throw(ArgumentError("no stream can be specified for `stdio` in read-write mode")) in = PipeEndpoint() out = PipeEndpoint() - processes = _spawn(cmds, Any[in, out, stderr]) + processes = _spawn(cmds, SpawnIO[in, out, stderr]) processes.in = in processes.out = out elseif read out = PipeEndpoint() - processes = _spawn(cmds, Any[stdio, out, stderr]) + processes = _spawn(cmds, SpawnIO[stdio, out, stderr]) processes.out = out elseif write in = PipeEndpoint() - processes = _spawn(cmds, Any[in, stdio, stderr]) + processes = _spawn(cmds, SpawnIO[in, stdio, stderr]) processes.in = in else stdio === devnull || throw(ArgumentError("no stream can be specified for `stdio` in no-access mode")) - processes = _spawn(cmds, Any[devnull, devnull, stderr]) + processes = _spawn(cmds, SpawnIO[devnull, devnull, stderr]) end return processes end diff --git a/base/show.jl b/base/show.jl index 8359690034c23..999a73047f6b2 100644 --- a/base/show.jl +++ b/base/show.jl @@ -1919,7 +1919,7 @@ function show_unquoted(io::IO, ex::Expr, indent::Int, prec::Int, quote_level::In na = length(func_args) if (na == 2 || (na > 2 && isa(func, Symbol) && func in (:+, :++, :*)) || (na == 3 && func === :(:))) && all(a -> !isa(a, Expr) || a.head !== :..., func_args) - sep = func === :(:) ? "$func" : " $func " + sep = func === :(:) ? "$func" : " " * convert(String, string(func))::String * " " # if func::Any, avoid string interpolation (invalidation) if func_prec <= prec show_enclosed_list(io, '(', func_args, sep, ')', indent, func_prec, quote_level, true) @@ -2289,7 +2289,7 @@ function show_unquoted(io::IO, ex::Expr, indent::Int, prec::Int, quote_level::In elseif head === :meta && nargs == 1 && args[1] === :pop_loc print(io, "# meta: pop location") elseif head === :meta && nargs == 2 && args[1] === :pop_loc - print(io, "# meta: pop locations ($(args[2]))") + print(io, "# meta: pop locations ($(args[2]::Int))") # print anything else as "Expr(head, args...)" else unhandled = true diff --git a/base/strings/substring.jl b/base/strings/substring.jl index 5142cf65fe9c5..86efbc1f6df3e 100644 --- a/base/strings/substring.jl +++ b/base/strings/substring.jl @@ -55,6 +55,11 @@ convert(::Type{SubString{S}}, s::AbstractString) where {S<:AbstractString} = SubString(convert(S, s)) convert(::Type{T}, s::T) where {T<:SubString} = s +# Regex match allows only Union{String, SubString{String}} so define conversion to this type +convert(::Type{Union{String, SubString{String}}}, s::String) = s +convert(::Type{Union{String, SubString{String}}}, s::SubString{String}) = s +convert(::Type{Union{String, SubString{String}}}, s::AbstractString) = convert(String, s) + function String(s::SubString{String}) parent = s.string copy = GC.@preserve parent unsafe_string(pointer(parent, s.offset+1), s.ncodeunits) @@ -229,7 +234,13 @@ function string(a::Union{Char, String, SubString{String}, Symbol}...) out = _string_n(n) offs = 1 for v in a - offs += __unsafe_string!(out, v, offs) + if v isa Char + offs += __unsafe_string!(out, v, offs) + elseif v isa String || v isa SubString{String} + offs += __unsafe_string!(out, v, offs) + else + offs += __unsafe_string!(out, v::Symbol, offs) + end end return out end diff --git a/stdlib/REPL/src/LineEdit.jl b/stdlib/REPL/src/LineEdit.jl index cf09cb1966bf1..89f57383d5e48 100644 --- a/stdlib/REPL/src/LineEdit.jl +++ b/stdlib/REPL/src/LineEdit.jl @@ -1646,7 +1646,7 @@ end throw_eager_redirection_cycle(key::Union{Char, String}) = error("Eager redirection cycle detected for key ", repr(key)) throw_could_not_find_redirected_value(key::Union{Char, String}) = - error("Could not find redirected value ", repl(key)) + error("Could not find redirected value ", repr(key)) function keymap_unify(keymaps) ret = Dict{Char,Any}() diff --git a/stdlib/REPL/src/TerminalMenus/AbstractMenu.jl b/stdlib/REPL/src/TerminalMenus/AbstractMenu.jl index b87a9c8c26464..127d0cd88a2cf 100644 --- a/stdlib/REPL/src/TerminalMenus/AbstractMenu.jl +++ b/stdlib/REPL/src/TerminalMenus/AbstractMenu.jl @@ -192,7 +192,7 @@ function request(term::REPL.Terminals.TTYTerminal, m::AbstractMenu; cursor::Unio REPL.Terminals.raw!(term, true) true catch err - suppress_output || @warn("TerminalMenus: Unable to enter raw mode: $err") + suppress_output || @warn "TerminalMenus: Unable to enter raw mode: " exception=(err, catch_backtrace()) false end # hide the cursor diff --git a/stdlib/p7zip_jll/src/p7zip_jll.jl b/stdlib/p7zip_jll/src/p7zip_jll.jl index 99b346017ad97..4320003b282f7 100644 --- a/stdlib/p7zip_jll/src/p7zip_jll.jl +++ b/stdlib/p7zip_jll/src/p7zip_jll.jl @@ -35,7 +35,7 @@ else const pathsep = ':' end -function adjust_ENV!(env::Dict, PATH::String, LIBPATH::String, adjust_PATH::Bool, adjust_LIBPATH::Bool) +function adjust_ENV!(env::Dict{keytype(Base.EnvDict),valtype(Base.EnvDict)}, PATH::String, LIBPATH::String, adjust_PATH::Bool, adjust_LIBPATH::Bool) if adjust_LIBPATH LIBPATH_base = get(env, LIBPATH_env, expanduser(LIBPATH_default)) if !isempty(LIBPATH_base) From 477dfb98e93e38c1f2dec220bc65b12182ceccf9 Mon Sep 17 00:00:00 2001 From: Daniel Karrasch Date: Tue, 29 Mar 2022 17:44:31 +0200 Subject: [PATCH 122/369] Fix performance issue with diagonal multiplication (#44651) (cherry picked from commit 03af78108afe6058f54cf766d8981d26a11c51f7) --- stdlib/LinearAlgebra/src/diagonal.jl | 99 ++++++++++++++++++---------- stdlib/LinearAlgebra/src/generic.jl | 3 +- 2 files changed, 65 insertions(+), 37 deletions(-) diff --git a/stdlib/LinearAlgebra/src/diagonal.jl b/stdlib/LinearAlgebra/src/diagonal.jl index 5d17049cfa4e1..748b165eca7fd 100644 --- a/stdlib/LinearAlgebra/src/diagonal.jl +++ b/stdlib/LinearAlgebra/src/diagonal.jl @@ -249,8 +249,8 @@ end (*)(D::Diagonal, A::AbstractMatrix) = mul!(similar(A, promote_op(*, eltype(A), eltype(D.diag)), size(A)), D, A) -rmul!(A::AbstractMatrix, D::Diagonal) = mul!(A, A, D) -lmul!(D::Diagonal, B::AbstractVecOrMat) = mul!(B, D, B) +rmul!(A::AbstractMatrix, D::Diagonal) = @inline mul!(A, A, D) +lmul!(D::Diagonal, B::AbstractVecOrMat) = @inline mul!(B, D, B) #TODO: It seems better to call (D' * adjA')' directly? function *(adjA::Adjoint{<:Any,<:AbstractMatrix}, D::Diagonal) @@ -285,35 +285,80 @@ function *(D::Diagonal, transA::Transpose{<:Any,<:AbstractMatrix}) end @inline function __muldiag!(out, D::Diagonal, B, alpha, beta) - if iszero(beta) - out .= (D.diag .* B) .*ₛ alpha + require_one_based_indexing(out) + if iszero(alpha) + _rmul_or_fill!(out, beta) else - out .= (D.diag .* B) .*ₛ alpha .+ out .* beta + if iszero(beta) + @inbounds for j in axes(B, 2) + @simd for i in axes(B, 1) + out[i,j] = D.diag[i] * B[i,j] * alpha + end + end + else + @inbounds for j in axes(B, 2) + @simd for i in axes(B, 1) + out[i,j] = D.diag[i] * B[i,j] * alpha + out[i,j] * beta + end + end + end end return out end - @inline function __muldiag!(out, A, D::Diagonal, alpha, beta) - if iszero(beta) - out .= (A .* permutedims(D.diag)) .*ₛ alpha + require_one_based_indexing(out) + if iszero(alpha) + _rmul_or_fill!(out, beta) else - out .= (A .* permutedims(D.diag)) .*ₛ alpha .+ out .* beta + if iszero(beta) + @inbounds for j in axes(A, 2) + dja = D.diag[j] * alpha + @simd for i in axes(A, 1) + out[i,j] = A[i,j] * dja + end + end + else + @inbounds for j in axes(A, 2) + dja = D.diag[j] * alpha + @simd for i in axes(A, 1) + out[i,j] = A[i,j] * dja + out[i,j] * beta + end + end + end end return out end - @inline function __muldiag!(out::Diagonal, D1::Diagonal, D2::Diagonal, alpha, beta) - if iszero(beta) - out.diag .= (D1.diag .* D2.diag) .*ₛ alpha + d1 = D1.diag + d2 = D2.diag + if iszero(alpha) + _rmul_or_fill!(out.diag, beta) else - out.diag .= (D1.diag .* D2.diag) .*ₛ alpha .+ out.diag .* beta + if iszero(beta) + @inbounds @simd for i in eachindex(out.diag) + out.diag[i] = d1[i] * d2[i] * alpha + end + else + @inbounds @simd for i in eachindex(out.diag) + out.diag[i] = d1[i] * d2[i] * alpha + out.diag[i] * beta + end + end + end + return out +end +@inline function __muldiag!(out, D1::Diagonal, D2::Diagonal, alpha, beta) + require_one_based_indexing(out) + mA = size(D1, 1) + d1 = D1.diag + d2 = D2.diag + _rmul_or_fill!(out, beta) + if !iszero(alpha) + @inbounds @simd for i in 1:mA + out[i,i] += d1[i] * d2[i] * alpha + end end return out end - -# only needed for ambiguity resolution, as mul! is explicitly defined for these arguments -@inline __muldiag!(out, D1::Diagonal, D2::Diagonal, alpha, beta) = - mul!(out, D1, D2, alpha, beta) @inline function _muldiag!(out, A, B, alpha, beta) _muldiag_size_check(out, A, B) @@ -340,24 +385,8 @@ end @inline mul!(C::Diagonal, Da::Diagonal, Db::Diagonal, alpha::Number, beta::Number) = _muldiag!(C, Da, Db, alpha, beta) -function mul!(C::AbstractMatrix, Da::Diagonal, Db::Diagonal, alpha::Number, beta::Number) - _muldiag_size_check(C, Da, Db) - require_one_based_indexing(C) - mA = size(Da, 1) - da = Da.diag - db = Db.diag - _rmul_or_fill!(C, beta) - if iszero(beta) - @inbounds @simd for i in 1:mA - C[i,i] = Ref(da[i] * db[i]) .*ₛ alpha - end - else - @inbounds @simd for i in 1:mA - C[i,i] += Ref(da[i] * db[i]) .*ₛ alpha - end - end - return C -end +mul!(C::AbstractMatrix, Da::Diagonal, Db::Diagonal, alpha::Number, beta::Number) = + _muldiag!(C, Da, Db, alpha, beta) _init(op, A::AbstractArray{<:Number}, B::AbstractArray{<:Number}) = (_ -> zero(typeof(op(oneunit(eltype(A)), oneunit(eltype(B)))))) diff --git a/stdlib/LinearAlgebra/src/generic.jl b/stdlib/LinearAlgebra/src/generic.jl index 676e965652e8f..08c77b22d7bbb 100644 --- a/stdlib/LinearAlgebra/src/generic.jl +++ b/stdlib/LinearAlgebra/src/generic.jl @@ -8,8 +8,7 @@ # inside this function. function *ₛ end Broadcast.broadcasted(::typeof(*ₛ), out, beta) = - iszero(beta::Number) ? false : - isone(beta::Number) ? broadcasted(identity, out) : broadcasted(*, out, beta) + iszero(beta::Number) ? false : broadcasted(*, out, beta) """ MulAddMul(alpha, beta) From efb28d21189189446b43a014101b564746036da0 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Tue, 29 Mar 2022 14:55:47 -0400 Subject: [PATCH 123/369] profile: fix async deadlock (#44781) Acquiring this lock in many implementations could result in deadlock, even with an existing reader. Add a TLS check for reentry before, instead of relying on the implementation specifics, to avoid any issues. (cherry picked from commit 7df454bdd678aa84365ce34780bb34e9a2730e75) --- src/debuginfo.cpp | 48 +++++++++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/src/debuginfo.cpp b/src/debuginfo.cpp index 263e506355d69..0e246160a3c16 100644 --- a/src/debuginfo.cpp +++ b/src/debuginfo.cpp @@ -47,21 +47,34 @@ typedef object::SymbolRef SymRef; // while holding this lock. // Certain functions in this file might be called from an unmanaged thread // and cannot have any interaction with the julia runtime -static uv_rwlock_t threadsafe; +// They also may be re-entrant, and operating while threads are paused, so we +// separately manage the re-entrant count behavior for safety across platforms +// Note that we cannot safely upgrade read->write +static uv_rwlock_t debuginfo_asyncsafe; +static pthread_key_t debuginfo_asyncsafe_held; void jl_init_debuginfo(void) { - uv_rwlock_init(&threadsafe); + uv_rwlock_init(&debuginfo_asyncsafe); + if (pthread_key_create(&debuginfo_asyncsafe_held, NULL)) + jl_error("fatal: pthread_key_create failed"); } extern "C" JL_DLLEXPORT void jl_lock_profile_impl(void) { - uv_rwlock_rdlock(&threadsafe); + uintptr_t held = (uintptr_t)pthread_getspecific(debuginfo_asyncsafe_held); + if (held++ == 0) + uv_rwlock_rdlock(&debuginfo_asyncsafe); + pthread_setspecific(debuginfo_asyncsafe_held, (void*)held); } extern "C" JL_DLLEXPORT void jl_unlock_profile_impl(void) { - uv_rwlock_rdunlock(&threadsafe); + uintptr_t held = (uintptr_t)pthread_getspecific(debuginfo_asyncsafe_held); + assert(held); + if (--held == 0) + uv_rwlock_rdunlock(&debuginfo_asyncsafe); + pthread_setspecific(debuginfo_asyncsafe_held, (void*)held); } // some actions aren't signal (especially profiler) safe so we acquire a lock @@ -69,7 +82,8 @@ extern "C" JL_DLLEXPORT void jl_unlock_profile_impl(void) template static void jl_profile_atomic(T f) { - uv_rwlock_wrlock(&threadsafe); + assert(0 == (uintptr_t)pthread_getspecific(debuginfo_asyncsafe_held)); + uv_rwlock_wrlock(&debuginfo_asyncsafe); #ifndef _OS_WINDOWS_ sigset_t sset; sigset_t oset; @@ -80,7 +94,7 @@ static void jl_profile_atomic(T f) #ifndef _OS_WINDOWS_ pthread_sigmask(SIG_SETMASK, &oset, NULL); #endif - uv_rwlock_wrunlock(&threadsafe); + uv_rwlock_wrunlock(&debuginfo_asyncsafe); } @@ -188,12 +202,12 @@ class JITObjectRegistry public: jl_method_instance_t *lookupLinfo(size_t pointer) JL_NOTSAFEPOINT { - uv_rwlock_rdlock(&threadsafe); + jl_lock_profile_impl(); auto region = linfomap.lower_bound(pointer); jl_method_instance_t *linfo = NULL; if (region != linfomap.end() && pointer < region->first + region->second.first) linfo = region->second.second; - uv_rwlock_rdunlock(&threadsafe); + jl_unlock_profile_impl(); return linfo; } @@ -448,9 +462,10 @@ static int lookup_pointer( // DWARFContext/DWARFUnit update some internal tables during these queries, so // a lock is needed. - uv_rwlock_wrlock(&threadsafe); + assert(0 == (uintptr_t)pthread_getspecific(debuginfo_asyncsafe_held)); + uv_rwlock_wrlock(&debuginfo_asyncsafe); auto inlineInfo = context->getInliningInfoForAddress(makeAddress(Section, pointer + slide), infoSpec); - uv_rwlock_wrunlock(&threadsafe); + uv_rwlock_wrunlock(&debuginfo_asyncsafe); int fromC = (*frames)[0].fromC; int n_frames = inlineInfo.getNumberOfFrames(); @@ -473,9 +488,9 @@ static int lookup_pointer( info = inlineInfo.getFrame(i); } else { - uv_rwlock_wrlock(&threadsafe); + uv_rwlock_wrlock(&debuginfo_asyncsafe); info = context->getLineInfoForAddress(makeAddress(Section, pointer + slide), infoSpec); - uv_rwlock_wrunlock(&threadsafe); + uv_rwlock_wrunlock(&debuginfo_asyncsafe); } jl_frame_t *frame = &(*frames)[i]; @@ -1148,7 +1163,8 @@ int jl_DI_for_fptr(uint64_t fptr, uint64_t *symsize, int64_t *slide, object::SectionRef *Section, llvm::DIContext **context) JL_NOTSAFEPOINT { int found = 0; - uv_rwlock_wrlock(&threadsafe); + assert(0 == (uintptr_t)pthread_getspecific(debuginfo_asyncsafe_held)); + uv_rwlock_wrlock(&debuginfo_asyncsafe); std::map &objmap = jl_jit_object_registry.getObjectMap(); std::map::iterator fit = objmap.lower_bound(fptr); @@ -1164,7 +1180,7 @@ int jl_DI_for_fptr(uint64_t fptr, uint64_t *symsize, int64_t *slide, } found = 1; } - uv_rwlock_wrunlock(&threadsafe); + uv_rwlock_wrunlock(&debuginfo_asyncsafe); return found; } @@ -1613,13 +1629,13 @@ extern "C" JL_DLLEXPORT uint64_t jl_getUnwindInfo_impl(uint64_t dwAddr) { // Might be called from unmanaged thread - uv_rwlock_rdlock(&threadsafe); + jl_lock_profile_impl(); std::map &objmap = jl_jit_object_registry.getObjectMap(); std::map::iterator it = objmap.lower_bound(dwAddr); uint64_t ipstart = 0; // ip of the start of the section (if found) if (it != objmap.end() && dwAddr < it->first + it->second.SectionSize) { ipstart = (uint64_t)(uintptr_t)(*it).first; } - uv_rwlock_rdunlock(&threadsafe); + jl_unlock_profile_impl(); return ipstart; } From ddc620f729983ebf33ff6acff2c6537940f3faf9 Mon Sep 17 00:00:00 2001 From: Thomas van Doornmalen <60822431+Taaitaaiger@users.noreply.github.com> Date: Mon, 4 Apr 2022 05:57:30 +0200 Subject: [PATCH 124/369] restore MSVC support to julia.h file (#44842) Put back a few lines that were removed by PR $42703 because they are required to successfully embed Julia with MSVC. (cherry picked from commit 209aad1ddfad16d689de677597181005c927cdda) --- src/support/dtypes.h | 8 +++++++- src/support/platform.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/support/dtypes.h b/src/support/dtypes.h index 2df897c7ba554..9e3e17015e135 100644 --- a/src/support/dtypes.h +++ b/src/support/dtypes.h @@ -116,7 +116,13 @@ # define NOINLINE_DECL(f) f __attribute__((noinline)) #endif -#if defined(__GNUC__) +#ifdef _COMPILER_MICROSOFT_ +# ifdef _P64 +# define JL_ATTRIBUTE_ALIGN_PTRSIZE(x) __declspec(align(8)) x +# else +# define JL_ATTRIBUTE_ALIGN_PTRSIZE(x) __declspec(align(4)) x +# endif +#elif defined(__GNUC__) # define JL_ATTRIBUTE_ALIGN_PTRSIZE(x) x __attribute__ ((aligned (sizeof(void*)))) #else # define JL_ATTRIBUTE_ALIGN_PTRSIZE(x) diff --git a/src/support/platform.h b/src/support/platform.h index bb960f54d3c4e..cf65fa01423fe 100644 --- a/src/support/platform.h +++ b/src/support/platform.h @@ -37,6 +37,8 @@ #define _COMPILER_CLANG_ #elif defined(__GNUC__) #define _COMPILER_GCC_ +#elif defined(_MSC_VER) +#define _COMPILER_MICROSOFT_ #else #error Unsupported compiler #endif From 2a0f4de814dc5bd23cec0571d51300c14ae1c51d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Mon, 4 Apr 2022 22:11:25 +0200 Subject: [PATCH 125/369] [Zlib_jll] Update to v1.2.12+3 (#44810) Note: this is the first build of the real upstream version 1.2.12 which was released a few days ago. (cherry picked from commit 81e7cfc0b7edaf8da3d892290da5fd20dc2e2a65) --- deps/checksums/zlib | 68 ++++++++++++++++---------------- deps/zlib.version | 4 +- stdlib/Zlib_jll/Project.toml | 2 +- stdlib/Zlib_jll/test/runtests.jl | 2 +- 4 files changed, 38 insertions(+), 38 deletions(-) diff --git a/deps/checksums/zlib b/deps/checksums/zlib index 6b14164c8318f..d524a3f588a18 100644 --- a/deps/checksums/zlib +++ b/deps/checksums/zlib @@ -1,34 +1,34 @@ -Zlib.v1.2.12+1.aarch64-apple-darwin.tar.gz/md5/6e255e13279855a99dae7d4ccf206069 -Zlib.v1.2.12+1.aarch64-apple-darwin.tar.gz/sha512/d160928dc6cad6bbc9fce36ea0d807c1f432aae375e6a032b0fd58d18640d02fc50c25233b32f8b73f3fc3488a091cf57418ad04498160441e3d7e4aa79302fe -Zlib.v1.2.12+1.aarch64-linux-gnu.tar.gz/md5/ff0ce9d6dec1c1b07114ed48f2bcfc88 -Zlib.v1.2.12+1.aarch64-linux-gnu.tar.gz/sha512/fdcea5e1fccc93641d0c372b6ba041c33c006e84ca6ba532bd9d6bb5ac449379daf27c5e1b95df3a6a57d3c24a363f12e55d5fb92184f1130606000e045a0d9b -Zlib.v1.2.12+1.aarch64-linux-musl.tar.gz/md5/900884b5eb02307665c1e6244f9d4be8 -Zlib.v1.2.12+1.aarch64-linux-musl.tar.gz/sha512/c3cbf7b41566af260a6e4ff2a2206b7f88439f0925609c72f822876eff384e3656e6bcd12131eac47d4177e5a1359ea6ebedbae949682c1d307607588ebfd80c -Zlib.v1.2.12+1.armv6l-linux-gnueabihf.tar.gz/md5/2766764794ae29ff4dc97c42faebbd91 -Zlib.v1.2.12+1.armv6l-linux-gnueabihf.tar.gz/sha512/341262c50ba5117ea93afb4acf3a036ee40a83d9b46b13a8360f36d74561c152d9ffa807887f4c452c65e91cae98df44fed861014ce26c4293ee0f45bafcb87e -Zlib.v1.2.12+1.armv6l-linux-musleabihf.tar.gz/md5/9037801d9524b3912acb5a5d3abfaa87 -Zlib.v1.2.12+1.armv6l-linux-musleabihf.tar.gz/sha512/6984076b0262e7ef19f08e6e83aa855eb6b60ae478dcad985d360b38f52ea6cc0fbf4e5c7723c007b722b01dc70ae378f6d487ddbe934e84ab4376de2688ce86 -Zlib.v1.2.12+1.armv7l-linux-gnueabihf.tar.gz/md5/627bcdf4216e9fb7020dcc50f71402e2 -Zlib.v1.2.12+1.armv7l-linux-gnueabihf.tar.gz/sha512/575000bed533f223ef2551ebdb7b431a743f83bf248edaf0a05ba00d33cf7848481952b325d7e18fdce3b91d2f0ec6fd02b24fb8cfa812f8a511f924a192fd1c -Zlib.v1.2.12+1.armv7l-linux-musleabihf.tar.gz/md5/11c79b0221d07986eeaf016650667059 -Zlib.v1.2.12+1.armv7l-linux-musleabihf.tar.gz/sha512/7f0415e8ebad6690621906885f72d3660962279e4ef57893334406a92f3eb9f6dac177d7430da0f4ae1ab0cabf185b33dbb347e054c35498e94e45771dd4b05a -Zlib.v1.2.12+1.i686-linux-gnu.tar.gz/md5/fc024f3aa4fffb298b6059adc7db6911 -Zlib.v1.2.12+1.i686-linux-gnu.tar.gz/sha512/cb219ecd89adda98f84914a4bc9355ba363bd942c7cd16adba70aa3f8ac37d1f7f812df942294a8eb3fa5ed474ee59126a567dea1f536467087fa27eb66c41b1 -Zlib.v1.2.12+1.i686-linux-musl.tar.gz/md5/5473f0c5ae14d4c34bc51c6ad583f21e -Zlib.v1.2.12+1.i686-linux-musl.tar.gz/sha512/c6380f1b22866dbfb8baaf724bcc33f2db3602741d3ffcdd61a6831740f1e4e4344b4ac4ac020054df06ebefac235f56a034a1d7cbc40e6c19d2e953945725c2 -Zlib.v1.2.12+1.i686-w64-mingw32.tar.gz/md5/1119dbaf451c691028522e43e2ca7f20 -Zlib.v1.2.12+1.i686-w64-mingw32.tar.gz/sha512/366d3ef55e3b448176388f8d92c6ffe00e68f7ae62b67ad1ceedb73984ba30b16c8a086807f61e87caa8262e8ea1cb7799b49d22b0269dcee7735d3ea36df6aa -Zlib.v1.2.12+1.powerpc64le-linux-gnu.tar.gz/md5/127bf2fbb739f52d1d455d9b8dd0b08e -Zlib.v1.2.12+1.powerpc64le-linux-gnu.tar.gz/sha512/cd647435a5ca819180f662f288106ce49521ad75501b7c95ad912f008caa264531f8b62ccc042c0f8f2cb1a728d89d84fef395c9f3797b0f9f111c1f8b8ce1b9 -Zlib.v1.2.12+1.x86_64-apple-darwin.tar.gz/md5/5740e0da15acce6234d54b56bc462529 -Zlib.v1.2.12+1.x86_64-apple-darwin.tar.gz/sha512/1b973091f381cd2d1403685fcc7ca69f31019e2bab6a031cc934bffdf339775bbd529fb375996bdade090ff4cfcf6f2aec6cb9891b91a5b21c3f847f159748a0 -Zlib.v1.2.12+1.x86_64-linux-gnu.tar.gz/md5/750e79f7ad235ee94088ad297c407e36 -Zlib.v1.2.12+1.x86_64-linux-gnu.tar.gz/sha512/ae995d9069eda2ac602eb53cd6d86c22d0d5e353504d1a6525a33efb99628fa4abd40d0dcc16f0927c409d5c57b6f7d63208d2aae01474665f9f93114bd1388a -Zlib.v1.2.12+1.x86_64-linux-musl.tar.gz/md5/bb62d2d9f6800c36183d2f2e6e094f42 -Zlib.v1.2.12+1.x86_64-linux-musl.tar.gz/sha512/d2ba384a1d31cf0f3cb6bc843d43005c39a72007954bc58bfa24c5d6d65af10ae2969670baecd854c8074f94424288f3fb29f735c9226f7f8a2df49eb62e6033 -Zlib.v1.2.12+1.x86_64-unknown-freebsd.tar.gz/md5/21dfda8d26dbe76c914216e79d7847d6 -Zlib.v1.2.12+1.x86_64-unknown-freebsd.tar.gz/sha512/2cd7be4070dbf20ab1c46553a9e3f84c98bf8e8fc72bf2eb4678630e648cb9ad02cae5e004f3c2a69216e2782d9bba43eac6a45a480f6fe58d1091a9fbba93ff -Zlib.v1.2.12+1.x86_64-w64-mingw32.tar.gz/md5/140ddbeeaf27867aeeeec118682e879d -Zlib.v1.2.12+1.x86_64-w64-mingw32.tar.gz/sha512/f61f3d1eb7e7960b2fdbc1d68f22526a06ba598cd821261e7ba3819e00daee4c5b5427f9c03277b57b7226860142f0071410c0583535ca4e4b9acbe5ee4b5ade -zlib-cacf7f1d4e3d44d871b605da3b647f07d718623f.tar.gz/md5/93d10d4dd040f14ae63417070d1346e8 -zlib-cacf7f1d4e3d44d871b605da3b647f07d718623f.tar.gz/sha512/a1e9c5a2963266a582192d0fe88c179f5239245f11c4df4427dda755ad77d31e1fcf045d7d3fe49141090f4ff8da13d9a2e8d8d317fe6460a5f3e9bdea29b883 +Zlib.v1.2.12+3.aarch64-apple-darwin.tar.gz/md5/2258883a6412fbdac0b807afd133834f +Zlib.v1.2.12+3.aarch64-apple-darwin.tar.gz/sha512/6e82b57646dfe2b86978d51cb4401d565d00d6bdcfabe09ceb888ad8979bd1398fd9ea7652542f149d88c120110f6c3baa919616f01410e9238a5199f50f5dda +Zlib.v1.2.12+3.aarch64-linux-gnu.tar.gz/md5/663aa0d0791b92464e4822a130ac7fa9 +Zlib.v1.2.12+3.aarch64-linux-gnu.tar.gz/sha512/e50f00d92600a78b2f540e0e8e1dce435d0d0499ea80ce3c3cd0e11c8e3b5b1a97eadca9ac863f597cee369e80bcd50ec1c0a0e0f1a87bb0ff94bbaf453dea2d +Zlib.v1.2.12+3.aarch64-linux-musl.tar.gz/md5/471179a2364d59abb6426b378ea4e195 +Zlib.v1.2.12+3.aarch64-linux-musl.tar.gz/sha512/35208e4be5966343ecb2b78471a3e1a947489f83c828b562db3508506dd0493eae3318c7eb3a6b599e911416795023193df862fbb6fcc7389d44710dc30f16a8 +Zlib.v1.2.12+3.armv6l-linux-gnueabihf.tar.gz/md5/53601c0201dadc8c9ff038167d5c4277 +Zlib.v1.2.12+3.armv6l-linux-gnueabihf.tar.gz/sha512/19744283bb412a656b934347cb7a1d121fbaf7e5f9b1aac373ddf2466567b731817a2e72e3a4d993ca7e5b5eb1fd9bb9c24d0126778367b28bdb94721649298b +Zlib.v1.2.12+3.armv6l-linux-musleabihf.tar.gz/md5/f7c923955fc600785aae455807e63c8b +Zlib.v1.2.12+3.armv6l-linux-musleabihf.tar.gz/sha512/623cd1758465c9e40b0dad93981ae93097a03f4aa67487b7e1c7240be2d780d86f35f8db96743c35bbb329d572741b58e73735a2b1cfb9e18e77f4dbcc714063 +Zlib.v1.2.12+3.armv7l-linux-gnueabihf.tar.gz/md5/5ce0fe42f67e09de047626424d61bc82 +Zlib.v1.2.12+3.armv7l-linux-gnueabihf.tar.gz/sha512/322e32d6fe6cd7a3334f5146f8980d4f1fc85b9a1c60271659ba8b4bbfdec314f8d9e8c6c0719248f5dd18e3daefd946811a3dcc74fa3ae5505d6dd653e65309 +Zlib.v1.2.12+3.armv7l-linux-musleabihf.tar.gz/md5/5115c374df90393cb895dd45c77275c4 +Zlib.v1.2.12+3.armv7l-linux-musleabihf.tar.gz/sha512/b04b4f42220833b99923a3ff349e4a05ad9f67c2b62d4848de37c833b287420b1dbec8a039c09d2a95ab6b68a62c6dcbacb4ba7cc069a4e90a11f8592719d2b8 +Zlib.v1.2.12+3.i686-linux-gnu.tar.gz/md5/37e0186f765fada0d76b9cd6f28c8d5d +Zlib.v1.2.12+3.i686-linux-gnu.tar.gz/sha512/1239675bbf46c6243131585283b0fc23baa32e68226fbb2f0b7a833c8979e2df33590947daade533e37bafe21838a10198e9f9de99e094c21fba6b218b2fceab +Zlib.v1.2.12+3.i686-linux-musl.tar.gz/md5/a0d92af6481929eed3a9fec3dbb2e622 +Zlib.v1.2.12+3.i686-linux-musl.tar.gz/sha512/b448590129ef251083b675c3d7494a90151a03297fd9883efb70bde032d106f16f2ec7c28508d9b4a0d0e5a0be0bdb4bcf0d1a9e4b2ade034a6d6cfc4916536e +Zlib.v1.2.12+3.i686-w64-mingw32.tar.gz/md5/cc38d9ec5430e2ed7fed4792c7ac9551 +Zlib.v1.2.12+3.i686-w64-mingw32.tar.gz/sha512/85ad3babb42682d7b2b69513a30fd5e992a56436dcd7e2a44800bf1bc30d60d09aff5769cfaeefd4f5668e7973a0c2d4ad4d28559ea5f28c1c5419ed595eae57 +Zlib.v1.2.12+3.powerpc64le-linux-gnu.tar.gz/md5/8f57d8c31d2355c64a05db0412462d58 +Zlib.v1.2.12+3.powerpc64le-linux-gnu.tar.gz/sha512/9a0208c7a4dbf71b6f7e1ccaf05e3f3a422507cf0431b6482aab1a7b1bea41bd135320567f7dba6666f37c26f48cb3a627f1a1ebd39bf5c2d61148aadf62a986 +Zlib.v1.2.12+3.x86_64-apple-darwin.tar.gz/md5/5d15bb591d26d24aa9d6c9c8cf3df097 +Zlib.v1.2.12+3.x86_64-apple-darwin.tar.gz/sha512/7d8b0ec5a46a85cef3c5de451823c5cfa73b5b7c5ac98699065bbc5692af556195664908cd5c35184b7a9586fc0adab41fc0f76ee8599ca09a740cf49b9be113 +Zlib.v1.2.12+3.x86_64-linux-gnu.tar.gz/md5/25df63b9e6cbef14b0f0bf2a9eec5d14 +Zlib.v1.2.12+3.x86_64-linux-gnu.tar.gz/sha512/2660b762d816491e6b877020d8dd4a1cf1b171d6232dd5e0f47c6ee7b15504b006cc8f051434df778e0910130ef7456e30d531464470d3c4a2502e8f9fd19e76 +Zlib.v1.2.12+3.x86_64-linux-musl.tar.gz/md5/3f0c85d248711608141046d15b2da339 +Zlib.v1.2.12+3.x86_64-linux-musl.tar.gz/sha512/e4256b1b9520d5b0d97fa7e7ca6f6b9aa2583c6e5f14967392d54e48f27e242461f77e522743b229ab9b333eec5fd51f6d7b1559b566bd68ca0741b05b96df3c +Zlib.v1.2.12+3.x86_64-unknown-freebsd.tar.gz/md5/e67dae1456645930c9e2b2fef6f805c8 +Zlib.v1.2.12+3.x86_64-unknown-freebsd.tar.gz/sha512/5915ec48ae80be829c36a71e2ce580d2d14b7a9824c8f279ad5c69fea62d9a03345b665f224b9dde0bc4b808af246f89ec4f932d47a14236bc3b7db7651e5bec +Zlib.v1.2.12+3.x86_64-w64-mingw32.tar.gz/md5/89b152b3de0068c7c2580b87ad529ed3 +Zlib.v1.2.12+3.x86_64-w64-mingw32.tar.gz/sha512/df4b585f6501f45bc85e8d00c1b03c482d70d3491081246f9e9f9560f90c5f6057b1174a81e653f725209323cd743cf05d3e1aba1385afd26cb6f8c50186f818 +zlib-21767c654d31d2dccdde4330529775c6c5fd5389.tar.gz/md5/1fb2320f871561306bc87b3894727b45 +zlib-21767c654d31d2dccdde4330529775c6c5fd5389.tar.gz/sha512/2ad1e728f97a81b65d24fe5bef66658c94222d717a3486a0d11682b61563d7eaaa578f7457078881e8ed8c91b87aec11634d4a64021546e23a3ecabb3285197a diff --git a/deps/zlib.version b/deps/zlib.version index e363169315051..0b16a7f662dd1 100644 --- a/deps/zlib.version +++ b/deps/zlib.version @@ -1,2 +1,2 @@ -ZLIB_BRANCH=v1.2.11 -ZLIB_SHA1=cacf7f1d4e3d44d871b605da3b647f07d718623f +ZLIB_BRANCH=v1.2.12 +ZLIB_SHA1=21767c654d31d2dccdde4330529775c6c5fd5389 diff --git a/stdlib/Zlib_jll/Project.toml b/stdlib/Zlib_jll/Project.toml index cafaf9c1b577c..77e1da5f9c22e 100644 --- a/stdlib/Zlib_jll/Project.toml +++ b/stdlib/Zlib_jll/Project.toml @@ -1,6 +1,6 @@ name = "Zlib_jll" uuid = "83775a58-1f1d-513f-b197-d71354ab007a" -version = "1.2.12+1" +version = "1.2.12+3" [deps] Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" diff --git a/stdlib/Zlib_jll/test/runtests.jl b/stdlib/Zlib_jll/test/runtests.jl index e6adc6b7c951f..cc9e64188a0aa 100644 --- a/stdlib/Zlib_jll/test/runtests.jl +++ b/stdlib/Zlib_jll/test/runtests.jl @@ -3,5 +3,5 @@ using Test, Zlib_jll @testset "Zlib_jll" begin - @test VersionNumber(unsafe_string(ccall((:zlibVersion, libz), Cstring, ()))) == v"1.2.11" + @test VersionNumber(unsafe_string(ccall((:zlibVersion, libz), Cstring, ()))) == v"1.2.12" end From 7cfc43fde18d8ddcf0f6f7aa0cf91c6d86f49b83 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Thu, 7 Apr 2022 13:48:04 -0400 Subject: [PATCH 126/369] fix missing field type initialization vars (#44797) We were accidentally passing the start of the list instead of the end of the list, resulting in some values passing through uninitialized. Fix #42297 regression (cherry picked from commit 5f2abf6cfaa49220f08900d6a7a4422b94e32187) --- src/jltypes.c | 4 ++-- test/core.jl | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/jltypes.c b/src/jltypes.c index bb1cdd6c49b97..1686a4b57e500 100644 --- a/src/jltypes.c +++ b/src/jltypes.c @@ -1934,7 +1934,7 @@ void jl_reinstantiate_inner_types(jl_datatype_t *t) // can throw! for (i = 0; i < n; i++) env[i].val = jl_svecref(ndt->parameters, i); - ndt->super = (jl_datatype_t*)inst_type_w_((jl_value_t*)t->super, env, &top, 1); + ndt->super = (jl_datatype_t*)inst_type_w_((jl_value_t*)t->super, &env[n - 1], &top, 1); jl_gc_wb(ndt, ndt->super); } @@ -1944,7 +1944,7 @@ void jl_reinstantiate_inner_types(jl_datatype_t *t) // can throw! for (i = 0; i < n; i++) env[i].val = jl_svecref(ndt->parameters, i); assert(ndt->types == NULL); - ndt->types = inst_ftypes(t->types, env, &top); + ndt->types = inst_ftypes(t->types, &env[n - 1], &top); jl_gc_wb(ndt, ndt->types); if (ndt->isconcretetype) { // cacheable jl_compute_field_offsets(ndt); diff --git a/test/core.jl b/test/core.jl index 985c15781e45c..ad2eac873baaf 100644 --- a/test/core.jl +++ b/test/core.jl @@ -337,6 +337,15 @@ end #struct S22624{A,B,C} <: Ref{S22624{Int64,A}}; end @test_broken @isdefined S22624 +# issue #42297 +mutable struct Node42297{T, V} + value::V + next::Union{Node42297{T, T}, Node42297{T, Val{T}}, Nothing} + Node42297{T}(value) where {T} = new{T, typeof(value)}(value, nothing) +end +@test fieldtype(Node42297{Int,Val{Int}}, 1) === Val{Int} +@test fieldtype(Node42297{Int,Int}, 1) === Int + # issue #3890 mutable struct A3890{T1} x::Matrix{Complex{T1}} From 09e14a4c7713c8a74f3c2ec4adf48a22de3f7645 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 11 Apr 2022 01:28:41 +0200 Subject: [PATCH 127/369] Fix "anonymous types declared in an anonymous union" warnings (#44807) They look like this: ``` CC src/processor.o In file included from /Users/mhorn/Projekte/Julia/julia.master/src/processor.cpp:10: In file included from ./processor.h:5: ./julia.h:395:9: warning: anonymous types declared in an anonymous union are an extension [-Wnested-anon-types] struct { ^ ./julia.h:405:9: warning: anonymous types declared in an anonymous union are an extension [-Wnested-anon-types] struct { ^ 2 warnings generated. ``` and come from code that was introduced by @keno in PR #43852. But it turns out that the union is not used at all! So I'm simply removing the offending union. Perhaps it is needed for some future work, but it should be trivial to add it back if needed. If that happens, I suggest a comment is added that explain why this looks similar to but has different layout compared to the `typedef _jl_purity_overrides_t` also in `julia.h`. (cherry picked from commit bb91e627a3967b764f2f7163c282e10cfa41929c) --- src/julia.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/julia.h b/src/julia.h index f88371e561ca3..695d816aa19c1 100644 --- a/src/julia.h +++ b/src/julia.h @@ -233,6 +233,7 @@ typedef struct _jl_line_info_node_t { intptr_t inlined_at; } jl_line_info_node_t; +// the following mirrors `struct EffectsOverride` in `base/compiler/types.jl` typedef union __jl_purity_overrides_t { struct { uint8_t ipo_consistent : 1; @@ -393,6 +394,8 @@ typedef struct _jl_code_instance_t { //TODO: uint8_t absolute_max; // whether true max world is unknown // purity results +#ifdef JL_USE_ANON_UNIONS_FOR_PURITY_FLAGS + // see also encode_effects() and decode_effects() in `base/compiler/types.jl`, union { uint32_t ipo_purity_bits; struct { @@ -413,6 +416,10 @@ typedef struct _jl_code_instance_t { uint8_t nonoverlayed:1; } purity_flags; }; +#else + uint32_t ipo_purity_bits; + uint32_t purity_bits; +#endif jl_value_t *argescapes; // escape information of call arguments // compilation state cache From 1f6dc034f269e4877ad512951f5f897b401afdff Mon Sep 17 00:00:00 2001 From: Ian Atol Date: Mon, 11 Apr 2022 18:54:13 -0700 Subject: [PATCH 128/369] Fix 44921 by properly setting Vboxed field (#44942) (cherry picked from commit 4c858f8be31c667348bb8419e40477edd7f4a38d) --- src/codegen.cpp | 17 +++++++++-------- test/compiler/codegen.jl | 17 +++++++++++++++++ 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/codegen.cpp b/src/codegen.cpp index 89107f99413dc..a16c854444677 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -1790,14 +1790,15 @@ static jl_cgval_t convert_julia_type_union(jl_codectx_t &ctx, const jl_cgval_t & boxv = ctx.builder.CreateSelect( ctx.builder.CreateAnd(wasboxed, isboxed), v.Vboxed, boxv); } + Value *slotv; + MDNode *tbaa; if (v.V == NULL) { // v.V might be NULL if it was all ghost objects before - return jl_cgval_t(boxv, NULL, false, typ, new_tindex, ctx.tbaa()); + slotv = NULL; + tbaa = ctx.tbaa().tbaa_const; } else { Value *isboxv = ctx.builder.CreateIsNotNull(boxv); - Value *slotv; - MDNode *tbaa; if (v.ispointer()) { slotv = v.V; tbaa = v.tbaa; @@ -1810,12 +1811,12 @@ static jl_cgval_t convert_julia_type_union(jl_codectx_t &ctx, const jl_cgval_t & slotv = ctx.builder.CreateSelect(isboxv, decay_derived(ctx, boxv), decay_derived(ctx, emit_bitcast(ctx, slotv, boxv->getType()))); - jl_cgval_t newv = jl_cgval_t(slotv, NULL, false, typ, new_tindex, ctx.tbaa()); - assert(boxv->getType() == ctx.types().T_prjlvalue); - newv.Vboxed = boxv; - newv.tbaa = tbaa; - return newv; } + jl_cgval_t newv = jl_cgval_t(slotv, NULL, false, typ, new_tindex, ctx.tbaa()); + assert(boxv->getType() == ctx.types().T_prjlvalue); + newv.Vboxed = boxv; + newv.tbaa = tbaa; + return newv; } } else { diff --git a/test/compiler/codegen.jl b/test/compiler/codegen.jl index ec89ac9cd72a4..fa332447e394c 100644 --- a/test/compiler/codegen.jl +++ b/test/compiler/codegen.jl @@ -702,6 +702,23 @@ function f42645() end @test ((f42645()::B42645).y::A42645{Int}).x +struct A44921{T} + x::T +end +function f44921(a) + if a == :x + A44921(_f) # _f purposefully undefined + elseif a == :p + g44921(a) + end +end +function g44921(a) + if !@isdefined _f # just needs to be some non constprop-able condition + A44921(()) + end +end +@test f44921(:p) isa A44921 + # issue #43123 @noinline cmp43123(a::Some, b::Some) = something(a) === something(b) @noinline cmp43123(a, b) = a[] === b[] From a89784700c1ba174a60c976a99484aa329d5aeaf Mon Sep 17 00:00:00 2001 From: Will Kimmerer Date: Mon, 11 Apr 2022 22:06:42 -0400 Subject: [PATCH 129/369] distributed docs (#44940) (cherry picked from commit b5bbb9f5f3f1d2a46118dd2b6b944221999f2cae) --- doc/src/manual/distributed-computing.md | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/doc/src/manual/distributed-computing.md b/doc/src/manual/distributed-computing.md index abaf47a53b39c..73c7bd8b1ee00 100644 --- a/doc/src/manual/distributed-computing.md +++ b/doc/src/manual/distributed-computing.md @@ -1258,20 +1258,21 @@ in future releases. ## Noteworthy external packages Outside of Julia parallelism there are plenty of external packages that should be mentioned. -For example [MPI.jl](https://github.com/JuliaParallel/MPI.jl) is a Julia wrapper for the `MPI` protocol, or -[DistributedArrays.jl](https://github.com/JuliaParallel/Distributedarrays.jl), as presented in [Shared Arrays](@ref). +For example [MPI.jl](https://github.com/JuliaParallel/MPI.jl) is a Julia wrapper for the `MPI` protocol, [Dagger.jl](https://github.com/JuliaParallel/Dagger.jl) provides functionality similar to Python's [Dask](https://dask.org/), and +[DistributedArrays.jl](https://github.com/JuliaParallel/Distributedarrays.jl) provides array operations distributed across workers, as presented in [Shared Arrays](@ref). + A mention must be made of Julia's GPU programming ecosystem, which includes: -1. Low-level (C kernel) based operations [OpenCL.jl](https://github.com/JuliaGPU/OpenCL.jl) and [CUDAdrv.jl](https://github.com/JuliaGPU/CUDAdrv.jl) which are respectively an OpenCL interface and a CUDA wrapper. +1. [CUDA.jl](https://github.com/JuliaGPU/CUDA.jl) wraps the various CUDA libraries and supports compiling Julia kernels for Nvidia GPUs. -2. Low-level (Julia Kernel) interfaces like [CUDAnative.jl](https://github.com/JuliaGPU/CUDAnative.jl) which is a Julia native CUDA implementation. +2. [oneAPI.jl](https://github.com/JuliaGPU/oneAPI.jl) wraps the oneAPI unified programming model, and supports executing Julia kernels on supported accelerators. Currently only Linux is supported. -3. High-level vendor-specific abstractions like [CuArrays.jl](https://github.com/JuliaGPU/CuArrays.jl) and [CLArrays.jl](https://github.com/JuliaGPU/CLArrays.jl) +3. [AMDGPU.jl](https://github.com/JuliaGPU/AMDGPU.jl) wraps the AMD ROCm libraries and supports compiling Julia kernels for AMD GPUs. Currently only Linux is supported. -4. High-level libraries like [ArrayFire.jl](https://github.com/JuliaComputing/ArrayFire.jl) and [GPUArrays.jl](https://github.com/JuliaGPU/GPUArrays.jl) +4. High-level libraries like [KernelAbstractions.jl](https://github.com/JuliaGPU/KernelAbstractions.jl), [Tullio.jl](https://github.com/mcabbott/Tullio.jl) and [ArrayFire.jl](https://github.com/JuliaComputing/ArrayFire.jl). -In the following example we will use both `DistributedArrays.jl` and `CuArrays.jl` to distribute an array across multiple +In the following example we will use both `DistributedArrays.jl` and `CUDA.jl` to distribute an array across multiple processes by first casting it through `distribute()` and `CuArray()`. Remember when importing `DistributedArrays.jl` to import it across all processes using [`@everywhere`](@ref) @@ -1284,7 +1285,7 @@ julia> addprocs() julia> @everywhere using DistributedArrays -julia> using CuArrays +julia> using CUDA julia> B = ones(10_000) ./ 2; @@ -1322,9 +1323,8 @@ true julia> typeof(cuC) CuArray{Float64,1} ``` -Keep in mind that some Julia features are not currently supported by CUDAnative.jl[^2] , especially some functions like `sin` will need to be replaced with `CUDAnative.sin`(cc: @maleadt). -In the following example we will use both `DistributedArrays.jl` and `CuArrays.jl` to distribute an array across multiple +In the following example we will use both `DistributedArrays.jl` and `CUDA.jl` to distribute an array across multiple processes and call a generic function on it. ```julia @@ -1407,6 +1407,3 @@ mpirun -np 4 ./julia example.jl introduced a new set of communication mechanisms, collectively referred to as Remote Memory Access (RMA). The motivation for adding rma to the MPI standard was to facilitate one-sided communication patterns. For additional information on the latest MPI standard, see . - -[^2]: - [Julia GPU man pages](https://juliagpu.github.io/CUDAnative.jl/stable/man/usage.html#Julia-support-1) From 099768422df92ce79d2dfcbb599056e9b2de2a26 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Wed, 13 Apr 2022 16:26:36 -0400 Subject: [PATCH 130/369] asyncevents: fix missing GC root and race (#44956) The event might have triggered on another thread before we observed it here, or it might have gotten finalized before it got triggered. Either outcome can result in a lost event. (I observed the later situation occurring locally during the Dates test once). (cherry picked from commit 8cc00ffd1c7851003acec419e01a4896f9ed88ad) --- base/asyncevent.jl | 67 +++++++++++++++++++++++++++++----------------- 1 file changed, 42 insertions(+), 25 deletions(-) diff --git a/base/asyncevent.jl b/base/asyncevent.jl index 0736bd463111f..1c52b7cf7ee48 100644 --- a/base/asyncevent.jl +++ b/base/asyncevent.jl @@ -45,13 +45,22 @@ the async condition object itself. """ function AsyncCondition(cb::Function) async = AsyncCondition() - t = @task while _trywait(async) - cb(async) - isopen(async) || return + t = @task begin + unpreserve_handle(async) + while _trywait(async) + cb(async) + isopen(async) || return + end + end + # here we are mimicking parts of _trywait, in coordination with task `t` + preserve_handle(async) + @lock async.cond begin + if async.set + schedule(t) + else + _wait2(async.cond, t) + end end - lock(async.cond) - _wait2(async.cond, t) - unlock(async.cond) return async end @@ -115,6 +124,7 @@ function _trywait(t::Union{Timer, AsyncCondition}) # full barrier now for AsyncCondition t isa Timer || Core.Intrinsics.atomic_fence(:acquire_release) else + t.isopen || return false t.handle == C_NULL && return false iolock_begin() set = t.set @@ -123,14 +133,12 @@ function _trywait(t::Union{Timer, AsyncCondition}) lock(t.cond) try set = t.set - if !set - if t.handle != C_NULL - iolock_end() - set = wait(t.cond) - unlock(t.cond) - iolock_begin() - lock(t.cond) - end + if !set && t.isopen && t.handle != C_NULL + iolock_end() + set = wait(t.cond) + unlock(t.cond) + iolock_begin() + lock(t.cond) end finally unlock(t.cond) @@ -266,19 +274,28 @@ julia> begin """ function Timer(cb::Function, timeout::Real; interval::Real=0.0) timer = Timer(timeout, interval=interval) - t = @task while _trywait(timer) - try - cb(timer) - catch err - write(stderr, "Error in Timer:\n") - showerror(stderr, err, catch_backtrace()) - return + t = @task begin + unpreserve_handle(timer) + while _trywait(timer) + try + cb(timer) + catch err + write(stderr, "Error in Timer:\n") + showerror(stderr, err, catch_backtrace()) + return + end + isopen(timer) || return + end + end + # here we are mimicking parts of _trywait, in coordination with task `t` + preserve_handle(timer) + @lock timer.cond begin + if timer.set + schedule(t) + else + _wait2(timer.cond, t) end - isopen(timer) || return end - lock(timer.cond) - _wait2(timer.cond, t) - unlock(timer.cond) return timer end From 81c881914aeeca375ab43ce146e96858952c2f54 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Thu, 14 Apr 2022 04:19:56 -0400 Subject: [PATCH 131/369] [REPL] Fix a REPL test failure by removing an erroneous space in test (#44972) * [REPL] remove erroneous space in test Introduced by https://github.com/JuliaLang/julia/pull/33805 (74f2de13727373b44da76a65ceb5297889d3e482). * Revert "Temporarily move the `REPL` test suite to node 1, to buy us time until we fix the underlying bugs (#44961)" This reverts commit 322fd706a1739daf4776fd050df756e6670ba958. (cherry picked from commit fbec395fd049948618442569aa3a7708ceed2013) --- stdlib/REPL/test/repl.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/REPL/test/repl.jl b/stdlib/REPL/test/repl.jl index 05f583c807165..f34b00a8f0595 100644 --- a/stdlib/REPL/test/repl.jl +++ b/stdlib/REPL/test/repl.jl @@ -264,7 +264,7 @@ fake_repl(options = REPL.Options(confirm_exit=false,hascolor=true)) do stdin_wri write(stdin_write, ";") readuntil(stdout_read, "shell> ") Base.print_shell_escaped(stdin_write, Base.julia_cmd().exec..., special=Base.shell_special) - write(stdin_write, """ -e "println(\\"HI\\")\" """) + write(stdin_write, """ -e "println(\\"HI\\")\"""") readuntil(stdout_read, ")\"") proc_stdout_read, proc_stdout = redirect_stdout() get_stdout = @async read(proc_stdout_read, String) From fe0faad28d26da88ce559550a36919d5f16a2781 Mon Sep 17 00:00:00 2001 From: Bart Janssens Date: Fri, 15 Apr 2022 00:47:21 +0200 Subject: [PATCH 132/369] Fix embedding with MSVC (#44976) (cherry picked from commit c589e0d59541b1240f5bf77c7ce8c22594179e1b) --- src/support/dtypes.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/support/dtypes.h b/src/support/dtypes.h index 9e3e17015e135..d49ae0b22b5f9 100644 --- a/src/support/dtypes.h +++ b/src/support/dtypes.h @@ -27,6 +27,16 @@ #define WIN32_LEAN_AND_MEAN #include +#if defined(_COMPILER_MICROSOFT_) && !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED) + +/* See https://github.com/JuliaLang/julia/pull/44587 */ +typedef intptr_t ssize_t; +#define SSIZE_MAX INTPTR_MAX +#define _SSIZE_T_ +#define _SSIZE_T_DEFINED + +#endif /* defined(_COMPILER_MICROSOFT_) && !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED) */ + #if !defined(_COMPILER_GCC_) #define strtoull _strtoui64 From 26a25e217e55a5b041f668588d5afe4216427d5d Mon Sep 17 00:00:00 2001 From: "Viral B. Shah" Date: Tue, 19 Apr 2022 04:40:13 -0400 Subject: [PATCH 133/369] Update Example header in admonition to render PDF better, see #44866. (#45026) (cherry picked from commit d29d2d622ae416c3e5ba82cb55ef0535a75fe8e8) --- base/floatfuncs.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/base/floatfuncs.jl b/base/floatfuncs.jl index d1164005d3e44..75cc0f43e4ace 100644 --- a/base/floatfuncs.jl +++ b/base/floatfuncs.jl @@ -97,9 +97,8 @@ julia> round(357.913; sigdigits=4, base=2) Rounding to specified digits in bases other than 2 can be inexact when operating on binary floating point numbers. For example, the [`Float64`](@ref) value represented by `1.15` is actually *less* than 1.15, yet will be - rounded to 1.2. + rounded to 1.2. For example: - # Examples ```jldoctest; setup = :(using Printf) julia> x = 1.15 1.15 From cc5743ce357060cc629a1a6085ac9e6ca1dc5628 Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Wed, 30 Mar 2022 05:06:31 +0200 Subject: [PATCH 134/369] Initialize jl_page_size when not calling julia_init. (#44699) If we load libjulia-codegen directly, e.g. from opt or llc, we don't call julia_init but init_llvm. Co-authored-by: Keno Fischer (cherry picked from commit f562ad06f49917ef26902f06f6ad1bcb19522d54) --- src/codegen.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/codegen.cpp b/src/codegen.cpp index a16c854444677..cefaa6c8a9fda 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -8185,6 +8185,7 @@ extern "C" void jl_init_llvm(void) { jl_f_donotdelete_addr, new JuliaFunction{XSTR(jl_f_donotdelete), get_func_sig, get_donotdelete_func_attrs} } }; + jl_page_size = jl_getpagesize(); jl_default_debug_info_kind = (int) DICompileUnit::DebugEmissionKind::FullDebug; imaging_mode = jl_options.image_codegen || (jl_generating_output() && !jl_options.incremental); jl_default_cgparams.generic_context = jl_nothing; From f13039e70aefca417bbaf62eb143d2bc47845e82 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Tue, 19 Apr 2022 15:06:48 +0200 Subject: [PATCH 135/369] Change type of donotdelete intrinsics --- src/codegen.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/codegen.cpp b/src/codegen.cpp index cefaa6c8a9fda..c88ed18cacb87 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -465,6 +465,10 @@ static Type *get_pjlvalue(LLVMContext &C) { return JuliaType::get_pjlvalue_ty(C) static FunctionType *get_func_sig(LLVMContext &C) { return JuliaType::get_jlfunc_ty(C); } +static FunctionType *get_donotdelete_sig(LLVMContext &C) { + return FunctionType::get(getVoidTy(C), true); +} + static AttributeList get_func_attrs(LLVMContext &C) { return AttributeList::get(C, @@ -8182,7 +8186,7 @@ extern "C" void jl_init_llvm(void) { jl_f_arrayset_addr, new JuliaFunction{XSTR(jl_f_arrayset), get_func_sig, get_func_attrs} }, { jl_f_arraysize_addr, new JuliaFunction{XSTR(jl_f_arraysize), get_func_sig, get_func_attrs} }, { jl_f_apply_type_addr, new JuliaFunction{XSTR(jl_f_apply_type), get_func_sig, get_func_attrs} }, - { jl_f_donotdelete_addr, new JuliaFunction{XSTR(jl_f_donotdelete), get_func_sig, get_donotdelete_func_attrs} } + { jl_f_donotdelete_addr, new JuliaFunction{XSTR(jl_f_donotdelete), get_donotdelete_sig, get_donotdelete_func_attrs} } }; jl_page_size = jl_getpagesize(); From 5073c4ec6e1b080f1d1d3166f4d8ebdac0a6946e Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Tue, 19 Apr 2022 15:08:48 +0200 Subject: [PATCH 136/369] Fix attributes for donotdelete intrinsic The change in #44793 changed the signature of the donotdelete intrinsic, but didn't change the corresponding attributes, leaving a `nonnull` attribute on a `void` return, which fails the verifier. --- src/codegen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/codegen.cpp b/src/codegen.cpp index c88ed18cacb87..531b35bfedb79 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -485,7 +485,7 @@ static AttributeList get_donotdelete_func_attrs(LLVMContext &C) FnAttrs = FnAttrs.addAttribute(C, Attribute::NoUnwind); return AttributeList::get(C, FnAttrs, - Attributes(C, {Attribute::NonNull}), + Attributes(C, {}), None); } From bbb53ac0e972c700aebf619529a633ee5312f0d2 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Wed, 20 Apr 2022 14:22:47 +0900 Subject: [PATCH 137/369] inference: relax backedge optimization condition (#45030) Follows up #45017. We can relax the condition in `add_call_backedges!` for backedge optimization by ignoring the `nonoverlayed` property when the `AbstractInterpreter` doesn't use overlayed method table at all, since the property will never be tainted anyway even if we add a new method later. --- base/compiler/abstractinterpretation.jl | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index b65a9751d394f..91063ee8d338c 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -451,11 +451,18 @@ function add_call_backedges!(interp::AbstractInterpreter, @nospecialize(rettype), all_effects::Effects, edges::Vector{MethodInstance}, matches::Union{MethodMatches,UnionSplitMethodMatches}, @nospecialize(atype), sv::InferenceState) - if rettype === Any && all_effects === Effects() - # for `NativeInterpreter`, we don't need to add backedges when: - # - a new method couldn't refine (widen) this type and - # - the effects don't provide any useful information for interprocedural optimization - return + # we don't need to add backedges when: + # - a new method couldn't refine (widen) this type and + # - the effects are known to not provide any useful IPO information + if rettype === Any + if !isoverlayed(method_table(interp)) + # we can ignore the `nonoverlayed` property if `interp` doesn't use + # overlayed method table at all since it will never be tainted anyway + all_effects = Effects(all_effects; nonoverlayed=false) + end + if all_effects === Effects() + return + end end for edge in edges add_backedge!(edge, sv) From c6dc6d1464208516d1f66108c3257e009fed7cf2 Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Wed, 16 Mar 2022 05:37:30 -0500 Subject: [PATCH 138/369] Fix some inference failures in Base.require call graph (#44628) Discovered via JET. This also causes `make_aliases` to always return a `Vector{SimpleVector}` as its first argument. Co-authored-by: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Co-authored-by: Jameson Nash Co-authored-by: Kristoffer Carlsson (cherry picked from commit cc606574fb440242b66f40fae170a083c28fd52c) --- base/cmd.jl | 2 +- base/deprecated.jl | 9 +++++++-- base/loading.jl | 15 ++++++++++----- base/process.jl | 2 +- base/show.jl | 32 +++++++++++++++++--------------- base/stat.jl | 2 +- base/toml_parser.jl | 2 +- 7 files changed, 38 insertions(+), 26 deletions(-) diff --git a/base/cmd.jl b/base/cmd.jl index ab639a2b185c8..ecabb5c32b1d0 100644 --- a/base/cmd.jl +++ b/base/cmd.jl @@ -130,7 +130,7 @@ function show(io::IO, cmd::Cmd) print(io, '`') if print_cpus print(io, ", ") - show(io, collect(Int, cmd.cpus)) + show(io, collect(Int, something(cmd.cpus))) print(io, ")") end print_env && (print(io, ","); show(io, cmd.env)) diff --git a/base/deprecated.jl b/base/deprecated.jl index 1af38ebcdac1c..09d051334b6c9 100644 --- a/base/deprecated.jl +++ b/base/deprecated.jl @@ -88,8 +88,13 @@ function depwarn(msg, funcsym; force::Bool=false) _module=begin bt = backtrace() frame, caller = firstcaller(bt, funcsym) - # TODO: Is it reasonable to attribute callers without linfo to Core? - caller.linfo isa Core.MethodInstance ? caller.linfo.def.module : Core + linfo = caller.linfo + if linfo isa Core.MethodInstance + def = linfo.def + def isa Module ? def : def.module + else + Core # TODO: Is it reasonable to attribute callers without linfo to Core? + end end, _file=String(caller.file), _line=caller.line, diff --git a/base/loading.jl b/base/loading.jl index 1f3297df36448..0dadb558a789c 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -596,7 +596,8 @@ end function is_v1_format_manifest(raw_manifest::Dict) if haskey(raw_manifest, "manifest_format") - if raw_manifest["manifest_format"] isa Dict && haskey(raw_manifest["manifest_format"], "uuid") + mf = raw_manifest["manifest_format"] + if mf isa Dict && haskey(mf, "uuid") # the off-chance where an old format manifest has a dep called "manifest_format" return true end @@ -612,7 +613,7 @@ function get_deps(raw_manifest::Dict) return raw_manifest else # if the manifest has no deps, there won't be a `deps` field - return get(Dict{String, Any}, raw_manifest, "deps") + return get(Dict{String, Any}, raw_manifest, "deps")::Dict{String, Any} end end @@ -893,6 +894,7 @@ const TIMING_IMPORTS = Threads.Atomic{Int}(0) if staledeps === true continue end + staledeps = staledeps::Vector{Any} try touch(path_to_try) # update timestamp of precompilation file catch # file might be read-only and then we fail to update timestamp, which is fine @@ -1289,8 +1291,11 @@ include_string(m::Module, txt::AbstractString, fname::AbstractString="string") = function source_path(default::Union{AbstractString,Nothing}="") s = current_task().storage - if s !== nothing && haskey(s::IdDict{Any,Any}, :SOURCE_PATH) - return s[:SOURCE_PATH]::Union{Nothing,String} + if s !== nothing + s = s::IdDict{Any,Any} + if haskey(s, :SOURCE_PATH) + return s[:SOURCE_PATH]::Union{Nothing,String} + end end return default end @@ -1877,7 +1882,7 @@ function get_preferences_hash(uuid::Union{UUID, Nothing}, prefs_list::Vector{Str for name in prefs_list prefs_value = get(prefs, name, nothing) if prefs_value !== nothing - h = hash(prefs_value, h) + h = hash(prefs_value, h)::UInt end end # We always return a `UInt64` so that our serialization format is stable diff --git a/base/process.jl b/base/process.jl index 876eb74fbd413..57c4e0ebd874a 100644 --- a/base/process.jl +++ b/base/process.jl @@ -90,7 +90,7 @@ end @noinline function _spawn_primitive(file, cmd::Cmd, stdio::SpawnIOs) loop = eventloop() cpumask = cmd.cpus - cpumask === nothing || (cpumask = as_cpumask(cmd.cpus)) + cpumask === nothing || (cpumask = as_cpumask(cpumask)) GC.@preserve stdio begin iohandles = Tuple{Cint, UInt}[ # assuming little-endian layout let h = rawhandle(io) diff --git a/base/show.jl b/base/show.jl index 999a73047f6b2..607f13d3778e7 100644 --- a/base/show.jl +++ b/base/show.jl @@ -727,11 +727,11 @@ function show_typealias(io::IO, @nospecialize(x::Type)) end function make_typealiases(@nospecialize(x::Type)) - Any === x && return Core.svec(), Union{} - x <: Tuple && return Core.svec(), Union{} + aliases = SimpleVector[] + Any === x && return aliases, Union{} + x <: Tuple && return aliases, Union{} mods = modulesof!(Set{Module}(), x) Core in mods && push!(mods, Base) - aliases = SimpleVector[] vars = Dict{Symbol,TypeVar}() xenv = UnionAll[] each = Any[] @@ -783,23 +783,24 @@ function make_typealiases(@nospecialize(x::Type)) end end if isempty(aliases) - return Core.svec(), Union{} + return aliases, Union{} end - sort!(aliases, by = x -> x[4], rev = true) # heuristic sort by "best" environment + sort!(aliases, by = x -> x[4]::Tuple{Int,Int}, rev = true) # heuristic sort by "best" environment let applied = Union{} applied1 = Union{} keep = SimpleVector[] prev = (0, 0) for alias in aliases - if alias[4][1] < 2 + alias4 = alias[4]::Tuple{Int,Int} + if alias4[1] < 2 if !(alias[3] <: applied) applied1 = Union{applied1, alias[3]} push!(keep, alias) end - elseif alias[4] == prev || !(alias[3] <: applied) + elseif alias4 == prev || !(alias[3] <: applied) applied = applied1 = Union{applied1, alias[3]} push!(keep, alias) - prev = alias[4] + prev = alias4 end end return keep, applied1 @@ -825,16 +826,17 @@ function show_unionaliases(io::IO, x::Union) end if first && !tvar && length(aliases) == 1 alias = aliases[1] - wheres = make_wheres(io, alias[2], x) - show_typealias(io, alias[1], x, alias[2], wheres) + env = alias[2]::SimpleVector + wheres = make_wheres(io, env, x) + show_typealias(io, alias[1], x, env, wheres) show_wheres(io, wheres) else for alias in aliases print(io, first ? "Union{" : ", ") first = false - env = alias[2] - wheres = make_wheres(io, alias[2], x) - show_typealias(io, alias[1], x, alias[2], wheres) + env = alias[2]::SimpleVector + wheres = make_wheres(io, env, x) + show_typealias(io, alias[1], x, env, wheres) show_wheres(io, wheres) end if tvar @@ -879,7 +881,7 @@ end show(io::IO, @nospecialize(x::Type)) = _show_type(io, inferencebarrier(x)) function _show_type(io::IO, @nospecialize(x::Type)) if print_without_params(x) - show_type_name(io, unwrap_unionall(x).name) + show_type_name(io, (unwrap_unionall(x)::DataType).name) return elseif get(io, :compact, true) && show_typealias(io, x) return @@ -1006,7 +1008,7 @@ function show_datatype(io::IO, x::DataType, wheres::Vector{TypeVar}=TypeVar[]) end else show_type_name(io, x.name) - show_typeparams(io, parameters, unwrap_unionall(x.name.wrapper).parameters, wheres) + show_typeparams(io, parameters, (unwrap_unionall(x.name.wrapper)::DataType).parameters, wheres) end end diff --git a/base/stat.jl b/base/stat.jl index f8d28cadf0c72..f38a82634dc2f 100644 --- a/base/stat.jl +++ b/base/stat.jl @@ -146,7 +146,7 @@ show(io::IO, ::MIME"text/plain", st::StatStruct) = show_statstruct(io, st, false macro stat_call(sym, arg1type, arg) return quote - stat_buf = zeros(UInt8, ccall(:jl_sizeof_stat, Int32, ())) + stat_buf = zeros(UInt8, Int(ccall(:jl_sizeof_stat, Int32, ()))) r = ccall($(Expr(:quote, sym)), Int32, ($(esc(arg1type)), Ptr{UInt8}), $(esc(arg)), stat_buf) if !(r in (0, Base.UV_ENOENT, Base.UV_ENOTDIR, Base.UV_EINVAL)) uv_error(string("stat(", repr($(esc(arg))), ")"), r) diff --git a/base/toml_parser.jl b/base/toml_parser.jl index 66db0e5695551..c19572c2ebaed 100644 --- a/base/toml_parser.jl +++ b/base/toml_parser.jl @@ -1165,7 +1165,7 @@ function parse_string_continue(l::Parser, multiline::Bool, quoted::Bool)::Err{St end function take_chunks(l::Parser, unescape::Bool)::String - nbytes = sum(length, l.chunks) + nbytes = sum(length, l.chunks; init=0) str = Base._string_n(nbytes) offset = 1 for chunk in l.chunks From b1e1c52deeb125576e06f917453eb9e0df31912c Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Wed, 20 Apr 2022 11:51:32 -0400 Subject: [PATCH 139/369] gc-ext: only sweep unmarked objects (#45035) This prior conditional was a fixed constant branch, so this seems more like the intent. (cherry picked from commit ac51add4a610668835bb12db4913af1c2c16aaf8) --- src/gc.c | 13 +++++++------ test/gcext/gcext.c | 6 ++++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/gc.c b/src/gc.c index 609c2009bf103..6942d153616b9 100644 --- a/src/gc.c +++ b/src/gc.c @@ -552,20 +552,21 @@ JL_DLLEXPORT void jl_finalize_th(jl_task_t *ct, jl_value_t *o) arraylist_free(&copied_list); } +// explicitly scheduled objects for the sweepfunc callback static void gc_sweep_foreign_objs_in_list(arraylist_t *objs) { size_t p = 0; for (size_t i = 0; i < objs->len; i++) { - jl_value_t *v = (jl_value_t *)(objs->items[i]); - jl_datatype_t *t = (jl_datatype_t *)(jl_typeof(v)); + jl_value_t *v = (jl_value_t*)(objs->items[i]); + jl_datatype_t *t = (jl_datatype_t*)(jl_typeof(v)); const jl_datatype_layout_t *layout = t->layout; jl_fielddescdyn_t *desc = (jl_fielddescdyn_t*)jl_dt_layout_fields(layout); - if (!gc_ptr_tag(v, 1)) { + + int bits = jl_astaggedvalue(v)->bits.gc; + if (!gc_marked(bits)) desc->sweepfunc(v); - } - else { + else objs->items[p++] = v; - } } objs->len = p; } diff --git a/test/gcext/gcext.c b/test/gcext/gcext.c index 2b380c43feccb..b66f21bb660ee 100644 --- a/test/gcext/gcext.c +++ b/test/gcext/gcext.c @@ -561,8 +561,10 @@ void sweep_stack_data(jl_value_t *p) { obj_sweeps++; dynstack_t *stk = (dynstack_t *)p; - if (stk->size > stk->capacity) - jl_error("internal error during sweeping"); + if (stk->size > stk->capacity) { + assert(0 && "internal error during sweeping"); + abort(); + } } // Safely execute Julia code From 68ddba354fa9bb779301866fc1de694deb8bdb0c Mon Sep 17 00:00:00 2001 From: woclass Date: Sun, 24 Apr 2022 06:15:37 +0800 Subject: [PATCH 140/369] [doc] Add a Cover page to PDF doc (#45034) * Add cover page * use tikz logo * Add "Release Notes" to devdocs Co-authored-by: Viral B. Shah (cherry picked from commit 8a3b4ab77c95cd8b387f6819cecc2e768e1edaa1) --- doc/make.jl | 4 +- doc/src/assets/cover-splash.tex | 353 ++++++++++++++++++++++++++++++++ doc/src/assets/cover.tex | 46 +++++ doc/src/assets/custom.sty | 45 ++++ doc/src/assets/logo.tex | 142 +++++++++++++ doc/src/assets/preamble.tex | 48 +++++ 6 files changed, 636 insertions(+), 2 deletions(-) create mode 100644 doc/src/assets/cover-splash.tex create mode 100644 doc/src/assets/cover.tex create mode 100644 doc/src/assets/custom.sty create mode 100644 doc/src/assets/logo.tex create mode 100644 doc/src/assets/preamble.tex diff --git a/doc/make.jl b/doc/make.jl index f814ba43382e4..b33173398467d 100644 --- a/doc/make.jl +++ b/doc/make.jl @@ -175,8 +175,8 @@ const PAGES = [ "Manual" => ["index.md", Manual...], "Base" => BaseDocs, "Standard Library" => StdlibDocs, - "Developer Documentation" => DevDocs, - hide("NEWS.md"), + # Add "Release Notes" to devdocs + "Developer Documentation" => [DevDocs..., hide("NEWS.md")], ] else const PAGES = [ diff --git a/doc/src/assets/cover-splash.tex b/doc/src/assets/cover-splash.tex new file mode 100644 index 0000000000000..10409a14d5742 --- /dev/null +++ b/doc/src/assets/cover-splash.tex @@ -0,0 +1,353 @@ +%% Direct translation of the backsplash image in "JuliaLang/www.julialang.org" +%% And cropping of the image +%% https://github.com/JuliaLang/www.julialang.org/blob/main/_assets/infra/backsplash-min-0.5.svg + + +\newcommand{\splashScaleFactor}{0.6} +\newcommand{\whiteMaskTransparency}{0.5} +\newcommand{\triangleTransparency}{0.6} +\begin{tikzpicture}[x=1,y=1,yscale=-\splashScaleFactor,xscale=\splashScaleFactor,draw=white] +% Clipping +\clip (510,15) rectangle (1570,350); +% Cropping +\useasboundingbox(510,0) rectangle (1570,350.0); +% gary background +% \draw[fill=splash_gary,opacity=0] (510.0,0.0)--++(1057.5,0.0)--++(0.0,350.0)--++(-1057.5,0.0)--cycle; + +%% Draw triangles +\draw[fill=julia_red,opacity=\triangleTransparency] + (991.9,11.4)--++(51.5,19.7)--++(-56.2,25.3) + ++(56.8,56.9)--++(-47.4,-27.5)--++(48.4,-52.2) + (990.9,9.0)--++(-40.6,1.4)--++(125.4,-21.0) + (969.5,111.5)--++(35.3,20.8)--++(-45.2,3.6) + (952.4,205.8)--++(14.0,55.9)--++(-44.7,-29.8) + ++(33.8,-160.3)--++(12.1,37.4)--++(-63.5,-1.9) + (946.8,335.7)--++(-6.5,-33.3)--++(58.2,17.6) + (920.0,235.8)--++(17.8,64.6)--++(-39.3,15.0) + ++(-0.7,3.0)--++(45.6,18.6)--++(-51.2,22.3) + (910.2,17.7)--++(43.6,51.2)--++(-72.1,-0.9) + (901.8,109.5)--++(53.8,27.4)--++(-62.3,24.5) + (885.4,204.6)--++(32.3,26.8)--++(-47.1,9.2) + (879.5,70.3)--++(19.3,35.8)--++(-54.1,-22.0) + (870.0,317.0)--++(0.0,-69.4)--++(25.6,68.5) + (868.7,319.7)--++(20.5,40.0)--++(-53.1,-8.4) + (867.4,190.9)--++(-12.9,-43.1)--++(35.8,15.6) + (866.0,193.8)--++(1.9,45.8)--++(-63.6,-57.1) + (815.2,79.7)--++(-16.2,-17.1)--++(65.6,-10.8) + ++(3.4,-40.0)--++(0.9,35.9)--++(-50.7,-41.5) + (801.8,362.7)--++(-7.3,-40.3)--++(37.5,29.3) + ++(-16.2,-267.4)--++(35.8,61.3)--++(-41.5,22.6) + (796.4,60.5)--++(-49.1,-26.4)--++(66.1,-27.4) + (765.0,352.3)--++(-0.9,-61.7)--++(27.6,29.5) + (758.0,131.6)--++(40.8,48.4)--++(-80.7,-0.9) + ++(66.2,78.4)--++(-38.6,-22.6)--++(53.7,-50.9) + (741.8,98.9)--++(14.7,30.4)--++(-45.1,7.4) + (720.7,321.9)--++(38.2,30.3)--++(-40.8,-13.9) + (716.2,182.1)--++(19.5,30.7)--++(-50.2,38.1) + (708.3,140.2)--++(6.5,39.0)--++(-52.0,9.3) + ++(4.7,130.8)--++(46.6,19.6)--++(-64.3,20.5) + ++(33.5,-102.7)--++(34.9,62.2)--++(-50.0,-1.9) + (697.1,1.3)--++(3.7,57.5)--++(-37.1,-47.3) + ++(20.3,86.2)--++(-30.6,-59.4)--++(47.4,24.1) + (660.1,193.2)--++(21.3,59.2)--++(-35.1,-12.0) + (650.6,34.4)--++(-49.2,-41.9)--++(59.2,19.1) + (641.9,103.0)--++(40.0,-1.9)--++(-45.6,59.5) + (640.4,99.6)--++(-46.4,-58.7)--++(55.9,-3.8) + (611.6,316.3)--++(34.5,43.8)--++(-43.8,2.8) + (600.4,137.3)--++(-7.1,-17.7)--++(43.4,-15.0) + (596.6,210.6)--++(44.0,28.8)--++(-49.4,-7.2) + (591.0,41.9)--++(0.0,71.1)--++(-19.8,-57.6) + (551.4,303.2)--++(-11.2,-49.5)--++(47.7,-18.7) + (541.9,104.3)--++(47.4,14.9)--++(-51.2,25.1) + (540.0,214.9)--++(-1.9,-66.3)--++(55.9,59.6) + ++(-2.7,-170.7)--++(-44.8,-53.2)--++(49.5,6.5) + (512.0,192.8)--++(-28.2,-58.3)--++(51.7,12.2) + ++(-23.0,50.0)--++(24.9,19.4)--++(-44.3,38.8) + (503.7,105.9)--++(-15.7,-57.3)--++(50.9,53.6) + (487.0,42.5)--(487.0,6.7)--++(53.2,-21.1) + (1602.3,36.6)--++(12.3,58.5)--++(-57.5,-32.1) + (1545.2,19.0)--++(-49.1,-29.1)--++(117.4,19.1) + (1538.8,89.3)--++(67.7,71.6)--++(-73.5,-3.8) + (1537.9,366.1)--++(-2.9,-80.5)--++(70.9,33.6) + (1532.0,159.8)--++(18.4,27.6)--++(-47.0,12.9) + ++(34.3,-114.6)--++(-48.3,-30.1)--++(63.8,8.2) + (1501.7,203.7)--++(63.0,41.4)--++(-71.5,0.9) + (1499.9,137.4)--++(-43.1,-47.7)--++(59.6,25.7) + (1493.0,315.9)--++(0.0,-66.7)--++(39.5,34.8) + (1491.7,319.6)--++(15.7,27.7)--++(-60.1,12.0) + (1469.9,265.9)--++(20.1,49.8)--++(-21.0,-12.2) + (1445.7,193.2)--++(21.8,66.4)--++(-57.8,-16.1) + ++(44.0,-158.6)--++(-7.4,-46.2)--++(37.0,15.7) + (1433.7,139.9)--++(-33.8,-45.1)--++(51.7,-6.6) + ++(-7.4,-52.1)--++(-30.1,1.8)--++(38.3,-51.9) + (1418.7,179.9)--++(-19.1,-27.3)--++(32.7,-9.1) + (1407.3,246.3)--++(7.5,63.2)--++(-49.1,-17.0) + (1384.6,-17.4)--++(24.9,53.5)--++(-49.9,-34.2) + (1367.2,191.1)--++(-28.2,-58.4)--++(57.4,19.8) + (1364.4,296.2)--++(23.2,49.3)--++(-35.3,17.7) + (1301.7,135.9)--++(-4.3,-16.4)--++(35.3,11.2) + (1297.0,116.5)--++(-1.9,-78.9)--++(52.3,57.0) + ++(-49.6,-80.8)--++(48.0,38.2)--++(-50.7,-17.8) + (1296.9,251.9)--++(-8.5,-57.6)--++(69.0,52.0) + (1295.1,254.1)--++(7.4,59.0)--++(-37.8,-54.3) + ++(23.2,74.8)--++(-32.1,-28.5)--++(46.3,12.5) + (1288.0,336.1)--++(55.2,26.3)--++(-77.0,-15.8) + (1258.6,34.5)--++(-14.0,-47.5)--++(50.3,25.2) + ++(-8.4,177.8)--++(-32.7,-39.3)--++(45.8,-12.2) + (1255.1,194.9)--++(6.6,60.1)--++(-60.1,-69.5) + ++(49.7,116.1)--++(-66.9,-32.0)--++(77.2,-10.4) + ++(-10.2,45.7)--++(10.3,41.3)--++(-66.6,13.1) + (1249.1,118.0)--++(1.8,31.1)--++(-43.9,1.8) + (1187.6,-8.5)--++(17.0,65.3)--++(-53.0,-5.7) + (1182.3,316.6)--++(8.3,42.4)--++(-40.6,-24.0) + (1180.3,267.6)--++(-31.7,-12.1)--++(48.5,-67.1) + (1180.1,271.2)--++(1.8,42.2)--++(-31.2,-14.7) + (1150.7,162.1)--++(-7.6,-81.0)--++(57.2,7.6) + (1146.0,256.9)--++(1.9,39.9)--++(-56.7,-44.6) + ++(55.8,81.3)--++(-43.2,-14.7)--++(44.1,-18.4) + (1141.6,77.9)--++(-32.5,-38.8)--++(39.7,13.5) + ++(-40.4,87.8)--++(39.0,24.2)--++(-60.4,13.9) + (1108.9,-14.3)--++(21.7,26.3)--++(-23.5,22.6) + (1108.3,136.4)--++(-14.1,-53.4)--++(45.9,-1.9) + (1066.9,169.8)--++(16.8,10.6)--++(-19.4,35.3) + ++(-15.7,97.5)--++(-10.4,-69.9)--++(48.2,8.5) + (1066.5,166.5)--++(-19.7,-49.7)--++(59.1,22.5) + (1058.4,4.5)--++(43.9,31.1)--++(-54.9,-5.5) + (1048.8,317.1)--++(48.4,2.7)--++(-55.7,27.4) + (1037.4,240.4)--++(-15.5,-33.7)--++(39.1,13.6) + (1007.4,135.4)--++(11.4,68.6)--++(-63.8,-0.9) + (1005.9,249.3)--++(40.4,65.8)--++(-43.3,3.8); + +\draw[fill=julia_purple,opacity=\triangleTransparency] + (995.4,84.1)--++(-8.2,-25.5)--++(54.7,-24.6) + (969.5,108.2)--++(-11.9,-36.5)--++(35.6,14.6) + (967.9,265.8)--++(31.9,52.5)--++(-59.1,-17.8) + ++(28.0,-37.9)--++(-14.0,-55.9)--++(48.5,39.1) + (952.1,202.2)--++(-58.0,-39.0)--++(62.7,-24.7) + (891.2,161.6)--++(-36.3,-15.8)--++(44.7,-35.4) + ++(-19.6,-43.5)--++(-8.8,-16.7)--++(35.1,-29.8) + (884.3,201.4)--++(-15.7,-8.7)--++(21.8,-26.2) + (841.1,84.9)--++(9.9,55.8)--++(-34.2,-58.4) + ++(-7.5,89.0)--++(47.9,19.0)--++(-54.5,-9.9) + (815.2,4.0)--++(-37.7,-10.6)--++(69.6,14.2) + ++(-45.4,175.3)--++(65.2,58.5)--++(-80.6,16.3) + (784.3,261.5)--++(7.3,55.5)--++(-27.3,-29.1) + ++(-18.4,-252.3)--++(49.1,26.4)--++(-51.9,33.1) + (762.0,290.0)--++(0.9,62.9)--++(-41.3,-32.9) + (758.3,128.4)--++(-14.9,-30.7)--++(67.9,-14.9) + (744.5,233.2)--++(-6.3,-19.7)--++(57.2,-28.6) + (744.2,32.2)--++(-43.9,-31.7)--++(49.5,-12.1) + (709.1,136.3)--++(-23.3,-35.4)--++(54.0,-2.8) + (635.0,165.5)--++(23.1,24.0)--++(-59.1,17.6) + (611.3,311.1)--++(-19.9,-76.8)--++(52.2,7.6) + (591.5,120.4)--++(7.1,17.8)--++(-56.0,6.2) + (551.3,307.9)--++(47.1,54.6)--++(-64.0,-12.2) + (540.0,251.5)--++(0.0,-34.1)--++(47.1,15.7) + ++(-16.6,-179.6)--++(-23.7,-65.5)--++(43.7,51.9) + (538.7,256.1)--++(11.1,49.2)--++(-38.0,8.4) + ++(29.1,-212.2)--++(-52.2,-55.0)--++(79.7,9.5) + (1608.2,159.7)--++(-67.6,-71.4)--++(74.2,9.5) + (1567.8,247.7)--++(37.8,69.1)--++(-70.0,-33.1) + (1555.7,61.5)--++(-9.3,-40.1)--++(54.0,14.0) + (1518.1,113.1)--++(-30.4,-56.3)--++(48.9,30.4) + (1517.6,117.1)--++(12.6,38.6)--++(-28.8,-17.1) + ++(7.4,207.0)--++(-15.5,-27.4)--++(38.4,-31.1) + (1484.1,52.5)--++(-37.4,-15.9)--++(43.0,-45.8) + ++(-20.2,268.7)--++(-20.9,-63.7)--++(41.9,51.0) + (1446.6,189.1)--++(-11.3,-46.1)--++(62.1,-2.8) + (1443.9,358.7)--++(-26.3,-46.9)--++(48.8,-6.6) + (1419.8,183.3)--++(24.6,8.2)--++(-34.6,48.3) + (1412.5,41.1)--++(38.5,45.1)--++(-51.7,6.6) + (1367.7,195.4)--++(38.3,47.7)--++(-44.9,2.8) + ++(-2.4,-242.2)--++(50.9,34.8)--++(-57.4,15.1) + (1359.1,248.1)--++(3.7,43.1)--++(-63.7,-37.4) + ++(37.6,-120.9)--++(28.6,59.1)--++(-76.3,-1.0) + (1351.9,57.0)--++(43.4,36.0)--++(-45.2,0.9) + (1336.4,129.8)--++(-37.5,-11.9)--++(48.5,-21.0) + (1304.0,318.5)--++(42.3,43.2)--++(-56.7,-27.0) + (1293.0,36.0)--++(1.9,77.2)--++(-35.3,-76.3) + (1256.9,192.9)--++(-3.6,-39.8)--++(31.7,38.0) + (1252.9,148.1)--++(-1.8,-31.1)--++(42.0,1.8) + (1204.9,153.0)--++(43.5,-1.8)--++(-48.0,30.8) + (1201.2,86.2)--++(-47.4,-32.8)--++(51.1,5.5) + ++(1.4,-3.7)--++(-17.0,-65.3)--++(52.0,-3.8) + (1201.1,91.1)--++(1.9,60.1)--++(-50.7,12.2) + (1184.0,313.8)--++(-1.9,-43.2)--++(66.7,31.9) + (1155.9,186.0)--++(41.1,-0.9)--++(-48.6,67.3) + (1149.3,166.2)--++(4.4,17.7)--++(-62.0,-4.4) + (1132.3,10.8)--++(-22.0,-26.6)--++(73.4,5.5) + (1131.7,13.7)--++(16.5,36.6)--++(-40.3,-13.7) + (1101.8,317.6)--++(-12.3,-64.2)--++(57.6,45.3) + (1092.5,80.0)--++(-44.0,-47.8)--++(56.2,5.6) + (1092.4,83.6)--++(14.1,53.7)--++(-59.4,-22.6) + (1062.9,221.4)--++(22.7,28.1)--++(-46.3,-8.2) + (1057.8,2.0)--++(-50.7,5.3)--++(88.5,-20.4) + (1036.2,243.1)--++(10.1,68.2)--++(-39.6,-64.5) + ++(32.7,100.5)--++(-34.7,-26.5)--++(42.0,-3.7) + (1020.7,203.2)--++(-11.4,-68.2)--++(54.9,33.1) + (1008.6,131.6)--++(-12.0,-43.5)--++(46.3,26.8) + (1001.4,321.2)--++(14.9,40.1)--++(-67.1,-24.2); + +\draw[fill=julia_green,opacity=\triangleTransparency] + (994.5,87.8)--++(11.9,43.0)--++(-35.7,-21.1) + ++(-11.7,28.1)--++(46.9,-3.8)--++(-51.6,66.6) + ++(-8.2,137.3)--++(66.0,23.8)--++(-116.4,-1.8) + (985.4,59.3)--++(8.0,24.9)--++(-34.7,-14.2) + (985.2,55.9)--++(-47.7,-43.0)--++(52.4,-1.9) + (957.5,135.6)--++(-52.1,-26.5)--++(62.1,1.8) + (935.0,11.0)--++(-170.3,-23.1)--++(330.5,-3.7) + (934.3,13.1)--++(18.8,52.0)--++(-41.3,-48.4) + (901.4,106.5)--++(-19.7,-36.5)--++(71.2,0.9) + (896.9,313.7)--++(-26.5,-71.0)--++(48.3,-9.5) + (892.7,164.7)--++(56.9,38.3)--++(-63.5,-0.9) + (890.4,357.7)--++(-19.8,-38.8)--++(25.2,-0.9) + (870.9,47.9)--++(-0.9,-35.8)--++(37.6,4.6) + (869.8,51.8)--++(8.8,16.7)--++(-33.4,13.2) + ++(24.6,155.7)--++(-1.7,-42.6)--++(15.7,8.7) + (868.0,243.2)--++(0.0,72.9)--++(-80.5,-56.6) + ++(28.0,-252.8)--++(52.1,42.7)--++(-69.2,11.4) + (852.4,147.5)--++(13.1,43.8)--++(-54.1,-21.5) + (833.9,350.7)--++(-38.1,-29.8)--++(70.7,-1.9) + (800.9,179.4)--++(-35.9,-42.6)--++(42.6,33.4) + ++(-55.8,-181.9)--++(60.1,16.9)--++(-65.7,27.2) + (796.8,63.3)--++(16.2,17.1)--++(-65.8,14.4) + (763.3,285.9)--++(-17.4,-48.7)--++(37.7,22.0) + (736.5,214.7)--++(6.3,19.7)--++(-54.6,17.0) + (720.3,318.5)--++(-35.0,-62.5)--++(75.7,32.2) + (717.0,340.1)--++(41.8,14.2)--++(-103.1,5.3) + (716.6,177.7)--++(-6.5,-38.9)--++(45.3,-7.4) + (702.9,60.2)--++(-3.8,-58.2)--++(44.1,31.9) + (702.3,63.6)--++(37.1,32.5)--++(-53.9,2.8) + (683.9,101.7)--++(23.5,35.8)--++(-69.6,24.5) + ++(45.3,89.4)--++(-21.8,-60.5)--++(53.0,-9.5) + (666.9,314.1)--++(-20.4,-71.6)--++(35.3,12.1) + (662.2,12.9)--++(36.2,46.1)--++(-46.1,-23.5) + (651.5,39.2)--++(30.9,59.9)--++(-40.2,1.9) + (647.8,359.1)--++(-34.6,-43.9)--++(52.3,3.7) + (644.4,239.4)--++(-46.1,-30.1)--++(60.2,-17.9) + (634.2,162.2)--++(-32.6,-23.3)--++(38.2,-34.4) + (595.1,206.6)--++(-56.0,-59.8)--++(59.8,-6.6) + (589.7,235.7)--++(20.0,77.1)--++(-57.1,-7.6) + (569.8,57.3)--++(20.7,60.1)--++(-47.9,-15.0) + (538.0,218.2)--++(0.0,33.9)--++(-44.0,4.6) + ++(42.2,-113.1)--++(-31.2,-35.8)--++(34.9,-3.7) + (532.8,348.8)--++(-21.2,-33.2)--++(37.8,-8.3) + (496.9,336.0)--++(30.8,13.7)--++(-86.5,-4.3) + (486.2,4.8)--++(-20.6,-17.9)--++(72.7,-2.7) + (1607.2,320.8)--++(4.7,48.2)--++(-71.8,-1.9) + ++(15.2,-302.8)--++(55.7,31.0)--++(-71.2,-9.1) + (1602.6,33.9)--++(-52.5,-13.6)--++(67.9,-10.0) + (1588.5,189.0)--++(-32.4,-1.8)--++(49.9,-22.8) + (1551.3,189.2)--++(15.0,54.5)--++(-62.9,-41.3) + (1544.3,21.5)--++(9.4,40.3)--++(-65.6,-8.4) + (1533.2,288.9)--++(2.8,77.1)--++(-25.7,-18.4) + (1531.4,153.0)--++(-12.3,-37.8)--++(17.6,-24.6) + (1502.0,198.9)--++(-0.9,-58.1)--++(29.5,17.5) + (1491.0,248.8)--++(0.0,64.1)--++(-20.8,-51.4) + (1484.8,55.7)--++(31.0,57.3)--++(-61.0,-26.3) + (1454.8,-16.9)--++(34.2,5.5)--++(-42.5,45.2) + (1453.4,88.9)--++(44.4,49.2)--++(-62.4,2.8) + ++(56.0,103.8)--++(-42.9,-52.2)--++(51.3,10.3) + (1444.2,38.1)--++(7.3,45.6)--++(-37.4,-43.8) + (1433.8,145.4)--++(10.8,44.1)--++(-24.3,-8.1) + (1416.8,308.9)--++(-7.6,-63.5)--++(57.9,16.1) + (1412.2,37.0)--++(-25.6,-55.0)--++(65.5,0.9) + (1399.0,150.7)--(1399,97.0)--++(33.3,44.4) + (1398.0,153.7)--++(19.3,27.6)--++(-47.9,10.1) + (1397.4,92.2)--++(-44.3,-36.7)--++(57.5,-15.1) + ++(-21.4,303.7)--++(-23.3,-49.4)--++(48.4,16.8) + (1389.105,347.066)--++(48.442,13.211)--++(-81.91,3.524) + (1364.8,290.6)--++(-3.7,-42.7)--++(44.5,-2.8) + (1359.2,245.2)--++(-69.2,-52.1)--++(75.8,0.9) + (1350.4,362.9)--++(-44.6,-45.5)--++(56.9,-22.8) + (1350.2,53.1)--++(-50.9,-40.5)--++(57.4,-9.4) + (1349.4,97.0)--++(45.4,52.9)--++(-56.6,-19.5) + (1301.8,137.9)--++(32.7,-5.5)--++(-45.5,55.5) + (1297.1,10.9)--++(-50.1,-25.0)--++(131.6,-3.7) + (1295.4,119.7)--++(4.4,16.6)--++(-42.9,11.4) + ++(6.5,112.7)--++(38.2,54.9)--++(-48.4,-13.0) + (1286.6,196.1)--++(8.3,56.1)--++(-30.4,4.6) + ++(28.6,-222.7)--++(-31.4,0.9)--++(34.0,-20.9) + (1263.0,348.0)--++(76.7,15.7)--++(-138.7,-3.5) + (1251.2,151.7)--++(3.7,41.1)--++(-53.2,-9.3) + (1249.3,113.4)--++(-41.7,-54.9)--++(49.3,-20.8) + ++(-57.3,148.6)--++(61.5,71.1)--++(-78.8,10.6) + (1204.9,150.0)--++(-1.9,-60.2)--++(45.2,26.3) + (1192.6,359.0)--++(-8.5,-43.2)--++(64.8,-11.3) + (1155.8,184.0)--++(-4.3,-17.4)--++(42.5,16.5) + ++(-43.4,-129.5)--++(47.4,32.8)--++(-54.7,-7.3) + (1150.1,49.9)--++(-16.8,-37.3)--++(52.2,-21.5) + ++(-37.5,345.1)--++(40.4,23.9)--++(-72.5,1.8) + (1149.9,296.8)--++(-1.8,-39.3)--++(31.1,11.9) + ++(-29.2,31.2)--++(30.9,14.5)--++(-31.8,18.2) + (1141.3,83.2)--++(7.5,79.9)--++(-39.5,-24.4) + ++(36.8,116.3)--++(-55.9,-4.7)--++(63.4,-62.5) + (1106.4,39.1)--++(33.5,40.0)--++(-45.6,1.9) + (1105.1,35.1)--++(-45.0,-31.9)--++(46.9,-18.7) + (1100.4,320.4)--++(11.3,41.3)--++(-68.5,-13.1) + (1087.5,253.7)--++(12.3,64.2)--++(-50.0,-2.8) + (1084.2,183.6)--++(2.7,64.4)--++(-22.7,-28.1) + ++(-17.2,-186.4)--++(44.5,48.3)--++(-45.5,31.3) + (1045.5,29.7)--++(-50.2,-19.2)--++(61.1,-6.4) + (1044.5,116.4)--++(19.5,49.2)--++(-53.9,-32.5) + (1020.1,207.6)--++(15.4,33.5)--++(-29.0,3.6) + ++(12.0,116.7)--++(-14.4,-38.6)--++(34.1,26.0) + (1001.1,316.6)--++(-31.7,-52.2)--++(34.5,-16.8); + +\draw[fill=julia_blue,opacity=\triangleTransparency] + (956.6,68.7)--++(-19.3,-53.3)--++(46.8,42.2) + (939.4,298.8)--++(-17.8,-64.5)--++(44.9,29.9) + (938.2,302.4)--++(6.4,33.0)--++(-44.9,-18.3) + (920.0,230.7)--++(-32.2,-26.7)--++(62.5,0.9) + (869.1,10.0)--++(-88.1,-17.9)--++(137.3,18.7) + (853.7,144.2)--++(-10.4,-58.6)--++(55.7,22.7) + (841.6,82.9)--++(-23.4,-2.6)--++(47.6,-26.8) + (808.1,168.1)--++(-48.6,-38.1)--++(54.3,-46.7) + (793.9,319.0)--++(-7.6,-57.9)--++(79.7,56.0) + (792.4,322.3)--++(7.3,40.4)--++(-34.0,-8.3) + (743.4,236.2)--++(17.9,49.9)--++(-75.4,-32.0) + (741.1,94.9)--++(-37.5,-32.8)--++(40.3,-26.2) + (737.4,211.7)--++(-19.5,-30.7)--++(79.0,0.9) + (716.2,337.6)--++(-43.8,-18.4)--++(46.4,1.8) + (662.0,10.0)--++(-55.8,-18.0)--++(86.8,8.6) + (660.0,188.6)--++(-23.2,-24.1)--++(68.7,-24.1) + (644.8,243.8)--++(20.9,73.0)--++(-53.1,-3.8) + (600.4,361.8)--++(-47.0,-54.5)--++(56.3,7.5) + ++(-8.9,-174.0)--++(32.6,23.3)--++(-36.4,42.0) + (597.8,-8.0)--++(50.7,43.2)--++(-55.4,3.8) + (593.0,117.6)--++(0.0,-74.7)--++(46.3,58.6) + (589.3,231.7)--++(-45.8,-15.3)--++(51.2,-6.3) + (543.6,-15.1)--++(24.9,68.9)--++(-80.4,-9.6) + (536.1,149.9)--++(1.8,64.0)--++(-24.7,-19.2) + ++(-3.1,117.6)--++(-17.8,-53.4)--++(45.0,-4.7) + (510.0,316.9)--++(20.4,31.9)--++(-31.9,-14.2) + ++(4.5,-226.0)--++(31.2,35.8)--++(-50.4,-11.9) + (1552.4,186.7)--++(-18.4,-27.6)--++(70.9,3.7) + (1533.9,282.6)--++(-39.3,-34.6)--++(71.1,-0.9) + ++(2.4,-4.3)--++(-14.8,-53.7)--++(34.3,1.9) + (1508.8,349.1)--++(24.7,17.7)--++(-82.2,-6.2) + (1499.0,141.3)--++(0.9,59.5)--++(-51.9,-10.4) + (1491.9,-10.3)--++(51.2,30.3)--++(-56.8,32.2) + (1468.5,305.4)--++(21.8,12.7)--++(-43.7,39.1) + (1467.0,303.1)--++(-48.1,6.5)--++(49.0,-46.2) + (1415.9,312.8)--++(26.1,46.6)--++(-51.3,-14.0) + (1407.4,241.7)--++(-38.6,-48.0)--++(49.0,-10.4) + (1397.0,95.0)--++(0.0,54.3)--++(-45.9,-53.3) + (1357.6,1.1)--++(-49.6,8.1)--++(71.5,-25.2) + (1348.1,92.6)--++(-50.7,-55.3)--++(52.5,18.4) + (1304.8,315.6)--++(-7.6,-60.7)--++(64.5,37.9) + (1263.5,253.6)--++(-6.4,-58.7)--++(28.4,-1.8) + ++(-21.9,152.5)--++(-9.9,-39.7)--++(32.5,28.9) + (1258.6,39.7)--++(35.8,77.2)--++(-43.3,-1.9) + (1242.8,-12.3)--++(14.0,47.7)--++(-48.7,20.6) + (1206.7,60.5)--++(39.5,52.1)--++(-43.1,-25.1) + (1198.2,182.6)--++(-44.9,-17.4)--++(49.4,-11.9) + (1113.6,361.3)--++(-11.1,-40.7)--++(43.5,14.8) + (1088.9,248.7)--++(-2.9,-67.6)--++(66.7,4.8) + (1084.6,178.6)--++(-16.8,-10.6)--++(37.2,-25.7) + (1062.1,218.6)--++(-40.0,-14.0)--++(42.8,-34.5) + (1004.5,244.3)--++(-48.7,-39.3)--++(62.7,0.9); + +% White Mask +\draw[fill=white,opacity=\whiteMaskTransparency] (500,0)--(1560,0)--(1560,360)--(500,360)--cycle; +\end{tikzpicture} diff --git a/doc/src/assets/cover.tex b/doc/src/assets/cover.tex new file mode 100644 index 0000000000000..67b77e520acd3 --- /dev/null +++ b/doc/src/assets/cover.tex @@ -0,0 +1,46 @@ +%% ============================================================================ +%% Custom tex styles, including this file, add a custom cover to the document. +%% +%% These custom styles include: +%% - `cover.tex`: This file, The main definition of the cover, +%% used to replace the default `\maketitle` command. +%% - `custom.sty`: Load the macro package required for the cover, +%% define the background image style, etc. +%% - `preamble.tex`: Replace the default preamble for inserting a custom cover. +%% - `logo.tex`: logo of julia. +%% - `cover-splash.tex`: Background image of the cover title, +%% from julia's homepage. +%% ============================================================================ + +%% ---- reset page geometry for cover page +\newgeometry{left=2cm,right=2cm,bottom=3cm} +% ref: memman@v3.7q, P65, "4.1. Styling the titling" +% http://mirrors.ctan.org/macros/latex/contrib/memoir/memman.pdf +\begin{titlingpage} + % set background image + \BgThispage + \vspace*{2.2cm} + + %% Centering content + \begin{center} + %% Main Heading + \textcolor{black}{ \MainHeading \DocMainTitle } + \vfill + + %% logo + % logo scale factor + \newcommand{\scaleFactor}{0.5} + \input{./assets/logo} + \\[1.5cm] + % git tag or doc version + { \SecondaryHeading V\JuliaVersion\ } + \vfill + + { \HUGE \DocAuthors } + \\[0.5cm] + % build time + { \huge \today } + \end{center} +\end{titlingpage} +\restoregeometry +%% ---- restore geometry diff --git a/doc/src/assets/custom.sty b/doc/src/assets/custom.sty new file mode 100644 index 0000000000000..f257d2d3d2174 --- /dev/null +++ b/doc/src/assets/custom.sty @@ -0,0 +1,45 @@ +%% Load the macro package required for the cover. + + +%% pkg for make cover page BEGIN ---------------------------------------------- +% Load `geometry' to modify margins later +\usepackage{geometry} +% "some": use \BgThispage to change background +% ref: background@v2.1,# 2.1 Options, "pages=" +% http://mirrors.ctan.org/macros/latex/contrib/background/background.pdf +\usepackage[pages=some]{background} + +%% Color definitions for Julia +%% https://github.com/JuliaLang/julia-logo-graphics#color-definitions +\definecolor{julia_blue} {HTML}{4063D8} +\definecolor{julia_green} {HTML}{389826} +\definecolor{julia_purple}{HTML}{9558B2} +\definecolor{julia_red} {HTML}{CB3C33} +\definecolor{splash_gary} {HTML}{1A1A33} + +% ---- define heading background +% ref: background.pdf, #2.1 Options +\backgroundsetup{ +scale=1, % scaling factor +angle=0, % counterclockwise angle +opacity=1, % transparency +contents={ +%% Place the background image `title-bg' in the right place via `tikz'. +% tikz option "remember picture", "overlay" +% ref: pgfmanual@3.1.9a, #17.13.1 Referencing a Node in a Different Picture\ +% http://mirrors.ctan.org/graphics/pgf/base/doc/pgfmanual.pdf +\begin{tikzpicture}[remember picture,overlay,draw=white] + \draw [path picture={ + % ref: pgfmanual, 15.6, "Predefined node path picture bounding box" + \node at (path picture bounding box.center){ + \input{assets/cover-splash} + };}] (-0.5\paperwidth,4cm) rectangle (0.5\paperwidth,11cm); + % Put picture to right place + % ref: pgfmanual, #2.6 Rectangle Path Construction +\end{tikzpicture} +}}% + +% ---- Heading font style +\DeclareFixedFont{\MainHeading}{T1}{phv}{b}{n}{1.5cm} +\DeclareFixedFont{\SecondaryHeading}{T1}{phv}{b}{n}{0.8cm} +%% cover page END ------------------------------------------------------------- diff --git a/doc/src/assets/logo.tex b/doc/src/assets/logo.tex new file mode 100644 index 0000000000000..a19022140d17f --- /dev/null +++ b/doc/src/assets/logo.tex @@ -0,0 +1,142 @@ + +%% Direct translation of the Julia logo definition code in Luxor.jl +%% https://github.com/JuliaGraphics/Luxor.jl/blob/master/src/juliagraphics.jl#L62 +\begin{tikzpicture}[x=1,y=1,yscale=-\scaleFactor,xscale=\scaleFactor] +% Blue circle in "j" +\path[fill=julia_blue] (77.953125, 68.08984375) .. + controls (77.953125, 77.7578125) and (70.1171875, 85.58984375) .. (60.453125, 85.58984375) .. + controls (50.7890625, 85.58984375) and (42.953125, 77.7578125) .. (42.953125, 68.08984375) .. + controls (42.953125, 58.42578125) and (50.7890625, 50.58984375) .. (60.453125, 50.58984375) .. + controls (70.1171875, 50.58984375) and (77.953125, 58.42578125) .. (77.953125, 68.08984375); + +% Letter "j" +\path[fill=black] (72.87109375, 177.3125) .. + controls (72.87109375, 184.84765625) and (72.0234375, 190.93359375) .. (70.328125, 195.56640625) .. + controls (68.6328125, 200.203125) and (66.22265625, 203.80078125) .. (63.09375, 206.36328125) .. + controls (59.96875, 208.92578125) and (56.21875, 210.640625) .. (51.84765625, 211.5078125) .. + controls (47.4765625, 212.37109375) and (42.61328125, 212.8046875) .. (37.265625, 212.8046875) .. + controls (30.02734375, 212.8046875) and (24.48828125, 211.67578125) .. (20.6484375, 209.4140625) .. + controls (16.8046875, 207.15234375) and (14.8828125, 204.44140625) .. (14.8828125, 201.2734375) .. + controls (14.8828125, 198.63671875) and (15.953125, 196.4140625) .. (18.1015625, 194.60546875) .. + controls (20.25, 192.796875) and (23.1328125, 191.89453125) .. (26.75, 191.89453125) .. + controls (29.46484375, 191.89453125) and (31.6328125, 192.62890625) .. (33.25, 194.09765625) .. + controls (34.87109375, 195.56640625) and (36.2109375, 197.01953125) .. (37.265625, 198.44921875) .. + controls (38.46875, 200.03125) and (39.48828125, 201.0859375) .. (40.31640625, 201.61328125) .. + controls (41.14453125, 202.140625) and (41.8984375, 202.40625) .. (42.578125, 202.40625) .. + controls (44.0078125, 202.40625) and (45.1015625, 201.55859375) .. (45.85546875, 199.86328125) .. + controls (46.609375, 198.16796875) and (46.984375, 194.87109375) .. (46.984375, 189.97265625) -- + (46.984375, 97.05078125) -- + (72.87109375, 89.9296875) -- + cycle; + +% Letter "u" +\path[fill=black] (109.73828125, 92.4140625) -- + (109.73828125, 152.21484375) .. + controls (109.73828125, 153.875) and (110.05859375, 155.4375) .. (110.69921875, 156.90625) .. + controls (111.33984375, 158.375) and (112.2265625, 159.640625) .. (113.35546875, 160.6953125) .. + controls (114.48828125, 161.75) and (115.8046875, 162.59765625) .. (117.3125, 163.23828125) .. + controls (118.8203125, 163.87890625) and (120.44140625, 164.19921875) .. (122.17578125, 164.19921875) .. + controls (124.1328125, 164.19921875) and (126.359375, 163.1015625) .. (129.0703125, 161.203125) .. + controls (133.36328125, 158.1953125) and (135.96484375, 156.12890625) .. (135.96484375, 153.68359375) .. + controls (135.96484375, 153.09765625) and (135.96484375, 92.4140625) .. (135.96484375, 92.4140625) -- + (161.73828125, 92.4140625) -- + (161.73828125, 177.3125) -- + (135.96484375, 177.3125) -- + (135.96484375, 169.3984375) .. + controls (132.57421875, 172.26171875) and (128.95703125, 174.55859375) .. (125.11328125, 176.29296875) .. + controls (121.26953125, 178.02734375) and (117.5390625, 178.89453125) .. (113.921875, 178.89453125) .. + controls (109.703125, 178.89453125) and (105.78125, 178.1953125) .. (102.1640625, 176.80078125) .. + controls (98.546875, 175.40625) and (95.3828125, 173.50390625) .. (92.671875, 171.09375) .. + controls (89.95703125, 168.68359375) and (87.828125, 165.85546875) .. (86.28125, 162.61328125) .. + controls (84.73828125, 159.375) and (83.96484375, 155.90625) .. (83.96484375, 152.21484375) -- + (83.96484375, 92.4140625) -- + cycle; + +% Letter "l" +\path[fill=black] (197.8828125, 177.3125) -- + (172.22265625, 177.3125) -- + (172.22265625, 58.27734375) -- + (197.8828125, 51.15625) -- + cycle; + +%% "i" + 3 circles +% Green circle +\path[fill=julia_green] (261.30078125, 31.671875) .. + controls (261.30078125, 41.3359375) and (253.46484375, 49.171875) .. (243.80078125, 49.171875) .. + controls (234.1328125, 49.171875) and (226.30078125, 41.3359375) .. (226.30078125, 31.671875) .. + controls (226.30078125, 22.0078125) and (234.1328125, 14.171875) .. (243.80078125, 14.171875) .. + controls (253.46484375, 14.171875) and (261.30078125, 22.0078125) .. (261.30078125, 31.671875); + +% Purple circle +\path[fill=julia_purple] (282.3203125, 68.08984375) .. + controls (282.3203125, 77.7578125) and (274.484375, 85.58984375) .. (264.8203125, 85.58984375) .. + controls (255.15625, 85.58984375) and (247.3203125, 77.7578125) .. (247.3203125, 68.08984375) .. + controls (247.3203125, 58.42578125) and (255.15625, 50.58984375) .. (264.8203125, 50.58984375) .. + controls (274.484375, 50.58984375) and (282.3203125, 58.42578125) .. (282.3203125, 68.08984375); + +% Red circle in "i" +\path[fill=julia_red] (240.2734375, 68.08984375) .. + controls (240.2734375, 77.7578125) and (232.4375, 85.58984375) .. (222.7734375, 85.58984375) .. + controls (213.10546875, 85.58984375) and (205.2734375, 77.7578125) .. (205.2734375, 68.08984375) .. + controls (205.2734375, 58.42578125) and (213.10546875, 50.58984375) .. (222.7734375, 50.58984375) .. + controls (232.4375, 50.58984375) and (240.2734375, 58.42578125) .. (240.2734375, 68.08984375); + +% Letter "i" +\path[fill=black] (208.6015625, 97.05078125) -- + (234.375, 89.9296875) -- + (234.375, 177.3125) -- + (208.6015625, 177.3125) -- + cycle; + +% Letter "a" +\path[fill=black,nonzero rule] (288.2265625, 133.44921875) .. + controls (285.73828125, 134.5078125) and (283.23046875, 135.73046875) .. (280.70703125, 137.125) .. + controls (278.18359375, 138.51953125) and (275.8828125, 140.046875) .. (273.8125, 141.703125) .. + controls (271.73828125, 143.359375) and (270.0625, 145.1328125) .. (268.78125, 147.015625) .. + controls (267.5, 148.8984375) and (266.859375, 150.859375) .. (266.859375, 152.89453125) .. + controls (266.859375, 154.4765625) and (267.06640625, 156.00390625) .. (267.48046875, 157.47265625) .. + controls (267.89453125, 158.94140625) and (268.48046875, 160.203125) .. (269.234375, 161.2578125) .. + controls (269.98828125, 162.3125) and (270.81640625, 163.16015625) .. (271.72265625, 163.80078125) .. + controls (272.625, 164.44140625) and (273.60546875, 164.76171875) .. (274.66015625, 164.76171875) .. + controls (276.76953125, 164.76171875) and (278.8984375, 164.12109375) .. (281.046875, 162.83984375) .. + controls (283.1953125, 161.55859375) and (285.5859375, 159.94140625) .. (288.2265625, 157.98046875) -- + cycle + (314.109375, 177.3125) -- + (288.2265625, 177.3125) -- + (288.2265625, 170.52734375) .. + controls (286.79296875, 171.734375) and (285.3984375, 172.84765625) .. (284.04296875, 173.86328125) .. + controls (282.6875, 174.87890625) and (281.16015625, 175.765625) .. (279.46484375, 176.51953125) .. + controls (277.76953125, 177.2734375) and (275.8671875, 177.85546875) .. (273.75390625, 178.2734375) .. + controls (271.64453125, 178.6875) and (269.15625, 178.89453125) .. (266.296875, 178.89453125) .. + controls (262.375, 178.89453125) and (258.8515625, 178.328125) .. (255.7265625, 177.19921875) .. + controls (252.59765625, 176.06640625) and (249.94140625, 174.5234375) .. (247.7578125, 172.5625) .. + controls (245.5703125, 170.60546875) and (243.89453125, 168.28515625) .. (242.7265625, 165.609375) .. + controls (241.55859375, 162.9375) and (240.97265625, 160.015625) .. (240.97265625, 156.8515625) .. + controls (240.97265625, 153.609375) and (241.59375, 150.671875) .. (242.83984375, 148.03125) .. + controls (244.08203125, 145.39453125) and (245.77734375, 143.0234375) .. (247.92578125, 140.91015625) .. + controls (250.07421875, 138.80078125) and (252.578125, 136.91796875) .. (255.44140625, 135.2578125) .. + controls (258.3046875, 133.6015625) and (261.37890625, 132.07421875) .. (264.65625, 130.6796875) .. + controls (267.93359375, 129.28515625) and (271.34375, 128.0078125) .. (274.88671875, 126.83984375) .. + controls (278.42578125, 125.671875) and (281.93359375, 124.55859375) .. (285.3984375, 123.50390625) -- + (288.2265625, 122.82421875) -- + (288.2265625, 114.4609375) .. + controls (288.2265625, 109.03515625) and (287.1875, 105.19140625) .. (285.1171875, 102.9296875) .. + controls (283.04296875, 100.66796875) and (280.2734375, 99.5390625) .. (276.80859375, 99.5390625) .. + controls (272.73828125, 99.5390625) and (269.91015625, 100.51953125) .. (268.328125, 102.4765625) .. + controls (266.74609375, 104.4375) and (265.953125, 106.80859375) .. (265.953125, 109.59765625) .. + controls (265.953125, 111.1796875) and (265.78515625, 112.7265625) .. (265.4453125, 114.234375) .. + controls (265.109375, 115.7421875) and (264.5234375, 117.05859375) .. (263.6953125, 118.19140625) .. + controls (262.8671875, 119.3203125) and (261.6796875, 120.2265625) .. (260.1328125, 120.90234375) .. + controls (258.58984375, 121.58203125) and (256.6484375, 121.921875) .. (254.3125, 121.921875) .. + controls (250.6953125, 121.921875) and (247.7578125, 120.8828125) .. (245.49609375, 118.8125) .. + controls (243.234375, 116.73828125) and (242.10546875, 114.12109375) .. (242.10546875, 110.953125) .. + controls (242.10546875, 108.015625) and (243.1015625, 105.28515625) .. (245.09765625, 102.76171875) .. + controls (247.09765625, 100.234375) and (249.7890625, 98.06640625) .. (253.18359375, 96.26171875) .. + controls (256.57421875, 94.44921875) and (260.4921875, 93.01953125) .. (264.9375, 91.96484375) .. + controls (269.3828125, 90.91015625) and (274.09375, 90.3828125) .. (279.06640625, 90.3828125) .. + controls (285.171875, 90.3828125) and (290.4296875, 90.9296875) .. (294.83984375, 92.01953125) .. + controls (299.24609375, 93.11328125) and (302.8828125, 94.67578125) .. (305.74609375, 96.7109375) .. + controls (308.609375, 98.74609375) and (310.71875, 101.1953125) .. (312.07421875, 104.05859375) .. + controls (313.43359375, 106.921875) and (314.109375, 110.12890625) .. (314.109375, 113.66796875) -- + cycle; +\end{tikzpicture} diff --git a/doc/src/assets/preamble.tex b/doc/src/assets/preamble.tex new file mode 100644 index 0000000000000..fe26add788c5b --- /dev/null +++ b/doc/src/assets/preamble.tex @@ -0,0 +1,48 @@ +%% Copied from the default preamble of `Documenter.jl`. +%% +%% With patch: +%% - inserting a custom cover + + +%% Default preamble BEGIN +\documentclass[oneside, a4paper]{memoir} + +\usepackage{./documenter} +\usepackage{./custom} + + +%% TOC settings +% -- TOC depth +% value: [part, chapter, section, subsection, +% subsubsection, paragraph, subparagraph] +\settocdepth{section} % show "part+chapter+section" in TOC +% -- TOC spacing +% ref: https://tex.stackexchange.com/questions/60317/toc-spacing-in-memoir +% doc: memoir/memman.pdf +% - Figure 9.2: Layout of a ToC +% - Table 9.3: Value of K in macros for styling entries +\makeatletter +% {part} to {chaper} +\setlength{\cftbeforepartskip}{1.5em \@plus \p@} +% {chaper} to {chaper} +\setlength{\cftbeforechapterskip}{0.0em \@plus \p@} +% Chapter num to chapter title spacing (Figure 9.2@memman) +\setlength{\cftchapternumwidth}{2.5em \@plus \p@} +% indent before section number +\setlength{\cftsectionindent}{2.5em \@plus \p@} +% Section num to section title spacing (Figure 9.2@memman) +\setlength{\cftsectionnumwidth}{4.0em \@plus \p@} +\makeatother + +%% Main document begin +\begin{document} + +\frontmatter +%% ---- Custom cover page +% \maketitle +\input{assets/cover.tex} % insert cover page +%% ---- Custom cover page +\cleardoublepage % makes the next page a odd-numbered page +\tableofcontents +\mainmatter +%% preamble END From eadbeec06c88fba301ce43e50d8e261bb5dd68d3 Mon Sep 17 00:00:00 2001 From: Orestis Ousoultzoglou Date: Sun, 24 Apr 2022 01:26:29 +0300 Subject: [PATCH 141/369] correct man-custom-indices ref in devdocs (#45071) (cherry picked from commit d8346ccf4141703687e4b9274511fbd22f0c3961) --- doc/src/devdocs/boundscheck.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/devdocs/boundscheck.md b/doc/src/devdocs/boundscheck.md index f840a0283ea15..258528dbd5960 100644 --- a/doc/src/devdocs/boundscheck.md +++ b/doc/src/devdocs/boundscheck.md @@ -52,7 +52,7 @@ end ``` Which quietly assumes 1-based indexing and therefore exposes unsafe memory access when used -with [`OffsetArrays`](@ref man-custom-indice): +with [`OffsetArrays`](@ref man-custom-indices): ```julia-repl julia> using OffsetArrays From c2ce2a1b9e480488adf29a2ce592e45d5d541f2e Mon Sep 17 00:00:00 2001 From: Orestis Ousoultzoglou Date: Sun, 24 Apr 2022 04:46:34 +0300 Subject: [PATCH 142/369] Correct typo in devdocs gc-sa (#45072) (cherry picked from commit 45abec434ae5732cb9fb04f3fa720597c568b448) --- doc/src/devdocs/gc-sa.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/devdocs/gc-sa.md b/doc/src/devdocs/gc-sa.md index 85d16c1e4e195..d2517374398c3 100644 --- a/doc/src/devdocs/gc-sa.md +++ b/doc/src/devdocs/gc-sa.md @@ -2,7 +2,7 @@ ## Running the analysis -The analyzer plugin that drives the anlysis ships with julia. Its +The analyzer plugin that drives the analysis ships with julia. Its source code can be found in `src/clangsa`. Running it requires the clang dependency to be build. Set the `BUILD_LLVM_CLANG` variable in your Make.user in order to build an appropriate version of clang. From 515a5ce658088522a60bcf731c1b435cd75c99e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Fri, 29 Apr 2022 10:06:45 +0100 Subject: [PATCH 143/369] [deps] Fix compillation of LLVM with system zlib (#45119) (cherry picked from commit 5e74df5f0ee91c66b95e92c35de65bb02d3e6e9e) --- deps/llvm.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/deps/llvm.mk b/deps/llvm.mk index 5afef0b83ba3c..19b684f709dd0 100644 --- a/deps/llvm.mk +++ b/deps/llvm.mk @@ -233,10 +233,14 @@ $$(LLVM_BUILDDIR_withtype)/build-compiled: $$(SRCCACHE)/$$(LLVM_SRC_DIR)/$1.patc LLVM_PATCH_PREV := $$(SRCCACHE)/$$(LLVM_SRC_DIR)/$1.patch-applied endef +ifeq ($(USE_SYSTEM_ZLIB), 0) +$(LLVM_BUILDDIR_withtype)/build-configured: | $(build_prefix)/manifest/zlib +endif + # NOTE: LLVM 12 and 13 have their patches applied to JuliaLang/llvm-project # declare that all patches must be applied before running ./configure -$(LLVM_BUILDDIR_withtype)/build-configured: | $(LLVM_PATCH_PREV) $(build_prefix)/manifest/zlib +$(LLVM_BUILDDIR_withtype)/build-configured: | $(LLVM_PATCH_PREV) $(LLVM_BUILDDIR_withtype)/build-configured: $(SRCCACHE)/$(LLVM_SRC_DIR)/source-extracted | $(llvm_python_workaround) mkdir -p $(dir $@) From f5e292a18dac66c2b08bc3d328314a23933d760b Mon Sep 17 00:00:00 2001 From: Jishnu Bhattacharya Date: Mon, 2 May 2022 12:11:21 +0400 Subject: [PATCH 144/369] Create a copy while evaluating eigvals(::Diagonal) (#45048) (cherry picked from commit b9d82808b8a3bd383b01d85ba3038b56e18c74e0) --- stdlib/LinearAlgebra/src/diagonal.jl | 2 +- stdlib/LinearAlgebra/test/diagonal.jl | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/stdlib/LinearAlgebra/src/diagonal.jl b/stdlib/LinearAlgebra/src/diagonal.jl index 748b165eca7fd..b06ccdd77cc57 100644 --- a/stdlib/LinearAlgebra/src/diagonal.jl +++ b/stdlib/LinearAlgebra/src/diagonal.jl @@ -704,7 +704,7 @@ function pinv(D::Diagonal{T}, tol::Real) where T end #Eigensystem -eigvals(D::Diagonal{<:Number}; permute::Bool=true, scale::Bool=true) = D.diag +eigvals(D::Diagonal{<:Number}; permute::Bool=true, scale::Bool=true) = copy(D.diag) eigvals(D::Diagonal; permute::Bool=true, scale::Bool=true) = [eigvals(x) for x in D.diag] #For block matrices, etc. eigvecs(D::Diagonal) = Matrix{eltype(D)}(I, size(D)) diff --git a/stdlib/LinearAlgebra/test/diagonal.jl b/stdlib/LinearAlgebra/test/diagonal.jl index 6efed3b7d9cff..8bc84d93c6348 100644 --- a/stdlib/LinearAlgebra/test/diagonal.jl +++ b/stdlib/LinearAlgebra/test/diagonal.jl @@ -465,6 +465,13 @@ end @test sort([eigvals(D)...;], by=LinearAlgebra.eigsortby) ≈ eigvals([D.diag[1] zeros(3,2); zeros(2,3) D.diag[2]]) end +@testset "eigvals should return a copy of the diagonal" begin + D = Diagonal([1, 2, 3]) + lam = eigvals(D) + D[3,3] = 4 # should not affect lam + @test lam == [1, 2, 3] +end + @testset "eigmin (#27847)" begin for _ in 1:100 d = randn(rand(1:10)) From 6d4b8d033db1848dadfca2fbbae7a4adab48b63b Mon Sep 17 00:00:00 2001 From: Yuto Horikawa Date: Tue, 3 May 2022 04:31:36 +0900 Subject: [PATCH 145/369] Fix bug in `pinv` (#45009) (cherry picked from commit b4eb88a71f8c2d8343b21d8fdd1ec403073a222c) --- stdlib/LinearAlgebra/src/dense.jl | 7 ++-- stdlib/LinearAlgebra/test/pinv.jl | 61 ++++++++++++++----------------- 2 files changed, 31 insertions(+), 37 deletions(-) diff --git a/stdlib/LinearAlgebra/src/dense.jl b/stdlib/LinearAlgebra/src/dense.jl index 249010adb4e5c..182277cfbf9a4 100644 --- a/stdlib/LinearAlgebra/src/dense.jl +++ b/stdlib/LinearAlgebra/src/dense.jl @@ -1449,12 +1449,13 @@ function pinv(A::AbstractMatrix{T}; atol::Real = 0.0, rtol::Real = (eps(real(flo return similar(A, Tout, (n, m)) end if isdiag(A) - ind = diagind(A) - dA = view(A, ind) + indA = diagind(A) + dA = view(A, indA) maxabsA = maximum(abs, dA) tol = max(rtol * maxabsA, atol) B = fill!(similar(A, Tout, (n, m)), 0) - B[ind] .= (x -> abs(x) > tol ? pinv(x) : zero(x)).(dA) + indB = diagind(B) + B[indB] .= (x -> abs(x) > tol ? pinv(x) : zero(x)).(dA) return B end SVD = svd(A) diff --git a/stdlib/LinearAlgebra/test/pinv.jl b/stdlib/LinearAlgebra/test/pinv.jl index d3eafb26797a9..c7268865a0505 100644 --- a/stdlib/LinearAlgebra/test/pinv.jl +++ b/stdlib/LinearAlgebra/test/pinv.jl @@ -63,39 +63,23 @@ function tridiag(T::Type, m::Integer, n::Integer) end tridiag(m::Integer, n::Integer) = tridiag(Float64, m::Integer, n::Integer) -function randn_float64(m::Integer, n::Integer) - a=randn(m,n) - b = Matrix{Float64}(undef, m, n) - for i=1:n - for j=1:m - b[j,i]=convert(Float64,a[j,i]) - end - end - return b -end - -function randn_float32(m::Integer, n::Integer) - a=randn(m,n) - b = Matrix{Float32}(undef, m, n) - for i=1:n - for j=1:m - b[j,i]=convert(Float32,a[j,i]) - end - end - return b -end - +function test_pinv(a,tol1,tol2) + m,n = size(a) -function test_pinv(a,m,n,tol1,tol2,tol3) apinv = @inferred pinv(a) - + @test size(apinv) == (n,m) @test norm(a*apinv*a-a)/norm(a) ≈ 0 atol=tol1 - x0 = randn(n); b = a*x0; x = apinv*b + @test norm(apinv*a*apinv-apinv)/norm(apinv) ≈ 0 atol=tol1 + b = a*randn(n) + x = apinv*b @test norm(a*x-b)/norm(b) ≈ 0 atol=tol1 - apinv = pinv(a,sqrt(eps(real(one(eltype(a)))))) + apinv = @inferred pinv(a,sqrt(eps(real(one(eltype(a)))))) + @test size(apinv) == (n,m) @test norm(a*apinv*a-a)/norm(a) ≈ 0 atol=tol2 - x0 = randn(n); b = a*x0; x = apinv*b + @test norm(apinv*a*apinv-apinv)/norm(apinv) ≈ 0 atol=tol2 + b = a*randn(n) + x = apinv*b @test norm(a*x-b)/norm(b) ≈ 0 atol=tol2 end @@ -104,28 +88,25 @@ end default_tol = (real(one(eltya))) * max(m,n) * 10 tol1 = 1e-2 tol2 = 1e-5 - tol3 = 1e-5 if real(eltya) == Float32 tol1 = 1e0 tol2 = 1e-2 - tol3 = 1e-2 end @testset "dense/ill-conditioned matrix" begin - ### a = randn_float64(m,n) * hilb(eltya,n) a = hilb(eltya, m, n) - test_pinv(a, m, n, tol1, tol2, tol3) + test_pinv(a, tol1, tol2) end @testset "dense/diagonal matrix" begin a = onediag(eltya, m, n) - test_pinv(a, m, n, default_tol, default_tol, default_tol) + test_pinv(a, default_tol, default_tol) end @testset "dense/tri-diagonal matrix" begin a = tridiag(eltya, m, n) - test_pinv(a, m, n, default_tol, tol2, default_tol) + test_pinv(a, default_tol, tol2) end @testset "Diagonal matrix" begin a = onediag_sparse(eltya, m) - test_pinv(a, m, m, default_tol, default_tol, default_tol) + test_pinv(a, default_tol, default_tol) end @testset "Vector" begin a = rand(eltya, m) @@ -164,6 +145,18 @@ end @test C ≈ ones(2,2) end + @testset "non-square diagonal matrices" begin + A = eltya[1 0 ; 0 1 ; 0 0] + B = pinv(A) + @test A*B*A ≈ A + @test B*A*B ≈ B + + A = eltya[1 0 0 ; 0 1 0] + B = pinv(A) + @test A*B*A ≈ A + @test B*A*B ≈ B + end + if eltya <: LinearAlgebra.BlasReal @testset "sub-normal numbers/vectors/matrices" begin a = pinv(floatmin(eltya)/100) From f89f049a7ec1d601186bfcb87e2b756a51fce967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Wed, 4 May 2022 16:57:19 +0100 Subject: [PATCH 146/369] [deps] Remove Python workaround in LLVM build, no longer necessary (#45176) (cherry picked from commit 862018b20dcef1b79568b2833991713556f1a1c1) --- deps/llvm.mk | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/deps/llvm.mk b/deps/llvm.mk index 19b684f709dd0..7c4c2d60dfd9a 100644 --- a/deps/llvm.mk +++ b/deps/llvm.mk @@ -194,16 +194,6 @@ ifeq ($(BUILD_LLDB),0) LLVM_CMAKE += -DLLVM_TOOL_LLDB_BUILD=OFF endif -# LLDB still relies on plenty of python 2.x infrastructure, without checking -llvm_python_location=$(shell /usr/bin/env python2 -c 'import sys; print(sys.executable)') -llvm_python_workaround=$(SRCCACHE)/python2_path -$(llvm_python_workaround): - mkdir -p $@ - -python -c 'import sys; sys.exit(not sys.version_info > (3, 0))' && \ - /usr/bin/env python2 -c 'import sys; sys.exit(not sys.version_info < (3, 0))' && \ - ln -sf $(llvm_python_location) "$@/python" && \ - ln -sf $(llvm_python_location)-config "$@/python-config" - LLVM_CMAKE += -DCMAKE_EXE_LINKER_FLAGS="$(LLVM_LDFLAGS)" \ -DCMAKE_SHARED_LINKER_FLAGS="$(LLVM_LDFLAGS)" @@ -242,32 +232,27 @@ endif # declare that all patches must be applied before running ./configure $(LLVM_BUILDDIR_withtype)/build-configured: | $(LLVM_PATCH_PREV) -$(LLVM_BUILDDIR_withtype)/build-configured: $(SRCCACHE)/$(LLVM_SRC_DIR)/source-extracted | $(llvm_python_workaround) +$(LLVM_BUILDDIR_withtype)/build-configured: $(SRCCACHE)/$(LLVM_SRC_DIR)/source-extracted mkdir -p $(dir $@) cd $(dir $@) && \ - export PATH=$(llvm_python_workaround):"$$PATH" && \ $(CMAKE) $(SRCCACHE)/$(LLVM_SRC_DIR)/llvm $(CMAKE_GENERATOR_COMMAND) $(CMAKE_COMMON) $(LLVM_CMAKE) \ || { echo '*** To install a newer version of cmake, run contrib/download_cmake.sh ***' && false; } echo 1 > $@ -$(LLVM_BUILDDIR_withtype)/build-compiled: $(LLVM_BUILDDIR_withtype)/build-configured | $(llvm_python_workaround) +$(LLVM_BUILDDIR_withtype)/build-compiled: $(LLVM_BUILDDIR_withtype)/build-configured cd $(LLVM_BUILDDIR_withtype) && \ - export PATH=$(llvm_python_workaround):"$$PATH" && \ $(if $(filter $(CMAKE_GENERATOR),make), \ $(MAKE), \ $(CMAKE) --build .) echo 1 > $@ -$(LLVM_BUILDDIR_withtype)/build-checked: $(LLVM_BUILDDIR_withtype)/build-compiled | $(llvm_python_workaround) +$(LLVM_BUILDDIR_withtype)/build-checked: $(LLVM_BUILDDIR_withtype)/build-compiled ifeq ($(OS),$(BUILD_OS)) cd $(LLVM_BUILDDIR_withtype) && \ - export PATH=$(llvm_python_workaround):"$$PATH" && \ $(CMAKE) --build . --target check endif echo 1 > $@ -$(build_prefix)/manifest/llvm: | $(llvm_python_workaround) - LLVM_INSTALL = \ cd $1 && mkdir -p $2$$(build_depsbindir) && \ cp -r $$(SRCCACHE)/$$(LLVM_SRC_DIR)/llvm/utils/lit $2$$(build_depsbindir)/ && \ From e0e24c12df15d5fc87b19e10c2fcfb81ec29440e Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Fri, 6 May 2022 22:18:40 -0400 Subject: [PATCH 147/369] Fix different .cachepath initialization points for precompile load (#45149) For quite some time I've been observing Revise randomly not pick up changes to my packages. Usually I just write that off to Revise getting into a bad state and restarting Julia fixes it. Today, I got very annoyed by this again and decided to finally track it down. What turns out to happen here is the packages in question are those which: A. Are being precompiled on load B. Use Requires C. Have an `@require`'d-dependency already loaded D. The change to be revised is made in a file not loaded via Requires.jl. In this case the `__init__` of the package triggers Requires, which in turn calls back to Revise, which tries to start watching the package. However, on the `compilecache` path (but not on the path where we just find a pre-existing cache file), we used to not set the .cachepath property of `pkgorigins` until after the `__init__` callbacks run, causing Revise not to be able to see those files. Infuriatingly, restarting julia fixes this because it just loads the .ji file that was just compiled. Fix this by unifying the point at which the .cachepath is set, always setting it just prior to the module initialization callback. (cherry picked from commit 58ab4c73088933dc53fd3e28325172bf97a0da8e) --- base/loading.jl | 24 ++++++++++++------------ test/precompile.jl | 14 +++++++++++++- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/base/loading.jl b/base/loading.jl index 0dadb558a789c..9a8a0b50e2166 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -786,7 +786,7 @@ end # these return either the array of modules loaded from the path / content given # or an Exception that describes why it couldn't be loaded # and it reconnects the Base.Docs.META -function _include_from_serialized(path::String, depmods::Vector{Any}) +function _include_from_serialized(pkg::PkgId, path::String, depmods::Vector{Any}) sv = ccall(:jl_restore_incremental, Any, (Cstring, Any), path, depmods) if isa(sv, Exception) return sv @@ -802,6 +802,11 @@ function _include_from_serialized(path::String, depmods::Vector{Any}) register_root_module(M) end end + + # Register this cache path now - If Requires.jl is loaded, Revise may end + # up looking at the cache path during the init callback. + get!(PkgOrigin, pkgorigins, pkg).cachepath = path + inits = sv[2]::Vector{Any} if !isempty(inits) unlock(require_lock) # temporarily _unlock_ during these callbacks @@ -856,7 +861,7 @@ function _tryrequire_from_serialized(modkey::PkgId, build_id::UInt64, modpath::U return nothing end -function _require_from_serialized(path::String) +function _require_from_serialized(pkg::PkgId, path::String) # loads a precompile cache file, ignoring stale_cachfile tests # load all of the dependent modules first local depmodnames @@ -877,7 +882,7 @@ function _require_from_serialized(path::String) depmods[i] = dep::Module end # then load the file - return _include_from_serialized(path, depmods) + return _include_from_serialized(pkg, path, depmods) end # use an Int counter so that nested @time_imports calls all remain open @@ -915,7 +920,7 @@ const TIMING_IMPORTS = Threads.Atomic{Int}(0) if staledeps === true continue end - restored = _include_from_serialized(path_to_try, staledeps) + restored = _include_from_serialized(pkg, path_to_try, staledeps) if isa(restored, Exception) @debug "Deserialization checks failed while attempting to load cache from $path_to_try" exception=restored else @@ -1083,10 +1088,7 @@ require(uuidkey::PkgId) = @lock require_lock _require_prelocked(uuidkey) function _require_prelocked(uuidkey::PkgId) just_loaded_pkg = false if !root_module_exists(uuidkey) - cachefile = _require(uuidkey) - if cachefile !== nothing - get!(PkgOrigin, pkgorigins, uuidkey).cachepath = cachefile - end + _require(uuidkey) # After successfully loading, notify downstream consumers run_package_callbacks(uuidkey) just_loaded_pkg = true @@ -1208,11 +1210,11 @@ function _require(pkg::PkgId) end # fall-through to loading the file locally else - m = _require_from_serialized(cachefile) + m = _require_from_serialized(pkg, cachefile) if isa(m, Exception) @warn "The call to compilecache failed to create a usable precompiled cache file for $pkg" exception=m else - return cachefile + return end end end @@ -2001,8 +2003,6 @@ get_compiletime_preferences(::Nothing) = String[] @debug "Rejecting cache file $cachefile because preferences hash does not match 0x$(string(prefs_hash, base=16)) != 0x$(string(curr_prefs_hash, base=16))" return true end - - get!(PkgOrigin, pkgorigins, id).cachepath = cachefile end return depmods # fresh cachefile diff --git a/test/precompile.jl b/test/precompile.jl index d39dcd9f7ccb8..5162d026628b7 100644 --- a/test/precompile.jl +++ b/test/precompile.jl @@ -313,7 +313,7 @@ precompile_test_harness(false) do dir # the module doesn't reload from the image: @test_warn "@ccallable was already defined for this method name" begin @test_logs (:warn, "Replacing module `$Foo_module`") begin - ms = Base._require_from_serialized(cachefile) + ms = Base._require_from_serialized(Base.PkgId(Foo), cachefile) @test isa(ms, Array{Any,1}) end end @@ -1278,3 +1278,15 @@ end @test any(mi -> mi.specTypes.parameters[2] === Any, mis) @test all(mi -> isa(mi.cache, Core.CodeInstance), mis) end + +# Test that the cachepath is available in pkgorigins during the +# __init__ callback +precompile_test_harness("__init__ cachepath") do load_path + write(joinpath(load_path, "InitCachePath.jl"), + """ + module InitCachePath + __init__() = Base.pkgorigins[Base.PkgId(InitCachePath)] + end + """) + @test isa((@eval (using InitCachePath; InitCachePath)), Module) +end From 66ba1ad933da3444e2910431259054f214e34c14 Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Sat, 7 May 2022 22:02:20 -0700 Subject: [PATCH 148/369] Avoid race condition in cleaning up cache files (#45214) If multiple processes attempt to clean up cache files at the same time, a race condition can result, e.g. https://buildkite.com/clima/climaatmos-ci/builds/812#6a961e99-e2a1-488b-a116-2a45dee26d38/102-104 (cherry picked from commit d4acead9130f97f0135bee604d94e1f67dabc70f) --- base/loading.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/loading.jl b/base/loading.jl index 9a8a0b50e2166..c1ddabda6c469 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -1541,7 +1541,7 @@ function compilecache(pkg::PkgId, path::String, internal_stderr::IO = stderr, in cachefiles = filter!(x -> startswith(x, entryfile * "_"), readdir(cachepath)) if length(cachefiles) >= MAX_NUM_PRECOMPILE_FILES[] idx = findmin(mtime.(joinpath.(cachepath, cachefiles)))[2] - rm(joinpath(cachepath, cachefiles[idx])) + rm(joinpath(cachepath, cachefiles[idx]); force=true) end end From fb45a1af00661be77a4fae13d33fd39a4ae96dbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gunnar=20Farneb=C3=A4ck?= Date: Mon, 9 May 2022 16:55:56 +0200 Subject: [PATCH 149/369] Consider additional default ssh keys for LibGit2. (#44767) (cherry picked from commit b6b0874a7341158067abe450ddb0b3f17d4efd64) --- stdlib/LibGit2/src/callbacks.jl | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/stdlib/LibGit2/src/callbacks.jl b/stdlib/LibGit2/src/callbacks.jl index 5da032d3143e2..6228f442df37f 100644 --- a/stdlib/LibGit2/src/callbacks.jl +++ b/stdlib/LibGit2/src/callbacks.jl @@ -91,12 +91,15 @@ function authenticate_ssh(libgit2credptr::Ptr{Ptr{Cvoid}}, p::CredentialPayload, cred.user = unsafe_string(username_ptr) end - cred.prvkey = Base.get(ENV, "SSH_KEY_PATH") do - default = joinpath(homedir(), ".ssh", "id_rsa") - if isempty(cred.prvkey) && isfile(default) - default - else - cred.prvkey + if haskey(ENV, "SSH_KEY_PATH") + cred.prvkey = ENV["SSH_KEY_PATH"] + elseif isempty(cred.prvkey) + for keytype in ("rsa", "ecdsa") + private_key_file = joinpath(homedir(), ".ssh", "id_$keytype") + if isfile(private_key_file) + cred.prvkey = private_key_file + break + end end end From a380056c0e7b0ab2993144a83ca9a74a485cb9ca Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Mon, 9 May 2022 12:06:47 -0400 Subject: [PATCH 150/369] syntax: keyword sorter location should just be definition line (#45199) fix #45171 (cherry picked from commit 5c557b22c73d5de977cd1c007ef075c56ff8afcf) --- src/julia-syntax.scm | 7 +++++-- src/utils.scm | 8 ++++++++ test/backtrace.jl | 13 +++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/julia-syntax.scm b/src/julia-syntax.scm index 7538b89d32cb3..e07f47df73a8f 100644 --- a/src/julia-syntax.scm +++ b/src/julia-syntax.scm @@ -529,7 +529,7 @@ ,(method-def-expr- name positional-sparams pargl-all `(block - ,@(without-generated prologue) + ,@(keep-first linenum? (without-generated prologue)) ,(let (;; call mangled(vals..., [rest_kw,] pargs..., [vararg]...) (ret `(return (call ,mangled ,@(if ordered-defaults keynames vals) @@ -548,7 +548,10 @@ ,(if (any kwarg? pargl) (gensy) UNUSED) (call (core kwftype) ,ftype)) ,kw ,@pargl ,@vararg) `(block - ,@(filter linenum? prologue) + ,@(let ((lnns (filter linenum? prologue))) + (if (pair? lnns) + (list (car lnns)) + '())) ;; nospecialize meta for just positional args ,@(map (lambda (m) `(meta ,(cadr m) ,@(filter (lambda (v) (not (memq v keynames))) diff --git a/src/utils.scm b/src/utils.scm index 7be6b2999a90c..97464b9a14e5a 100644 --- a/src/utils.scm +++ b/src/utils.scm @@ -104,3 +104,11 @@ (begin (put! tbl (car xs) i) (loop (cdr xs) (+ i 1))))) tbl)) + +;; keep at most the first element matching a given predicate +(define (keep-first pred lst) + (cond ((null? lst) lst) + ((pred (car lst)) + (cons (car lst) (filter (lambda (x) (not (pred x))) (cdr lst)))) + (else + (cons (car lst) (keep-first pred (cdr lst)))))) diff --git a/test/backtrace.jl b/test/backtrace.jl index 35b607137a5c2..c0abad5146b39 100644 --- a/test/backtrace.jl +++ b/test/backtrace.jl @@ -224,6 +224,19 @@ let trace = try @test trace[1].line == 2 end +# issue #45171 +linenum = @__LINE__; function f45171(;kwarg = true) + 1 + error() +end +let trace = try + f45171() + catch + stacktrace(catch_backtrace()) + end + @test trace[3].line == linenum +end + # issue #29695 (see also test for #28442) let code = """ f29695(c) = g29695(c) From 51f8ac2b2d87219c2ca468edaa9b57008e25ab42 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Mon, 9 May 2022 10:55:08 -0400 Subject: [PATCH 151/369] fix #45162, function arg not specialized if only called with keywords (#45198) (cherry picked from commit c62ea269067415db4ad5deeb28df87585de0ac4c) --- src/julia-syntax.scm | 5 +++++ test/syntax.jl | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/julia-syntax.scm b/src/julia-syntax.scm index e07f47df73a8f..ed5a25961df88 100644 --- a/src/julia-syntax.scm +++ b/src/julia-syntax.scm @@ -3254,6 +3254,11 @@ (let ((vi (get tab (cadr e) #f))) (if vi (vinfo:set-called! vi #t)) + ;; calls to functions with keyword args go through `kwfunc` first + (if (and (length= e 3) (equal? (cadr e) '(core kwfunc))) + (let ((vi2 (get tab (caddr e) #f))) + (if vi2 + (vinfo:set-called! vi2 #t)))) (for-each (lambda (x) (analyze-vars x env captvars sp tab)) (cdr e)))) ((decl) diff --git a/test/syntax.jl b/test/syntax.jl index 8320060678d16..df5ed7babbffd 100644 --- a/test/syntax.jl +++ b/test/syntax.jl @@ -3274,3 +3274,7 @@ end # issue 44723 demo44723()::Any = Base.Experimental.@opaque () -> true ? 1 : 2 @test demo44723()() == 1 + +# issue #45162 +f45162(f) = f(x=1) +@test first(methods(f45162)).called != 0 From b3dde45e943c476d8d6e63227f0db1b861be1299 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Fri, 11 Mar 2022 16:59:07 -0800 Subject: [PATCH 152/369] Fix a concurrency bug in `iterate(::Dict)` (#44534) (cherry picked from commit 6be86a380b09d0f02404140cb042f1ffb06c3442) --- NEWS.md | 4 ++++ base/dict.jl | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 73ca691ab7c3f..3e9eece2260ea 100644 --- a/NEWS.md +++ b/NEWS.md @@ -97,6 +97,10 @@ New library functions New library features -------------------- +* A known concurrency issue of `iterate` methods on `Dict` and other derived objects such + as `keys(::Dict)`, `values(::Dict)`, and `Set` is fixed. These methods of `iterate` can + now be called on a dictionary or set shared by arbitrary tasks provided that there are no + tasks mutating the dictionary or set ([#44534]). * `@time` and `@timev` now take an optional description to allow annotating the source of time reports, e.g. `@time "Evaluating foo" foo()` ([#42431]). * `range` accepts either `stop` or `length` as a sole keyword argument ([#39241]). diff --git a/base/dict.jl b/base/dict.jl index dabdfa5c34773..220840ed0e5ea 100644 --- a/base/dict.jl +++ b/base/dict.jl @@ -702,7 +702,7 @@ end @propagate_inbounds _iterate(t::Dict{K,V}, i) where {K,V} = i == 0 ? nothing : (Pair{K,V}(t.keys[i],t.vals[i]), i == typemax(Int) ? 0 : i+1) @propagate_inbounds function iterate(t::Dict) - _iterate(t, skip_deleted_floor!(t)) + _iterate(t, skip_deleted(t, t.idxfloor)) end @propagate_inbounds iterate(t::Dict, i) = _iterate(t, skip_deleted(t, i)) From 293b51387ea144fcefa6c709fae2f2606fba917f Mon Sep 17 00:00:00 2001 From: KristofferC Date: Mon, 16 May 2022 10:01:58 +0200 Subject: [PATCH 153/369] Bump Documenter to get the new pdf improvements for the manual. --- doc/Manifest.toml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/doc/Manifest.toml b/doc/Manifest.toml index f38f11a7778bb..ffd798ec59a90 100644 --- a/doc/Manifest.toml +++ b/doc/Manifest.toml @@ -1,6 +1,6 @@ # This file is machine-generated - editing it directly is not advised -julia_version = "1.8.0-DEV.1335" +julia_version = "1.7.2" manifest_format = "2.0" project_hash = "e0c77beb18dc1f6cce661ebd60658c0c1a77390f" @@ -24,9 +24,9 @@ version = "0.8.6" [[deps.Documenter]] deps = ["ANSIColoredPrinters", "Base64", "Dates", "DocStringExtensions", "IOCapture", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"] -git-tree-sha1 = "75c6cf9d99e0efc79b724f5566726ad3ad010a01" +git-tree-sha1 = "122d031e8dcb2d3e767ed434bc4d1ae1788b5a7f" uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4" -version = "0.27.12" +version = "0.27.17" [[deps.IOCapture]] deps = ["Logging", "Random"] @@ -40,9 +40,9 @@ uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" [[deps.JSON]] deps = ["Dates", "Mmap", "Parsers", "Unicode"] -git-tree-sha1 = "8076680b162ada2a031f707ac7b4953e30667a37" +git-tree-sha1 = "3c837543ddb02250ef42f4738347454f95079d4e" uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" -version = "0.21.2" +version = "0.21.3" [[deps.LibGit2]] deps = ["Base64", "NetworkOptions", "Printf", "SHA"] @@ -60,13 +60,12 @@ uuid = "a63ad114-7e13-5084-954f-fe012c677804" [[deps.NetworkOptions]] uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" -version = "1.2.0" [[deps.Parsers]] deps = ["Dates"] -git-tree-sha1 = "92f91ba9e5941fc781fecf5494ac1da87bdac775" +git-tree-sha1 = "1285416549ccfcdf0c50d4997a94331e88d68413" uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" -version = "2.2.0" +version = "2.3.1" [[deps.Printf]] deps = ["Unicode"] @@ -82,7 +81,6 @@ uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" [[deps.SHA]] uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" -version = "0.7.0" [[deps.Serialization]] uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" From b11258aaf765dec6d1b5e53fd6f4f3d7921a4d9d Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Wed, 11 May 2022 11:23:59 -0400 Subject: [PATCH 154/369] codegen: add handling for undefined phinode values (#45155) The optimization pass often uses values for phi values (and thus by extension, also for pi, phic and upsilon values) that are invalid. We make sure that these have a null pointer, so that we can detect that case at runtime (at the cost of slightly worse code generation for them), but it means we need to be very careful to check for that. This is identical to #39747, which added the equivalent code to the other side of the conditional there, but missed some additional relevant, but rare, cases that are observed to be possible. The `emit_isa_and_defined` is derived from the LLVM name for this operation: `isa_and_nonnull`. Secondly, we also optimize `emit_unionmove` to change a bad IR case to a better IR form. Fix #44501 (cherry picked from commit 72b80e2b158b9d4016e70791efdc81fead933881) --- src/cgutils.cpp | 118 ++++++++++++++++++---------------- src/codegen.cpp | 30 +++++---- src/llvm-late-gc-lowering.cpp | 3 +- 3 files changed, 82 insertions(+), 69 deletions(-) diff --git a/src/cgutils.cpp b/src/cgutils.cpp index b219498315905..7eb2fa11d209d 100644 --- a/src/cgutils.cpp +++ b/src/cgutils.cpp @@ -761,7 +761,7 @@ static bool is_uniontype_allunboxed(jl_value_t *typ) return for_each_uniontype_small([&](unsigned, jl_datatype_t*) {}, typ, counter); } -static Value *emit_typeof_boxed(jl_codectx_t &ctx, const jl_cgval_t &p); +static Value *emit_typeof_boxed(jl_codectx_t &ctx, const jl_cgval_t &p, bool maybenull=false); static unsigned get_box_tindex(jl_datatype_t *jt, jl_value_t *ut) { @@ -814,15 +814,9 @@ static LoadInst *emit_nthptr_recast(jl_codectx_t &ctx, Value *v, ssize_t n, MDNo } static Value *boxed(jl_codectx_t &ctx, const jl_cgval_t &v); +static Value *emit_typeof(jl_codectx_t &ctx, Value *v, bool maybenull); -// Returns ctx.types().T_prjlvalue -static Value *emit_typeof(jl_codectx_t &ctx, Value *tt) -{ - assert(tt != NULL && !isa(tt) && "expected a conditionally boxed value"); - return ctx.builder.CreateCall(prepare_call(jl_typeof_func), {tt}); -} - -static jl_cgval_t emit_typeof(jl_codectx_t &ctx, const jl_cgval_t &p) +static jl_cgval_t emit_typeof(jl_codectx_t &ctx, const jl_cgval_t &p, bool maybenull) { // given p, compute its type if (p.constant) @@ -835,7 +829,7 @@ static jl_cgval_t emit_typeof(jl_codectx_t &ctx, const jl_cgval_t &p) return mark_julia_const(ctx, jl_typeof(tp)); } } - return mark_julia_type(ctx, emit_typeof(ctx, p.V), true, jl_datatype_type); + return mark_julia_type(ctx, emit_typeof(ctx, p.V, maybenull), true, jl_datatype_type); } if (p.TIndex) { Value *tindex = ctx.builder.CreateAnd(p.TIndex, ConstantInt::get(getInt8Ty(ctx.builder.getContext()), 0x7f)); @@ -870,7 +864,7 @@ static jl_cgval_t emit_typeof(jl_codectx_t &ctx, const jl_cgval_t &p) BasicBlock *mergeBB = BasicBlock::Create(ctx.builder.getContext(), "merge", ctx.f); ctx.builder.CreateCondBr(isnull, boxBB, unboxBB); ctx.builder.SetInsertPoint(boxBB); - auto boxTy = emit_typeof(ctx, p.Vboxed); + auto boxTy = emit_typeof(ctx, p.Vboxed, maybenull); ctx.builder.CreateBr(mergeBB); boxBB = ctx.builder.GetInsertBlock(); // could have changed ctx.builder.SetInsertPoint(unboxBB); @@ -892,9 +886,9 @@ static jl_cgval_t emit_typeof(jl_codectx_t &ctx, const jl_cgval_t &p) } // Returns ctx.types().T_prjlvalue -static Value *emit_typeof_boxed(jl_codectx_t &ctx, const jl_cgval_t &p) +static Value *emit_typeof_boxed(jl_codectx_t &ctx, const jl_cgval_t &p, bool maybenull) { - return boxed(ctx, emit_typeof(ctx, p)); + return boxed(ctx, emit_typeof(ctx, p, maybenull)); } static Value *emit_datatype_types(jl_codectx_t &ctx, Value *dt) @@ -1129,6 +1123,23 @@ static Value *emit_nullcheck_guard2(jl_codectx_t &ctx, Value *nullcheck1, }); } +// Returns typeof(v), or null if v is a null pointer at run time and maybenull is true. +// This is used when the value might have come from an undefined value (a PhiNode), +// yet we try to read its type to compute a union index when moving the value (a PiNode). +// Returns a ctx.types().T_prjlvalue typed Value +static Value *emit_typeof(jl_codectx_t &ctx, Value *v, bool maybenull) +{ + assert(v != NULL && !isa(v) && "expected a conditionally boxed value"); + Function *typeof = prepare_call(jl_typeof_func); + if (maybenull) + return emit_guarded_test(ctx, null_pointer_cmp(ctx, v), Constant::getNullValue(typeof->getReturnType()), [&] { + // e.g. emit_typeof(ctx, v) + return ctx.builder.CreateCall(typeof, {v}); + }); + return ctx.builder.CreateCall(typeof, {v}); +} + + static void emit_type_error(jl_codectx_t &ctx, const jl_cgval_t &x, Value *type, const std::string &msg) { Value *msg_val = stringConstPtr(ctx.emission_context, ctx.builder, msg); @@ -1256,7 +1267,7 @@ static std::pair emit_isa(jl_codectx_t &ctx, const jl_cgval_t &x, BasicBlock *postBB = BasicBlock::Create(ctx.builder.getContext(), "post_isa", ctx.f); ctx.builder.CreateCondBr(isboxed, isaBB, postBB); ctx.builder.SetInsertPoint(isaBB); - Value *istype_boxed = ctx.builder.CreateICmpEQ(emit_typeof(ctx, x.Vboxed), + Value *istype_boxed = ctx.builder.CreateICmpEQ(emit_typeof(ctx, x.Vboxed, false), track_pjlvalue(ctx, literal_pointer_val(ctx, intersected_type))); ctx.builder.CreateBr(postBB); isaBB = ctx.builder.GetInsertBlock(); // could have changed @@ -1312,6 +1323,20 @@ static std::pair emit_isa(jl_codectx_t &ctx, const jl_cgval_t &x, ConstantInt::get(getInt32Ty(ctx.builder.getContext()), 0)), false); } +// If this might have been sourced from a PhiNode object, it is possible our +// Vboxed pointer itself is null (undef) at runtime even if we thought we should +// know exactly the type of the bytes that should have been inside. +// +// n.b. It is also possible the value is a ghost of some sort, and we will +// declare that the pointer is legal (for zero bytes) even though it might be undef. +static Value *emit_isa_and_defined(jl_codectx_t &ctx, const jl_cgval_t &val, jl_value_t *typ) +{ + return emit_nullcheck_guard(ctx, val.ispointer() ? val.V : nullptr, [&] { + return emit_isa(ctx, val, typ, nullptr).first; + }); +} + + static void emit_typecheck(jl_codectx_t &ctx, const jl_cgval_t &x, jl_value_t *type, const std::string &msg) { Value *istype; @@ -2885,42 +2910,16 @@ static Value *compute_box_tindex(jl_codectx_t &ctx, Value *datatype, jl_value_t return tindex; } -// Returns typeof(v), or null if v is a null pointer at run time. -// This is used when the value might have come from an undefined variable, -// yet we try to read its type to compute a union index when moving the value. -static Value *emit_typeof_or_null(jl_codectx_t &ctx, Value *v) -{ - BasicBlock *nonnull = BasicBlock::Create(ctx.builder.getContext(), "nonnull", ctx.f); - BasicBlock *postBB = BasicBlock::Create(ctx.builder.getContext(), "postnull", ctx.f); - Value *isnull = ctx.builder.CreateICmpEQ(v, Constant::getNullValue(v->getType())); - ctx.builder.CreateCondBr(isnull, postBB, nonnull); - BasicBlock *entry = ctx.builder.GetInsertBlock(); - ctx.builder.SetInsertPoint(nonnull); - Value *typof = emit_typeof(ctx, v); - ctx.builder.CreateBr(postBB); - nonnull = ctx.builder.GetInsertBlock(); // could have changed - ctx.builder.SetInsertPoint(postBB); - PHINode *ti = ctx.builder.CreatePHI(typof->getType(), 2); - ti->addIncoming(Constant::getNullValue(typof->getType()), entry); - ti->addIncoming(typof, nonnull); - return ti; -} - // get the runtime tindex value, assuming val is already converted to type typ if it has a TIndex -static Value *compute_tindex_unboxed(jl_codectx_t &ctx, const jl_cgval_t &val, jl_value_t *typ) +static Value *compute_tindex_unboxed(jl_codectx_t &ctx, const jl_cgval_t &val, jl_value_t *typ, bool maybenull=false) { if (val.typ == jl_bottom_type) return UndefValue::get(getInt8Ty(ctx.builder.getContext())); if (val.constant) return ConstantInt::get(getInt8Ty(ctx.builder.getContext()), get_box_tindex((jl_datatype_t*)jl_typeof(val.constant), typ)); - if (val.TIndex) return ctx.builder.CreateAnd(val.TIndex, ConstantInt::get(getInt8Ty(ctx.builder.getContext()), 0x7f)); - Value *typof; - if (val.isboxed && !jl_is_concrete_type(val.typ) && !jl_is_type_type(val.typ)) - typof = emit_typeof_or_null(ctx, val.V); - else - typof = emit_typeof_boxed(ctx, val); + Value *typof = emit_typeof_boxed(ctx, val, maybenull); return compute_box_tindex(ctx, typof, val.typ, typ); } @@ -3102,14 +3101,17 @@ static void emit_unionmove(jl_codectx_t &ctx, Value *dest, MDNode *tbaa_dst, con Value *src_ptr = data_pointer(ctx, src); unsigned nb = jl_datatype_size(typ); unsigned alignment = julia_alignment(typ); - Value *nbytes = ConstantInt::get(getSizeTy(ctx.builder.getContext()), nb); - if (skip) { - // TODO: this Select is very bad for performance, but is necessary to work around LLVM bugs with the undef option that we want to use: - // select copy dest -> dest to simulate an undef value / conditional copy - // src_ptr = ctx.builder.CreateSelect(skip, dest, src_ptr); - nbytes = ctx.builder.CreateSelect(skip, Constant::getNullValue(getSizeTy(ctx.builder.getContext())), nbytes); - } - emit_memcpy(ctx, dest, tbaa_dst, src_ptr, src.tbaa, nbytes, alignment, isVolatile); + // TODO: this branch may be bad for performance, but is necessary to work around LLVM bugs with the undef option that we want to use: + // select copy dest -> dest to simulate an undef value / conditional copy + // if (skip) src_ptr = ctx.builder.CreateSelect(skip, dest, src_ptr); + auto f = [&] { + (void)emit_memcpy(ctx, dest, tbaa_dst, src_ptr, src.tbaa, nb, alignment, isVolatile); + return nullptr; + }; + if (skip) + emit_guarded_test(ctx, skip, nullptr, f); + else + f(); } } } @@ -3162,12 +3164,16 @@ static void emit_unionmove(jl_codectx_t &ctx, Value *dest, MDNode *tbaa_dst, con } else { assert(src.isboxed && "expected boxed value for sizeof/alignment computation"); - Value *datatype = emit_typeof_boxed(ctx, src); - Value *copy_bytes = emit_datatype_size(ctx, datatype); - if (skip) { - copy_bytes = ctx.builder.CreateSelect(skip, ConstantInt::get(copy_bytes->getType(), 0), copy_bytes); - } - emit_memcpy(ctx, dest, tbaa_dst, src, copy_bytes, /*TODO: min-align*/1, isVolatile); + auto f = [&] { + Value *datatype = emit_typeof_boxed(ctx, src); + Value *copy_bytes = emit_datatype_size(ctx, datatype); + emit_memcpy(ctx, dest, tbaa_dst, src, copy_bytes, /*TODO: min-align*/1, isVolatile); + return nullptr; + }; + if (skip) + emit_guarded_test(ctx, skip, nullptr, f); + else + f(); } } diff --git a/src/codegen.cpp b/src/codegen.cpp index 531b35bfedb79..cccb4b12cfc1d 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -1743,7 +1743,7 @@ static jl_cgval_t convert_julia_type_union(jl_codectx_t &ctx, const jl_cgval_t & if (!union_isaBB) { union_isaBB = BasicBlock::Create(ctx.builder.getContext(), "union_isa", ctx.f); ctx.builder.SetInsertPoint(union_isaBB); - union_box_dt = emit_typeof_or_null(ctx, v.Vboxed); + union_box_dt = emit_typeof(ctx, v.Vboxed, skip != NULL); post_union_isaBB = ctx.builder.GetInsertBlock(); } }; @@ -1842,7 +1842,6 @@ static jl_cgval_t convert_julia_type(jl_codectx_t &ctx, const jl_cgval_t &v, jl_ return ghostValue(ctx, typ); Value *new_tindex = NULL; if (jl_is_concrete_type(typ)) { - assert(skip == nullptr && "skip only valid for union type return"); if (v.TIndex && !jl_is_pointerfree(typ)) { // discovered that this union-split type must actually be isboxed if (v.Vboxed) { @@ -1850,14 +1849,20 @@ static jl_cgval_t convert_julia_type(jl_codectx_t &ctx, const jl_cgval_t &v, jl_ } else { // type mismatch: there weren't any boxed values in the union - CreateTrap(ctx.builder); + if (skip) + *skip = ConstantInt::get(getInt1Ty(ctx.builder.getContext()), 1); + else + CreateTrap(ctx.builder); return jl_cgval_t(ctx.builder.getContext()); } } if (jl_is_concrete_type(v.typ) && !jl_is_kind(v.typ)) { if (jl_is_concrete_type(typ) && !jl_is_kind(typ)) { // type mismatch: changing from one leaftype to another - CreateTrap(ctx.builder); + if (skip) + *skip = ConstantInt::get(getInt1Ty(ctx.builder.getContext()), 1); + else + CreateTrap(ctx.builder); return jl_cgval_t(ctx.builder.getContext()); } } @@ -2802,7 +2807,7 @@ static bool emit_builtin_call(jl_codectx_t &ctx, jl_cgval_t *ret, jl_value_t *f, } else if (f == jl_builtin_typeof && nargs == 1) { - *ret = emit_typeof(ctx, argv[1]); + *ret = emit_typeof(ctx, argv[1], false); return true; } @@ -3944,7 +3949,7 @@ static jl_cgval_t emit_sparam(jl_codectx_t &ctx, size_t i) ctx.spvals_ptr, i + sizeof(jl_svec_t) / sizeof(jl_value_t*)); Value *sp = tbaa_decorate(ctx.tbaa().tbaa_const, ctx.builder.CreateAlignedLoad(ctx.types().T_prjlvalue, bp, Align(sizeof(void*)))); - Value *isnull = ctx.builder.CreateICmpNE(emit_typeof(ctx, sp), + Value *isnull = ctx.builder.CreateICmpNE(emit_typeof(ctx, sp, false), track_pjlvalue(ctx, literal_pointer_val(ctx, (jl_value_t*)jl_tvar_type))); jl_unionall_t *sparam = (jl_unionall_t*)ctx.linfo->def.method->sig; for (size_t j = 0; j < i; j++) { @@ -4018,7 +4023,7 @@ static jl_cgval_t emit_isdefined(jl_codectx_t &ctx, jl_value_t *sym) ctx.spvals_ptr, i + sizeof(jl_svec_t) / sizeof(jl_value_t*)); Value *sp = tbaa_decorate(ctx.tbaa().tbaa_const, ctx.builder.CreateAlignedLoad(ctx.types().T_prjlvalue, bp, Align(sizeof(void*)))); - isnull = ctx.builder.CreateICmpNE(emit_typeof(ctx, sp), + isnull = ctx.builder.CreateICmpNE(emit_typeof(ctx, sp, false), track_pjlvalue(ctx, literal_pointer_val(ctx, (jl_value_t*)jl_tvar_type))); } else { @@ -4191,7 +4196,7 @@ static void emit_vi_assignment_unboxed(jl_codectx_t &ctx, jl_varinfo_t &vi, Valu } } else { - emit_unionmove(ctx, vi.value.V, ctx.tbaa().tbaa_stack, rval_info, isboxed, vi.isVolatile); + emit_unionmove(ctx, vi.value.V, ctx.tbaa().tbaa_stack, rval_info, /*skip*/isboxed, vi.isVolatile); } } } @@ -4655,7 +4660,8 @@ static jl_cgval_t emit_expr(jl_codectx_t &ctx, jl_value_t *expr, ssize_t ssaval) jl_error("GotoIfNot in value position"); } if (jl_is_pinode(expr)) { - return convert_julia_type(ctx, emit_expr(ctx, jl_fieldref_noalloc(expr, 0)), jl_fieldref_noalloc(expr, 1)); + Value *skip = NULL; + return convert_julia_type(ctx, emit_expr(ctx, jl_fieldref_noalloc(expr, 0)), jl_fieldref_noalloc(expr, 1), &skip); } if (!jl_is_expr(expr)) { int needroot = true; @@ -7504,7 +7510,7 @@ static std::pair, jl_llvm_functions_t> else { // must be careful to emit undef here (rather than a bitcast or // load of val) if the runtime type of val isn't phiType - Value *isvalid = emit_isa(ctx, val, phiType, NULL).first; + Value *isvalid = emit_isa_and_defined(ctx, val, phiType); V = emit_guarded_test(ctx, isvalid, undef_value_for_type(VN->getType()), [&] { return emit_unbox(ctx, VN->getType(), val, phiType); }); @@ -7516,7 +7522,7 @@ static std::pair, jl_llvm_functions_t> // must be careful to emit undef here (rather than a bitcast or // load of val) if the runtime type of val isn't phiType assert(lty != ctx.types().T_prjlvalue); - Value *isvalid = emit_isa(ctx, val, phiType, NULL).first; + Value *isvalid = emit_isa_and_defined(ctx, val, phiType); emit_guarded_test(ctx, isvalid, nullptr, [&] { (void)emit_unbox(ctx, lty, val, phiType, maybe_decay_tracked(ctx, dest), ctx.tbaa().tbaa_stack); return nullptr; @@ -7558,7 +7564,7 @@ static std::pair, jl_llvm_functions_t> RTindex = new_union.TIndex; if (!RTindex) { assert(new_union.isboxed && new_union.Vboxed && "convert_julia_type failed"); - RTindex = compute_tindex_unboxed(ctx, new_union, phiType); + RTindex = compute_tindex_unboxed(ctx, new_union, phiType, true); if (dest) { // If dest is not set, this is a ghost union, the recipient of which // is often not prepared to handle a boxed representation of the ghost. diff --git a/src/llvm-late-gc-lowering.cpp b/src/llvm-late-gc-lowering.cpp index 3586527668135..9f716db3898d5 100644 --- a/src/llvm-late-gc-lowering.cpp +++ b/src/llvm-late-gc-lowering.cpp @@ -1065,8 +1065,9 @@ void RecursivelyVisit(callback f, Value *V) { if (isa(TheUser)) f(VU); if (isa(TheUser) || isa(TheUser) || - isa(TheUser) || isa(TheUser) || + isa(TheUser) || isa(TheUser) || // TODO: should these be removed from this list? isa(TheUser) || isa(TheUser) || + isa(TheUser) || // ICmpEQ/ICmpNE can be used with ptr types isa(TheUser) || isa(TheUser)) continue; if (isa(TheUser) || isa(TheUser) || isa(TheUser)) { From 834c8e6553cd0a0eeae2aca678fda4845e62715d Mon Sep 17 00:00:00 2001 From: N5N3 <2642243996@qq.com> Date: Mon, 16 May 2022 20:07:03 +0800 Subject: [PATCH 155/369] Use `CartesianIndices(Rsrc)` as the shared iterator. (#45289) There's no performance change, if the `indices`s of `Rdest` and `Rsrc` are all `NTuple{N,<:AbstractUnitRange}`. (cherry picked from commit a91be39b671638b8c48215931eb4ccd948ce33a3) --- base/multidimensional.jl | 12 +++++++----- test/copy.jl | 13 ++++++++----- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/base/multidimensional.jl b/base/multidimensional.jl index b5e401a7834e7..4be18766a30e6 100644 --- a/base/multidimensional.jl +++ b/base/multidimensional.jl @@ -1113,16 +1113,18 @@ function copyto!(dest::AbstractArray{T1,N}, Rdest::CartesianIndices{N}, checkbounds(src, first(Rsrc)) checkbounds(src, last(Rsrc)) src′ = unalias(dest, src) - ΔI = first(Rdest) - first(Rsrc) + CRdest = CartesianIndices(Rdest) + CRsrc = CartesianIndices(Rsrc) + ΔI = first(CRdest) - first(CRsrc) if @generated quote - @nloops $N i (n->Rsrc.indices[n]) begin - @inbounds @nref($N,dest,n->i_n+ΔI[n]) = @nref($N,src′,i) + @nloops $N i (n->CRsrc.indices[n]) begin + @inbounds @nref($N,dest,n->Rdest.indices[n][i_n+ΔI[n]]) = @nref($N,src,n->Rsrc.indices[n][i_n]) end end else - for I in Rsrc - @inbounds dest[I + ΔI] = src′[I] + for I in CRsrc + @inbounds dest[Rdest[I + ΔI]] = src′[Rsrc[I]] end end dest diff --git a/test/copy.jl b/test/copy.jl index 28d34e4756a6b..654e95dec67d5 100644 --- a/test/copy.jl +++ b/test/copy.jl @@ -58,11 +58,14 @@ end @test B == A end let A = reshape(1:6, 3, 2), B = zeros(8,8) - RA = CartesianIndices(axes(A)) - copyto!(B, CartesianIndices((5:7,2:3)), A, RA) - @test B[5:7,2:3] == A - B[5:7,2:3] .= 0 - @test all(x->x==0, B) + RBs = Any[(5:7,2:3), (3:2:7,1:2:3), (6:-1:4,2:-1:1)] + RAs = Any[axes(A), reverse.(axes(A))] + for RB in RBs, RA in RAs + copyto!(B, CartesianIndices(RB), A, CartesianIndices(RA)) + @test B[RB...] == A[RA...] + B[RB...] .= 0 + @test all(iszero, B) + end end end From 3dfa74d2786faed1de5782d472330c4a91f6729f Mon Sep 17 00:00:00 2001 From: N5N3 <2642243996@qq.com> Date: Tue, 17 May 2022 18:54:03 +0800 Subject: [PATCH 156/369] Typo fix. (#45333) (cherry picked from commit eed2dba73d5c781055c23120d357a17c875e685b) --- base/multidimensional.jl | 2 +- test/copy.jl | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/base/multidimensional.jl b/base/multidimensional.jl index 4be18766a30e6..cd55b371de5a3 100644 --- a/base/multidimensional.jl +++ b/base/multidimensional.jl @@ -1119,7 +1119,7 @@ function copyto!(dest::AbstractArray{T1,N}, Rdest::CartesianIndices{N}, if @generated quote @nloops $N i (n->CRsrc.indices[n]) begin - @inbounds @nref($N,dest,n->Rdest.indices[n][i_n+ΔI[n]]) = @nref($N,src,n->Rsrc.indices[n][i_n]) + @inbounds @nref($N,dest,n->Rdest.indices[n][i_n+ΔI[n]]) = @nref($N,src′,n->Rsrc.indices[n][i_n]) end end else diff --git a/test/copy.jl b/test/copy.jl index 654e95dec67d5..04fda36728e62 100644 --- a/test/copy.jl +++ b/test/copy.jl @@ -67,6 +67,10 @@ end @test all(iszero, B) end end + let A = [reshape(1:6, 3, 2);;] + copyto!(A, CartesianIndices((2:3,2)), A, CartesianIndices((2,2))) + @test A[2:3,:] == [1 4;2 5] + end end @testset "shallow and deep copying" begin From 43ba8aec070f036ec7d541598db904e7679c8e9e Mon Sep 17 00:00:00 2001 From: FX Coudert Date: Tue, 17 May 2022 23:48:34 +0200 Subject: [PATCH 157/369] Resurrect libunwind patches (#45189) Fixes #44499 (cherry picked from commit f18324c856aad346c9040abb0f1b327aace7d081) --- deps/patches/llvm-libunwind-force-dwarf.patch | 179 +++++++++++++++++ ...-libunwind-freebsd-libgcc-api-compat.patch | 107 ++++++++++ .../llvm-libunwind-prologue-epilogue.patch | 183 ++++++++++++++++++ ...ibunwind-revert-monorepo-requirement.patch | 156 +++++++++++++++ deps/unwind.mk | 10 +- 5 files changed, 634 insertions(+), 1 deletion(-) create mode 100644 deps/patches/llvm-libunwind-force-dwarf.patch create mode 100644 deps/patches/llvm-libunwind-freebsd-libgcc-api-compat.patch create mode 100644 deps/patches/llvm-libunwind-prologue-epilogue.patch create mode 100644 deps/patches/llvm-libunwind-revert-monorepo-requirement.patch diff --git a/deps/patches/llvm-libunwind-force-dwarf.patch b/deps/patches/llvm-libunwind-force-dwarf.patch new file mode 100644 index 0000000000000..2f4d31acb8a4a --- /dev/null +++ b/deps/patches/llvm-libunwind-force-dwarf.patch @@ -0,0 +1,179 @@ +An updated version of this libosxunwind commit: + +Author: Keno Fischer +Date: Tue Aug 27 15:01:22 2013 -0400 + + Add option to step with DWARF + +--- +diff -pur a/libunwind/include/libunwind.h b/libunwind/include/libunwind.h +--- a/libunwind/include/libunwind.h 2021-06-28 18:23:38.000000000 +0200 ++++ b/libunwind/include/libunwind.h 2022-05-04 18:44:24.000000000 +0200 +@@ -108,6 +108,7 @@ extern "C" { + + extern int unw_getcontext(unw_context_t *) LIBUNWIND_AVAIL; + extern int unw_init_local(unw_cursor_t *, unw_context_t *) LIBUNWIND_AVAIL; ++extern int unw_init_local_dwarf(unw_cursor_t *, unw_context_t *) LIBUNWIND_AVAIL; + extern int unw_step(unw_cursor_t *) LIBUNWIND_AVAIL; + extern int unw_get_reg(unw_cursor_t *, unw_regnum_t, unw_word_t *) LIBUNWIND_AVAIL; + extern int unw_get_fpreg(unw_cursor_t *, unw_regnum_t, unw_fpreg_t *) LIBUNWIND_AVAIL; +Only in b/libunwind/include: libunwind.h.orig +diff -pur a/libunwind/src/UnwindCursor.hpp b/libunwind/src/UnwindCursor.hpp +--- a/libunwind/src/UnwindCursor.hpp 2021-06-28 18:23:38.000000000 +0200 ++++ b/libunwind/src/UnwindCursor.hpp 2022-05-04 18:45:11.000000000 +0200 +@@ -437,6 +437,9 @@ public: + virtual bool isSignalFrame() { + _LIBUNWIND_ABORT("isSignalFrame not implemented"); + } ++ virtual void setForceDWARF(bool) { ++ _LIBUNWIND_ABORT("setForceDWARF not implemented"); ++ } + virtual bool getFunctionName(char *, size_t, unw_word_t *) { + _LIBUNWIND_ABORT("getFunctionName not implemented"); + } +@@ -894,6 +897,7 @@ public: + virtual void getInfo(unw_proc_info_t *); + virtual void jumpto(); + virtual bool isSignalFrame(); ++ virtual void setForceDWARF(bool force); + virtual bool getFunctionName(char *buf, size_t len, unw_word_t *off); + virtual void setInfoBasedOnIPRegister(bool isReturnAddress = false); + virtual const char *getRegisterName(int num); +@@ -963,7 +967,7 @@ private: + const UnwindInfoSections §s); + int stepWithCompactEncoding() { + #if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) +- if ( compactSaysUseDwarf() ) ++ if ( _forceDwarf || compactSaysUseDwarf() ) + return stepWithDwarfFDE(); + #endif + R dummy; +@@ -1198,6 +1202,7 @@ private: + unw_proc_info_t _info; + bool _unwindInfoMissing; + bool _isSignalFrame; ++ bool _forceDwarf; + #if defined(_LIBUNWIND_TARGET_LINUX) && defined(_LIBUNWIND_TARGET_AARCH64) + bool _isSigReturn = false; + #endif +@@ -1207,7 +1212,7 @@ private: + template + UnwindCursor::UnwindCursor(unw_context_t *context, A &as) + : _addressSpace(as), _registers(context), _unwindInfoMissing(false), +- _isSignalFrame(false) { ++ _isSignalFrame(false), _forceDwarf(false) { + static_assert((check_fit, unw_cursor_t>::does_fit), + "UnwindCursor<> does not fit in unw_cursor_t"); + static_assert((alignof(UnwindCursor) <= alignof(unw_cursor_t)), +@@ -1217,7 +1222,8 @@ UnwindCursor::UnwindCursor(unw_con + + template + UnwindCursor::UnwindCursor(A &as, void *) +- : _addressSpace(as), _unwindInfoMissing(false), _isSignalFrame(false) { ++ : _addressSpace(as), _unwindInfoMissing(false), _isSignalFrame(false), ++ _forceDwarf(false) { + memset(&_info, 0, sizeof(_info)); + // FIXME + // fill in _registers from thread arg +@@ -1273,6 +1279,10 @@ template bool U + return _isSignalFrame; + } + ++template void UnwindCursor::setForceDWARF(bool force) { ++ _forceDwarf = force; ++} ++ + #endif // defined(_LIBUNWIND_SUPPORT_SEH_UNWIND) + + #if defined(_LIBUNWIND_ARM_EHABI) +@@ -1941,7 +1951,13 @@ void UnwindCursor::setInfoBasedOnI + // record that we have no unwind info. + if (_info.format == 0) + _unwindInfoMissing = true; ++ #if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) ++ if (!(_forceDwarf || compactSaysUseDwarf(&dwarfOffset))) ++ return; ++ #else + return; ++ #endif ++ + } + } + #endif // defined(_LIBUNWIND_SUPPORT_COMPACT_UNWIND) +diff -pur a/libunwind/src/libunwind.cpp b/libunwind/src/libunwind.cpp +--- a/libunwind/src/libunwind.cpp 2021-06-28 18:23:38.000000000 +0200 ++++ b/libunwind/src/libunwind.cpp 2022-05-04 18:44:24.000000000 +0200 +@@ -71,6 +71,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(u + new (reinterpret_cast *>(cursor)) + UnwindCursor( + context, LocalAddressSpace::sThisAddressSpace); ++ static_assert(sizeof(unw_cursor_t) >= sizeof(UnwindCursor), "libunwind header outdated"); + #undef REGISTER_KIND + AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor; + co->setInfoBasedOnIPRegister(); +@@ -79,6 +80,54 @@ _LIBUNWIND_HIDDEN int __unw_init_local(u + } + _LIBUNWIND_WEAK_ALIAS(__unw_init_local, unw_init_local) + ++_LIBUNWIND_HIDDEN int __unw_init_local_dwarf(unw_cursor_t *cursor, ++ unw_context_t *context) { ++ _LIBUNWIND_TRACE_API("__unw_init_local_dwarf(cursor=%p, context=%p)", ++ static_cast(cursor), ++ static_cast(context)); ++#if defined(__i386__) ++# define REGISTER_KIND Registers_x86 ++#elif defined(__x86_64__) ++# define REGISTER_KIND Registers_x86_64 ++#elif defined(__powerpc64__) ++# define REGISTER_KIND Registers_ppc64 ++#elif defined(__ppc__) ++# define REGISTER_KIND Registers_ppc ++#elif defined(__aarch64__) ++# define REGISTER_KIND Registers_arm64 ++#elif defined(__arm__) ++# define REGISTER_KIND Registers_arm ++#elif defined(__or1k__) ++# define REGISTER_KIND Registers_or1k ++#elif defined(__hexagon__) ++# define REGISTER_KIND Registers_hexagon ++#elif defined(__mips__) && defined(_ABIO32) && _MIPS_SIM == _ABIO32 ++# define REGISTER_KIND Registers_mips_o32 ++#elif defined(__mips64) ++# define REGISTER_KIND Registers_mips_newabi ++#elif defined(__mips__) ++# warning The MIPS architecture is not supported with this ABI and environment! ++#elif defined(__sparc__) ++# define REGISTER_KIND Registers_sparc ++#elif defined(__riscv) && __riscv_xlen == 64 ++# define REGISTER_KIND Registers_riscv ++#else ++# error Architecture not supported ++#endif ++ // Use "placement new" to allocate UnwindCursor in the cursor buffer. ++ new (reinterpret_cast *>(cursor)) ++ UnwindCursor( ++ context, LocalAddressSpace::sThisAddressSpace); ++ static_assert(sizeof(unw_cursor_t) >= sizeof(UnwindCursor), "libunwind header outdated"); ++#undef REGISTER_KIND ++ AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor; ++ co->setForceDWARF(true); ++ co->setInfoBasedOnIPRegister(); ++ ++ return UNW_ESUCCESS; ++} ++_LIBUNWIND_WEAK_ALIAS(__unw_init_local_dwarf, unw_init_local_dwarf) ++ + /// Get value of specified register at cursor position in stack frame. + _LIBUNWIND_HIDDEN int __unw_get_reg(unw_cursor_t *cursor, unw_regnum_t regNum, + unw_word_t *value) { +diff -pur a/libunwind/src/libunwind_ext.h b/libunwind/src/libunwind_ext.h +--- a/libunwind/src/libunwind_ext.h 2021-06-28 18:23:38.000000000 +0200 ++++ b/libunwind/src/libunwind_ext.h 2022-05-04 18:44:24.000000000 +0200 +@@ -25,6 +25,7 @@ extern "C" { + + extern int __unw_getcontext(unw_context_t *); + extern int __unw_init_local(unw_cursor_t *, unw_context_t *); ++extern int __unw_init_local_dwarf(unw_cursor_t *, unw_context_t *); + extern int __unw_step(unw_cursor_t *); + extern int __unw_get_reg(unw_cursor_t *, unw_regnum_t, unw_word_t *); + extern int __unw_get_fpreg(unw_cursor_t *, unw_regnum_t, unw_fpreg_t *); diff --git a/deps/patches/llvm-libunwind-freebsd-libgcc-api-compat.patch b/deps/patches/llvm-libunwind-freebsd-libgcc-api-compat.patch new file mode 100644 index 0000000000000..afb4b941d5b92 --- /dev/null +++ b/deps/patches/llvm-libunwind-freebsd-libgcc-api-compat.patch @@ -0,0 +1,107 @@ +Modification of the following patch in the FreeBSD source tree, which +includes LLVM libunwind in contrib/llvm-project/libunwind. + +From 9f287522cec9feac040d7cb845a440a8f6b7b90e Mon Sep 17 00:00:00 2001 +From: Dimitry Andric +Date: Sun, 2 Aug 2020 18:12:14 +0000 +Subject: [PATCH] Reapply r310365 (by emaste): + +libunwind: make __{de,}register_frame compatible with libgcc API + +The libgcc __register_frame and __deregister_frame functions take a +pointer to a set of FDE/CIEs, terminated by an entry where length is 0. + +In Apple's libunwind implementation the pointer is taken to be to a +single FDE. I suspect this was just an Apple bug, compensated by Apple- +specific code in LLVM. + +See lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp and +http://lists.llvm.org/pipermail/llvm-dev/2013-April/061737.html +for more detail. + +This change is based on the LLVM RTDyldMemoryManager.cpp. It should +later be changed to be alignment-safe. + +Reported by: dim +Reviewed by: dim +Sponsored by: The FreeBSD Foundation +Differential Revision: https://reviews.freebsd.org/D8869 + +Reapply r351610: + +Update libunwind custom frame register and deregister functions for +FreeBSD: use the new doubly underscored names for unw_add_dynamic_fde +and unw_remove_dynamic_fde. + +NOTE: this should be upstreamed... +--- + .../libunwind/src/UnwindLevel1-gcc-ext.c | 42 ++++++++++++++++++- + 1 file changed, 41 insertions(+), 1 deletion(-) + +diff --git a/libunwind/src/UnwindLevel1-gcc-ext.c b/libunwind/src/UnwindLevel1-gcc-ext.c +index 310b836d129e5..30f9cabf241f2 100644 +--- a/libunwind/src/UnwindLevel1-gcc-ext.c ++++ b/libunwind/src/UnwindLevel1-gcc-ext.c +@@ -234,6 +234,46 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIPInfo(struct _Unwind_Context *context, + + #if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) + ++#if defined(__FreeBSD__) ++ ++// Based on LLVM's lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp ++// and XXX should be fixed to be alignment-safe. ++static void processFDE(const char *addr, bool isDeregister) { ++ uint64_t length; ++ while ((length = *((const uint32_t *)addr)) != 0) { ++ const char *p = addr + 4; ++ if (length == 0xffffffff) { ++ length = *((const uint64_t *)p); ++ p += 8; ++ } ++ uint32_t offset = *((const uint32_t *)p); ++ if (offset != 0) { ++ if (isDeregister) ++ __unw_remove_dynamic_fde((unw_word_t)(uintptr_t)addr); ++ else ++ __unw_add_dynamic_fde((unw_word_t)(uintptr_t)addr); ++ } ++ addr = p + length; ++ } ++} ++ ++/// Called by programs with dynamic code generators that want to register ++/// dynamically generated FDEs, with a libgcc-compatible API. ++ ++_LIBUNWIND_EXPORT void __register_frame(const void *addr) { ++ _LIBUNWIND_TRACE_API("__register_frame(%p)", addr); ++ processFDE(addr, false); ++} ++ ++/// Called by programs with dynamic code generators that want to unregister ++/// dynamically generated FDEs, with a libgcc-compatible API. ++_LIBUNWIND_EXPORT void __deregister_frame(const void *addr) { ++ _LIBUNWIND_TRACE_API("__deregister_frame(%p)", addr); ++ processFDE(addr, true); ++} ++ ++#else // defined(__FreeBSD__) ++ + /// Called by programs with dynamic code generators that want + /// to register a dynamically generated FDE. + /// This function has existed on Mac OS X since 10.4, but +@@ -243,7 +283,6 @@ _LIBUNWIND_EXPORT void __register_frame(const void *fde) { + __unw_add_dynamic_fde((unw_word_t)(uintptr_t)fde); + } + +- + /// Called by programs with dynamic code generators that want + /// to unregister a dynamically generated FDE. + /// This function has existed on Mac OS X since 10.4, but +@@ -253,6 +292,7 @@ _LIBUNWIND_EXPORT void __deregister_frame(const void *fde) { + __unw_remove_dynamic_fde((unw_word_t)(uintptr_t)fde); + } + ++#endif // defined(__FreeBSD__) + + // The following register/deregister functions are gcc extensions. + // They have existed on Mac OS X, but have never worked because Mac OS X diff --git a/deps/patches/llvm-libunwind-prologue-epilogue.patch b/deps/patches/llvm-libunwind-prologue-epilogue.patch new file mode 100644 index 0000000000000..7dadca728f9cf --- /dev/null +++ b/deps/patches/llvm-libunwind-prologue-epilogue.patch @@ -0,0 +1,183 @@ +An updated version of this libosxunwind commit: + +commit ca57a5b60de4cd1daa42ed2e5d1d4aa3e96a09d1 +Author: Keno Fischer +Date: Mon Aug 26 15:28:08 2013 -0400 + + Add support for unwinding during prologue/epilogue + +--- +diff --git a/libunwind/src/CompactUnwinder.hpp b/libunwind/src/CompactUnwinder.hpp +index 1c3175dff50a..78a658ccbc27 100644 +--- a/libunwind/src/CompactUnwinder.hpp ++++ b/libunwind/src/CompactUnwinder.hpp +@@ -310,6 +310,50 @@ int CompactUnwinder_x86_64::stepWithCompactEncodingRBPFrame( + uint32_t savedRegistersLocations = + EXTRACT_BITS(compactEncoding, UNWIND_X86_64_RBP_FRAME_REGISTERS); + ++ // If we have not stored EBP yet ++ if (functionStart == registers.getIP()) { ++ uint64_t rsp = registers.getSP(); ++ // old esp is ebp less return address ++ registers.setSP(rsp+8); ++ // pop return address into eip ++ registers.setIP(addressSpace.get64(rsp)); ++ ++ return UNW_STEP_SUCCESS; ++ } else if (functionStart + 1 == registers.getIP()) { ++ uint64_t rsp = registers.getSP(); ++ // old esp is ebp less return address ++ registers.setSP(rsp + 16); ++ // pop return address into eip ++ registers.setIP(addressSpace.get64(rsp + 8)); ++ ++ return UNW_STEP_SUCCESS; ++ } ++ ++ // If we're about to return, we've already popped the base pointer ++ uint8_t b = addressSpace.get8(registers.getIP()); ++ ++ // This is a hack to detect VZEROUPPER but in between popq rbp and ret ++ // It's not pretty but it works ++ if (b == 0xC5) { ++ if ((b = addressSpace.get8(registers.getIP() + 1)) == 0xF8 && ++ (b = addressSpace.get8(registers.getIP() + 2)) == 0x77) ++ b = addressSpace.get8(registers.getIP() + 3); ++ else ++ goto skip_ret; ++ } ++ ++ if (b == 0xC3 || b == 0xCB || b == 0xC2 || b == 0xCA) { ++ uint64_t rbp = registers.getSP(); ++ // old esp is ebp less return address ++ registers.setSP(rbp + 16); ++ // pop return address into eip ++ registers.setIP(addressSpace.get64(rbp + 8)); ++ ++ return UNW_STEP_SUCCESS; ++ } ++ ++ skip_ret: ++ + uint64_t savedRegisters = registers.getRBP() - 8 * savedRegistersOffset; + for (int i = 0; i < 5; ++i) { + switch (savedRegistersLocations & 0x7) { +@@ -430,6 +474,118 @@ int CompactUnwinder_x86_64::stepWithCompactEncodingFrameless( + } + } + } ++ ++ // Note that the order of these registers is so that ++ // registersSaved[0] is the one that will be pushed onto the stack last. ++ // Thus, if we want to walk this from the top, we need to go in reverse. ++ assert(regCount <= 6); ++ ++ // check whether we are still in the prologue ++ uint64_t curAddr = functionStart; ++ if (regCount > 0) { ++ for (int8_t i = (int8_t)(regCount) - 1; i >= 0; --i) { ++ if (registers.getIP() == curAddr) { ++ // None of the registers have been modified yet, so we don't need to reload them ++ framelessUnwind(addressSpace, registers.getSP() + 8 * (regCount - (uint64_t)(i + 1)), registers); ++ return UNW_STEP_SUCCESS; ++ } else { ++ assert(curAddr < registers.getIP()); ++ } ++ ++ ++ // pushq %rbp and pushq %rbx is 1 byte. Everything else 2 ++ if ((UNWIND_X86_64_REG_RBP == registersSaved[i]) || ++ (UNWIND_X86_64_REG_RBX == registersSaved[i])) ++ curAddr += 1; ++ else ++ curAddr += 2; ++ } ++ } ++ if (registers.getIP() == curAddr) { ++ // None of the registers have been modified yet, so we don't need to reload them ++ framelessUnwind(addressSpace, registers.getSP() + 8*regCount, registers); ++ return UNW_STEP_SUCCESS; ++ } else { ++ assert(curAddr < registers.getIP()); ++ } ++ ++ ++ // And now for the epilogue ++ { ++ uint8_t i = 0; ++ uint64_t p = registers.getIP(); ++ uint8_t b = 0; ++ ++ while (true) { ++ b = addressSpace.get8(p++); ++ // This is a hack to detect VZEROUPPER but in between the popq's and ret ++ // It's not pretty but it works ++ if (b == 0xC5) { ++ if ((b = addressSpace.get8(p++)) == 0xF8 && (b = addressSpace.get8(p++)) == 0x77) ++ b = addressSpace.get8(p++); ++ else ++ break; ++ } ++ // popq %rbx popq %rbp ++ if (b == 0x5B || b == 0x5D) { ++ i++; ++ } else if (b == 0x41) { ++ b = addressSpace.get8(p++); ++ if (b == 0x5C || b == 0x5D || b == 0x5E || b == 0x5F) ++ i++; ++ else ++ break; ++ } else if (b == 0xC3 || b == 0xCB || b == 0xC2 || b == 0xCA) { ++ // i pop's haven't happened yet ++ uint64_t savedRegisters = registers.getSP() + 8 * i; ++ if (regCount > 0) { ++ for (int8_t j = (int8_t)(regCount) - 1; j >= (int8_t)(regCount) - i; --j) { ++ uint64_t addr = savedRegisters - 8 * (regCount - (uint64_t)(j)); ++ switch (registersSaved[j]) { ++ case UNWIND_X86_64_REG_RBX: ++ registers.setRBX(addressSpace.get64(addr)); ++ break; ++ case UNWIND_X86_64_REG_R12: ++ registers.setR12(addressSpace.get64(addr)); ++ break; ++ case UNWIND_X86_64_REG_R13: ++ registers.setR13(addressSpace.get64(addr)); ++ break; ++ case UNWIND_X86_64_REG_R14: ++ registers.setR14(addressSpace.get64(addr)); ++ break; ++ case UNWIND_X86_64_REG_R15: ++ registers.setR15(addressSpace.get64(addr)); ++ break; ++ case UNWIND_X86_64_REG_RBP: ++ registers.setRBP(addressSpace.get64(addr)); ++ break; ++ default: ++ _LIBUNWIND_DEBUG_LOG("bad register for frameless, encoding=%08X for " ++ "function starting at 0x%llX", ++ encoding, functionStart); ++ _LIBUNWIND_ABORT("invalid compact unwind encoding"); ++ } ++ } ++ } ++ framelessUnwind(addressSpace, savedRegisters, registers); ++ return UNW_STEP_SUCCESS; ++ } else { ++ break; ++ } ++ } ++ } ++ ++ /* ++ 0x10fe2733a: 5b popq %rbx ++ 0x10fe2733b: 41 5c popq %r12 ++ 0x10fe2733d: 41 5d popq %r13 ++ 0x10fe2733f: 41 5e popq %r14 ++ 0x10fe27341: 41 5f popq %r15 ++ 0x10fe27343: 5d popq %rbp ++ */ ++ ++ + uint64_t savedRegisters = registers.getSP() + stackSize - 8 - 8 * regCount; + for (uint32_t i = 0; i < regCount; ++i) { + switch (registersSaved[i]) { diff --git a/deps/patches/llvm-libunwind-revert-monorepo-requirement.patch b/deps/patches/llvm-libunwind-revert-monorepo-requirement.patch new file mode 100644 index 0000000000000..4e3897dfb9801 --- /dev/null +++ b/deps/patches/llvm-libunwind-revert-monorepo-requirement.patch @@ -0,0 +1,156 @@ +Upstream commit 8c03fdf34a659925a3f09c8f54016e47ea1c7519 changed the build such +that it requires living inside the monorepo with libcxx available, only so that +it can reuse a CMake file to simplify some build steps. This patch is a revert +of that commit applied only to libunwind. + +--- +diff --git a/libunwind/CMakeLists.txt b/libunwind/CMakeLists.txt +index 570b8db90653..a383d7d77d6f 100644 +--- a/libunwind/CMakeLists.txt ++++ b/libunwind/CMakeLists.txt +@@ -1,7 +1,3 @@ +-if (NOT IS_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/../libcxx") +- message(FATAL_ERROR "libunwind requires being built in a monorepo layout with libcxx available") +-endif() +- + #=============================================================================== + # Setup Project + #=============================================================================== +@@ -15,31 +11,103 @@ set(CMAKE_MODULE_PATH + ${CMAKE_MODULE_PATH} + ) + +-set(LIBUNWIND_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) +-set(LIBUNWIND_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) +-set(LIBUNWIND_LIBCXX_PATH "${CMAKE_CURRENT_LIST_DIR}/../libcxx" CACHE PATH +- "Specify path to libc++ source.") +- + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBUNWIND_STANDALONE_BUILD) + project(libunwind LANGUAGES C CXX ASM) + ++ # Rely on llvm-config. ++ set(CONFIG_OUTPUT) ++ if(NOT LLVM_CONFIG_PATH) ++ find_program(LLVM_CONFIG_PATH "llvm-config") ++ endif() ++ if (DEFINED LLVM_PATH) ++ set(LLVM_INCLUDE_DIR ${LLVM_INCLUDE_DIR} CACHE PATH "Path to llvm/include") ++ set(LLVM_PATH ${LLVM_PATH} CACHE PATH "Path to LLVM source tree") ++ set(LLVM_MAIN_SRC_DIR ${LLVM_PATH}) ++ set(LLVM_CMAKE_PATH "${LLVM_PATH}/cmake/modules") ++ elseif(LLVM_CONFIG_PATH) ++ message(STATUS "Found LLVM_CONFIG_PATH as ${LLVM_CONFIG_PATH}") ++ set(CONFIG_COMMAND ${LLVM_CONFIG_PATH} "--includedir" "--prefix" "--src-root") ++ execute_process(COMMAND ${CONFIG_COMMAND} ++ RESULT_VARIABLE HAD_ERROR ++ OUTPUT_VARIABLE CONFIG_OUTPUT) ++ if (NOT HAD_ERROR) ++ string(REGEX REPLACE "[ \t]*[\r\n]+[ \t]*" ";" ++ CONFIG_OUTPUT ${CONFIG_OUTPUT}) ++ else() ++ string(REPLACE ";" " " CONFIG_COMMAND_STR "${CONFIG_COMMAND}") ++ message(STATUS "${CONFIG_COMMAND_STR}") ++ message(FATAL_ERROR "llvm-config failed with status ${HAD_ERROR}") ++ endif() ++ ++ list(GET CONFIG_OUTPUT 0 INCLUDE_DIR) ++ list(GET CONFIG_OUTPUT 1 LLVM_OBJ_ROOT) ++ list(GET CONFIG_OUTPUT 2 MAIN_SRC_DIR) ++ ++ set(LLVM_INCLUDE_DIR ${INCLUDE_DIR} CACHE PATH "Path to llvm/include") ++ set(LLVM_BINARY_DIR ${LLVM_OBJ_ROOT} CACHE PATH "Path to LLVM build tree") ++ set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree") ++ set(LLVM_LIT_PATH "${LLVM_PATH}/utils/lit/lit.py") ++ ++ # --cmakedir is supported since llvm r291218 (4.0 release) ++ execute_process( ++ COMMAND ${LLVM_CONFIG_PATH} --cmakedir ++ RESULT_VARIABLE HAD_ERROR ++ OUTPUT_VARIABLE CONFIG_OUTPUT ++ ERROR_QUIET) ++ if(NOT HAD_ERROR) ++ string(STRIP "${CONFIG_OUTPUT}" LLVM_CMAKE_PATH_FROM_LLVM_CONFIG) ++ file(TO_CMAKE_PATH "${LLVM_CMAKE_PATH_FROM_LLVM_CONFIG}" LLVM_CMAKE_PATH) ++ else() ++ file(TO_CMAKE_PATH "${LLVM_BINARY_DIR}" LLVM_BINARY_DIR_CMAKE_STYLE) ++ set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR_CMAKE_STYLE}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm") ++ endif() ++ else() ++ message(WARNING "UNSUPPORTED LIBUNWIND CONFIGURATION DETECTED: " ++ "llvm-config not found and LLVM_MAIN_SRC_DIR not defined. " ++ "Reconfigure with -DLLVM_CONFIG=path/to/llvm-config " ++ "or -DLLVM_PATH=path/to/llvm-source-root.") ++ endif() ++ ++ if (EXISTS ${LLVM_CMAKE_PATH}) ++ list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}") ++ include("${LLVM_CMAKE_PATH}/AddLLVM.cmake") ++ include("${LLVM_CMAKE_PATH}/HandleLLVMOptions.cmake") ++ else() ++ message(WARNING "Not found: ${LLVM_CMAKE_PATH}") ++ endif() ++ + set(PACKAGE_NAME libunwind) + set(PACKAGE_VERSION 12.0.1) + set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") + set(PACKAGE_BUGREPORT "llvm-bugs@lists.llvm.org") + +- # Add the CMake module path of libcxx so we can reuse HandleOutOfTreeLLVM.cmake +- set(LIBUNWIND_LIBCXX_CMAKE_PATH "${LIBUNWIND_LIBCXX_PATH}/cmake/Modules") +- list(APPEND CMAKE_MODULE_PATH "${LIBUNWIND_LIBCXX_CMAKE_PATH}") ++ if (EXISTS ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py) ++ set(LLVM_LIT ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py) ++ else() ++ # Seek installed Lit. ++ find_program(LLVM_LIT "lit.py" ${LLVM_MAIN_SRC_DIR}/utils/lit ++ DOC "Path to lit.py") ++ endif() + +- # In a standalone build, we don't have llvm to automatically generate the +- # llvm-lit script for us. So we need to provide an explicit directory that +- # the configurator should write the script into. +- set(LIBUNWIND_STANDALONE_BUILD 1) +- set(LLVM_LIT_OUTPUT_DIR "${LIBUNWIND_BINARY_DIR}/bin") ++ if (LLVM_LIT) ++ # Define the default arguments to use with 'lit', and an option for the user ++ # to override. ++ set(LIT_ARGS_DEFAULT "-sv") ++ if (MSVC OR XCODE) ++ set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar") ++ endif() ++ set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING "Default options for lit") ++ ++ # On Win32 hosts, provide an option to specify the path to the GnuWin32 tools. ++ if (WIN32 AND NOT CYGWIN) ++ set(LLVM_LIT_TOOLS_DIR "" CACHE PATH "Path to GnuWin32 tools") ++ endif() ++ else() ++ set(LLVM_INCLUDE_TESTS OFF) ++ endif() + +- # Find the LLVM sources and simulate LLVM CMake options. +- include(HandleOutOfTreeLLVM) ++ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}) ++ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}) + else() + set(LLVM_LIT "${CMAKE_SOURCE_DIR}/utils/lit/lit.py") + endif() +@@ -85,8 +153,6 @@ set(LIBUNWIND_TEST_COMPILER_FLAGS "" CACHE STRING + "Additional compiler flags for test programs.") + set(LIBUNWIND_TEST_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/test/lit.site.cfg.in" CACHE STRING + "The Lit testing configuration to use when running the tests.") +-set(LIBUNWIND_TEST_PARAMS "" CACHE STRING +- "A list of parameters to run the Lit test suite with.") + + if (NOT LIBUNWIND_ENABLE_SHARED AND NOT LIBUNWIND_ENABLE_STATIC) + message(FATAL_ERROR "libunwind must be built as either a shared or static library.") +@@ -113,6 +179,9 @@ set(CMAKE_MODULE_PATH + "${CMAKE_CURRENT_SOURCE_DIR}/cmake" + ${CMAKE_MODULE_PATH}) + ++set(LIBUNWIND_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) ++set(LIBUNWIND_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) ++ + if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) + set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) + set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) diff --git a/deps/unwind.mk b/deps/unwind.mk index c794b94d5e636..dbdffdae31996 100644 --- a/deps/unwind.mk +++ b/deps/unwind.mk @@ -95,10 +95,18 @@ $(SRCCACHE)/llvmunwind-$(LLVMUNWIND_VER)/llvm-libunwind-force-dwarf.patch-applie cd $(SRCCACHE)/llvmunwind-$(LLVMUNWIND_VER) && patch -p2 -f < $(SRCDIR)/patches/llvm-libunwind-force-dwarf.patch echo 1 > $@ +$(SRCCACHE)/llvmunwind-$(LLVMUNWIND_VER)/llvm-libunwind-revert-monorepo-requirement.patch-applied: $(SRCCACHE)/llvmunwind-$(LLVMUNWIND_VER)/llvm-libunwind-force-dwarf.patch-applied + cd $(SRCCACHE)/llvmunwind-$(LLVMUNWIND_VER) && patch -p2 -f < $(SRCDIR)/patches/llvm-libunwind-revert-monorepo-requirement.patch + echo 1 > $@ + +$(SRCCACHE)/llvmunwind-$(LLVMUNWIND_VER)/llvm-libunwind-freebsd-libgcc-api-compat.patch-applied: $(SRCCACHE)/llvmunwind-$(LLVMUNWIND_VER)/llvm-libunwind-revert-monorepo-requirement.patch-applied + cd $(SRCCACHE)/llvmunwind-$(LLVMUNWIND_VER) && patch -p2 -f < $(SRCDIR)/patches/llvm-libunwind-freebsd-libgcc-api-compat.patch + echo 1 > $@ + checksum-llvmunwind: $(SRCCACHE)/llvmunwind-$(LLVMUNWIND_VER).tar.xz $(JLCHECKSUM) $< -$(BUILDDIR)/llvmunwind-$(LLVMUNWIND_VER)/build-configured: $(SRCCACHE)/llvmunwind-$(LLVMUNWIND_VER)/source-extracted $(SRCCACHE)/llvmunwind-$(LLVMUNWIND_VER)/llvm-libunwind-force-dwarf.patch-applied +$(BUILDDIR)/llvmunwind-$(LLVMUNWIND_VER)/build-configured: $(SRCCACHE)/llvmunwind-$(LLVMUNWIND_VER)/source-extracted $(SRCCACHE)/llvmunwind-$(LLVMUNWIND_VER)/llvm-libunwind-freebsd-libgcc-api-compat.patch-applied mkdir -p $(dir $@) cd $(dir $@) && \ $(CMAKE) $(dir $<) $(LLVMUNWIND_OPTS) From 1f9140f4a02c683ee64775a95e0e6b59058c0cfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Wed, 18 May 2022 03:50:34 +0100 Subject: [PATCH 158/369] [deps] Use newer `config.sub` when building nghttp2 (#45346) (cherry picked from commit 7f84d46ce01b9400a61dd5660c7607a4629abad6) --- deps/nghttp2.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/deps/nghttp2.mk b/deps/nghttp2.mk index 2b8a18728b712..9a161e1b238d3 100644 --- a/deps/nghttp2.mk +++ b/deps/nghttp2.mk @@ -8,6 +8,7 @@ $(SRCCACHE)/nghttp2-$(NGHTTP2_VER).tar.bz2: | $(SRCCACHE) $(SRCCACHE)/nghttp2-$(NGHTTP2_VER)/source-extracted: $(SRCCACHE)/nghttp2-$(NGHTTP2_VER).tar.bz2 $(JLCHECKSUM) $< cd $(dir $<) && $(TAR) -jxf $< + cp $(SRCDIR)/patches/config.sub $(SRCCACHE)/nghttp2-$(NGHTTP2_VER)/config.sub touch -c $(SRCCACHE)/nghttp2-$(NGHTTP2_VER)/configure # old target echo 1 > $@ From 1ccb618cae7ab30c7279cf13b4c76ef558f46203 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Wed, 18 May 2022 04:01:28 -0400 Subject: [PATCH 159/369] fix #45024, lost `expected assignment after const` error (#45344) (cherry picked from commit 2d40898a0bb09bbde7dae36cacc6ed5e23c7c0fa) --- src/julia-parser.scm | 18 ++++++++++++++++-- test/syntax.jl | 10 ++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/julia-parser.scm b/src/julia-parser.scm index 97a11df701a37..22d677b8bdaa2 100644 --- a/src/julia-parser.scm +++ b/src/julia-parser.scm @@ -1355,11 +1355,19 @@ (list 'where (rewrap-where x (cadr w)) (caddr w)) x)) +(define (parse-struct-field s) + (let ((tok (peek-token s))) + ;; allow `const x` only as a struct field + (if (eq? tok 'const) + (begin (take-token s) + `(const ,(parse-eq s))) + (parse-eq s)))) + (define (parse-struct-def s mut? word) (if (reserved-word? (peek-token s)) (error (string "invalid type name \"" (take-token s) "\""))) (let ((sig (parse-subtype-spec s))) - (begin0 (list 'struct (if mut? '(true) '(false)) sig (parse-block s)) + (begin0 (list 'struct (if mut? '(true) '(false)) sig (parse-block s parse-struct-field)) (expect-end s word)))) ;; consume any number of line endings from a token stream @@ -1456,7 +1464,13 @@ `(const ,expr) expr))) ((const) - `(const ,(parse-eq s))) + (let ((assgn (parse-eq s))) + (if (not (and (pair? assgn) + (or (eq? (car assgn) '=) + (eq? (car assgn) 'global) + (eq? (car assgn) 'local)))) + (error "expected assignment after \"const\"") + `(const ,assgn)))) ((function macro) (let* ((loc (line-number-node s)) diff --git a/test/syntax.jl b/test/syntax.jl index df5ed7babbffd..6ed3e7ca59ad7 100644 --- a/test/syntax.jl +++ b/test/syntax.jl @@ -3278,3 +3278,13 @@ demo44723()::Any = Base.Experimental.@opaque () -> true ? 1 : 2 # issue #45162 f45162(f) = f(x=1) @test first(methods(f45162)).called != 0 + +# issue #45024 +@test_throws ParseError("expected assignment after \"const\"") Meta.parse("const x") +@test_throws ParseError("expected assignment after \"const\"") Meta.parse("const x::Int") +# these cases have always been caught during lowering, since (const (global x)) is not +# ambiguous with the lowered form (const x), but that could probably be changed. +@test Meta.lower(@__MODULE__, :(global const x)) == Expr(:error, "expected assignment after \"const\"") +@test Meta.lower(@__MODULE__, :(global const x::Int)) == Expr(:error, "expected assignment after \"const\"") +@test Meta.lower(@__MODULE__, :(const global x)) == Expr(:error, "expected assignment after \"const\"") +@test Meta.lower(@__MODULE__, :(const global x::Int)) == Expr(:error, "expected assignment after \"const\"") From eb82f1846fdc2d195ab1031fe192b27fd171f148 Mon Sep 17 00:00:00 2001 From: Prem Chintalapudi Date: Sat, 12 Mar 2022 00:57:16 -0500 Subject: [PATCH 160/369] codegen: explicitly handle Float16 intrinsics (#45249) Fixes #44829, until llvm fixes the support for these intrinsics itself Also need to handle vectors, since the vectorizer may have introduced them. Also change our runtime emulation versions to f32 for consistency. (cherry picked from commit f2c627ef8af37c3cf94c19a5403bc6cd796d5031) --- src/APInt-C.cpp | 6 +- src/julia.expmap | 6 - src/julia_internal.h | 14 +- src/llvm-demote-float16.cpp | 276 ++++++++++++++++++++++++++++++------ src/runtime_intrinsics.c | 64 +++++---- 5 files changed, 284 insertions(+), 82 deletions(-) diff --git a/src/APInt-C.cpp b/src/APInt-C.cpp index bc0a62e21dd3e..f06d4362bf958 100644 --- a/src/APInt-C.cpp +++ b/src/APInt-C.cpp @@ -316,7 +316,7 @@ void LLVMByteSwap(unsigned numbits, integerPart *pa, integerPart *pr) { void LLVMFPtoInt(unsigned numbits, void *pa, unsigned onumbits, integerPart *pr, bool isSigned, bool *isExact) { double Val; if (numbits == 16) - Val = __gnu_h2f_ieee(*(uint16_t*)pa); + Val = julia__gnu_h2f_ieee(*(uint16_t*)pa); else if (numbits == 32) Val = *(float*)pa; else if (numbits == 64) @@ -391,7 +391,7 @@ void LLVMSItoFP(unsigned numbits, integerPart *pa, unsigned onumbits, integerPar val = a.roundToDouble(true); } if (onumbits == 16) - *(uint16_t*)pr = __gnu_f2h_ieee(val); + *(uint16_t*)pr = julia__gnu_f2h_ieee(val); else if (onumbits == 32) *(float*)pr = val; else if (onumbits == 64) @@ -408,7 +408,7 @@ void LLVMUItoFP(unsigned numbits, integerPart *pa, unsigned onumbits, integerPar val = a.roundToDouble(false); } if (onumbits == 16) - *(uint16_t*)pr = __gnu_f2h_ieee(val); + *(uint16_t*)pr = julia__gnu_f2h_ieee(val); else if (onumbits == 32) *(float*)pr = val; else if (onumbits == 64) diff --git a/src/julia.expmap b/src/julia.expmap index 2d801dceae044..6717f8d00c621 100644 --- a/src/julia.expmap +++ b/src/julia.expmap @@ -37,12 +37,6 @@ environ; __progname; - /* compiler run-time intrinsics */ - __gnu_h2f_ieee; - __extendhfsf2; - __gnu_f2h_ieee; - __truncdfhf2; - local: *; }; diff --git a/src/julia_internal.h b/src/julia_internal.h index 21c46129b7149..3b37f3b075d67 100644 --- a/src/julia_internal.h +++ b/src/julia_internal.h @@ -1522,8 +1522,18 @@ jl_sym_t *_jl_symbol(const char *str, size_t len) JL_NOTSAFEPOINT; #define JL_GC_ASSERT_LIVE(x) (void)(x) #endif -float __gnu_h2f_ieee(uint16_t param) JL_NOTSAFEPOINT; -uint16_t __gnu_f2h_ieee(float param) JL_NOTSAFEPOINT; +JL_DLLEXPORT float julia__gnu_h2f_ieee(uint16_t param) JL_NOTSAFEPOINT; +JL_DLLEXPORT uint16_t julia__gnu_f2h_ieee(float param) JL_NOTSAFEPOINT; +JL_DLLEXPORT uint16_t julia__truncdfhf2(double param) JL_NOTSAFEPOINT; +//JL_DLLEXPORT double julia__extendhfdf2(uint16_t n) JL_NOTSAFEPOINT; +//JL_DLLEXPORT int32_t julia__fixhfsi(uint16_t n) JL_NOTSAFEPOINT; +//JL_DLLEXPORT int64_t julia__fixhfdi(uint16_t n) JL_NOTSAFEPOINT; +//JL_DLLEXPORT uint32_t julia__fixunshfsi(uint16_t n) JL_NOTSAFEPOINT; +//JL_DLLEXPORT uint64_t julia__fixunshfdi(uint16_t n) JL_NOTSAFEPOINT; +//JL_DLLEXPORT uint16_t julia__floatsihf(int32_t n) JL_NOTSAFEPOINT; +//JL_DLLEXPORT uint16_t julia__floatdihf(int64_t n) JL_NOTSAFEPOINT; +//JL_DLLEXPORT uint16_t julia__floatunsihf(uint32_t n) JL_NOTSAFEPOINT; +//JL_DLLEXPORT uint16_t julia__floatundihf(uint64_t n) JL_NOTSAFEPOINT; #ifdef __cplusplus } diff --git a/src/llvm-demote-float16.cpp b/src/llvm-demote-float16.cpp index 3e328424e26d2..a68f8faf2e3a7 100644 --- a/src/llvm-demote-float16.cpp +++ b/src/llvm-demote-float16.cpp @@ -18,6 +18,7 @@ #include "support/dtypes.h" +#include #include #include #include @@ -28,15 +29,193 @@ using namespace llvm; namespace { +inline AttributeSet getFnAttrs(const AttributeList &Attrs) +{ +#if JL_LLVM_VERSION >= 140000 + return Attrs.getFnAttrs(); +#else + return Attrs.getFnAttributes(); +#endif +} + +inline AttributeSet getRetAttrs(const AttributeList &Attrs) +{ +#if JL_LLVM_VERSION >= 140000 + return Attrs.getRetAttrs(); +#else + return Attrs.getRetAttributes(); +#endif +} + +static Instruction *replaceIntrinsicWith(IntrinsicInst *call, Type *RetTy, ArrayRef args) +{ + Intrinsic::ID ID = call->getIntrinsicID(); + assert(ID); + auto oldfType = call->getFunctionType(); + auto nargs = oldfType->getNumParams(); + assert(args.size() > nargs); + SmallVector argTys(nargs); + for (unsigned i = 0; i < nargs; i++) + argTys[i] = args[i]->getType(); + auto newfType = FunctionType::get(RetTy, argTys, oldfType->isVarArg()); + + // Accumulate an array of overloaded types for the given intrinsic + // and compute the new name mangling schema + SmallVector overloadTys; + { + SmallVector Table; + getIntrinsicInfoTableEntries(ID, Table); + ArrayRef TableRef = Table; + auto res = Intrinsic::matchIntrinsicSignature(newfType, TableRef, overloadTys); + assert(res == Intrinsic::MatchIntrinsicTypes_Match); + (void)res; + bool matchvararg = !Intrinsic::matchIntrinsicVarArg(newfType->isVarArg(), TableRef); + assert(matchvararg); + (void)matchvararg; + } + auto newF = Intrinsic::getDeclaration(call->getModule(), ID, overloadTys); + assert(newF->getFunctionType() == newfType); + newF->setCallingConv(call->getCallingConv()); + assert(args.back() == call->getCalledFunction()); + auto newCall = CallInst::Create(newF, args.drop_back(), "", call); + newCall->setTailCallKind(call->getTailCallKind()); + auto old_attrs = call->getAttributes(); + newCall->setAttributes(AttributeList::get(call->getContext(), getFnAttrs(old_attrs), + getRetAttrs(old_attrs), {})); // drop parameter attributes + return newCall; +} + + +static Value* CreateFPCast(Instruction::CastOps opcode, Value *V, Type *DestTy, IRBuilder<> &builder) +{ + Type *SrcTy = V->getType(); + Type *RetTy = DestTy; + if (auto *VC = dyn_cast(V)) { + // The input IR often has things of the form + // fcmp olt half %0, 0xH7C00 + // and we would like to avoid turning that constant into a call here + // if we can simply constant fold it to the new type. + VC = ConstantExpr::getCast(opcode, VC, DestTy, true); + if (VC) + return VC; + } + assert(SrcTy->isVectorTy() == DestTy->isVectorTy()); + if (SrcTy->isVectorTy()) { + unsigned NumElems = cast(SrcTy)->getNumElements(); + assert(cast(DestTy)->getNumElements() == NumElems && "Mismatched cast"); + Value *NewV = UndefValue::get(DestTy); + RetTy = RetTy->getScalarType(); + for (unsigned i = 0; i < NumElems; ++i) { + Value *I = builder.getInt32(i); + Value *Vi = builder.CreateExtractElement(V, I); + Vi = CreateFPCast(opcode, Vi, RetTy, builder); + NewV = builder.CreateInsertElement(NewV, Vi, I); + } + return NewV; + } + auto &M = *builder.GetInsertBlock()->getModule(); + auto &ctx = M.getContext(); + // Pick the Function to call in the Julia runtime + StringRef Name; + switch (opcode) { + case Instruction::FPExt: + // this is exact, so we only need one conversion + assert(SrcTy->isHalfTy()); + Name = "julia__gnu_h2f_ieee"; + RetTy = Type::getFloatTy(ctx); + break; + case Instruction::FPTrunc: + assert(DestTy->isHalfTy()); + if (SrcTy->isFloatTy()) + Name = "julia__gnu_f2h_ieee"; + else if (SrcTy->isDoubleTy()) + Name = "julia__truncdfhf2"; + break; + // All F16 fit exactly in Int32 (-65504 to 65504) + case Instruction::FPToSI: JL_FALLTHROUGH; + case Instruction::FPToUI: + assert(SrcTy->isHalfTy()); + Name = "julia__gnu_h2f_ieee"; + RetTy = Type::getFloatTy(ctx); + break; + case Instruction::SIToFP: JL_FALLTHROUGH; + case Instruction::UIToFP: + assert(DestTy->isHalfTy()); + Name = "julia__gnu_f2h_ieee"; + SrcTy = Type::getFloatTy(ctx); + break; + default: + errs() << Instruction::getOpcodeName(opcode) << ' '; + V->getType()->print(errs()); + errs() << " to "; + DestTy->print(errs()); + errs() << " is an "; + llvm_unreachable("invalid cast"); + } + if (Name.empty()) { + errs() << Instruction::getOpcodeName(opcode) << ' '; + V->getType()->print(errs()); + errs() << " to "; + DestTy->print(errs()); + errs() << " is an "; + llvm_unreachable("illegal cast"); + } + // Coerce the source to the required size and type + auto T_int16 = Type::getInt16Ty(ctx); + if (SrcTy->isHalfTy()) + SrcTy = T_int16; + if (opcode == Instruction::SIToFP) + V = builder.CreateSIToFP(V, SrcTy); + else if (opcode == Instruction::UIToFP) + V = builder.CreateUIToFP(V, SrcTy); + else + V = builder.CreateBitCast(V, SrcTy); + // Call our intrinsic + if (RetTy->isHalfTy()) + RetTy = T_int16; + auto FT = FunctionType::get(RetTy, {SrcTy}, false); + FunctionCallee F = M.getOrInsertFunction(Name, FT); + Value *I = builder.CreateCall(F, {V}); + // Coerce the result to the expected type + if (opcode == Instruction::FPToSI) + I = builder.CreateFPToSI(I, DestTy); + else if (opcode == Instruction::FPToUI) + I = builder.CreateFPToUI(I, DestTy); + else if (opcode == Instruction::FPExt) + I = builder.CreateFPCast(I, DestTy); + else + I = builder.CreateBitCast(I, DestTy); + return I; +} + static bool demoteFloat16(Function &F) { auto &ctx = F.getContext(); - auto T_float16 = Type::getHalfTy(ctx); auto T_float32 = Type::getFloatTy(ctx); SmallVector erase; for (auto &BB : F) { for (auto &I : BB) { + // extend Float16 operands to Float32 + bool Float16 = I.getType()->getScalarType()->isHalfTy(); + for (size_t i = 0; !Float16 && i < I.getNumOperands(); i++) { + Value *Op = I.getOperand(i); + if (Op->getType()->getScalarType()->isHalfTy()) + Float16 = true; + } + if (!Float16) + continue; + + if (auto CI = dyn_cast(&I)) { + if (CI->getOpcode() != Instruction::BitCast) { // aka !CI->isNoopCast(DL) + IRBuilder<> builder(&I); + Value *NewI = CreateFPCast(CI->getOpcode(), I.getOperand(0), I.getType(), builder); + I.replaceAllUsesWith(NewI); + erase.push_back(&I); + } + continue; + } + switch (I.getOpcode()) { case Instruction::FNeg: case Instruction::FAdd: @@ -47,6 +226,9 @@ static bool demoteFloat16(Function &F) case Instruction::FCmp: break; default: + if (auto intrinsic = dyn_cast(&I)) + if (intrinsic->getIntrinsicID()) + break; continue; } @@ -58,61 +240,67 @@ static bool demoteFloat16(Function &F) IRBuilder<> builder(&I); // extend Float16 operands to Float32 - bool OperandsChanged = false; + // XXX: Calls to llvm.fma.f16 may need to go to f64 to be correct? SmallVector Operands(I.getNumOperands()); for (size_t i = 0; i < I.getNumOperands(); i++) { Value *Op = I.getOperand(i); - if (Op->getType() == T_float16) { - Op = builder.CreateFPExt(Op, T_float32); - OperandsChanged = true; + if (Op->getType()->getScalarType()->isHalfTy()) { + Op = CreateFPCast(Instruction::FPExt, Op, Op->getType()->getWithNewType(T_float32), builder); } Operands[i] = (Op); } // recreate the instruction if any operands changed, // truncating the result back to Float16 - if (OperandsChanged) { - Value *NewI; - switch (I.getOpcode()) { - case Instruction::FNeg: - assert(Operands.size() == 1); - NewI = builder.CreateFNeg(Operands[0]); - break; - case Instruction::FAdd: - assert(Operands.size() == 2); - NewI = builder.CreateFAdd(Operands[0], Operands[1]); - break; - case Instruction::FSub: - assert(Operands.size() == 2); - NewI = builder.CreateFSub(Operands[0], Operands[1]); - break; - case Instruction::FMul: - assert(Operands.size() == 2); - NewI = builder.CreateFMul(Operands[0], Operands[1]); - break; - case Instruction::FDiv: - assert(Operands.size() == 2); - NewI = builder.CreateFDiv(Operands[0], Operands[1]); - break; - case Instruction::FRem: - assert(Operands.size() == 2); - NewI = builder.CreateFRem(Operands[0], Operands[1]); - break; - case Instruction::FCmp: - assert(Operands.size() == 2); - NewI = builder.CreateFCmp(cast(&I)->getPredicate(), - Operands[0], Operands[1]); + Value *NewI; + switch (I.getOpcode()) { + case Instruction::FNeg: + assert(Operands.size() == 1); + NewI = builder.CreateFNeg(Operands[0]); + break; + case Instruction::FAdd: + assert(Operands.size() == 2); + NewI = builder.CreateFAdd(Operands[0], Operands[1]); + break; + case Instruction::FSub: + assert(Operands.size() == 2); + NewI = builder.CreateFSub(Operands[0], Operands[1]); + break; + case Instruction::FMul: + assert(Operands.size() == 2); + NewI = builder.CreateFMul(Operands[0], Operands[1]); + break; + case Instruction::FDiv: + assert(Operands.size() == 2); + NewI = builder.CreateFDiv(Operands[0], Operands[1]); + break; + case Instruction::FRem: + assert(Operands.size() == 2); + NewI = builder.CreateFRem(Operands[0], Operands[1]); + break; + case Instruction::FCmp: + assert(Operands.size() == 2); + NewI = builder.CreateFCmp(cast(&I)->getPredicate(), + Operands[0], Operands[1]); + break; + default: + if (auto intrinsic = dyn_cast(&I)) { + // XXX: this is not correct in general + // some obvious failures include llvm.convert.to.fp16.*, llvm.vp.*to*, llvm.experimental.constrained.*to*, llvm.masked.* + Type *RetTy = I.getType(); + if (RetTy->getScalarType()->isHalfTy()) + RetTy = RetTy->getWithNewType(T_float32); + NewI = replaceIntrinsicWith(intrinsic, RetTy, Operands); break; - default: - abort(); } - cast(NewI)->copyMetadata(I); - cast(NewI)->copyFastMathFlags(&I); - if (NewI->getType() != I.getType()) - NewI = builder.CreateFPTrunc(NewI, I.getType()); - I.replaceAllUsesWith(NewI); - erase.push_back(&I); + abort(); } + cast(NewI)->copyMetadata(I); + cast(NewI)->copyFastMathFlags(&I); + if (NewI->getType() != I.getType()) + NewI = CreateFPCast(Instruction::FPTrunc, NewI, I.getType(), builder); + I.replaceAllUsesWith(NewI); + erase.push_back(&I); } } diff --git a/src/runtime_intrinsics.c b/src/runtime_intrinsics.c index 9525b655dc5e3..f505a9d5e5d5a 100644 --- a/src/runtime_intrinsics.c +++ b/src/runtime_intrinsics.c @@ -15,9 +15,6 @@ const unsigned int host_char_bit = 8; // float16 intrinsics -// TODO: use LLVM's compiler-rt on all platforms (Xcode already links compiler-rt) - -#if !defined(_OS_DARWIN_) static inline float half_to_float(uint16_t ival) JL_NOTSAFEPOINT { @@ -188,22 +185,17 @@ static inline uint16_t float_to_half(float param) JL_NOTSAFEPOINT return h; } -JL_DLLEXPORT float __gnu_h2f_ieee(uint16_t param) +JL_DLLEXPORT float julia__gnu_h2f_ieee(uint16_t param) { return half_to_float(param); } -JL_DLLEXPORT float __extendhfsf2(uint16_t param) -{ - return half_to_float(param); -} - -JL_DLLEXPORT uint16_t __gnu_f2h_ieee(float param) +JL_DLLEXPORT uint16_t julia__gnu_f2h_ieee(float param) { return float_to_half(param); } -JL_DLLEXPORT uint16_t __truncdfhf2(double param) +JL_DLLEXPORT uint16_t julia__truncdfhf2(double param) { float res = (float)param; uint32_t resi; @@ -225,7 +217,25 @@ JL_DLLEXPORT uint16_t __truncdfhf2(double param) return float_to_half(res); } -#endif +//JL_DLLEXPORT double julia__extendhfdf2(uint16_t n) { return (double)julia__gnu_h2f_ieee(n); } +//JL_DLLEXPORT int32_t julia__fixhfsi(uint16_t n) { return (int32_t)julia__gnu_h2f_ieee(n); } +//JL_DLLEXPORT int64_t julia__fixhfdi(uint16_t n) { return (int64_t)julia__gnu_h2f_ieee(n); } +//JL_DLLEXPORT uint32_t julia__fixunshfsi(uint16_t n) { return (uint32_t)julia__gnu_h2f_ieee(n); } +//JL_DLLEXPORT uint64_t julia__fixunshfdi(uint16_t n) { return (uint64_t)julia__gnu_h2f_ieee(n); } +//JL_DLLEXPORT uint16_t julia__floatsihf(int32_t n) { return julia__gnu_f2h_ieee((float)n); } +//JL_DLLEXPORT uint16_t julia__floatdihf(int64_t n) { return julia__gnu_f2h_ieee((float)n); } +//JL_DLLEXPORT uint16_t julia__floatunsihf(uint32_t n) { return julia__gnu_f2h_ieee((float)n); } +//JL_DLLEXPORT uint16_t julia__floatundihf(uint64_t n) { return julia__gnu_f2h_ieee((float)n); } +//HANDLE_LIBCALL(F16, F128, __extendhftf2) +//HANDLE_LIBCALL(F16, F80, __extendhfxf2) +//HANDLE_LIBCALL(F80, F16, __truncxfhf2) +//HANDLE_LIBCALL(F128, F16, __trunctfhf2) +//HANDLE_LIBCALL(PPCF128, F16, __trunctfhf2) +//HANDLE_LIBCALL(F16, I128, __fixhfti) +//HANDLE_LIBCALL(F16, I128, __fixunshfti) +//HANDLE_LIBCALL(I128, F16, __floattihf) +//HANDLE_LIBCALL(I128, F16, __floatuntihf) + // run time version of bitcast intrinsic JL_DLLEXPORT jl_value_t *jl_bitcast(jl_value_t *ty, jl_value_t *v) @@ -551,9 +561,9 @@ static inline unsigned select_by_size(unsigned sz) JL_NOTSAFEPOINT } #define fp_select(a, func) \ - sizeof(a) == sizeof(float) ? func##f((float)a) : func(a) + sizeof(a) <= sizeof(float) ? func##f((float)a) : func(a) #define fp_select2(a, b, func) \ - sizeof(a) == sizeof(float) ? func##f(a, b) : func(a, b) + sizeof(a) <= sizeof(float) ? func##f(a, b) : func(a, b) // fast-function generators // @@ -597,11 +607,11 @@ static inline void name(unsigned osize, void *pa, void *pr) JL_NOTSAFEPOINT \ static inline void name(unsigned osize, void *pa, void *pr) JL_NOTSAFEPOINT \ { \ uint16_t a = *(uint16_t*)pa; \ - float A = __gnu_h2f_ieee(a); \ + float A = julia__gnu_h2f_ieee(a); \ if (osize == 16) { \ float R; \ OP(&R, A); \ - *(uint16_t*)pr = __gnu_f2h_ieee(R); \ + *(uint16_t*)pr = julia__gnu_f2h_ieee(R); \ } else { \ OP((uint16_t*)pr, A); \ } \ @@ -625,11 +635,11 @@ static void jl_##name##16(unsigned runtime_nbits, void *pa, void *pb, void *pr) { \ uint16_t a = *(uint16_t*)pa; \ uint16_t b = *(uint16_t*)pb; \ - float A = __gnu_h2f_ieee(a); \ - float B = __gnu_h2f_ieee(b); \ + float A = julia__gnu_h2f_ieee(a); \ + float B = julia__gnu_h2f_ieee(b); \ runtime_nbits = 16; \ float R = OP(A, B); \ - *(uint16_t*)pr = __gnu_f2h_ieee(R); \ + *(uint16_t*)pr = julia__gnu_f2h_ieee(R); \ } // float or integer inputs, bool output @@ -650,8 +660,8 @@ static int jl_##name##16(unsigned runtime_nbits, void *pa, void *pb) JL_NOTSAFEP { \ uint16_t a = *(uint16_t*)pa; \ uint16_t b = *(uint16_t*)pb; \ - float A = __gnu_h2f_ieee(a); \ - float B = __gnu_h2f_ieee(b); \ + float A = julia__gnu_h2f_ieee(a); \ + float B = julia__gnu_h2f_ieee(b); \ runtime_nbits = 16; \ return OP(A, B); \ } @@ -691,12 +701,12 @@ static void jl_##name##16(unsigned runtime_nbits, void *pa, void *pb, void *pc, uint16_t a = *(uint16_t*)pa; \ uint16_t b = *(uint16_t*)pb; \ uint16_t c = *(uint16_t*)pc; \ - float A = __gnu_h2f_ieee(a); \ - float B = __gnu_h2f_ieee(b); \ - float C = __gnu_h2f_ieee(c); \ + float A = julia__gnu_h2f_ieee(a); \ + float B = julia__gnu_h2f_ieee(b); \ + float C = julia__gnu_h2f_ieee(c); \ runtime_nbits = 16; \ float R = OP(A, B, C); \ - *(uint16_t*)pr = __gnu_f2h_ieee(R); \ + *(uint16_t*)pr = julia__gnu_f2h_ieee(R); \ } @@ -1318,7 +1328,7 @@ static inline int fpiseq##nbits(c_type a, c_type b) JL_NOTSAFEPOINT { \ fpiseq_n(float, 32) fpiseq_n(double, 64) #define fpiseq(a,b) \ - sizeof(a) == sizeof(float) ? fpiseq32(a, b) : fpiseq64(a, b) + sizeof(a) <= sizeof(float) ? fpiseq32(a, b) : fpiseq64(a, b) bool_fintrinsic(eq,eq_float) bool_fintrinsic(ne,ne_float) @@ -1367,7 +1377,7 @@ cvt_iintrinsic(LLVMFPtoUI, fptoui) if (!(osize < 8 * sizeof(a))) \ jl_error("fptrunc: output bitsize must be < input bitsize"); \ else if (osize == 16) \ - *(uint16_t*)pr = __gnu_f2h_ieee(a); \ + *(uint16_t*)pr = julia__gnu_f2h_ieee(a); \ else if (osize == 32) \ *(float*)pr = a; \ else if (osize == 64) \ From 945a2db4250ca386dcc673e6f81ebff7da5567cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Mon, 28 Feb 2022 19:33:51 +0000 Subject: [PATCH 161/369] Guard GCC-specific macros with `_COMPILER_GCC_` (#44353) By default Clang on Linux defines the macro `__GNUC__`, so to guard GCC-specific code paths it isn't sufficient to check `#ifdef __GNUC__`. (cherry picked from commit bcc0f70d73bd93775e1e7fd74ef7c46f23616218) --- src/julia_internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/julia_internal.h b/src/julia_internal.h index 3b37f3b075d67..8e7079f75364f 100644 --- a/src/julia_internal.h +++ b/src/julia_internal.h @@ -422,7 +422,7 @@ jl_svec_t *jl_perm_symsvec(size_t n, ...); // this sizeof(__VA_ARGS__) trick can't be computed until C11, but that only matters to Clang in some situations #if !defined(__clang_analyzer__) && !(defined(_COMPILER_ASAN_ENABLED_) || defined(_COMPILER_TSAN_ENABLED_)) -#ifdef __GNUC__ +#ifdef _COMPILER_GCC_ #define jl_perm_symsvec(n, ...) \ (jl_perm_symsvec)(__extension__({ \ static_assert( \ From 8c6994127a8fbb7170efb34e1c118408ac21925b Mon Sep 17 00:00:00 2001 From: Nicholas Bauer Date: Thu, 19 May 2022 15:56:49 -0400 Subject: [PATCH 162/369] Fix error in validating complex row-first hvncat (#45365) (cherry picked from commit 0f2ed77dca88785c9ae0fb1cf1a77593d1527c18) --- base/abstractarray.jl | 5 ++++- test/abstractarray.jl | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/base/abstractarray.jl b/base/abstractarray.jl index 9c3cb23865dff..e7dda128fcadc 100644 --- a/base/abstractarray.jl +++ b/base/abstractarray.jl @@ -2375,6 +2375,9 @@ function _typed_hvncat_dims(::Type{T}, dims::NTuple{N, Int}, row_first::Bool, as # validate shapes for lowest level of concatenation d = findfirst(>(1), dims) if d !== nothing # all dims are 1 + if row_first && d < 3 + d = d == 1 ? 2 : 1 + end nblocks = length(as) ÷ dims[d] for b ∈ 1:nblocks offset = ((b - 1) * dims[d]) @@ -2382,7 +2385,7 @@ function _typed_hvncat_dims(::Type{T}, dims::NTuple{N, Int}, row_first::Bool, as for i ∈ offset .+ (2:dims[d]) for dd ∈ 1:N dd == d && continue - if size(as[startelementi], dd) != size(as[i], dd) + if cat_size(as[startelementi], dd) != cat_size(as[i], dd) throw(ArgumentError("incompatible shape in element $i")) end end diff --git a/test/abstractarray.jl b/test/abstractarray.jl index d650cf67ebf11..cd084c747897c 100644 --- a/test/abstractarray.jl +++ b/test/abstractarray.jl @@ -1539,6 +1539,8 @@ using Base: typed_hvncat # Issue 43933 - semicolon precedence mistake should produce an error @test_throws ArgumentError [[1 1]; 2 ;; 3 ; [3 4]] @test_throws ArgumentError [[1 ;;; 1]; 2 ;;; 3 ; [3 ;;; 4]] + + @test [[1 2; 3 4] [5; 6]; [7 8] 9;;;] == [1 2 5; 3 4 6; 7 8 9;;;] end @testset "keepat!" begin From 8c33506975587f268ce6d25c8e4d38fdc0766d00 Mon Sep 17 00:00:00 2001 From: "Viral B. Shah" Date: Fri, 20 May 2022 12:00:29 -0400 Subject: [PATCH 163/369] Apply patch for GMP CVE-2021-43618 (#45375) * Apply patch for GMP CVE-2021-43618 * Update checksums (cherry picked from commit dea980590f41bab820be4c42b42f29639ac8a56c) --- deps/checksums/gmp | 116 +++++++++++++------------- deps/gmp.mk | 8 +- deps/patches/gmp-CVE-2021-43618.patch | 24 ++++++ stdlib/GMP_jll/Project.toml | 2 +- 4 files changed, 90 insertions(+), 60 deletions(-) create mode 100644 deps/patches/gmp-CVE-2021-43618.patch diff --git a/deps/checksums/gmp b/deps/checksums/gmp index 47cee2e34a42f..0c45aa6a00ca9 100644 --- a/deps/checksums/gmp +++ b/deps/checksums/gmp @@ -1,60 +1,60 @@ -GMP.v6.2.1+1.aarch64-apple-darwin.tar.gz/md5/03cb14ac16daabb4a77fe1c78e8e48a9 -GMP.v6.2.1+1.aarch64-apple-darwin.tar.gz/sha512/5b8f974a07f579272981f5ebe44191385a4ce95f58d434a3565ffa827a6d65824cbe4173736b7328630bbccfe6af4242195aec24de3f0aa687e2e32a18a97a5c -GMP.v6.2.1+1.aarch64-linux-gnu-cxx03.tar.gz/md5/0ce7d419a49f2f90033618bdda2588e7 -GMP.v6.2.1+1.aarch64-linux-gnu-cxx03.tar.gz/sha512/16363dedaae116fa0d493182aeadb2ffa7f990f1813e4b47cae3cd61ca71f23b65267ea4e2c698d52bd78d61e12feaa73179d7b86ab6d6df01eeb7b6a9b27958 -GMP.v6.2.1+1.aarch64-linux-gnu-cxx11.tar.gz/md5/011f1cdc39b9e529b4b6ea80f4c33108 -GMP.v6.2.1+1.aarch64-linux-gnu-cxx11.tar.gz/sha512/1ed2139580c5c78578f350ee83dbf9cd0120d9d36e1951438d757f5734cda7931600b3f83bfe0d0d806926636d6aea8048c6b64aa42a22e59310282c2428f417 -GMP.v6.2.1+1.aarch64-linux-musl-cxx03.tar.gz/md5/34f17083a1f142c284b707cc82407b00 -GMP.v6.2.1+1.aarch64-linux-musl-cxx03.tar.gz/sha512/dd32912c31a8422734c2e5d5a37001ac18f0e9de151982583d9dc185e5cc3e45076d737729345cca8e8eaf42993d4102353261a2de245e26a8a9cd86960a2fbf -GMP.v6.2.1+1.aarch64-linux-musl-cxx11.tar.gz/md5/9ba1b822f20f88a1e4c6e81dc8c4fdc1 -GMP.v6.2.1+1.aarch64-linux-musl-cxx11.tar.gz/sha512/d8a4ecd5c35022b9c912c3b4fabe3a4c31258d6a1bd38e4fea13a3da53206a29bfd90f4d602f6e3ee3ee271d84289d1ecdf45534adfabf7e657daef5b5cb0b21 -GMP.v6.2.1+1.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/23e28efa2579d636cb4c80036da5d4ea -GMP.v6.2.1+1.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/02c8023958fa616c1f944898e686510d449b743d053cfd42f526e9c4fe3ff3dd9de7309694b8537b4bb6dc978085339eb787983ec4ba32dc041448c912a8b982 -GMP.v6.2.1+1.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/bf2a2c4f81f6d04746cc528438f62639 -GMP.v6.2.1+1.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/1c152abeed24761c775e78a64835f8e61b28b16cbc29a6fde88fa4fdbf2a5782cd62697bd03a552d873995bda58b7bdc081c11ecd5e4badde2dea426e5218116 -GMP.v6.2.1+1.armv6l-linux-musleabihf-cxx03.tar.gz/md5/25cbceed2cf1bb12601fe285c342d6b0 -GMP.v6.2.1+1.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/37d8b21bf59c0c555f2b59d6dca4f486bf1725ae18a7fea9a2f31533c54ebb818b5ddb88ec8aa2b618e0ecad78973659abd1a9f095f64ef65067ab8ed08d7801 -GMP.v6.2.1+1.armv6l-linux-musleabihf-cxx11.tar.gz/md5/8ec72c769625a218c6951abed32b3684 -GMP.v6.2.1+1.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/4cb9ccb97859b0918002b649e1b5e74e1fc89a2daeec6f32d5a06ce0d84217f54d1ee788f472cebeefc73ef52284a3d5607efbed47058b438d2dcbcf9f384ed0 -GMP.v6.2.1+1.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/6f799d6516cc46af28eacf8409634825 -GMP.v6.2.1+1.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/541c1e03726584ddb672a83becdc9a99c68f5da9a7415750d582753b47774910bf25cee7fe21f5b5c2a80ff8ce87fc327abd45bf54d6cfe821cb202c81b67e43 -GMP.v6.2.1+1.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/17dba9ebcc1bf4637095a98a876375a8 -GMP.v6.2.1+1.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/648220e632618d23e8611e10fa4bb2e581ed4432e3fff77d0d7349a7585bffa65ae57bf1ce64c550bf6d2acc016f499c0bbbfed8088281445b9d4ecbbf9a64bc -GMP.v6.2.1+1.armv7l-linux-musleabihf-cxx03.tar.gz/md5/79c77b81cc16fd22ad4cef75af7aa220 -GMP.v6.2.1+1.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/0059ba54806ef0ca6621ddcd309a18922c4c7d9d9e214bc6870b6338a9449a472934cc27569402741d41a18dd53a896aae2f68b788f853fd4ea3db63035c8153 -GMP.v6.2.1+1.armv7l-linux-musleabihf-cxx11.tar.gz/md5/87b79bfc5c780e214863d0f0c1944da9 -GMP.v6.2.1+1.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/88dcabcf96d8f2dcc7968333a94adcb8e8a91615b67ca23edf75c3368a89ef60a8deff8e8532d0cd4d5dd5356343b753b0ae0bf88ce7e190639468bf8170939a -GMP.v6.2.1+1.i686-linux-gnu-cxx03.tar.gz/md5/61d39e42ab6fd5844e938605e357b336 -GMP.v6.2.1+1.i686-linux-gnu-cxx03.tar.gz/sha512/8e0d382adf6b45cbf613092cee524551a04096b0bc6fb8893701edae9c1928bda67b5522cae3ef954a882ff73b735190881ade37495d9d1a6db88ed6fbcdc6b1 -GMP.v6.2.1+1.i686-linux-gnu-cxx11.tar.gz/md5/b66b49054426adf3e1d3454a80010d97 -GMP.v6.2.1+1.i686-linux-gnu-cxx11.tar.gz/sha512/b28f22bbfbf796c4e959b1fa3433d46b4cf0dbd402c0497a6d4893c8030aa12fd038da4846d8bce02199f1da9b0158d78f2b4ff2636799ba139602775725ff6d -GMP.v6.2.1+1.i686-linux-musl-cxx03.tar.gz/md5/69ea3b3348813777a1682e41a117d7c3 -GMP.v6.2.1+1.i686-linux-musl-cxx03.tar.gz/sha512/048dd08b5891864e69504baf6328ef5423e0f8e31c5c6cfac552eb51b3ef943af83b7ac654c33e1a0cf061c5832e08eebb9c03dbda6532fbc24e160e99c2aae6 -GMP.v6.2.1+1.i686-linux-musl-cxx11.tar.gz/md5/e7c82091d29a3e5958442c9ec631ad78 -GMP.v6.2.1+1.i686-linux-musl-cxx11.tar.gz/sha512/8574f2e42e181a7bd1cf8aa8056a14d13efe555ee74b14e14aef1bdce7f26ce2afe41b4f85ee20de6823045d5ff38e4dbcebcc7042fff4288af1b7d296202d43 -GMP.v6.2.1+1.i686-w64-mingw32-cxx03.tar.gz/md5/dcef59aa056dcd56e6e36ad49174389f -GMP.v6.2.1+1.i686-w64-mingw32-cxx03.tar.gz/sha512/3cf3096c325ae2baea8b3c3aed4a26d649dc2bb3cf0d979809d9962521422ada3fdcdddbcfc52b27d43b473a1d3ed4a40368cdeb16cac4d32718c604dbc9f388 -GMP.v6.2.1+1.i686-w64-mingw32-cxx11.tar.gz/md5/b772a602b016e73dfc9a93908f51622b -GMP.v6.2.1+1.i686-w64-mingw32-cxx11.tar.gz/sha512/00e06591e2cc44100dca1a8897c72933bf4bd8c3c732daea99a9efa4d0a67f6a8820bf3e5d27583dfddc50d4cda656fa7462a2c453035d03657948f0051dc2fe -GMP.v6.2.1+1.powerpc64le-linux-gnu-cxx03.tar.gz/md5/b31c423855c4c5633b41301e3b424312 -GMP.v6.2.1+1.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/2565176e2bbcb9deab25a91736e8b6de01e7dca619ed1fcc98cebcaaa144eb03f89f4f6d5989aa8454b0d1c7266d1ace690e6deef67c0cf5c3fc1c2ab4d41b43 -GMP.v6.2.1+1.powerpc64le-linux-gnu-cxx11.tar.gz/md5/1ed2494342b5713308f6ffed5fe3863d -GMP.v6.2.1+1.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/c600802c81c77247a24a50ec0695f742177c8c9f090b4c345f9b0cd065b35183f49592a764cdb7b1b6d5ee3722e7dd26672d85db963d1e490731545a36d1e581 -GMP.v6.2.1+1.x86_64-apple-darwin.tar.gz/md5/51e00a2b55e9f81eb62abe23bb5f6fd9 -GMP.v6.2.1+1.x86_64-apple-darwin.tar.gz/sha512/91731427afd8df54b54d87b93006190a8b959438dc591eb5fa44724056911b8bd5588b2b1e70e9da3d8d6e9ce5aaa6fea66b0706f636cb56b3c860e8f3c0550a -GMP.v6.2.1+1.x86_64-linux-gnu-cxx03.tar.gz/md5/3f3a6f15e4e8499470bbe69a9ea885c1 -GMP.v6.2.1+1.x86_64-linux-gnu-cxx03.tar.gz/sha512/2659344ab097cd9542a5946c127a43af6fad05aa1445d69a4978d1a6d9a9f0e0502a5a60c6ca88acccb86d038dd10f2a72a7c2d4dd7ad5383c7d687e9720cc88 -GMP.v6.2.1+1.x86_64-linux-gnu-cxx11.tar.gz/md5/15ee858d8e1f07f18df8a893634d859e -GMP.v6.2.1+1.x86_64-linux-gnu-cxx11.tar.gz/sha512/9d8ffa570eb22a5a908679e06af4dd0ce8c06cf97ff9fd766baeca352a99bcc54b4b71b9c52829ba80043a688f2ed6a33b0302072518f2b16416235d5295ea00 -GMP.v6.2.1+1.x86_64-linux-musl-cxx03.tar.gz/md5/79078a236575994696e7328e34326243 -GMP.v6.2.1+1.x86_64-linux-musl-cxx03.tar.gz/sha512/d4b77a4056a2b0dcb6f789381fff720ab7481cc7edb4672756cb2057ed6475abeb6ea414e6cec3e2450ef7302b647d7d2fc2d9f7de52feddd7767548392e84bb -GMP.v6.2.1+1.x86_64-linux-musl-cxx11.tar.gz/md5/94f822c7521f83652d87fd5f1ad8bb19 -GMP.v6.2.1+1.x86_64-linux-musl-cxx11.tar.gz/sha512/fa4f70f81524d47b65d5cf3ff5abe38a691f09e3297c62f0db2512483702b9af33bc4a3c15f6f1465d6dce4eeb19f665f29872e6dd7caea0806f4c7fd32c2c5a -GMP.v6.2.1+1.x86_64-unknown-freebsd.tar.gz/md5/cdb93a733763e8a4fc29652fda8c8b13 -GMP.v6.2.1+1.x86_64-unknown-freebsd.tar.gz/sha512/ec529f57eb167bfcb367310b375a3cded007cbc386cab9b09faa9fe8f37a443302c674814ada6c82125ad0ce4aebecb75bb61633a21e7a3a00fc928fbe05cb4f -GMP.v6.2.1+1.x86_64-w64-mingw32-cxx03.tar.gz/md5/8b5be9da6a0a293e14ab1d589a622b98 -GMP.v6.2.1+1.x86_64-w64-mingw32-cxx03.tar.gz/sha512/73287b8390cac2ce8afc4565c5218ac739ed8a23c56754f4667570039f022b777284aee25d7857a94ff46fd502ac0fabe46f509a5f870b1aa074f6ed1278dcf1 -GMP.v6.2.1+1.x86_64-w64-mingw32-cxx11.tar.gz/md5/11bcbfc3b65b19d73c3abf92ec46cb6a -GMP.v6.2.1+1.x86_64-w64-mingw32-cxx11.tar.gz/sha512/1dd9a6fe5c4991483a2d46420cd892271d37d9d23c409ed782b7736ab1942cd6c42360efbc308b5684bd5f991c7a96e8d375f3e855dc537bb3089e3402eed110 +GMP.v6.2.1+2.aarch64-apple-darwin.tar.gz/md5/37a4c537149a1d6d7424833294e61dac +GMP.v6.2.1+2.aarch64-apple-darwin.tar.gz/sha512/33dd86279b5b3b08496180c92971c2e7ef84715e9ed3a80071a178ee94de6231ea3cf7b4dd4fa7e0dbd0b386a1a04c4f6b28446e86cb92c100ebb295b2f5ee3a +GMP.v6.2.1+2.aarch64-linux-gnu-cxx03.tar.gz/md5/44ef76b228cdc4cf54e5d4b40a29034d +GMP.v6.2.1+2.aarch64-linux-gnu-cxx03.tar.gz/sha512/255a680c75d3e8ca542dffc47050adfce038e25a12a4131c18dc719d36b364c1a6488ee5743d1c5de445b4bc5ccbb932399f7071083d86fe5bd2befc521cfbfd +GMP.v6.2.1+2.aarch64-linux-gnu-cxx11.tar.gz/md5/0289ffc3621b5d62dc2f9e1b36c41f9f +GMP.v6.2.1+2.aarch64-linux-gnu-cxx11.tar.gz/sha512/f27b82efb5aa1d7eaaed7574d3312969664eac38f45cf40c6de13ca20b256d45481546fc1a402e6c04bee416c842a092a4e57b8df702bbcdc52f742555d07aa7 +GMP.v6.2.1+2.aarch64-linux-musl-cxx03.tar.gz/md5/9ff4c76804f59056b49a9bf5b6a02099 +GMP.v6.2.1+2.aarch64-linux-musl-cxx03.tar.gz/sha512/d86afa10bdc4e20fa259a17ce7d0a5dca2524b42752bc7d5c33e4323973587d234d4c420900deef34670bfce8ab8c6725e7edb45bfd3896b2644a42ec187dfd7 +GMP.v6.2.1+2.aarch64-linux-musl-cxx11.tar.gz/md5/cc9857a965afcdcbc2b378a368360690 +GMP.v6.2.1+2.aarch64-linux-musl-cxx11.tar.gz/sha512/c46bff9fdcbecc71c12914dadb31ee9fd5b4293cb45bda782200daa18d7f7e8b588e0c0f68a39c2fec7cc3d026bcef3620dae35ae2dd3acf2505dcfc084d11bd +GMP.v6.2.1+2.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/5b3343367896e31b29571fe0d2b90390 +GMP.v6.2.1+2.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/65a501db63c386727aa336d6dbecdff0417628bc9ff7ac1b2161922246d94f8caa71b63fc3789ec6bb10aff03b96d5d0c22c37c82bd95d74e557df8de7e8a09c +GMP.v6.2.1+2.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/cc04dda18412fa11f228e66eb5a03aad +GMP.v6.2.1+2.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/49fdd452fe8f0129ee06795e04a0cc0238132f9d6f60a124dd2c7395fabbb71f005c16d95fdc00d87f8bf82b048cc54e07f162fbc38223c644854cc72c4d26b0 +GMP.v6.2.1+2.armv6l-linux-musleabihf-cxx03.tar.gz/md5/675599595f3dedb8ca11151168da7110 +GMP.v6.2.1+2.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/eedcdc2230fd81d613d54be356679a97b59491f5f9a17c518239b5504c3dd5da15721d553f57ae21f1c55d253e808e7afd1d1651b8c666379c55c7b48f71217e +GMP.v6.2.1+2.armv6l-linux-musleabihf-cxx11.tar.gz/md5/9a74abbc46439ae8268ca926f0045691 +GMP.v6.2.1+2.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/6329506f7a886d0dd907b051d6cbab1bd0cd21b2d5715f55402bf9ad6cb1ae33e058931bdf6cba17658b0e455f9e4fb7f9aad274755a159106cfe1c4d1ea328a +GMP.v6.2.1+2.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/8c20e0def927a202f2d23aed78aadb4a +GMP.v6.2.1+2.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/b7f42efae6fce864c9e07714056444ba74befb9cc9a766ffe14e676240f23f83d3241b1bf3a8f4a282acbdc197287fffb27dadedf3055505ad63bb0b9df573c6 +GMP.v6.2.1+2.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/423a625816b3c52efa6021e76f6009b7 +GMP.v6.2.1+2.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/21cbbfd647d4a7c884344dc66e0fd83d654d22c3338669539e8eab515bdc6bbd772b47f949d28280789e4343e9a8d6319a73dc9e11c23da381b8a452ef7fb098 +GMP.v6.2.1+2.armv7l-linux-musleabihf-cxx03.tar.gz/md5/7d67f981538d7a69ab1e458a54bf56f4 +GMP.v6.2.1+2.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/8aefbcddc326d4ef289dcdba8d3bd56a5f9656a7be30c83b4dbd9a0b8ee26a963c6a2f4294c94b8a8f2f712f1e1c9e17b8b9dcc9967d64294ca466e51656f7c7 +GMP.v6.2.1+2.armv7l-linux-musleabihf-cxx11.tar.gz/md5/ed8713b71636ea75fcc0c9fbc4a8618d +GMP.v6.2.1+2.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/d7f50d06a256fd9176d5fbf682ff599a5ffba62bb35fb37321ab41e88970921a9d9fa4531bd74e73e471c7e15fcae568d0536d3e32a2b2d7f81dc9cd1f0c039f +GMP.v6.2.1+2.i686-linux-gnu-cxx03.tar.gz/md5/875f0bc57172788cb80ca2b80ff3065f +GMP.v6.2.1+2.i686-linux-gnu-cxx03.tar.gz/sha512/808a3c2422b5168260dbf7a3875d5c8151e10b20a8ec87a66bf08f71ad7cf5de20fb7a4f3457c3ab2b4ffc9627764c743baa96f409629c70f2233ea7a5b628b9 +GMP.v6.2.1+2.i686-linux-gnu-cxx11.tar.gz/md5/09ae13f2a6a0dc317d2bca5700d2bf59 +GMP.v6.2.1+2.i686-linux-gnu-cxx11.tar.gz/sha512/9c986e2904247de937e30c05b29e0179986d7747b217468c59bc56af6d4c48d4575f24dace521dc8d66d84230eebd695fe0538972bfd744182ca940a23a9239c +GMP.v6.2.1+2.i686-linux-musl-cxx03.tar.gz/md5/45f53fd95dd69a6ee6b43463976b5aa6 +GMP.v6.2.1+2.i686-linux-musl-cxx03.tar.gz/sha512/4df57d6c88f0ff86e0ee78da8f6ad02decf7a38884ae8c785c114e0e38e791b733e0d046c90712327c08645dd40b7f0391fcb3258cb3bfb8b6a62c59c27d6e83 +GMP.v6.2.1+2.i686-linux-musl-cxx11.tar.gz/md5/8b15988bfb1ba0543eefab73b3ac3439 +GMP.v6.2.1+2.i686-linux-musl-cxx11.tar.gz/sha512/e32dec7ded9bf6fc26033df83521481dde851c68d7cc45efaabeded7603417cdc5016de45f78a956b69aaed00a55a91aa8b1cd5bbe5431b01074dafce2c47751 +GMP.v6.2.1+2.i686-w64-mingw32-cxx03.tar.gz/md5/4138d0b5185f722aef4e1f215f381275 +GMP.v6.2.1+2.i686-w64-mingw32-cxx03.tar.gz/sha512/255d4ecf178b9440b667c56e542baa4422d731f83a67accd41b76268274c2344fbbf94979fddbbd1f6b5751bac2d228a8ef49a93365de78c1772146edd1b4845 +GMP.v6.2.1+2.i686-w64-mingw32-cxx11.tar.gz/md5/606b4b453af25ded1323aee9e085c132 +GMP.v6.2.1+2.i686-w64-mingw32-cxx11.tar.gz/sha512/8605b764ff6e5d81767432fd8e70c25c5ad76f2cac7c2b3d6ed0596df692300973803487c970a896a0a316d46de3e3cae31b21d4e11fe2961e228cd389da13da +GMP.v6.2.1+2.powerpc64le-linux-gnu-cxx03.tar.gz/md5/3fbd157df4ae738da6820b26fb75e75e +GMP.v6.2.1+2.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/6e64c5c4e393c0001bd7085e627126134b5999c2d8df2fa9b72c9f9835d6b0f0ad440a2f58fe6537ec446a517f8df2667881871fce9b4d61c356d2b52080d641 +GMP.v6.2.1+2.powerpc64le-linux-gnu-cxx11.tar.gz/md5/35608e3166278d52a482d7e19313eca6 +GMP.v6.2.1+2.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/a9550fe2b94e0e111a487159c0cd8fb6f1a21b8941ada7bb281572079dbbece921f80b0275bcc8f88117ecc72e7f8e93219350f5444b67295620db1aa9ae947d +GMP.v6.2.1+2.x86_64-apple-darwin.tar.gz/md5/b5004a436660a2533b94b41c592b686c +GMP.v6.2.1+2.x86_64-apple-darwin.tar.gz/sha512/b7b4dc8025ce304c5b899084f42c8f5aad5bbe03509bada17dbe6be952f98306729180a22b5d0a095692f349406db0b98f99f5e3f2be5f2165825e6f7f7d1813 +GMP.v6.2.1+2.x86_64-linux-gnu-cxx03.tar.gz/md5/47ba899c9ac714a4594f999d845f45cf +GMP.v6.2.1+2.x86_64-linux-gnu-cxx03.tar.gz/sha512/99624ec71865d6285ab409ef54f4cf12ba246de6233de56a2fb9f70806574891539efed32e711202003570c157918fde8d53534c695fd5b8476e0d4e0ecd1bd4 +GMP.v6.2.1+2.x86_64-linux-gnu-cxx11.tar.gz/md5/3b0c1258ecafcaf96e549f9b979420ee +GMP.v6.2.1+2.x86_64-linux-gnu-cxx11.tar.gz/sha512/b94d8f25d23597f96cc0cf0aebd1708755a8714ec4a481108add852b77addc737d3d8feba566ec410db019698ca2de826583b1a6105f0d2188679e7f72331df0 +GMP.v6.2.1+2.x86_64-linux-musl-cxx03.tar.gz/md5/061cfe5f416c1365e98d6b1ed89abd63 +GMP.v6.2.1+2.x86_64-linux-musl-cxx03.tar.gz/sha512/b6847f7ff599fa811851788a6ec6ce69ba02dbb3672d0a64b03b7056b35215536b059287709b3d207bc977094e994a7d744061b7ecf95886510285489bb89578 +GMP.v6.2.1+2.x86_64-linux-musl-cxx11.tar.gz/md5/81911acbc0c3607338c6455b1798cab8 +GMP.v6.2.1+2.x86_64-linux-musl-cxx11.tar.gz/sha512/e007441194abc5c80d9521a17e2ab9e6fb54f319571f4045fec2f7464ffaa99652d3252416c15d110dbf9deaad2c1dc94f81c638e28ce620cf543f554eb7d1e0 +GMP.v6.2.1+2.x86_64-unknown-freebsd.tar.gz/md5/ef7173194848e8d00d73ef05fc520f0e +GMP.v6.2.1+2.x86_64-unknown-freebsd.tar.gz/sha512/512c3cf8fb951fe0ef7b1715b78202d0bdf5844fe33e16c4674a19e6335440fb5352d7bde71fce83e8e373efe43281d05b160b11657a582a9d3a0201ce97a189 +GMP.v6.2.1+2.x86_64-w64-mingw32-cxx03.tar.gz/md5/882c6749f217f5a691b744ef728ad089 +GMP.v6.2.1+2.x86_64-w64-mingw32-cxx03.tar.gz/sha512/53424ad8a9dcfb8e0e738d4521b2ab1c75aaf54668a54a76b8bcab2404308e69b531dc25b3dc18bc8eaa7ebd9e2914d6624c5d371e6c0ecb9e8d24aa575e99ab +GMP.v6.2.1+2.x86_64-w64-mingw32-cxx11.tar.gz/md5/bcdd7bcbc69161744397d249a9c82e45 +GMP.v6.2.1+2.x86_64-w64-mingw32-cxx11.tar.gz/sha512/b7f8fb4f5aaf5034d4d2f60e29cc7b5e06c13d4b677af30f30831e1fc95925a575275ebffda36efcc09e29ccd78ba56475c1be3ad0627e28862057764f1ef74e gmp-6.2.1.tar.bz2/md5/28971fc21cf028042d4897f02fd355ea gmp-6.2.1.tar.bz2/sha512/8904334a3bcc5c896ececabc75cda9dec642e401fb5397c4992c4fabea5e962c9ce8bd44e8e4233c34e55c8010cc28db0545f5f750cbdbb5f00af538dc763be9 diff --git a/deps/gmp.mk b/deps/gmp.mk index a37327d82101e..cbb99aba4a003 100644 --- a/deps/gmp.mk +++ b/deps/gmp.mk @@ -39,10 +39,16 @@ $(SRCCACHE)/gmp-$(GMP_VER)/gmp_alloc_overflow_func.patch-applied: $(SRCCACHE)/gm patch -p1 < $(SRCDIR)/patches/gmp_alloc_overflow_func.patch echo 1 > $@ +$(SRCCACHE)/gmp-$(GMP_VER)/gmp-CVE-2021-43618.patch-applied: $(SRCCACHE)/gmp-$(GMP_VER)/gmp_alloc_overflow_func.patch-applied + cd $(dir $@) && \ + patch -p1 < $(SRCDIR)/patches/gmp-CVE-2021-43618.patch + echo 1 > $@ + $(SRCCACHE)/gmp-$(GMP_VER)/source-patched: \ $(SRCCACHE)/gmp-$(GMP_VER)/gmp-HG-changeset.patch-applied \ $(SRCCACHE)/gmp-$(GMP_VER)/gmp-exception.patch-applied \ - $(SRCCACHE)/gmp-$(GMP_VER)/gmp_alloc_overflow_func.patch-applied + $(SRCCACHE)/gmp-$(GMP_VER)/gmp_alloc_overflow_func.patch-applied \ + $(SRCCACHE)/gmp-$(GMP_VER)/gmp-CVE-2021-43618.patch-applied echo 1 > $@ $(BUILDDIR)/gmp-$(GMP_VER)/build-configured: $(SRCCACHE)/gmp-$(GMP_VER)/source-extracted $(SRCCACHE)/gmp-$(GMP_VER)/source-patched diff --git a/deps/patches/gmp-CVE-2021-43618.patch b/deps/patches/gmp-CVE-2021-43618.patch new file mode 100644 index 0000000000000..a4e420e9219da --- /dev/null +++ b/deps/patches/gmp-CVE-2021-43618.patch @@ -0,0 +1,24 @@ +# Origin: https://gmplib.org/repo/gmp-6.2/rev/561a9c25298e +# HG changeset patch +# User Marco Bodrato +# Date 1634836009 -7200 +# Node ID 561a9c25298e17bb01896801ff353546c6923dbd +# Parent e1fd9db13b475209a864577237ea4b9105b3e96e +mpz/inp_raw.c: Avoid bit size overflows + +diff -r e1fd9db13b47 -r 561a9c25298e mpz/inp_raw.c +--- a/mpz/inp_raw.c Tue Dec 22 23:49:51 2020 +0100 ++++ b/mpz/inp_raw.c Thu Oct 21 19:06:49 2021 +0200 +@@ -88,8 +88,11 @@ + + abs_csize = ABS (csize); + ++ if (UNLIKELY (abs_csize > ~(mp_bitcnt_t) 0 / 8)) ++ return 0; /* Bit size overflows */ ++ + /* round up to a multiple of limbs */ +- abs_xsize = BITS_TO_LIMBS (abs_csize*8); ++ abs_xsize = BITS_TO_LIMBS ((mp_bitcnt_t) abs_csize * 8); + + if (abs_xsize != 0) + { diff --git a/stdlib/GMP_jll/Project.toml b/stdlib/GMP_jll/Project.toml index 0fc262e562da7..510b6f6a49c60 100644 --- a/stdlib/GMP_jll/Project.toml +++ b/stdlib/GMP_jll/Project.toml @@ -1,6 +1,6 @@ name = "GMP_jll" uuid = "781609d7-10c4-51f6-84f2-b8444358ff6d" -version = "6.2.1+1" +version = "6.2.1+2" [deps] Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" From dea62ee35878702e0c993c13e09f59f852702066 Mon Sep 17 00:00:00 2001 From: Fabian Zickgraf Date: Sat, 21 May 2022 03:09:47 +0000 Subject: [PATCH 164/369] Use root module when determining UUID in @artifact_str (#45392) Otherwise, overrides do not trigger when using `artifact"..."` inside a submodule. (cherry picked from commit 9b106adcdff120cdfc1fb0c0d6c50b68a787ce95) --- stdlib/Artifacts/src/Artifacts.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stdlib/Artifacts/src/Artifacts.jl b/stdlib/Artifacts/src/Artifacts.jl index 6d3bdb5fb674b..27e352be59270 100644 --- a/stdlib/Artifacts/src/Artifacts.jl +++ b/stdlib/Artifacts/src/Artifacts.jl @@ -524,9 +524,10 @@ function jointail(dir, tail) end function _artifact_str(__module__, artifacts_toml, name, path_tail, artifact_dict, hash, platform, @nospecialize(lazyartifacts)) - if haskey(Base.module_keys, __module__) + moduleroot = Base.moduleroot(__module__) + if haskey(Base.module_keys, moduleroot) # Process overrides for this UUID, if we know what it is - process_overrides(artifact_dict, Base.module_keys[__module__].uuid) + process_overrides(artifact_dict, Base.module_keys[moduleroot].uuid) end # If the artifact exists, we're in the happy path and we can immediately From 823071e0b61135fb2e106459eba3d3ad5933ff69 Mon Sep 17 00:00:00 2001 From: FX Coudert Date: Sat, 21 May 2022 17:27:39 +0200 Subject: [PATCH 165/369] OpenBLAS: Find objconv in its proper path (#45391) (cherry picked from commit 434d340afc7e4cc4d18b09c3858a6c6bc47ba85b) --- deps/openblas.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/openblas.mk b/deps/openblas.mk index d4ee63a543bf0..26d92fc4bd70b 100644 --- a/deps/openblas.mk +++ b/deps/openblas.mk @@ -29,7 +29,7 @@ endif ifeq ($(USE_BLAS64), 1) OPENBLAS_BUILD_OPTS += INTERFACE64=1 SYMBOLSUFFIX="$(OPENBLAS_SYMBOLSUFFIX)" LIBPREFIX="libopenblas$(OPENBLAS_LIBNAMESUFFIX)" ifeq ($(OS), Darwin) -OPENBLAS_BUILD_OPTS += OBJCONV=$(abspath $(build_bindir)/objconv) +OPENBLAS_BUILD_OPTS += OBJCONV=$(abspath $(build_depsbindir)/objconv) $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/build-compiled: | $(build_prefix)/manifest/objconv endif endif From b8943ecdd344d00f4f0a2b5196c38b07e03c7310 Mon Sep 17 00:00:00 2001 From: FX Coudert Date: Sat, 21 May 2022 20:58:12 +0200 Subject: [PATCH 166/369] Update PCRE2 to 10.40 (#45398) (cherry picked from commit 3d6731be2bf54b7b2ab7f33a28cae7c7a91c0d14) --- deps/Versions.make | 2 +- deps/checksums/pcre | 68 ++--- .../pcre2-sljit-apple-silicon-support.patch | 244 ------------------ deps/patches/pcre2-sljit-nomprotect.patch | 17 -- deps/pcre.mk | 13 +- stdlib/PCRE2_jll/Project.toml | 2 +- stdlib/PCRE2_jll/test/runtests.jl | 2 +- 7 files changed, 39 insertions(+), 309 deletions(-) delete mode 100644 deps/patches/pcre2-sljit-apple-silicon-support.patch delete mode 100644 deps/patches/pcre2-sljit-nomprotect.patch diff --git a/deps/Versions.make b/deps/Versions.make index 77d568ee7c6b5..b865922c7f3d9 100644 --- a/deps/Versions.make +++ b/deps/Versions.make @@ -94,7 +94,7 @@ P7ZIP_VER := 16.2.0 P7ZIP_JLL_NAME := p7zip # PCRE -PCRE_VER := 10.36 +PCRE_VER := 10.40 PCRE_JLL_NAME := PCRE2 # SuiteSparse diff --git a/deps/checksums/pcre b/deps/checksums/pcre index 05a06f9844ddf..202265ee58060 100644 --- a/deps/checksums/pcre +++ b/deps/checksums/pcre @@ -1,34 +1,34 @@ -PCRE2.v10.36.0+2.aarch64-apple-darwin.tar.gz/md5/12ac3bee39df3a79f868f6463964953b -PCRE2.v10.36.0+2.aarch64-apple-darwin.tar.gz/sha512/a1a1312931deb7f742f80886188babcf9c179ed3f156626fb23d92633fde896d1ee9b2d72cd99ae4a1f8048971b6d939e9b0b10c455d4eeec24b265968593486 -PCRE2.v10.36.0+2.aarch64-linux-gnu.tar.gz/md5/32240ccddee3040aeedcbe69ea52fcad -PCRE2.v10.36.0+2.aarch64-linux-gnu.tar.gz/sha512/86fb9febd186fcaeec83d2ed336fb060d7e49c7b7efe1bd8a6d2d74023ddbcce04eed5cf0e5d15348313eb2b51cd6b27763c08f7b9cf4eaf9df22d88f9405ef8 -PCRE2.v10.36.0+2.aarch64-linux-musl.tar.gz/md5/06abf8210e597a8669fb371da73865ce -PCRE2.v10.36.0+2.aarch64-linux-musl.tar.gz/sha512/063edaa92e36468a8cf70ca9e25d9004586400a5304c0e91b067788825cbf5354e0190cad951f163e318b65d0f3f915f1944d03de61a5627ead2ead2674d3279 -PCRE2.v10.36.0+2.armv6l-linux-gnueabihf.tar.gz/md5/70ca2acdd5b1524141f15d02d26c3b1c -PCRE2.v10.36.0+2.armv6l-linux-gnueabihf.tar.gz/sha512/377fdc5fd8b771027ffe8c0871e1688f8d991caf930b26b397eae01504af2fad5bdfbe2b3af33f25cf4b5c7bfd73dc77b16b65882a7846803a00edc0968ccef2 -PCRE2.v10.36.0+2.armv6l-linux-musleabihf.tar.gz/md5/860180f0a15ad38fac20590fab177718 -PCRE2.v10.36.0+2.armv6l-linux-musleabihf.tar.gz/sha512/412e7b0355a7bcdecca4ff5f85a1c6af1eeb094a9f07c2e90de105a0e0e6acedcbca146b5c136509ef8b38666f645b0c06fc68676dd8b1b70e2c7af4b070eb3d -PCRE2.v10.36.0+2.armv7l-linux-gnueabihf.tar.gz/md5/12fd561c00fc7fca14e577ed54525740 -PCRE2.v10.36.0+2.armv7l-linux-gnueabihf.tar.gz/sha512/e5655e5c3f96a3a95699be534acbd399bc29873fa1064f50c2d78c43ad8e85a1fbf9039bcb674a88ecdb9bf5b468f9ecdf9a79f0dce5d95996f99d6c700da79a -PCRE2.v10.36.0+2.armv7l-linux-musleabihf.tar.gz/md5/97d5eab8806a1920e6fd30f82db1b754 -PCRE2.v10.36.0+2.armv7l-linux-musleabihf.tar.gz/sha512/827fc45049a4b3adb6de2ab0569e45dd5e8749c09c42e57c579d3d6350f0953f6ad4fae1ba71af7347c9271ffff805a0200b5c9418e7f1894a6bc17a4fe0071c -PCRE2.v10.36.0+2.i686-linux-gnu.tar.gz/md5/d7c9fdbcf3055c4745ea93a9274e16d1 -PCRE2.v10.36.0+2.i686-linux-gnu.tar.gz/sha512/ac0edd5d5910e7948a65c2a5c9fb05d2a6beb3f9bd875ea87433b910444bcba617ac5bc215fa0f101cbd7c5556966de7593080674cfaf28fdc8784e2485cf71b -PCRE2.v10.36.0+2.i686-linux-musl.tar.gz/md5/05ef7559eba68cecbad0f2c75c017640 -PCRE2.v10.36.0+2.i686-linux-musl.tar.gz/sha512/91603d596a1b70bc4a933f9151fc791e09a167e4ad2de442a7ff9c355a329353cc9fb3148cf75639eaef0de3cf4f71212525f1040b0eff63c5d884892814b7af -PCRE2.v10.36.0+2.i686-w64-mingw32.tar.gz/md5/8015e6633bf0f4c359f85445d4a98a9a -PCRE2.v10.36.0+2.i686-w64-mingw32.tar.gz/sha512/527183fcc473c8e3f04622701cf73a55c5df132713e8230cd0bfd484023da594a9e29f5745d384f1e1015b8efac96e88bd985b06af5901b0d3052f90af8d89d6 -PCRE2.v10.36.0+2.powerpc64le-linux-gnu.tar.gz/md5/2ece20fa11fdbae393fb85a41ee1e17d -PCRE2.v10.36.0+2.powerpc64le-linux-gnu.tar.gz/sha512/e6fbc03efed53da43b3b15b31cc0fbd85aaf5cc65564392b8c7bc02695d3a32fe832880d547c37b3a508197a4d4023be0aef910cd36da69a54ee184880cc0438 -PCRE2.v10.36.0+2.x86_64-apple-darwin.tar.gz/md5/26c560dd16b460a1ac7c81807edbacc6 -PCRE2.v10.36.0+2.x86_64-apple-darwin.tar.gz/sha512/ce56bc399e204e4b437d3f398b4e68c33d9c55ec990126523f3be0b14571603eea3b3104e1909deb22eab3f5302da72fcc690d1a279cb85ef598c42a5ef9a8a9 -PCRE2.v10.36.0+2.x86_64-linux-gnu.tar.gz/md5/474dec882abefcb56febddc309ed4682 -PCRE2.v10.36.0+2.x86_64-linux-gnu.tar.gz/sha512/882898c2d6cab8cd5ecf1027388bd08ddd1fec2339b45388786f98c53518bf7ca56f9e2cccb4a5ede953cc85e6c1cc54a5a00f80ece4cbfdc17e5f6116a9976a -PCRE2.v10.36.0+2.x86_64-linux-musl.tar.gz/md5/af6d90c071437c5529306a5bafe6f6aa -PCRE2.v10.36.0+2.x86_64-linux-musl.tar.gz/sha512/92a16960d7514c829a5f372a40472c87c717d49e9694030ae0cb39106d6530f5bb169155a74a416bf340139f9dea231ddc2b7ae6e54fcb935f6a9bf672b5e0c1 -PCRE2.v10.36.0+2.x86_64-unknown-freebsd.tar.gz/md5/97410029c0b6ed5f7fb0d14e1f1215ea -PCRE2.v10.36.0+2.x86_64-unknown-freebsd.tar.gz/sha512/229e910759da2959ddef83ca89e05a050c266b8e755c85dfce6a786658be541911c3b78a0fca7dfdee1b41fbbdccf57da75cf9fe45fd2821dba8d2aaeabfd538 -PCRE2.v10.36.0+2.x86_64-w64-mingw32.tar.gz/md5/39827564bca329768e0380bd79b869fe -PCRE2.v10.36.0+2.x86_64-w64-mingw32.tar.gz/sha512/4579049b99fca3334d726b0ca1f07524d1643a758e375b5b02b8f294ba7d9c2a4130da1a1523de29033233a8848105b3cb660e15bb4a759593405d805ee99883 -pcre2-10.36.tar.bz2/md5/bd7e7421ff3fa2e2d5429229ecfad095 -pcre2-10.36.tar.bz2/sha512/fc2a920562c80c3d31cedd94028fab55314ae0fb168cac7178f286c344a11fc514939edc3b83b8e0b57c872db4e595fd5530fd1d4b8c779be629553e9ec965a3 +PCRE2.v10.40.0+0.aarch64-apple-darwin.tar.gz/md5/3d6b01c094c9e1adad2c1d42a3e7c3a6 +PCRE2.v10.40.0+0.aarch64-apple-darwin.tar.gz/sha512/374f9f35ae7925a6db6249850822d90c56c11b1b49971b76f016203e85bcc14ea6ab7e017b0ad5ce56c47b0715b2a396099749656e7d7291008a2dc8cb393792 +PCRE2.v10.40.0+0.aarch64-linux-gnu.tar.gz/md5/0f4c7daae3c08e5438b0af3299cbb003 +PCRE2.v10.40.0+0.aarch64-linux-gnu.tar.gz/sha512/ee9c6275019ef09a2fd7c6a649ebe184b58dae4e65a9b38159bac596e0427819e086084ca56be0f2f2ad0eb98a50a2511999cb46d5e9d1f03d39b04ade5e270d +PCRE2.v10.40.0+0.aarch64-linux-musl.tar.gz/md5/baf858fd38471dd933312079ebaf065d +PCRE2.v10.40.0+0.aarch64-linux-musl.tar.gz/sha512/3b50f6380673d30d487a3b10e6c58b76ff47fbb5c774f59f15bcc0b92e7740e73ad04c62b86e8eab0c916d4c231449f5279eae37aa401fab1a46c6e11687e806 +PCRE2.v10.40.0+0.armv6l-linux-gnueabihf.tar.gz/md5/9c582d85fe43e205679d2ed8d1ee3df7 +PCRE2.v10.40.0+0.armv6l-linux-gnueabihf.tar.gz/sha512/fb7df17fa39ac93c7af92f4afdcdd120b171682ce172561a65fae3c6e3b1c26c5715b1264007fd12713464cbff406fb19117adaf1d50bd239f0dc53e7842ca8e +PCRE2.v10.40.0+0.armv6l-linux-musleabihf.tar.gz/md5/a9c6c90c69d3de7030bd5015092a1340 +PCRE2.v10.40.0+0.armv6l-linux-musleabihf.tar.gz/sha512/7030aaaac0d275e72f3a36fe5104d11eba9bd1909c3d7126c751c9409f619d25c7735c7d3354b48786aef1ca9f1be48a60e0bd04a04c6b098915e6c4b2935e5f +PCRE2.v10.40.0+0.armv7l-linux-gnueabihf.tar.gz/md5/cc4add9c80f47ac3fb682aca3347aca3 +PCRE2.v10.40.0+0.armv7l-linux-gnueabihf.tar.gz/sha512/4a21795524d3cf8112384d133b47e87738a8c1efa71606fb55f5fabe1cc4108b2921c2efb539506552a2b630398a6770d93c9c541d5123b7a84016aad7a112f0 +PCRE2.v10.40.0+0.armv7l-linux-musleabihf.tar.gz/md5/51c54233c6e536671f2c1af74e1773d5 +PCRE2.v10.40.0+0.armv7l-linux-musleabihf.tar.gz/sha512/3889cf1faacd16779c87ac00317fbc36e54f5a99733b838920add360196edbe388c12421380105a87041d3502e5f4bea74460dedc3d797aafde5cb0f960516d0 +PCRE2.v10.40.0+0.i686-linux-gnu.tar.gz/md5/368342965b12beed2c4c92e60f7dda8f +PCRE2.v10.40.0+0.i686-linux-gnu.tar.gz/sha512/bdb3692412d0b1d07bf302fbd129755e4a53e6b39caf135df912da79088e5db29a788680b282292919c45560a795fab60d043feece63cae2296165a9909ecb57 +PCRE2.v10.40.0+0.i686-linux-musl.tar.gz/md5/79bf801c0d86614ebf95ef83016195e6 +PCRE2.v10.40.0+0.i686-linux-musl.tar.gz/sha512/d35d15ccc8b09a33088efb4bf631cbbb3ff332521f37fdaa5fc106e576a54cb57ad1243dc3db1ab17a8195fd1476889b8d548987437a195267fae7683769da38 +PCRE2.v10.40.0+0.i686-w64-mingw32.tar.gz/md5/930cbf007549542b027a1db72bab0e58 +PCRE2.v10.40.0+0.i686-w64-mingw32.tar.gz/sha512/e9bad56ca6e1871f2bf37c8b2b03ecbc77acd3f4b04c95dd6e63a4cb38487fc3349a97ca7f575c158fde8b948c363af3f7cffc4ad89af9df09e536119a1d743b +PCRE2.v10.40.0+0.powerpc64le-linux-gnu.tar.gz/md5/cebf0e67b6ae67fa841e491bf8955ae0 +PCRE2.v10.40.0+0.powerpc64le-linux-gnu.tar.gz/sha512/e04087f3e3268d389c08068ac8ae45f017e742787f20235eb6e4d32257ae3a3e445c61dc80db5a2c73d3fea5721272ec517c8b3be428d8aca097e691a14eb659 +PCRE2.v10.40.0+0.x86_64-apple-darwin.tar.gz/md5/5ed58d794f55139baac9a1ee50da3647 +PCRE2.v10.40.0+0.x86_64-apple-darwin.tar.gz/sha512/e906c6953be8a894d4cfa1792843e85aef58cf3b87baf4bcba99d19c84bd7d67dfbde85f1ddad42cbd51d2b1fa36797ce2ad79d79b19a792ca886bf52632a919 +PCRE2.v10.40.0+0.x86_64-linux-gnu.tar.gz/md5/db3fd5e855ca47b90d9a1faf58c88279 +PCRE2.v10.40.0+0.x86_64-linux-gnu.tar.gz/sha512/9082201b6519a693cf0038cf667841a0a4e4158698e1b7455ed3e0db1a7796c7303cf105975ddf059a6dbf5865eaf99f33d4e42803364935da7fa9e9c3bcb5b5 +PCRE2.v10.40.0+0.x86_64-linux-musl.tar.gz/md5/ab3456b926864ab27d5a4ce8dd42d1e7 +PCRE2.v10.40.0+0.x86_64-linux-musl.tar.gz/sha512/4b9109d9fadde86b1d76c420cb3e8b884ccba6fa08fec4fb039c384af5f040cf52b3232fbf4921cf680f36e54683b28bdb77e3b2a8943acf974f446e99f93475 +PCRE2.v10.40.0+0.x86_64-unknown-freebsd.tar.gz/md5/ee7679ad09e13f3cf9a2089e761bd718 +PCRE2.v10.40.0+0.x86_64-unknown-freebsd.tar.gz/sha512/cce31108246bdc2947865339a7cdbb7f505baf3b1b94fa6f6d825416149d8bc888a0a55961873f041cb94bba623c27f5ecaef23dda284cc57b76b30987fb6f5b +PCRE2.v10.40.0+0.x86_64-w64-mingw32.tar.gz/md5/8178c12311e6f74bc1155d6d49dfb612 +PCRE2.v10.40.0+0.x86_64-w64-mingw32.tar.gz/sha512/9d03dd7ee07fdce9af7e6995e533c59dc274417c0e39a27ccea397291b17d6865bf9c80bbc7c9aa8e908518ba33873b39b9cbfd36bc7137cb5b7432c5684e073 +pcre2-10.40.tar.bz2/md5/a5cc4e276129c177d4fffb40601019a4 +pcre2-10.40.tar.bz2/sha512/00e7b48a6554b9127cb6fe24c5cacf72783416a9754ec88f62f73c52f46ed72c86c1869e62c91a31b2ff2cbafbbedabca44b3f1eb7670bc92f49d8401c7374e8 diff --git a/deps/patches/pcre2-sljit-apple-silicon-support.patch b/deps/patches/pcre2-sljit-apple-silicon-support.patch deleted file mode 100644 index 3aff832ca08fd..0000000000000 --- a/deps/patches/pcre2-sljit-apple-silicon-support.patch +++ /dev/null @@ -1,244 +0,0 @@ -From e87e1ccf93768238db3d6e28d0272980dba707fa Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= -Date: Mon, 30 Nov 2020 01:35:13 -0800 -Subject: [PATCH] macos: add BigSur support to execalloc (#90) - -Apple Silicon requires that pages that will hold JIT code are -marked with MAP_JIT (even if not using the hardened runtime) -and that a call be made to a pthread function before writing -to them, so a special exception could be made to the current -thread[1]; add support for both. - -since the allocator keeps the metadata about chunk/block in the -executable pages, all functions that modify that metadata will -also need to be updated. - -note that since there is no need for an accurate pointer range -with the apple implementation, NULL is passed for the pointers. - -historically, adding MAP_JIT was only recommended when the hardened -runtime was being used as it adds several undocumented restrictions -(like not being able to use JIT pages accross fork()) so the -new codepath won't be used if running in Intel. - -Tested-by: @Keno -Fixes: #51 - -[1] https://developer.apple.com/documentation/apple_silicon/porting_just-in-time_compilers_to_apple_silicon?language=objc ---- - sljit_src/sljitExecAllocator.c | 113 ++++++++++++++++++--------------- - 1 file changed, 63 insertions(+), 50 deletions(-) - -diff --git a/sljit_src/sljitExecAllocator.c b/sljit_src/sljitExecAllocator.c -index 61a32f2..2e1c138 100644 ---- a/sljit_src/sljitExecAllocator.c -+++ b/sljit_src/sljitExecAllocator.c -@@ -79,6 +79,7 @@ - */ - - #ifdef _WIN32 -+#define SLJIT_UPDATE_WX_FLAGS(from, to, enable_exec) - - static SLJIT_INLINE void* alloc_chunk(sljit_uw size) - { -@@ -91,65 +92,76 @@ static SLJIT_INLINE void free_chunk(void *chunk, sljit_uw size) - VirtualFree(chunk, 0, MEM_RELEASE); - } - --#else -- --#ifdef __APPLE__ --#ifdef MAP_ANON --/* Configures TARGET_OS_OSX when appropriate */ --#include -- --#if TARGET_OS_OSX && defined(MAP_JIT) --#include --#endif /* TARGET_OS_OSX && MAP_JIT */ -- --#ifdef MAP_JIT -+#else /* POSIX */ - -+#if defined(__APPLE__) && defined(MAP_JIT) - /* - On macOS systems, returns MAP_JIT if it is defined _and_ we're running on a -- version where it's OK to have more than one JIT block. -+ version where it's OK to have more than one JIT block or where MAP_JIT is -+ required. - On non-macOS systems, returns MAP_JIT if it is defined. - */ -+#include -+#if TARGET_OS_OSX -+#if defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86 -+#ifdef MAP_ANON -+#include -+#include -+ -+#define SLJIT_MAP_JIT (get_map_jit_flag()) -+ - static SLJIT_INLINE int get_map_jit_flag() - { --#if TARGET_OS_OSX -- sljit_sw page_size = get_page_alignment() + 1; -+ sljit_sw page_size; - void *ptr; -+ struct utsname name; - static int map_jit_flag = -1; - -- /* -- The following code is thread safe because multiple initialization -- sets map_jit_flag to the same value and the code has no side-effects. -- Changing the kernel version witout system restart is (very) unlikely. -- */ -- if (map_jit_flag == -1) { -- struct utsname name; -- -+ if (map_jit_flag < 0) { - map_jit_flag = 0; - uname(&name); - -- /* Kernel version for 10.14.0 (Mojave) */ -+ /* Kernel version for 10.14.0 (Mojave) or later */ - if (atoi(name.release) >= 18) { -+ page_size = get_page_alignment() + 1; - /* Only use MAP_JIT if a hardened runtime is used */ -+ ptr = mmap(NULL, page_size, PROT_WRITE | PROT_EXEC, -+ MAP_PRIVATE | MAP_ANON, -1, 0); - -- ptr = mmap(NULL, page_size, PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANON, -1, 0); -- -- if (ptr == MAP_FAILED) { -- map_jit_flag = MAP_JIT; -- } else { -+ if (ptr != MAP_FAILED) - munmap(ptr, page_size); -- } -+ else -+ map_jit_flag = MAP_JIT; - } - } -- - return map_jit_flag; --#else /* !TARGET_OS_OSX */ -- return MAP_JIT; --#endif /* TARGET_OS_OSX */ - } -- --#endif /* MAP_JIT */ - #endif /* MAP_ANON */ --#endif /* __APPLE__ */ -+#else /* !SLJIT_CONFIG_X86 */ -+#if !(defined SLJIT_CONFIG_ARM && SLJIT_CONFIG_ARM) -+#error Unsupported architecture -+#endif /* SLJIT_CONFIG_ARM */ -+#include -+ -+#define SLJIT_MAP_JIT (MAP_JIT) -+#define SLJIT_UPDATE_WX_FLAGS(from, to, enable_exec) \ -+ apple_update_wx_flags(enable_exec) -+ -+static SLJIT_INLINE void apple_update_wx_flags(sljit_s32 enable_exec) -+{ -+ pthread_jit_write_protect_np(enable_exec); -+} -+#endif /* SLJIT_CONFIG_X86 */ -+#else /* !TARGET_OS_OSX */ -+#define SLJIT_MAP_JIT (MAP_JIT) -+#endif /* TARGET_OS_OSX */ -+#endif /* __APPLE__ && MAP_JIT */ -+#ifndef SLJIT_UPDATE_WX_FLAGS -+#define SLJIT_UPDATE_WX_FLAGS(from, to, enable_exec) -+#endif /* !SLJIT_UPDATE_WX_FLAGS */ -+#ifndef SLJIT_MAP_JIT -+#define SLJIT_MAP_JIT (0) -+#endif /* !SLJIT_MAP_JIT */ - - static SLJIT_INLINE void* alloc_chunk(sljit_uw size) - { -@@ -157,12 +169,7 @@ static SLJIT_INLINE void* alloc_chunk(sljit_uw size) - const int prot = PROT_READ | PROT_WRITE | PROT_EXEC; - - #ifdef MAP_ANON -- -- int flags = MAP_PRIVATE | MAP_ANON; -- --#ifdef MAP_JIT -- flags |= get_map_jit_flag(); --#endif -+ int flags = MAP_PRIVATE | MAP_ANON | SLJIT_MAP_JIT; - - retval = mmap(NULL, size, prot, flags, -1, 0); - #else /* !MAP_ANON */ -@@ -173,14 +180,15 @@ static SLJIT_INLINE void* alloc_chunk(sljit_uw size) - #endif /* MAP_ANON */ - - if (retval == MAP_FAILED) -- retval = NULL; -- else { -- if (mprotect(retval, size, prot) < 0) { -- munmap(retval, size); -- retval = NULL; -- } -+ return NULL; -+ -+ if (mprotect(retval, size, prot) < 0) { -+ munmap(retval, size); -+ return NULL; - } - -+ SLJIT_UPDATE_WX_FLAGS(retval, (uint8_t *)retval + size, 0); -+ - return retval; - } - -@@ -189,7 +197,7 @@ static SLJIT_INLINE void free_chunk(void *chunk, sljit_uw size) - munmap(chunk, size); - } - --#endif -+#endif /* windows */ - - /* --------------------------------------------------------------------- */ - /* Common functions */ -@@ -261,6 +269,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_malloc_exec(sljit_uw size) - while (free_block) { - if (free_block->size >= size) { - chunk_size = free_block->size; -+ SLJIT_UPDATE_WX_FLAGS(NULL, NULL, 0); - if (chunk_size > size + 64) { - /* We just cut a block from the end of the free block. */ - chunk_size -= size; -@@ -326,6 +335,7 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_free_exec(void* ptr) - allocated_size -= header->size; - - /* Connecting free blocks together if possible. */ -+ SLJIT_UPDATE_WX_FLAGS(NULL, NULL, 0); - - /* If header->prev_size == 0, free_block will equal to header. - In this case, free_block->header.size will be > 0. */ -@@ -358,6 +368,7 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_free_exec(void* ptr) - } - } - -+ SLJIT_UPDATE_WX_FLAGS(NULL, NULL, 1); - SLJIT_ALLOCATOR_UNLOCK(); - } - -@@ -367,6 +378,7 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_free_unused_memory_exec(void) - struct free_block* next_free_block; - - SLJIT_ALLOCATOR_LOCK(); -+ SLJIT_UPDATE_WX_FLAGS(NULL, NULL, 0); - - free_block = free_blocks; - while (free_block) { -@@ -381,5 +393,6 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_free_unused_memory_exec(void) - } - - SLJIT_ASSERT((total_size && free_blocks) || (!total_size && !free_blocks)); -+ SLJIT_UPDATE_WX_FLAGS(NULL, NULL, 1); - SLJIT_ALLOCATOR_UNLOCK(); - } --- -2.30.0 - diff --git a/deps/patches/pcre2-sljit-nomprotect.patch b/deps/patches/pcre2-sljit-nomprotect.patch deleted file mode 100644 index 3c2df1808630b..0000000000000 --- a/deps/patches/pcre2-sljit-nomprotect.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/sljit_src/sljitExecAllocator.c b/sljit_src/sljitExecAllocator.c -index 2e1c138..bae8cd6 100644 ---- a/sljit_src/sljitExecAllocator.c -+++ b/sljit_src/sljitExecAllocator.c -@@ -182,10 +182,12 @@ static SLJIT_INLINE void* alloc_chunk(sljit_uw size) - if (retval == MAP_FAILED) - return NULL; - -+#ifdef SLIJT_WX_OS_NEEDSCHEK - if (mprotect(retval, size, prot) < 0) { - munmap(retval, size); - return NULL; - } -+#endif - - SLJIT_UPDATE_WX_FLAGS(retval, (uint8_t *)retval + size, 0); - diff --git a/deps/pcre.mk b/deps/pcre.mk index 053a773e5609e..2fd8ad48b199f 100644 --- a/deps/pcre.mk +++ b/deps/pcre.mk @@ -6,26 +6,17 @@ PCRE_CFLAGS := -O3 PCRE_LDFLAGS := $(RPATH_ESCAPED_ORIGIN) $(SRCCACHE)/pcre2-$(PCRE_VER).tar.bz2: | $(SRCCACHE) - $(JLDOWNLOAD) $@ https://github.com/PhilipHazel/pcre2/releases/download/pcre2-$(PCRE_VER)/pcre2-$(PCRE_VER).tar.bz2 + $(JLDOWNLOAD) $@ https://github.com/PCRE2Project/pcre2/releases/download/pcre2-$(PCRE_VER)/pcre2-$(PCRE_VER).tar.bz2 $(SRCCACHE)/pcre2-$(PCRE_VER)/source-extracted: $(SRCCACHE)/pcre2-$(PCRE_VER).tar.bz2 $(JLCHECKSUM) $< cd $(dir $<) && $(TAR) jxf $(notdir $<) - cp $(SRCDIR)/patches/config.sub $(SRCCACHE)/pcre2-$(PCRE_VER)/config.sub echo 1 > $@ checksum-pcre: $(SRCCACHE)/pcre2-$(PCRE_VER).tar.bz2 $(JLCHECKSUM) $< -$(SRCCACHE)/pcre2-$(PCRE_VER)/pcre2-sljit-apple-silicon-support.patch-applied: $(SRCCACHE)/pcre2-$(PCRE_VER)/source-extracted - cd $(SRCCACHE)/pcre2-$(PCRE_VER) && patch -d src/sljit -p2 -f < $(SRCDIR)/patches/pcre2-sljit-apple-silicon-support.patch - echo 1 > $@ - -$(SRCCACHE)/pcre2-$(PCRE_VER)/pcre2-sljit-nomprotect.patch-applied: $(SRCCACHE)/pcre2-$(PCRE_VER)/pcre2-sljit-apple-silicon-support.patch-applied - cd $(SRCCACHE)/pcre2-$(PCRE_VER) && patch -d src/sljit -p2 -f < $(SRCDIR)/patches/pcre2-sljit-nomprotect.patch - echo 1 > $@ - -$(BUILDDIR)/pcre2-$(PCRE_VER)/build-configured: $(SRCCACHE)/pcre2-$(PCRE_VER)/source-extracted $(SRCCACHE)/pcre2-$(PCRE_VER)/pcre2-sljit-apple-silicon-support.patch-applied $(SRCCACHE)/pcre2-$(PCRE_VER)/pcre2-sljit-nomprotect.patch-applied +$(BUILDDIR)/pcre2-$(PCRE_VER)/build-configured: $(SRCCACHE)/pcre2-$(PCRE_VER)/source-extracted mkdir -p $(dir $@) cd $(dir $@) && \ $(dir $<)/configure $(CONFIGURE_COMMON) --enable-jit --includedir=$(build_includedir) CFLAGS="$(CFLAGS) $(PCRE_CFLAGS) -g -O0" LDFLAGS="$(LDFLAGS) $(PCRE_LDFLAGS)" diff --git a/stdlib/PCRE2_jll/Project.toml b/stdlib/PCRE2_jll/Project.toml index b7718fcf79f48..187eddb2a5541 100644 --- a/stdlib/PCRE2_jll/Project.toml +++ b/stdlib/PCRE2_jll/Project.toml @@ -1,6 +1,6 @@ name = "PCRE2_jll" uuid = "efcefdf7-47ab-520b-bdef-62a2eaa19f15" -version = "10.36.0+2" +version = "10.40.0+0" [deps] Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" diff --git a/stdlib/PCRE2_jll/test/runtests.jl b/stdlib/PCRE2_jll/test/runtests.jl index b2446e7e5caab..21e7e7db7286b 100644 --- a/stdlib/PCRE2_jll/test/runtests.jl +++ b/stdlib/PCRE2_jll/test/runtests.jl @@ -6,5 +6,5 @@ using Test, Libdl, PCRE2_jll vstr = zeros(UInt8, 32) @test ccall((:pcre2_config_8, libpcre2_8), Cint, (UInt32, Ref{UInt8}), 11, vstr) > 0 vn = VersionNumber(split(unsafe_string(pointer(vstr)), " ")[1]) - @test vn == v"10.36.0" + @test vn == v"10.40.0" end From a02630ed8f6ccf52eea58e27875751a5491fc3f0 Mon Sep 17 00:00:00 2001 From: Jerry Ling Date: Sun, 22 May 2022 09:33:43 -0400 Subject: [PATCH 167/369] set default blas num threads to Sys.CPU_THREADS / 2 (#45412) Set default blas num threads to Sys.CPU_THREADS / 2 in absence of OPENBLAS_NUM_THREADS Co-authored-by: SamuraiAku <61489439+SamuraiAku@users.noreply.github.com> (cherry picked from commit 390503ebe26074646d880b43ef0f4cf17db37df0) --- stdlib/LinearAlgebra/src/LinearAlgebra.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stdlib/LinearAlgebra/src/LinearAlgebra.jl b/stdlib/LinearAlgebra/src/LinearAlgebra.jl index 7417e6256cef5..e8c2de0ac056a 100644 --- a/stdlib/LinearAlgebra/src/LinearAlgebra.jl +++ b/stdlib/LinearAlgebra/src/LinearAlgebra.jl @@ -581,6 +581,10 @@ function __init__() end # register a hook to disable BLAS threading Base.at_disable_library_threading(() -> BLAS.set_num_threads(1)) + + if !haskey(ENV, "OPENBLAS_NUM_THREADS") + BLAS.set_num_threads(max(1, Sys.CPU_THREADS ÷ 2)) + end end end # module LinearAlgebra From 6acc46b5ff8263c9dea6237fd3dc84944f0e502a Mon Sep 17 00:00:00 2001 From: Perry Fraser Date: Mon, 23 May 2022 03:31:50 -0400 Subject: [PATCH 168/369] Don't error when transposing a single character (#45420) This fixes an issue where an error would be thrown in the REPL if you tried to transpose an input that was a single character while your cursor was to the right of that character (e.g., "A|"). To fix this, let's move left once before we check for if we're at the start of a line. This does change behavior slightly in that the cursor can move left once without actually transposing anything, but this seems to match what Emacs does with M-x transpose-chars in an equivalent situation. (cherry picked from commit 9dd993e0604ab19f51e61c0f8d7f339599352e95) --- stdlib/REPL/src/LineEdit.jl | 3 ++- stdlib/REPL/test/lineedit.jl | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/stdlib/REPL/src/LineEdit.jl b/stdlib/REPL/src/LineEdit.jl index 89f57383d5e48..e3daa4677f077 100644 --- a/stdlib/REPL/src/LineEdit.jl +++ b/stdlib/REPL/src/LineEdit.jl @@ -1085,8 +1085,9 @@ function edit_transpose_chars(s::MIState) end function edit_transpose_chars(buf::IOBuffer) - position(buf) == 0 && return false + # Moving left but not transpoing anything is intentional, and matches Emacs's behavior eof(buf) && char_move_left(buf) + position(buf) == 0 && return false char_move_left(buf) pos = position(buf) a, b = read(buf, Char), read(buf, Char) diff --git a/stdlib/REPL/test/lineedit.jl b/stdlib/REPL/test/lineedit.jl index decad3eb07938..87028e239d5b8 100644 --- a/stdlib/REPL/test/lineedit.jl +++ b/stdlib/REPL/test/lineedit.jl @@ -375,6 +375,16 @@ let buf = IOBuffer() @test content(buf) == "βγαεδ" LineEdit.edit_transpose_chars(buf) @test content(buf) == "βγαδε" + + seek(buf, 0) + @inferred(LineEdit.edit_clear(buf)) + edit_insert(buf, "a") + LineEdit.edit_transpose_chars(buf) + @test content(buf) == "a" + seekend(buf) + LineEdit.edit_transpose_chars(buf) + @test content(buf) == "a" + @test position(buf) == 0 end @testset "edit_word_transpose" begin From 5403c43089764305d28f179d90f802ae2812c121 Mon Sep 17 00:00:00 2001 From: KristofferC Date: Tue, 24 May 2022 14:41:02 +0200 Subject: [PATCH 169/369] bump Pkg version to latest 1.8 --- .../Pkg-7c1544f092a006556ce46dfaf9a93cb408b705d3.tar.gz/md5 | 1 + .../Pkg-7c1544f092a006556ce46dfaf9a93cb408b705d3.tar.gz/sha512 | 1 + .../Pkg-e31a3dc77201e1c7c469f6d4572c521f93fefb20.tar.gz/md5 | 1 - .../Pkg-e31a3dc77201e1c7c469f6d4572c521f93fefb20.tar.gz/sha512 | 1 - stdlib/Pkg.version | 2 +- 5 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 deps/checksums/Pkg-7c1544f092a006556ce46dfaf9a93cb408b705d3.tar.gz/md5 create mode 100644 deps/checksums/Pkg-7c1544f092a006556ce46dfaf9a93cb408b705d3.tar.gz/sha512 delete mode 100644 deps/checksums/Pkg-e31a3dc77201e1c7c469f6d4572c521f93fefb20.tar.gz/md5 delete mode 100644 deps/checksums/Pkg-e31a3dc77201e1c7c469f6d4572c521f93fefb20.tar.gz/sha512 diff --git a/deps/checksums/Pkg-7c1544f092a006556ce46dfaf9a93cb408b705d3.tar.gz/md5 b/deps/checksums/Pkg-7c1544f092a006556ce46dfaf9a93cb408b705d3.tar.gz/md5 new file mode 100644 index 0000000000000..7b3aa9f19c01b --- /dev/null +++ b/deps/checksums/Pkg-7c1544f092a006556ce46dfaf9a93cb408b705d3.tar.gz/md5 @@ -0,0 +1 @@ +59386028556257c324385840a93bb43d diff --git a/deps/checksums/Pkg-7c1544f092a006556ce46dfaf9a93cb408b705d3.tar.gz/sha512 b/deps/checksums/Pkg-7c1544f092a006556ce46dfaf9a93cb408b705d3.tar.gz/sha512 new file mode 100644 index 0000000000000..fbe82d95808ae --- /dev/null +++ b/deps/checksums/Pkg-7c1544f092a006556ce46dfaf9a93cb408b705d3.tar.gz/sha512 @@ -0,0 +1 @@ +2cd00db324fab2ffe245f9804fc3d1cb8bc733e892d40ec18c02fd69b4c165111e42aacf4654a1d610f933d9bc6868fe9a01e3241116f796ef73fa7d48fd499c diff --git a/deps/checksums/Pkg-e31a3dc77201e1c7c469f6d4572c521f93fefb20.tar.gz/md5 b/deps/checksums/Pkg-e31a3dc77201e1c7c469f6d4572c521f93fefb20.tar.gz/md5 deleted file mode 100644 index f4cc3e5cde47d..0000000000000 --- a/deps/checksums/Pkg-e31a3dc77201e1c7c469f6d4572c521f93fefb20.tar.gz/md5 +++ /dev/null @@ -1 +0,0 @@ -df5033e44bde58e85642eabe9a3a118b diff --git a/deps/checksums/Pkg-e31a3dc77201e1c7c469f6d4572c521f93fefb20.tar.gz/sha512 b/deps/checksums/Pkg-e31a3dc77201e1c7c469f6d4572c521f93fefb20.tar.gz/sha512 deleted file mode 100644 index de5c95167ce9b..0000000000000 --- a/deps/checksums/Pkg-e31a3dc77201e1c7c469f6d4572c521f93fefb20.tar.gz/sha512 +++ /dev/null @@ -1 +0,0 @@ -d3630f9fab8b72c9a42d5bb43a7ad4e9e024510b189dd63c581e989960d6478bd6c6c6676f702a0fea8be67c58182a7febd2b63c5934bc86068c7cd4168cdf9b diff --git a/stdlib/Pkg.version b/stdlib/Pkg.version index 5706cef05e9a5..b33656cecd56a 100644 --- a/stdlib/Pkg.version +++ b/stdlib/Pkg.version @@ -1,4 +1,4 @@ PKG_BRANCH = master -PKG_SHA1 = e31a3dc77201e1c7c469f6d4572c521f93fefb20 +PKG_SHA1 = 7c1544f092a006556ce46dfaf9a93cb408b705d3 PKG_GIT_URL := https://github.com/JuliaLang/Pkg.jl.git PKG_TAR_URL = https://api.github.com/repos/JuliaLang/Pkg.jl/tarball/$1 From 11a1ee2a484afc9d74c34bcd31b07c92c2096337 Mon Sep 17 00:00:00 2001 From: FX Coudert Date: Tue, 24 May 2022 10:24:30 -0600 Subject: [PATCH 170/369] Update p7zip to 17.04 (#45435) Co-authored-by: KristofferC (cherry picked from commit 86f5501f248bb30304fc19a9abc8affee98e42f8) --- deps/Versions.make | 2 +- deps/checksums/p7zip | 69 ++-- deps/p7zip.mk | 34 +- deps/patches/p7zip-12-CVE-2016-9296.patch | 23 -- deps/patches/p7zip-13-CVE-2017-17969.patch | 35 -- ...7zip-15-Enhanced-encryption-strength.patch | 298 ------------------ deps/patches/p7zip-Windows_ErrorMsg.patch | 33 -- stdlib/p7zip_jll/Project.toml | 2 +- 8 files changed, 46 insertions(+), 450 deletions(-) delete mode 100644 deps/patches/p7zip-12-CVE-2016-9296.patch delete mode 100644 deps/patches/p7zip-13-CVE-2017-17969.patch delete mode 100644 deps/patches/p7zip-15-Enhanced-encryption-strength.patch delete mode 100644 deps/patches/p7zip-Windows_ErrorMsg.patch diff --git a/deps/Versions.make b/deps/Versions.make index b865922c7f3d9..7442543716ad4 100644 --- a/deps/Versions.make +++ b/deps/Versions.make @@ -90,7 +90,7 @@ OPENLIBM_JLL_NAME := OpenLibm PATCHELF_VER := 0.13 # p7zip -P7ZIP_VER := 16.2.0 +P7ZIP_VER := 17.04 P7ZIP_JLL_NAME := p7zip # PCRE diff --git a/deps/checksums/p7zip b/deps/checksums/p7zip index 0df5ed96067b1..faeedc1a05d72 100644 --- a/deps/checksums/p7zip +++ b/deps/checksums/p7zip @@ -1,34 +1,35 @@ -p7zip-16.2.0.tar.bz2/md5/a0128d661cfe7cc8c121e73519c54fbf -p7zip-16.2.0.tar.bz2/sha512/d2c4d53817f96bb4c7683f42045198d4cd509cfc9c3e2cb85c8d9dc4ab6dfa7496449edeac4e300ecf986a9cbbc90bd8f8feef8156895d94617c04e507add55f -p7zip.v16.2.1+1.aarch64-apple-darwin.tar.gz/md5/12485086522a08b62dfef503b61af007 -p7zip.v16.2.1+1.aarch64-apple-darwin.tar.gz/sha512/dc9d92b294a65c55d8742b33df0d905a8cd1e80500647b33537fd404167aaa43a01280bb19035a9e4da94dd49c6ee712a0fbf455b9661af487e1c35a9a09eda7 -p7zip.v16.2.1+1.aarch64-linux-gnu.tar.gz/md5/35a760ced992c9cd4c6085e40394299b -p7zip.v16.2.1+1.aarch64-linux-gnu.tar.gz/sha512/da3123601db48cead255240e048e33de401de52cbddddbc1e109dd7b3b36645251008108c7545abaf09e0b2803198ac4067b00a3f0ff7fe31f65a5de4ce49710 -p7zip.v16.2.1+1.aarch64-linux-musl.tar.gz/md5/f795313bc73c9f635a63861126c838eb -p7zip.v16.2.1+1.aarch64-linux-musl.tar.gz/sha512/886b0e9e2476915be2c7106a8fb4547e9326d50fad93d8002ca97f4e35a856fee43a2350b48404f112938da6fc19255cb2dfb31e3112c74551d4a3ccb44a7fbf -p7zip.v16.2.1+1.armv6l-linux-gnueabihf.tar.gz/md5/644ed1b6a5d7bb16407cea5264ef45ce -p7zip.v16.2.1+1.armv6l-linux-gnueabihf.tar.gz/sha512/3cbdb56faca44ac2a3ea4cba35b8913811a2d3602a689496228968fb17c23b191ab3e01b43f619526cd8ea0f33c5a4453d2b5cca7437026e54b2c164acb1e8ee -p7zip.v16.2.1+1.armv6l-linux-musleabihf.tar.gz/md5/219fdda71c08848844b4630e613bf35d -p7zip.v16.2.1+1.armv6l-linux-musleabihf.tar.gz/sha512/419297b14aa820f8f49d6add367fe3a7153be18546e41e9f8bf6bbddada7535301dd3ea524089981046fc739b8094cff9113fb2aeca2947e796a8e6b74414245 -p7zip.v16.2.1+1.armv7l-linux-gnueabihf.tar.gz/md5/919e6508e4b2adb82fa2493a805875e9 -p7zip.v16.2.1+1.armv7l-linux-gnueabihf.tar.gz/sha512/cf8f58ee590e23aa6fe348b639f2b052fbc0ed52ecf7ce1e370f7dc3255e47727ef65a109b14cd045d59201ef8a5b426eb05b167967ce95581a35df7a6b67400 -p7zip.v16.2.1+1.armv7l-linux-musleabihf.tar.gz/md5/8bfb81a9a4d31ac9f05b59c19490461e -p7zip.v16.2.1+1.armv7l-linux-musleabihf.tar.gz/sha512/6b13c1971e7049613aefd4a2bad64d534ffc7293efb037b2da92e23754462fc3872169399f3a9fe34bc337b900ecc4fccc878e3e54067238b3f890c09f8e05f0 -p7zip.v16.2.1+1.i686-linux-gnu.tar.gz/md5/f62eefb6fb2724082933e95d706b232f -p7zip.v16.2.1+1.i686-linux-gnu.tar.gz/sha512/43a669bb64e0318c16feade75ade6e4ac73e056fb33479268e217310fa469a8f535ace13b8ade45495d96d8a540e1c247dcdb8fd7044c8096693f3766f00224f -p7zip.v16.2.1+1.i686-linux-musl.tar.gz/md5/8a80bbfcb8c4a05d6c56539640a7bfaf -p7zip.v16.2.1+1.i686-linux-musl.tar.gz/sha512/38ce14788fbfd964fa446c98c89ecd3854c732f5529406d6d650d8f0ac4a657caeea8ae2985370f5cee129d974a4bafa8cd164fd1c11ae0cad5191e9640534f0 -p7zip.v16.2.1+1.i686-w64-mingw32.tar.gz/md5/d55077826cdfe69747efd4fd53b81e18 -p7zip.v16.2.1+1.i686-w64-mingw32.tar.gz/sha512/71ee03bbb9916eff2e7807ff25d1c1992c209506c4602f570095ee0cd12355ed4590d77dfd090085a109604c4cbad221154bfd55d5fd79bf35c76b3b43c67a25 -p7zip.v16.2.1+1.powerpc64le-linux-gnu.tar.gz/md5/16682edc596bc1f7d6311339644070fb -p7zip.v16.2.1+1.powerpc64le-linux-gnu.tar.gz/sha512/09c3bfbae7c4ab2757fdee0dac4baf71f6fa7b99aab48c5260ed9481c5e7b05317f7a6d466c543ffe46318281011b61c5652fef33466c02a5b24b3c39d92137d -p7zip.v16.2.1+1.x86_64-apple-darwin.tar.gz/md5/6d7873510fca444740ab2f4ae701ae3a -p7zip.v16.2.1+1.x86_64-apple-darwin.tar.gz/sha512/e6fc0c669b62eb2e6f11d07e840ce44beb6c8981750ac4fb5d7401cf00916465f97f8b3a49c73777d893752a7df9bed8bf40068fe7339df88942a21aff4e9d2a -p7zip.v16.2.1+1.x86_64-linux-gnu.tar.gz/md5/2cd2efe4d51967ac8acf24a6f2c80893 -p7zip.v16.2.1+1.x86_64-linux-gnu.tar.gz/sha512/a0fdf061b5d7da97134eee7fc9afb468d8bee01108843814432d318d2b5c6217772e62700a015d5be41010ecf7b613218ed9e8ea6e2da2a24d1e5c15a1734a59 -p7zip.v16.2.1+1.x86_64-linux-musl.tar.gz/md5/f5a312e21abd7f24100e91eefa875c7f -p7zip.v16.2.1+1.x86_64-linux-musl.tar.gz/sha512/034b00d0685da5456b91f45c0b4196e0aa21436e67ecd7a09318a578a814491774ca5c2ce2c49f6b17e1665d9c8a896a0f2f6fca6d3260208ad8be44c1dce656 -p7zip.v16.2.1+1.x86_64-unknown-freebsd.tar.gz/md5/1e647ff7fd8bf2dfdcdd569c743e9c8c -p7zip.v16.2.1+1.x86_64-unknown-freebsd.tar.gz/sha512/e868eb1bab65ff383177ed0e929ff0db084df1f4b144430098f25cb8df788696113fe466ecf756c4ca61439fa8eed8c8a3fc396aec2972bea6ec7b3b0be51baa -p7zip.v16.2.1+1.x86_64-w64-mingw32.tar.gz/md5/70d58fe372550313b18437f58cd249e1 -p7zip.v16.2.1+1.x86_64-w64-mingw32.tar.gz/sha512/1908d3dfd218e33c8e85366e02d920e237111b5fdb8bf028d8f7a2029ec7292c465d4d0ee50f58ef186fa8c83bfe33ea98d0bacdbcbb9c345b71eeb038cbda89 +p7zip.v17.4.0+0.aarch64-apple-darwin.tar.gz/md5/af8134ed9c24b99d69e4edb4d5226ca5 +p7zip.v17.4.0+0.aarch64-apple-darwin.tar.gz/sha512/b8bb6aee60a54cca37568af8b2d9baedd892ba0d4918b93bcb29d74189524af7115901f4fabafb1ca58ed17e97c59846fcdfbd460abc81059806802b0a7be840 +p7zip.v17.4.0+0.aarch64-linux-gnu.tar.gz/md5/20abac5ebb99f31742878013c02f96a3 +p7zip.v17.4.0+0.aarch64-linux-gnu.tar.gz/sha512/6d8ebf895b969b1f707d0c23a19db4cd0dee47957d076e6e389395e09404d55bfcb78bb14bb67bb35b93b6a0072f2b4f097d839503d1ccab62b4ce28939dc71d +p7zip.v17.4.0+0.aarch64-linux-musl.tar.gz/md5/185c979c7419b7ded3832c0f5cfd3b77 +p7zip.v17.4.0+0.aarch64-linux-musl.tar.gz/sha512/722e880c9f111738cb4cde84bf62c36892dbefdba625ae2b9e0fae76a7b1eabfa481a9838fbf9667223f19f62b6f09fcfd42b50c2bff7a65af0fae3616250fc7 +p7zip.v17.4.0+0.armv6l-linux-gnueabihf.tar.gz/md5/dceb37181763f86bf12f8ca473cf3403 +p7zip.v17.4.0+0.armv6l-linux-gnueabihf.tar.gz/sha512/51e409bbcd3c54838cb3219b2476c8b45c8340e0a2fd26cced0d8484ae7f51711723e06e9023fce9ae9a1b51b5fb94aba536428ce2a5c5902b38498a0b3c2b50 +p7zip.v17.4.0+0.armv6l-linux-musleabihf.tar.gz/md5/193ecd888787ea03a500d102a7e33afa +p7zip.v17.4.0+0.armv6l-linux-musleabihf.tar.gz/sha512/d525aad33f5ed27dc993f31c6db2996b830716bfac9bc7c49cb462ea3f0b412d0d3267765b9952c85e9c9be31d36d095d55ba89c0fa2c92823d9490372389c95 +p7zip.v17.4.0+0.armv7l-linux-gnueabihf.tar.gz/md5/096f11a7f1af5ff730bb8cfef22e335e +p7zip.v17.4.0+0.armv7l-linux-gnueabihf.tar.gz/sha512/1866ffd0169e0795594aaa70f1af8102ebbd79b3cafaadfb9c6a537dac0cdbb6eb7c31ad5165a975508c1b850744f94b60d9c530d658cdcc5536a474203cff21 +p7zip.v17.4.0+0.armv7l-linux-musleabihf.tar.gz/md5/fef1576982f45d1922582f6f7a7d6665 +p7zip.v17.4.0+0.armv7l-linux-musleabihf.tar.gz/sha512/71061585b32fa1a8e0a403a60c07e9f90586291a9799d7e2d6f7e6ec9f7b0ebf4b45ed080efd87cad82c45f71ec9a14cbcf9134a73bad4f5e3329f23bc6df01a +p7zip.v17.4.0+0.i686-linux-gnu.tar.gz/md5/8818389b3bf00f10c6a39fe0c4a331b4 +p7zip.v17.4.0+0.i686-linux-gnu.tar.gz/sha512/bec2051a258f7e8a762b7cd4324e7b8f00fe5d99d48f05fb3557c41604e8b08af9ab66ab830f4a48086656be41aaf011b2aae0fb530e0ffefec38689f85a3bb5 +p7zip.v17.4.0+0.i686-linux-musl.tar.gz/md5/4ed9c16a65ed1d656aa214013e46eb28 +p7zip.v17.4.0+0.i686-linux-musl.tar.gz/sha512/7a5b3e15d0038bea0de7fc28ce058d7f93b8e04f271e30953a6b52d2b5d71f59d10177033e888a50cf8dfeb4f44bcf3271c9b9d1b28d0122ab2b239decdad446 +p7zip.v17.4.0+0.i686-w64-mingw32.tar.gz/md5/d06cff2ec0b7c8415700587f931ce1ac +p7zip.v17.4.0+0.i686-w64-mingw32.tar.gz/sha512/ed72440f5306a57465a70b00bff33185a83c3e223844a79aa0b0d1fbe30dbd35da75e6188725aa621f5c4574a09527daf1e4893c7c6979ab91b2c09b4979dbcb +p7zip.v17.4.0+0.powerpc64le-linux-gnu.tar.gz/md5/949ca7d111e497b82c9c762e5ac63a6b +p7zip.v17.4.0+0.powerpc64le-linux-gnu.tar.gz/sha512/4842e0d44bf6380100723209596f526181fefe8a81d59c28658d03ea16600e71d010d5c7898b4c943efdd9caaa2301c3fdb0dccb343d631d1734acda1c559f65 +p7zip.v17.4.0+0.x86_64-apple-darwin.tar.gz/md5/2322c7a08f62592ca394a716949008bc +p7zip.v17.4.0+0.x86_64-apple-darwin.tar.gz/sha512/9549f3e1052730ce13414636b32f0d1a9a1ac944a2b622380eac0da144b11fd65d437afe877ba6797d651da9c4ec77f0ebd3e515146caceaa2524829419eda48 +p7zip.v17.4.0+0.x86_64-linux-gnu.tar.gz/md5/a21b12946a62ef3688d5fc965974e8f7 +p7zip.v17.4.0+0.x86_64-linux-gnu.tar.gz/sha512/d32faeac23acf8a023f65350ba1d62bb3d9f904e32570ae03b8fb0a5375758784dd95be8caeecd007cbde40e103854a077e2c817f62afa72491f3b8966deb738 +p7zip.v17.4.0+0.x86_64-linux-musl.tar.gz/md5/c448e872d4ad66beb2d46d9134952f2f +p7zip.v17.4.0+0.x86_64-linux-musl.tar.gz/sha512/92588f4817e145ef655c718dec049e7f43dd93644f43f19cd320643fac5f5b2312837c7a6c3e782e97fd08747311c58ed4657484f8bc778942fc5206ff8ea4e5 +p7zip.v17.4.0+0.x86_64-unknown-freebsd.tar.gz/md5/2cca6259a2eb1b0fea777d566267bf05 +p7zip.v17.4.0+0.x86_64-unknown-freebsd.tar.gz/sha512/92f90e2be4a8b8fcd80a4ceacac8bbab750913526b85f9279f8ee9ed91b77248b5de2d35d0c6241d0ad51fda185f4cb1ead1dcc9d23e2bef35e0b61efe3c3170 +p7zip.v17.4.0+0.x86_64-w64-mingw32.tar.gz/md5/5d272c78d7ffb40da0f333463f3cc098 +p7zip.v17.4.0+0.x86_64-w64-mingw32.tar.gz/sha512/2d999c6df4786cec1bba396b3a651a63740f4b799e9fc11754afd24438076e898daae74b4d3c7072450428e89881991e8884711cd4c349879a00c7aeeb4e1d3e +p7zip-17.04.tar.gz/md5/00acfd6be87848231722d2d53f89e4a5 +p7zip-17.04.tar.gz/sha512/ad176db5b657b1c39584f6792c47978d94f2f1ccb1cf5bdb0f52ab31a7356b3822f4a922152c4253f4aa7e79166ba052b6592530b7a38f548cd555fe9c008be3 + diff --git a/deps/p7zip.mk b/deps/p7zip.mk index 20c85602f767a..8c0d11d74a061 100644 --- a/deps/p7zip.mk +++ b/deps/p7zip.mk @@ -1,36 +1,20 @@ ## p7zip ## ifneq ($(USE_BINARYBUILDER_P7ZIP),1) -# Force optimization for P7ZIP flags (Issue #11668) -$(SRCCACHE)/p7zip-$(P7ZIP_VER).tar.bz2: | $(SRCCACHE) - $(JLDOWNLOAD) $@ https://downloads.sourceforge.net/project/p7zip/p7zip/16.02/p7zip_16.02_src_all.tar.bz2 -$(BUILDDIR)/p7zip-$(P7ZIP_VER)/source-extracted: $(SRCCACHE)/p7zip-$(P7ZIP_VER).tar.bz2 +$(SRCCACHE)/p7zip-$(P7ZIP_VER).tar.gz: | $(SRCCACHE) + $(JLDOWNLOAD) $@ https://github.com/jinfeihan57/p7zip/archive/refs/tags/v$(P7ZIP_VER).tar.gz + +$(BUILDDIR)/p7zip-$(P7ZIP_VER)/source-extracted: $(SRCCACHE)/p7zip-$(P7ZIP_VER).tar.gz $(JLCHECKSUM) $< mkdir -p $(dir $@) - cd $(dir $@) && $(TAR) --strip-components 1 -jxf $< + cd $(dir $@) && $(TAR) --strip-components 1 -zxf $< echo 1 > $@ -checksum-p7zip: $(SRCCACHE)/p7zip-$(P7ZIP_VER).tar.bz2 +checksum-p7zip: $(SRCCACHE)/p7zip-$(P7ZIP_VER).tar.gz $(JLCHECKSUM) $< -$(BUILDDIR)/p7zip-$(P7ZIP_VER)/p7zip-12-CVE-2016-9296.patch-applied: $(BUILDDIR)/p7zip-$(P7ZIP_VER)/source-extracted - cd $(dir $@) && patch -p1 -f < $(SRCDIR)/patches/p7zip-12-CVE-2016-9296.patch - echo 1 > $@ - -$(BUILDDIR)/p7zip-$(P7ZIP_VER)/p7zip-13-CVE-2017-17969.patch-applied: $(BUILDDIR)/p7zip-$(P7ZIP_VER)/p7zip-12-CVE-2016-9296.patch-applied - cd $(dir $@) && patch -p1 -f < $(SRCDIR)/patches/p7zip-13-CVE-2017-17969.patch - echo 1 > $@ - -$(BUILDDIR)/p7zip-$(P7ZIP_VER)/p7zip-15-Enhanced-encryption-strength.patch-applied: $(BUILDDIR)/p7zip-$(P7ZIP_VER)/p7zip-13-CVE-2017-17969.patch-applied - cd $(dir $@) && patch -p4 -f < $(SRCDIR)/patches/p7zip-15-Enhanced-encryption-strength.patch - echo 1 > $@ - -$(BUILDDIR)/p7zip-$(P7ZIP_VER)/p7zip-Windows_ErrorMsg.patch-applied: $(BUILDDIR)/p7zip-$(P7ZIP_VER)/p7zip-15-Enhanced-encryption-strength.patch-applied - cd $(dir $@) && patch -p0 -f < $(SRCDIR)/patches/p7zip-Windows_ErrorMsg.patch - echo 1 > $@ - -$(BUILDDIR)/p7zip-$(P7ZIP_VER)/build-configured: $(BUILDDIR)/p7zip-$(P7ZIP_VER)/p7zip-Windows_ErrorMsg.patch-applied +$(BUILDDIR)/p7zip-$(P7ZIP_VER)/build-configured: $(BUILDDIR)/p7zip-$(P7ZIP_VER)/source-extracted $(BUILDDIR)/p7zip-$(P7ZIP_VER)/build-compiled: $(BUILDDIR)/p7zip-$(P7ZIP_VER)/build-configured $(MAKE) -C $(dir $<) $(MAKE_COMMON) CC="$(CC)" CXX="$(CXX)" 7za echo 1 > $@ @@ -49,10 +33,10 @@ clean-p7zip: -$(MAKE) -C $(BUILDDIR)/p7zip-$(P7ZIP_VER) clean distclean-p7zip: - -rm -rf $(SRCCACHE)/p7zip-$(P7ZIP_VER).tar.bz2 $(SRCCACHE)/p7zip-$(P7ZIP_VER) $(BUILDDIR)/p7zip-$(P7ZIP_VER) + -rm -rf $(SRCCACHE)/p7zip-$(P7ZIP_VER).tar.gz $(SRCCACHE)/p7zip-$(P7ZIP_VER) $(BUILDDIR)/p7zip-$(P7ZIP_VER) -get-p7zip: $(SRCCACHE)/p7zip-$(P7ZIP_VER).tar.bz2 +get-p7zip: $(SRCCACHE)/p7zip-$(P7ZIP_VER).tar.gz extract-p7zip: $(SRCCACHE)/p7zip-$(P7ZIP_VER)/source-extracted configure-p7zip: $(BUILDDIR)/p7zip-$(P7ZIP_VER)/build-configured compile-p7zip: $(BUILDDIR)/p7zip-$(P7ZIP_VER)/build-compiled diff --git a/deps/patches/p7zip-12-CVE-2016-9296.patch b/deps/patches/p7zip-12-CVE-2016-9296.patch deleted file mode 100644 index 42245c92c0aae..0000000000000 --- a/deps/patches/p7zip-12-CVE-2016-9296.patch +++ /dev/null @@ -1,23 +0,0 @@ -From: Robert Luberda -Date: Sat, 19 Nov 2016 08:48:08 +0100 -Subject: Fix nullptr dereference (CVE-2016-9296) - -Patch taken from https://sourceforge.net/p/p7zip/bugs/185/ ---- - CPP/7zip/Archive/7z/7zIn.cpp | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/CPP/7zip/Archive/7z/7zIn.cpp b/CPP/7zip/Archive/7z/7zIn.cpp -index b0c6b98..7c6dde2 100644 ---- a/CPP/7zip/Archive/7z/7zIn.cpp -+++ b/CPP/7zip/Archive/7z/7zIn.cpp -@@ -1097,7 +1097,8 @@ HRESULT CInArchive::ReadAndDecodePackedStreams( - if (CrcCalc(data, unpackSize) != folders.FolderCRCs.Vals[i]) - ThrowIncorrect(); - } -- HeadersSize += folders.PackPositions[folders.NumPackStreams]; -+ if (folders.PackPositions) -+ HeadersSize += folders.PackPositions[folders.NumPackStreams]; - return S_OK; - } - diff --git a/deps/patches/p7zip-13-CVE-2017-17969.patch b/deps/patches/p7zip-13-CVE-2017-17969.patch deleted file mode 100644 index a9787c4a90886..0000000000000 --- a/deps/patches/p7zip-13-CVE-2017-17969.patch +++ /dev/null @@ -1,35 +0,0 @@ -From: =?utf-8?q?Antoine_Beaupr=C3=A9?= -Date: Fri, 2 Feb 2018 11:11:41 +0100 -Subject: Heap-based buffer overflow in 7zip/Compress/ShrinkDecoder.cpp - -Origin: vendor, https://sourceforge.net/p/p7zip/bugs/_discuss/thread/0920f369/27d7/attachment/CVE-2017-17969.patch -Forwarded: https://sourceforge.net/p/p7zip/bugs/_discuss/thread/0920f369/#27d7 -Bug: https://sourceforge.net/p/p7zip/bugs/204/ -Bug-Debian: https://bugs.debian.org/888297 -Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2017-17969 -Reviewed-by: Salvatore Bonaccorso -Last-Update: 2018-02-01 -Applied-Upstream: 18.00-beta ---- - CPP/7zip/Compress/ShrinkDecoder.cpp | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/CPP/7zip/Compress/ShrinkDecoder.cpp b/CPP/7zip/Compress/ShrinkDecoder.cpp -index 80b7e67..ca37764 100644 ---- a/CPP/7zip/Compress/ShrinkDecoder.cpp -+++ b/CPP/7zip/Compress/ShrinkDecoder.cpp -@@ -121,8 +121,13 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream * - { - _stack[i++] = _suffixes[cur]; - cur = _parents[cur]; -+ if (cur >= kNumItems || i >= kNumItems) -+ break; - } -- -+ -+ if (cur >= kNumItems || i >= kNumItems) -+ break; -+ - _stack[i++] = (Byte)cur; - lastChar2 = (Byte)cur; - diff --git a/deps/patches/p7zip-15-Enhanced-encryption-strength.patch b/deps/patches/p7zip-15-Enhanced-encryption-strength.patch deleted file mode 100644 index ab1cfb9c743fb..0000000000000 --- a/deps/patches/p7zip-15-Enhanced-encryption-strength.patch +++ /dev/null @@ -1,298 +0,0 @@ -From ea31bbe661abef761e49983b56923e6523b9463a Mon Sep 17 00:00:00 2001 -From: aone -Date: Thu, 7 Mar 2019 10:06:16 +0100 -Subject: [PATCH] Enhanced encryption strength from 7-Zip 19.00 - -https://github.com/aonez/Keka/issues/379 -https://sourceforge.net/p/sevenzip/bugs/2176 ---- - .../CPP/7zip/Archive/Wim/WimHandlerOut.cpp | 2 +- - Bin/p7zip/source/CPP/7zip/Crypto/7zAes.cpp | 4 +- - Bin/p7zip/source/CPP/7zip/Crypto/RandGen.cpp | 135 ++++++++++++++++-- - Bin/p7zip/source/CPP/7zip/Crypto/RandGen.h | 19 +++ - Bin/p7zip/source/CPP/7zip/Crypto/WzAes.cpp | 2 +- - .../source/CPP/7zip/Crypto/ZipCrypto.cpp | 2 +- - 6 files changed, 146 insertions(+), 18 deletions(-) - -diff --git a/Bin/p7zip/source/CPP/7zip/Archive/Wim/WimHandlerOut.cpp b/Bin/p7zip/source/CPP/7zip/Archive/Wim/WimHandlerOut.cpp -index 1d198df0..39679883 100644 ---- a/Bin/p7zip/source/CPP/7zip/Archive/Wim/WimHandlerOut.cpp -+++ b/Bin/p7zip/source/CPP/7zip/Archive/Wim/WimHandlerOut.cpp -@@ -671,7 +671,7 @@ void CHeader::SetDefaultFields(bool useLZX) - ChunkSize = kChunkSize; - ChunkSizeBits = kChunkSizeBits; - } -- g_RandomGenerator.Generate(Guid, 16); -+ MY_RAND_GEN(Guid, 16); - PartNumber = 1; - NumParts = 1; - NumImages = 1; -diff --git a/Bin/p7zip/source/CPP/7zip/Crypto/7zAes.cpp b/Bin/p7zip/source/CPP/7zip/Crypto/7zAes.cpp -index d33b562a..2ed69bad 100644 ---- a/Bin/p7zip/source/CPP/7zip/Crypto/7zAes.cpp -+++ b/Bin/p7zip/source/CPP/7zip/Crypto/7zAes.cpp -@@ -164,8 +164,8 @@ STDMETHODIMP CEncoder::ResetInitVector() - { - for (unsigned i = 0; i < sizeof(_iv); i++) - _iv[i] = 0; -- _ivSize = 8; -- g_RandomGenerator.Generate(_iv, _ivSize); -+ _ivSize = 16; -+ MY_RAND_GEN(_iv, _ivSize); - return S_OK; - } - -diff --git a/Bin/p7zip/source/CPP/7zip/Crypto/RandGen.cpp b/Bin/p7zip/source/CPP/7zip/Crypto/RandGen.cpp -index f5ea31f0..a70f4ec8 100644 ---- a/Bin/p7zip/source/CPP/7zip/Crypto/RandGen.cpp -+++ b/Bin/p7zip/source/CPP/7zip/Crypto/RandGen.cpp -@@ -2,14 +2,44 @@ - - #include "StdAfx.h" - -+#include "RandGen.h" -+ -+#ifndef USE_STATIC_SYSTEM_RAND -+ - #ifndef _7ZIP_ST - #include "../../Windows/Synchronization.h" - #endif - --#include "RandGen.h" - --#ifndef _WIN32 -+#ifdef _WIN32 -+ -+#ifdef _WIN64 -+#define USE_STATIC_RtlGenRandom -+#endif -+ -+#ifdef USE_STATIC_RtlGenRandom -+ -+#include -+ -+EXTERN_C_BEGIN -+#ifndef RtlGenRandom -+ #define RtlGenRandom SystemFunction036 -+ BOOLEAN WINAPI RtlGenRandom(PVOID RandomBuffer, ULONG RandomBufferLength); -+#endif -+EXTERN_C_END -+ -+#else -+EXTERN_C_BEGIN -+typedef BOOLEAN (WINAPI * Func_RtlGenRandom)(PVOID RandomBuffer, ULONG RandomBufferLength); -+EXTERN_C_END -+#endif -+ -+ -+#else - #include -+#include -+#include -+#include - #define USE_POSIX_TIME - #define USE_POSIX_TIME2 - #endif -@@ -21,11 +51,9 @@ - #endif - #endif - --// This is not very good random number generator. --// Please use it only for salt. --// First generated data block depends from timer and processID. -+// The seed and first generated data block depend from processID, -+// theadID, timer and system random generator, if available. - // Other generated data blocks depend from previous state --// Maybe it's possible to restore original timer value from generated value. - - #define HASH_UPD(x) Sha256_Update(&hash, (const Byte *)&x, sizeof(x)); - -@@ -34,25 +62,102 @@ void CRandomGenerator::Init() - CSha256 hash; - Sha256_Init(&hash); - -+ unsigned numIterations = 1000; -+ -+ { -+ #ifndef UNDER_CE -+ const unsigned kNumIterations_Small = 100; -+ const unsigned kBufSize = 32; -+ Byte buf[kBufSize]; -+ #endif -+ - #ifdef _WIN32 -+ - DWORD w = ::GetCurrentProcessId(); - HASH_UPD(w); - w = ::GetCurrentThreadId(); - HASH_UPD(w); -+ -+ #ifdef UNDER_CE -+ /* -+ if (CeGenRandom(kBufSize, buf)) -+ { -+ numIterations = kNumIterations_Small; -+ Sha256_Update(&hash, buf, kBufSize); -+ } -+ */ -+ #elif defined(USE_STATIC_RtlGenRandom) -+ if (RtlGenRandom(buf, kBufSize)) -+ { -+ numIterations = kNumIterations_Small; -+ Sha256_Update(&hash, buf, kBufSize); -+ } - #else -+ { -+ HMODULE hModule = ::LoadLibrary(TEXT("Advapi32.dll")); -+ if (hModule) -+ { -+ // SystemFunction036() is real name of RtlGenRandom() function -+ Func_RtlGenRandom my_RtlGenRandom = (Func_RtlGenRandom)GetProcAddress(hModule, "SystemFunction036"); -+ if (my_RtlGenRandom) -+ { -+ if (my_RtlGenRandom(buf, kBufSize)) -+ { -+ numIterations = kNumIterations_Small; -+ Sha256_Update(&hash, buf, kBufSize); -+ } -+ } -+ ::FreeLibrary(hModule); -+ } -+ } -+ #endif -+ -+ #else -+ - pid_t pid = getpid(); - HASH_UPD(pid); - pid = getppid(); - HASH_UPD(pid); -+ -+ { -+ int f = open("/dev/urandom", O_RDONLY); -+ unsigned numBytes = kBufSize; -+ if (f >= 0) -+ { -+ do -+ { -+ int n = read(f, buf, numBytes); -+ if (n <= 0) -+ break; -+ Sha256_Update(&hash, buf, n); -+ numBytes -= n; -+ } -+ while (numBytes); -+ close(f); -+ if (numBytes == 0) -+ numIterations = kNumIterations_Small; -+ } -+ } -+ /* -+ { -+ int n = getrandom(buf, kBufSize, 0); -+ if (n > 0) -+ { -+ Sha256_Update(&hash, buf, n); -+ if (n == kBufSize) -+ numIterations = kNumIterations_Small; -+ } -+ } -+ */ -+ -+ #endif -+ } -+ -+ #ifdef _DEBUG -+ numIterations = 2; - #endif - -- for (unsigned i = 0; i < -- #ifdef _DEBUG -- 2; -- #else -- 1000; -- #endif -- i++) -+ do - { - #ifdef _WIN32 - LARGE_INTEGER v; -@@ -83,6 +188,8 @@ void CRandomGenerator::Init() - Sha256_Update(&hash, _buff, SHA256_DIGEST_SIZE); - } - } -+ while (--numIterations); -+ - Sha256_Final(&hash, _buff); - _needInit = false; - } -@@ -120,3 +227,5 @@ void CRandomGenerator::Generate(Byte *data, unsigned size) - } - - CRandomGenerator g_RandomGenerator; -+ -+#endif -diff --git a/Bin/p7zip/source/CPP/7zip/Crypto/RandGen.h b/Bin/p7zip/source/CPP/7zip/Crypto/RandGen.h -index cfdcd60d..5122ec4b 100644 ---- a/Bin/p7zip/source/CPP/7zip/Crypto/RandGen.h -+++ b/Bin/p7zip/source/CPP/7zip/Crypto/RandGen.h -@@ -5,6 +5,21 @@ - - #include "../../../C/Sha256.h" - -+#ifdef _WIN64 -+// #define USE_STATIC_SYSTEM_RAND -+#endif -+ -+#ifdef USE_STATIC_SYSTEM_RAND -+ -+#ifdef _WIN32 -+#include -+#define MY_RAND_GEN(data, size) RtlGenRandom(data, size) -+#else -+#define MY_RAND_GEN(data, size) getrandom(data, size, 0) -+#endif -+ -+#else -+ - class CRandomGenerator - { - Byte _buff[SHA256_DIGEST_SIZE]; -@@ -18,4 +33,8 @@ public: - - extern CRandomGenerator g_RandomGenerator; - -+#define MY_RAND_GEN(data, size) g_RandomGenerator.Generate(data, size) -+ -+#endif -+ - #endif -diff --git a/Bin/p7zip/source/CPP/7zip/Crypto/WzAes.cpp b/Bin/p7zip/source/CPP/7zip/Crypto/WzAes.cpp -index 4572f06e..d415ab84 100644 ---- a/Bin/p7zip/source/CPP/7zip/Crypto/WzAes.cpp -+++ b/Bin/p7zip/source/CPP/7zip/Crypto/WzAes.cpp -@@ -96,7 +96,7 @@ STDMETHODIMP CBaseCoder::Init() - HRESULT CEncoder::WriteHeader(ISequentialOutStream *outStream) - { - unsigned saltSize = _key.GetSaltSize(); -- g_RandomGenerator.Generate(_key.Salt, saltSize); -+ MY_RAND_GEN(_key.Salt, saltSize); - Init2(); - RINOK(WriteStream(outStream, _key.Salt, saltSize)); - return WriteStream(outStream, _key.PwdVerifComputed, kPwdVerifSize); -diff --git a/Bin/p7zip/source/CPP/7zip/Crypto/ZipCrypto.cpp b/Bin/p7zip/source/CPP/7zip/Crypto/ZipCrypto.cpp -index ae715063..8610297a 100644 ---- a/Bin/p7zip/source/CPP/7zip/Crypto/ZipCrypto.cpp -+++ b/Bin/p7zip/source/CPP/7zip/Crypto/ZipCrypto.cpp -@@ -49,7 +49,7 @@ HRESULT CEncoder::WriteHeader_Check16(ISequentialOutStream *outStream, UInt16 cr - PKZIP 2.0+ used 1 byte CRC check. It's more secure. - We also use 1 byte CRC. */ - -- g_RandomGenerator.Generate(h, kHeaderSize - 1); -+ MY_RAND_GEN(h, kHeaderSize - 1); - // h[kHeaderSize - 2] = (Byte)(crc); - h[kHeaderSize - 1] = (Byte)(crc >> 8); - --- -2.17.1 - diff --git a/deps/patches/p7zip-Windows_ErrorMsg.patch b/deps/patches/p7zip-Windows_ErrorMsg.patch deleted file mode 100644 index 71de3e9f59c86..0000000000000 --- a/deps/patches/p7zip-Windows_ErrorMsg.patch +++ /dev/null @@ -1,33 +0,0 @@ -This fixes the build with Clang 6.0: - - ../../../../CPP/Windows/ErrorMsg.cpp:24:10: error: case value evaluates to -2147024809, which cannot be narrowed to type 'DWORD' (aka 'unsigned int') [-Wc++11-narrowing] - case E_INVALIDARG : txt = "E_INVALIDARG"; break ; - ^ - ../../../../CPP/Common/MyWindows.h:89:22: note: expanded from macro 'E_INVALIDARG' - #define E_INVALIDARG ((HRESULT)0x80070057L) - ^ - -The HRESULT cast in the macro causes the value to be read as signed int. ---- CPP/Windows/ErrorMsg.cpp.orig 2015-01-18 18:20:28 UTC -+++ CPP/Windows/ErrorMsg.cpp -@@ -15,13 +15,13 @@ UString MyFormatMessage(DWORD errorCode) - - switch(errorCode) { - case ERROR_NO_MORE_FILES : txt = "No more files"; break ; -- case E_NOTIMPL : txt = "E_NOTIMPL"; break ; -- case E_NOINTERFACE : txt = "E_NOINTERFACE"; break ; -- case E_ABORT : txt = "E_ABORT"; break ; -- case E_FAIL : txt = "E_FAIL"; break ; -- case STG_E_INVALIDFUNCTION : txt = "STG_E_INVALIDFUNCTION"; break ; -- case E_OUTOFMEMORY : txt = "E_OUTOFMEMORY"; break ; -- case E_INVALIDARG : txt = "E_INVALIDARG"; break ; -+ case (DWORD)(E_NOTIMPL) : txt = "E_NOTIMPL"; break ; -+ case (DWORD)(E_NOINTERFACE) : txt = "E_NOINTERFACE"; break ; -+ case (DWORD)(E_ABORT) : txt = "E_ABORT"; break ; -+ case (DWORD)(E_FAIL) : txt = "E_FAIL"; break ; -+ case (DWORD)(STG_E_INVALIDFUNCTION) : txt = "STG_E_INVALIDFUNCTION"; break ; -+ case (DWORD)(E_OUTOFMEMORY) : txt = "E_OUTOFMEMORY"; break ; -+ case (DWORD)(E_INVALIDARG) : txt = "E_INVALIDARG"; break ; - case ERROR_DIRECTORY : txt = "Error Directory"; break ; - default: - txt = strerror(errorCode); diff --git a/stdlib/p7zip_jll/Project.toml b/stdlib/p7zip_jll/Project.toml index 75e04b6362fdf..4c9bf62ad7ec1 100644 --- a/stdlib/p7zip_jll/Project.toml +++ b/stdlib/p7zip_jll/Project.toml @@ -1,6 +1,6 @@ name = "p7zip_jll" uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" -version = "16.2.1+1" +version = "17.4.0+0" [deps] Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" From 7a4cef745168ec9e7143e6e0b28942eb82932624 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Wed, 26 Jan 2022 14:51:58 -0500 Subject: [PATCH 171/369] [Distributed] Set stdin to devnull before closing it Distributed closes and destroys stdin, but some tests attempted to explicitly use it, leading to test problems. We previously interpreted this as passing devnull, but this is better to be explicit. (cherry picked from commit 64a86f9bca119db3a64e02294f9da16ed6b50a07) --- stdlib/Distributed/src/cluster.jl | 5 ++++- stdlib/Distributed/test/distributed_exec.jl | 6 +++++- stdlib/REPL/src/TerminalMenus/util.jl | 10 +++++----- .../TerminalMenus/legacytests/old_multiselect_menu.jl | 4 ++-- .../test/TerminalMenus/legacytests/old_radio_menu.jl | 6 +++--- stdlib/REPL/test/TerminalMenus/multiselect_menu.jl | 4 ++-- .../test/TerminalMenus/multiselect_with_skip_menu.jl | 4 ++-- stdlib/REPL/test/TerminalMenus/radio_menu.jl | 8 ++++---- stdlib/REPL/test/TerminalMenus/runtests.jl | 11 ++++++----- 9 files changed, 33 insertions(+), 25 deletions(-) diff --git a/stdlib/Distributed/src/cluster.jl b/stdlib/Distributed/src/cluster.jl index 5e90f231f59b1..b7268a7e053ee 100644 --- a/stdlib/Distributed/src/cluster.jl +++ b/stdlib/Distributed/src/cluster.jl @@ -232,7 +232,10 @@ start_worker(cookie::AbstractString=readline(stdin); kwargs...) = start_worker(s function start_worker(out::IO, cookie::AbstractString=readline(stdin); close_stdin::Bool=true, stderr_to_stdout::Bool=true) init_multi() - close_stdin && close(stdin) # workers will not use it + if close_stdin # workers will not use it + redirect_stdin(devnull) + close(stdin) + end stderr_to_stdout && redirect_stderr(stdout) init_worker(cookie) diff --git a/stdlib/Distributed/test/distributed_exec.jl b/stdlib/Distributed/test/distributed_exec.jl index d2d46aebf0f1b..4819623ccf9e1 100644 --- a/stdlib/Distributed/test/distributed_exec.jl +++ b/stdlib/Distributed/test/distributed_exec.jl @@ -1616,7 +1616,11 @@ cluster_cookie("") for close_stdin in (true, false), stderr_to_stdout in (true, false) local npids = addprocs_with_testenv(RetainStdioTester(close_stdin,stderr_to_stdout)) @test remotecall_fetch(myid, npids[1]) == npids[1] - @test close_stdin != remotecall_fetch(()->isopen(stdin), npids[1]) + if close_stdin + @test remotecall_fetch(()->stdin === devnull && !isreadable(stdin), npids[1]) + else + @test remotecall_fetch(()->stdin !== devnull && isopen(stdin) && isreadable(stdin), npids[1]) + end @test stderr_to_stdout == remotecall_fetch(()->(stderr === stdout), npids[1]) rmprocs(npids) end diff --git a/stdlib/REPL/src/TerminalMenus/util.jl b/stdlib/REPL/src/TerminalMenus/util.jl index 8ad9ec0e4100d..91e336070d2cf 100644 --- a/stdlib/REPL/src/TerminalMenus/util.jl +++ b/stdlib/REPL/src/TerminalMenus/util.jl @@ -17,24 +17,24 @@ readbyte(stream::IO=stdin) = read(stream, Char) # Read the next key from stdin. It is also able to read several bytes for # escaped keys such as the arrow keys, home/end keys, etc. # Escaped keys are returned using the `Key` enum. -readkey(stream::Base.LibuvStream=stdin) = UInt32(_readkey(stream)) -function _readkey(stream::Base.LibuvStream=stdin) +readkey(stream::IO=stdin) = UInt32(_readkey(stream)) +function _readkey(stream::IO=stdin) c = readbyte(stream) # Escape characters if c == '\x1b' - stream.buffer.size < 2 && return '\x1b' + bytesavailable(stream) < 1 && return '\x1b' esc_a = readbyte(stream) esc_a == 'v' && return PAGE_UP # M-v esc_a == '<' && return HOME_KEY # M-< esc_a == '>' && return END_KEY # M-> - stream.buffer.size < 3 && return '\x1b' + bytesavailable(stream) < 1 && return '\x1b' esc_b = readbyte(stream) if esc_a == '[' || esc_a == 'O' if esc_b >= '0' && esc_b <= '9' - stream.buffer.size < 4 && return '\x1b' + bytesavailable(stream) < 1 && return '\x1b' esc_c = readbyte(stream) if esc_c == '~' esc_b == '1' && return HOME_KEY diff --git a/stdlib/REPL/test/TerminalMenus/legacytests/old_multiselect_menu.jl b/stdlib/REPL/test/TerminalMenus/legacytests/old_multiselect_menu.jl index 49dbcc42c3095..9902a992ea081 100644 --- a/stdlib/REPL/test/TerminalMenus/legacytests/old_multiselect_menu.jl +++ b/stdlib/REPL/test/TerminalMenus/legacytests/old_multiselect_menu.jl @@ -33,6 +33,6 @@ TerminalMenus.writeLine(buf, multi_menu, 1, true) # Test SDTIN multi_menu = MultiSelectMenu(string.(1:10), warn=false) -@test simulate_input(Set([1,2]), multi_menu, :enter, :down, :enter, 'd') +@test simulate_input(multi_menu, :enter, :down, :enter, 'd') == Set([1,2]) multi_menu = MultiSelectMenu(["single option"], warn=false) -@test simulate_input(Set([1]), multi_menu, :up, :up, :down, :enter, 'd') +@test simulate_input(multi_menu, :up, :up, :down, :enter, 'd') == Set([1]) diff --git a/stdlib/REPL/test/TerminalMenus/legacytests/old_radio_menu.jl b/stdlib/REPL/test/TerminalMenus/legacytests/old_radio_menu.jl index 9438808a847d6..248d5cd6a3183 100644 --- a/stdlib/REPL/test/TerminalMenus/legacytests/old_radio_menu.jl +++ b/stdlib/REPL/test/TerminalMenus/legacytests/old_radio_menu.jl @@ -36,8 +36,8 @@ TerminalMenus.writeLine(buf, radio_menu, 1, true) # Test using stdin radio_menu = RadioMenu(string.(1:10), warn=false) -@test simulate_input(3, radio_menu, :down, :down, :enter) +@test simulate_input(radio_menu, :down, :down, :enter) == 3 radio_menu = RadioMenu(["single option"], warn=false) -@test simulate_input(1, radio_menu, :up, :up, :down, :up, :enter) +@test simulate_input(radio_menu, :up, :up, :down, :up, :enter) == 1 radio_menu = RadioMenu(string.(1:3), pagesize=1, warn=false) -@test simulate_input(3, radio_menu, :down, :down, :down, :down, :enter) +@test simulate_input(radio_menu, :down, :down, :down, :down, :enter) == 3 diff --git a/stdlib/REPL/test/TerminalMenus/multiselect_menu.jl b/stdlib/REPL/test/TerminalMenus/multiselect_menu.jl index d625554c813b0..d6568fb6b04c1 100644 --- a/stdlib/REPL/test/TerminalMenus/multiselect_menu.jl +++ b/stdlib/REPL/test/TerminalMenus/multiselect_menu.jl @@ -52,6 +52,6 @@ end # Test SDTIN multi_menu = MultiSelectMenu(string.(1:10), charset=:ascii) -@test simulate_input(Set([1,2]), multi_menu, :enter, :down, :enter, 'd') +@test simulate_input(multi_menu, :enter, :down, :enter, 'd') == Set([1,2]) multi_menu = MultiSelectMenu(["single option"], charset=:ascii) -@test simulate_input(Set([1]), multi_menu, :up, :up, :down, :enter, 'd') +@test simulate_input(multi_menu, :up, :up, :down, :enter, 'd') == Set([1]) diff --git a/stdlib/REPL/test/TerminalMenus/multiselect_with_skip_menu.jl b/stdlib/REPL/test/TerminalMenus/multiselect_with_skip_menu.jl index 84f259ad7642c..609b168c2ddba 100644 --- a/stdlib/REPL/test/TerminalMenus/multiselect_with_skip_menu.jl +++ b/stdlib/REPL/test/TerminalMenus/multiselect_with_skip_menu.jl @@ -121,10 +121,10 @@ menu = MultiSelectWithSkipMenu(string.(1:5), selected=[2, 3]) buf = IOBuffer() TerminalMenus.printmenu(buf, menu, 1; init=true) @test occursin("2 items selected", String(take!(buf))) -@test simulate_input(Set([2, 3, 4]), menu, 'n', :enter, 'd') +@test simulate_input(menu, 'n', :enter, 'd') == Set([2, 3, 4]) buf = IOBuffer() TerminalMenus.printmenu(buf, menu, 1; init=true) @test occursin("3 items selected", String(take!(buf))) menu = MultiSelectWithSkipMenu(string.(1:5), selected=[2, 3]) -@test simulate_input(Set([2]), menu, 'P', :enter, 'd', cursor=5) +@test simulate_input(menu, 'P', :enter, 'd', cursor=5) == Set([2]) diff --git a/stdlib/REPL/test/TerminalMenus/radio_menu.jl b/stdlib/REPL/test/TerminalMenus/radio_menu.jl index 696be1324a8e3..5ca6422717425 100644 --- a/stdlib/REPL/test/TerminalMenus/radio_menu.jl +++ b/stdlib/REPL/test/TerminalMenus/radio_menu.jl @@ -45,10 +45,10 @@ end # Test using stdin radio_menu = RadioMenu(string.(1:10); charset=:ascii) -@test simulate_input(3, radio_menu, :down, :down, :enter) +@test simulate_input(radio_menu, :down, :down, :enter) == 3 radio_menu = RadioMenu(["single option"], charset=:ascii) -@test simulate_input(1, radio_menu, :up, :up, :down, :up, :enter) +@test simulate_input(radio_menu, :up, :up, :down, :up, :enter) == 1 radio_menu = RadioMenu(string.(1:3), pagesize=1, charset=:ascii) -@test simulate_input(3, radio_menu, :down, :down, :down, :down, :enter) +@test simulate_input(radio_menu, :down, :down, :down, :down, :enter) == 3 radio_menu = RadioMenu(["apple", "banana", "cherry"]; keybindings=collect('a':'c'), charset=:ascii) -@test simulate_input(2, radio_menu, 'b') +@test simulate_input(radio_menu, 'b') == 2 diff --git a/stdlib/REPL/test/TerminalMenus/runtests.jl b/stdlib/REPL/test/TerminalMenus/runtests.jl index 62a91cc0a1256..c594958a36670 100644 --- a/stdlib/REPL/test/TerminalMenus/runtests.jl +++ b/stdlib/REPL/test/TerminalMenus/runtests.jl @@ -4,21 +4,22 @@ import REPL using REPL.TerminalMenus using Test -function simulate_input(expected, menu::TerminalMenus.AbstractMenu, keys...; - kwargs...) +function simulate_input(menu::TerminalMenus.AbstractMenu, keys...; kwargs...) keydict = Dict(:up => "\e[A", :down => "\e[B", :enter => "\r") + new_stdin = Base.BufferStream() for key in keys if isa(key, Symbol) - write(stdin.buffer, keydict[key]) + write(new_stdin, keydict[key]) else - write(stdin.buffer, "$key") + write(new_stdin, "$key") end end + TerminalMenus.terminal.in_stream = new_stdin - request(menu; suppress_output=true, kwargs...) == expected + return request(menu; suppress_output=true, kwargs...) end include("radio_menu.jl") From 2cf85b615ef3a3264b670e0ef2bff8a64532a0e8 Mon Sep 17 00:00:00 2001 From: pchintalapudi <34727397+pchintalapudi@users.noreply.github.com> Date: Tue, 24 May 2022 23:12:07 +0200 Subject: [PATCH 172/369] Fix use-after-free bugs in debuginfo (#45016) Co-authored-by: Dilum Aluthge --- src/Makefile | 8 +- src/codegen.cpp | 3 - src/debug-registry.h | 183 ++++++++++++ src/debuginfo.cpp | 670 +++++++++++++++++++++---------------------- src/jitlayers.h | 7 + src/processor.h | 5 + 6 files changed, 529 insertions(+), 347 deletions(-) create mode 100644 src/debug-registry.h diff --git a/src/Makefile b/src/Makefile index b7235597fd08c..e0ab9568fd242 100644 --- a/src/Makefile +++ b/src/Makefile @@ -279,12 +279,12 @@ $(BUILDDIR)/julia_flisp.boot: $(addprefix $(SRCDIR)/,jlfrontend.scm flisp/aliase # additional dependency links $(BUILDDIR)/codegen-stubs.o $(BUILDDIR)/codegen-stubs.dbg.obj: $(SRCDIR)/intrinsics.h -$(BUILDDIR)/aotcompile.o $(BUILDDIR)/aotcompile.dbg.obj: $(SRCDIR)/jitlayers.h $(SRCDIR)/codegen_shared.h +$(BUILDDIR)/aotcompile.o $(BUILDDIR)/aotcompile.dbg.obj: $(SRCDIR)/jitlayers.h $(SRCDIR)/codegen_shared.h $(SRCDIR)/debug-registry.h $(BUILDDIR)/ast.o $(BUILDDIR)/ast.dbg.obj: $(BUILDDIR)/julia_flisp.boot.inc $(SRCDIR)/flisp/*.h $(BUILDDIR)/builtins.o $(BUILDDIR)/builtins.dbg.obj: $(SRCDIR)/iddict.c $(SRCDIR)/builtin_proto.h $(BUILDDIR)/codegen.o $(BUILDDIR)/codegen.dbg.obj: $(addprefix $(SRCDIR)/,\ - intrinsics.cpp jitlayers.h intrinsics.h codegen_shared.h cgutils.cpp ccall.cpp abi_*.cpp processor.h builtin_proto.h) -$(BUILDDIR)/debuginfo.o $(BUILDDIR)/debuginfo.dbg.obj: $(addprefix $(SRCDIR)/,debuginfo.h processor.h) + intrinsics.cpp jitlayers.h debug-registry.h intrinsics.h codegen_shared.h cgutils.cpp ccall.cpp abi_*.cpp processor.h builtin_proto.h) +$(BUILDDIR)/debuginfo.o $(BUILDDIR)/debuginfo.dbg.obj: $(addprefix $(SRCDIR)/,debuginfo.h processor.h jitlayers.h debug-registry.h) $(BUILDDIR)/disasm.o $(BUILDDIR)/disasm.dbg.obj: $(SRCDIR)/debuginfo.h $(SRCDIR)/processor.h $(BUILDDIR)/dump.o $(BUILDDIR)/dump.dbg.obj: $(addprefix $(SRCDIR)/,common_symbols1.inc common_symbols2.inc builtin_proto.h serialize.h) $(BUILDDIR)/gc-debug.o $(BUILDDIR)/gc-debug.dbg.obj: $(SRCDIR)/gc.h @@ -292,7 +292,7 @@ $(BUILDDIR)/gc-pages.o $(BUILDDIR)/gc-pages.dbg.obj: $(SRCDIR)/gc.h $(BUILDDIR)/gc.o $(BUILDDIR)/gc.dbg.obj: $(SRCDIR)/gc.h $(SRCDIR)/gc-alloc-profiler.h $(BUILDDIR)/init.o $(BUILDDIR)/init.dbg.obj: $(SRCDIR)/builtin_proto.h $(BUILDDIR)/interpreter.o $(BUILDDIR)/interpreter.dbg.obj: $(SRCDIR)/builtin_proto.h -$(BUILDDIR)/jitlayers.o $(BUILDDIR)/jitlayers.dbg.obj: $(SRCDIR)/jitlayers.h $(SRCDIR)/codegen_shared.h +$(BUILDDIR)/jitlayers.o $(BUILDDIR)/jitlayers.dbg.obj: $(SRCDIR)/jitlayers.h $(SRCDIR)/codegen_shared.h $(SRCDIR)/debug-registry.h $(BUILDDIR)/jltypes.o $(BUILDDIR)/jltypes.dbg.obj: $(SRCDIR)/builtin_proto.h $(build_shlibdir)/libllvmcalltest.$(SHLIB_EXT): $(SRCDIR)/codegen_shared.h $(BUILDDIR)/julia_version.h $(BUILDDIR)/llvm-alloc-helpers.o $(BUILDDIR)/llvm-alloc-helpers.dbg.obj: $(SRCDIR)/codegen_shared.h $(SRCDIR)/llvm-pass-helpers.h $(SRCDIR)/llvm-alloc-helpers.h diff --git a/src/codegen.cpp b/src/codegen.cpp index cccb4b12cfc1d..517577df0f324 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -8155,8 +8155,6 @@ char jl_using_oprofile_jitevents = 0; // Non-zero if running under OProfile char jl_using_perf_jitevents = 0; #endif -void jl_init_debuginfo(void); - extern "C" void jl_init_llvm(void) { builtin_func_map = @@ -8199,7 +8197,6 @@ extern "C" void jl_init_llvm(void) jl_default_debug_info_kind = (int) DICompileUnit::DebugEmissionKind::FullDebug; imaging_mode = jl_options.image_codegen || (jl_generating_output() && !jl_options.incremental); jl_default_cgparams.generic_context = jl_nothing; - jl_init_debuginfo(); InitializeNativeTarget(); InitializeNativeTargetAsmPrinter(); diff --git a/src/debug-registry.h b/src/debug-registry.h new file mode 100644 index 0000000000000..dfdb09ca84519 --- /dev/null +++ b/src/debug-registry.h @@ -0,0 +1,183 @@ +#include +#include +#include + +#include "julia_internal.h" +#include "processor.h" + +#include +#include +#include + +typedef struct { + const llvm::object::ObjectFile *obj; + llvm::DIContext *ctx; + int64_t slide; +} objfileentry_t; + + +// Central registry for resolving function addresses to `jl_method_instance_t`s and +// originating `ObjectFile`s (for the DWARF debug info). +// +// A global singleton instance is notified by the JIT whenever a new object is emitted, +// and later queried by the various function info APIs. We also use the chance to handle +// some platform-specific unwind info registration (which is unrelated to the query +// functionality). +class JITDebugInfoRegistry +{ +public: + template + struct Locked { + + template + struct Lock { + std::unique_lock lock; + CResourceT &resource; + + Lock(std::mutex &mutex, CResourceT &resource) JL_NOTSAFEPOINT : lock(mutex), resource(resource) {} + Lock(Lock &&) JL_NOTSAFEPOINT = default; + Lock &operator=(Lock &&) JL_NOTSAFEPOINT = default; + + CResourceT &operator*() JL_NOTSAFEPOINT { + return resource; + } + + const CResourceT &operator*() const JL_NOTSAFEPOINT { + return resource; + } + + CResourceT *operator->() JL_NOTSAFEPOINT { + return &**this; + } + + const CResourceT *operator->() const JL_NOTSAFEPOINT { + return &**this; + } + + operator const CResourceT &() const JL_NOTSAFEPOINT { + return resource; + } + + ~Lock() JL_NOTSAFEPOINT = default; + }; + private: + + mutable std::mutex mutex; + ResourceT resource; + public: + typedef Lock LockT; + typedef Lock ConstLockT; + + Locked(ResourceT resource = ResourceT()) JL_NOTSAFEPOINT : mutex(), resource(std::move(resource)) {} + + LockT operator*() JL_NOTSAFEPOINT { + return LockT(mutex, resource); + } + + ConstLockT operator*() const JL_NOTSAFEPOINT { + return ConstLockT(mutex, resource); + } + + ~Locked() JL_NOTSAFEPOINT = default; + }; + + template + struct jl_pthread_key_t { + static_assert(std::is_trivially_default_constructible::value, "Invalid datatype for pthread key!"); + static_assert(std::is_trivially_destructible::value, "Expected datatype to be trivially destructible!"); + static_assert(sizeof(datatype) == sizeof(void*), "Expected datatype to be like a void*!"); + pthread_key_t key; + + void init() JL_NOTSAFEPOINT { + if (pthread_key_create(&key, NULL)) + jl_error("fatal: pthread_key_create failed"); + } + + operator datatype() JL_NOTSAFEPOINT { + return reinterpret_cast(pthread_getspecific(key)); + } + + jl_pthread_key_t &operator=(datatype val) JL_NOTSAFEPOINT { + pthread_setspecific(key, reinterpret_cast(val)); + return *this; + } + + void destroy() JL_NOTSAFEPOINT { + pthread_key_delete(key); + } + }; + + struct sysimg_info_t { + uint64_t jl_sysimage_base; + jl_sysimg_fptrs_t sysimg_fptrs; + jl_method_instance_t **sysimg_fvars_linfo; + size_t sysimg_fvars_n; + }; + + struct libc_frames_t { +#if defined(_OS_DARWIN_) && defined(LLVM_SHLIB) + std::atomic libc_register_frame_{nullptr}; + std::atomic libc_deregister_frame_{nullptr}; + + void libc_register_frame(const char *Entry) JL_NOTSAFEPOINT; + + void libc_deregister_frame(const char *Entry) JL_NOTSAFEPOINT; +#endif + }; +private: + + struct ObjectInfo { + const llvm::object::ObjectFile *object = nullptr; + size_t SectionSize = 0; + ptrdiff_t slide = 0; + llvm::object::SectionRef Section{}; + llvm::DIContext *context = nullptr; + }; + + template + using rev_map = std::map>; + + typedef rev_map objectmap_t; + typedef rev_map objfilemap_t; + + objectmap_t objectmap{}; + rev_map> linfomap{}; + + // Maintain a mapping of unrealized function names -> linfo objects + // so that when we see it get emitted, we can add a link back to the linfo + // that it came from (providing name, type signature, file info, etc.) + Locked> codeinst_in_flight{}; + + Locked sysimg_info{}; + + Locked objfilemap{}; + + static std::string mangle(llvm::StringRef Name, const llvm::DataLayout &DL) JL_NOTSAFEPOINT; + +public: + + JITDebugInfoRegistry() JL_NOTSAFEPOINT; + ~JITDebugInfoRegistry() JL_NOTSAFEPOINT = default; + + // Any function that acquires this lock must be either a unmanaged thread + // or in the GC safe region and must NOT allocate anything through the GC + // while holding this lock. + // Certain functions in this file might be called from an unmanaged thread + // and cannot have any interaction with the julia runtime + // They also may be re-entrant, and operating while threads are paused, so we + // separately manage the re-entrant count behavior for safety across platforms + // Note that we cannot safely upgrade read->write + uv_rwlock_t debuginfo_asyncsafe{}; + jl_pthread_key_t debuginfo_asyncsafe_held{}; + libc_frames_t libc_frames{}; + + void add_code_in_flight(llvm::StringRef name, jl_code_instance_t *codeinst, const llvm::DataLayout &DL) JL_NOTSAFEPOINT; + jl_method_instance_t *lookupLinfo(size_t pointer) JL_NOTSAFEPOINT; + void registerJITObject(const llvm::object::ObjectFile &Object, + std::function getLoadAddress, + std::function lookupWriteAddress) JL_NOTSAFEPOINT; + objectmap_t& getObjectMap() JL_NOTSAFEPOINT; + void set_sysimg_info(sysimg_info_t info) JL_NOTSAFEPOINT; + Locked::ConstLockT get_sysimg_info() const JL_NOTSAFEPOINT; + Locked::LockT get_objfile_map() JL_NOTSAFEPOINT; +}; diff --git a/src/debuginfo.cpp b/src/debuginfo.cpp index 0e246160a3c16..76a203eead0db 100644 --- a/src/debuginfo.cpp +++ b/src/debuginfo.cpp @@ -34,47 +34,129 @@ using namespace llvm; #include #include #include +#include #include "julia_assert.h" #ifdef _OS_DARWIN_ #include #endif -typedef object::SymbolRef SymRef; +#include "jitlayers.h" -// Any function that acquires this lock must be either a unmanaged thread -// or in the GC safe region and must NOT allocate anything through the GC -// while holding this lock. -// Certain functions in this file might be called from an unmanaged thread -// and cannot have any interaction with the julia runtime -// They also may be re-entrant, and operating while threads are paused, so we -// separately manage the re-entrant count behavior for safety across platforms -// Note that we cannot safely upgrade read->write -static uv_rwlock_t debuginfo_asyncsafe; -static pthread_key_t debuginfo_asyncsafe_held; +static JITDebugInfoRegistry &getJITDebugRegistry() JL_NOTSAFEPOINT { + return jl_ExecutionEngine->getDebugInfoRegistry(); +} + +struct debug_link_info { + StringRef filename; + uint32_t crc32; +}; + +extern "C" JL_DLLEXPORT void jl_lock_profile_impl(void) JL_NOTSAFEPOINT; +extern "C" JL_DLLEXPORT void jl_unlock_profile_impl(void) JL_NOTSAFEPOINT; + +template +static void jl_profile_atomic(T f); + +#if (defined(_OS_LINUX_) || defined(_OS_FREEBSD_) || (defined(_OS_DARWIN_) && defined(LLVM_SHLIB))) +extern "C" void __register_frame(void*); +extern "C" void __deregister_frame(void*); + +template +static void processFDEs(const char *EHFrameAddr, size_t EHFrameSize, callback f) +{ + const char *P = EHFrameAddr; + const char *End = P + EHFrameSize; + do { + const char *Entry = P; + P += 4; + assert(P <= End); + uint32_t Length = *(const uint32_t*)Entry; + // Length == 0: Terminator + if (Length == 0) + break; + assert(P + Length <= End); + uint32_t Offset = *(const uint32_t*)P; + // Offset == 0: CIE + if (Offset != 0) + f(Entry); + P += Length; + } while (P != End); +} +#endif + +std::string JITDebugInfoRegistry::mangle(StringRef Name, const DataLayout &DL) JL_NOTSAFEPOINT +{ + std::string MangledName; + { + raw_string_ostream MangledNameStream(MangledName); + Mangler::getNameWithPrefix(MangledNameStream, Name, DL); + } + return MangledName; +} + +void JITDebugInfoRegistry::add_code_in_flight(StringRef name, jl_code_instance_t *codeinst, const DataLayout &DL) JL_NOTSAFEPOINT { + (**codeinst_in_flight)[mangle(name, DL)] = codeinst; +} + +jl_method_instance_t *JITDebugInfoRegistry::lookupLinfo(size_t pointer) JL_NOTSAFEPOINT +{ + jl_lock_profile_impl(); + auto region = linfomap.lower_bound(pointer); + jl_method_instance_t *linfo = NULL; + if (region != linfomap.end() && pointer < region->first + region->second.first) + linfo = region->second.second; + jl_unlock_profile_impl(); + return linfo; +} -void jl_init_debuginfo(void) +//Protected by debuginfo_asyncsafe +JITDebugInfoRegistry::objectmap_t & +JITDebugInfoRegistry::getObjectMap() JL_NOTSAFEPOINT { + return objectmap; +} + +void JITDebugInfoRegistry::set_sysimg_info(sysimg_info_t info) JL_NOTSAFEPOINT { + (**this->sysimg_info) = info; +} + +JITDebugInfoRegistry::Locked::ConstLockT +JITDebugInfoRegistry::get_sysimg_info() const JL_NOTSAFEPOINT { + return *this->sysimg_info; +} + +JITDebugInfoRegistry::Locked::LockT +JITDebugInfoRegistry::get_objfile_map() JL_NOTSAFEPOINT { + return *this->objfilemap; +} + +JITDebugInfoRegistry::JITDebugInfoRegistry() JL_NOTSAFEPOINT { uv_rwlock_init(&debuginfo_asyncsafe); - if (pthread_key_create(&debuginfo_asyncsafe_held, NULL)) - jl_error("fatal: pthread_key_create failed"); + debuginfo_asyncsafe_held.init(); } -extern "C" JL_DLLEXPORT void jl_lock_profile_impl(void) +struct unw_table_entry +{ + int32_t start_ip_offset; + int32_t fde_offset; +}; + +extern "C" JL_DLLEXPORT void jl_lock_profile_impl(void) JL_NOTSAFEPOINT { - uintptr_t held = (uintptr_t)pthread_getspecific(debuginfo_asyncsafe_held); + uintptr_t held = getJITDebugRegistry().debuginfo_asyncsafe_held; if (held++ == 0) - uv_rwlock_rdlock(&debuginfo_asyncsafe); - pthread_setspecific(debuginfo_asyncsafe_held, (void*)held); + uv_rwlock_rdlock(&getJITDebugRegistry().debuginfo_asyncsafe); + getJITDebugRegistry().debuginfo_asyncsafe_held = held; } -extern "C" JL_DLLEXPORT void jl_unlock_profile_impl(void) +extern "C" JL_DLLEXPORT void jl_unlock_profile_impl(void) JL_NOTSAFEPOINT { - uintptr_t held = (uintptr_t)pthread_getspecific(debuginfo_asyncsafe_held); + uintptr_t held = getJITDebugRegistry().debuginfo_asyncsafe_held; assert(held); if (--held == 0) - uv_rwlock_rdunlock(&debuginfo_asyncsafe); - pthread_setspecific(debuginfo_asyncsafe_held, (void*)held); + uv_rwlock_rdunlock(&getJITDebugRegistry().debuginfo_asyncsafe); + getJITDebugRegistry().debuginfo_asyncsafe_held = held; } // some actions aren't signal (especially profiler) safe so we acquire a lock @@ -82,8 +164,8 @@ extern "C" JL_DLLEXPORT void jl_unlock_profile_impl(void) template static void jl_profile_atomic(T f) { - assert(0 == (uintptr_t)pthread_getspecific(debuginfo_asyncsafe_held)); - uv_rwlock_wrlock(&debuginfo_asyncsafe); + assert(0 == getJITDebugRegistry().debuginfo_asyncsafe_held); + uv_rwlock_wrlock(&getJITDebugRegistry().debuginfo_asyncsafe); #ifndef _OS_WINDOWS_ sigset_t sset; sigset_t oset; @@ -94,36 +176,14 @@ static void jl_profile_atomic(T f) #ifndef _OS_WINDOWS_ pthread_sigmask(SIG_SETMASK, &oset, NULL); #endif - uv_rwlock_wrunlock(&debuginfo_asyncsafe); + uv_rwlock_wrunlock(&getJITDebugRegistry().debuginfo_asyncsafe); } // --- storing and accessing source location metadata --- - -struct ObjectInfo { - const object::ObjectFile *object; - size_t SectionSize; - ptrdiff_t slide; - object::SectionRef Section; - DIContext *context; -}; - -// Maintain a mapping of unrealized function names -> linfo objects -// so that when we see it get emitted, we can add a link back to the linfo -// that it came from (providing name, type signature, file info, etc.) -static StringMap codeinst_in_flight; -static std::string mangle(StringRef Name, const DataLayout &DL) -{ - std::string MangledName; - { - raw_string_ostream MangledNameStream(MangledName); - Mangler::getNameWithPrefix(MangledNameStream, Name, DL); - } - return MangledName; -} void jl_add_code_in_flight(StringRef name, jl_code_instance_t *codeinst, const DataLayout &DL) { - codeinst_in_flight[mangle(name, DL)] = codeinst; + getJITDebugRegistry().add_code_in_flight(name, codeinst, DL); } @@ -181,218 +241,184 @@ static void create_PRUNTIME_FUNCTION(uint8_t *Code, size_t Size, StringRef fnnam } #endif -struct revcomp { - bool operator() (const size_t& lhs, const size_t& rhs) const - { return lhs>rhs; } -}; - - -// Central registry for resolving function addresses to `jl_method_instance_t`s and -// originating `ObjectFile`s (for the DWARF debug info). -// -// A global singleton instance is notified by the JIT whenever a new object is emitted, -// and later queried by the various function info APIs. We also use the chance to handle -// some platform-specific unwind info registration (which is unrelated to the query -// functionality). -class JITObjectRegistry +void JITDebugInfoRegistry::registerJITObject(const object::ObjectFile &Object, + std::function getLoadAddress, + std::function lookupWriteAddress) { - std::map objectmap; - std::map, revcomp> linfomap; + jl_ptls_t ptls = jl_current_task->ptls; + // This function modify codeinst->fptr in GC safe region. + // This should be fine since the GC won't scan this field. + int8_t gc_state = jl_gc_safe_enter(ptls); -public: - jl_method_instance_t *lookupLinfo(size_t pointer) JL_NOTSAFEPOINT - { - jl_lock_profile_impl(); - auto region = linfomap.lower_bound(pointer); - jl_method_instance_t *linfo = NULL; - if (region != linfomap.end() && pointer < region->first + region->second.first) - linfo = region->second.second; - jl_unlock_profile_impl(); - return linfo; - } - - void registerJITObject(const object::ObjectFile &Object, - std::function getLoadAddress, - std::function lookupWriteAddress) - { - jl_ptls_t ptls = jl_current_task->ptls; - // This function modify codeinst->fptr in GC safe region. - // This should be fine since the GC won't scan this field. - int8_t gc_state = jl_gc_safe_enter(ptls); - - object::section_iterator EndSection = Object.section_end(); + object::section_iterator EndSection = Object.section_end(); #ifdef _CPU_ARM_ - // ARM does not have/use .eh_frame - uint64_t arm_exidx_addr = 0; - size_t arm_exidx_len = 0; - uint64_t arm_text_addr = 0; - size_t arm_text_len = 0; - for (auto §ion: Object.sections()) { - bool istext = false; - if (section.isText()) { - istext = true; - } - else { - auto sName = section.getName(); - if (!sName) - continue; - if (sName.get() != ".ARM.exidx") { - continue; - } + // ARM does not have/use .eh_frame + uint64_t arm_exidx_addr = 0; + size_t arm_exidx_len = 0; + uint64_t arm_text_addr = 0; + size_t arm_text_len = 0; + for (auto §ion: Object.sections()) { + bool istext = false; + if (section.isText()) { + istext = true; + } + else { + auto sName = section.getName(); + if (!sName) + continue; + if (sName.get() != ".ARM.exidx") { + continue; } - uint64_t loadaddr = getLoadAddress(section.getName().get()); - size_t seclen = section.getSize(); - if (istext) { - arm_text_addr = loadaddr; - arm_text_len = seclen; - if (!arm_exidx_addr) { - continue; - } + } + uint64_t loadaddr = getLoadAddress(section.getName().get()); + size_t seclen = section.getSize(); + if (istext) { + arm_text_addr = loadaddr; + arm_text_len = seclen; + if (!arm_exidx_addr) { + continue; } - else { - arm_exidx_addr = loadaddr; - arm_exidx_len = seclen; - if (!arm_text_addr) { - continue; - } + } + else { + arm_exidx_addr = loadaddr; + arm_exidx_len = seclen; + if (!arm_text_addr) { + continue; } - unw_dyn_info_t *di = new unw_dyn_info_t; - di->gp = 0; - di->format = UNW_INFO_FORMAT_ARM_EXIDX; - di->start_ip = (uintptr_t)arm_text_addr; - di->end_ip = (uintptr_t)(arm_text_addr + arm_text_len); - di->u.rti.name_ptr = 0; - di->u.rti.table_data = arm_exidx_addr; - di->u.rti.table_len = arm_exidx_len; - jl_profile_atomic([&]() { - _U_dyn_register(di); - }); - break; } + unw_dyn_info_t *di = new unw_dyn_info_t; + di->gp = 0; + di->format = UNW_INFO_FORMAT_ARM_EXIDX; + di->start_ip = (uintptr_t)arm_text_addr; + di->end_ip = (uintptr_t)(arm_text_addr + arm_text_len); + di->u.rti.name_ptr = 0; + di->u.rti.table_data = arm_exidx_addr; + di->u.rti.table_len = arm_exidx_len; + jl_profile_atomic([&]() { + _U_dyn_register(di); + }); + break; + } #endif #if defined(_OS_WINDOWS_) - uint64_t SectionAddrCheck = 0; - uint64_t SectionLoadCheck = 0; (void)SectionLoadCheck; - uint64_t SectionWriteCheck = 0; (void)SectionWriteCheck; - uint8_t *UnwindData = NULL; + uint64_t SectionAddrCheck = 0; + uint64_t SectionLoadCheck = 0; (void)SectionLoadCheck; + uint64_t SectionWriteCheck = 0; (void)SectionWriteCheck; + uint8_t *UnwindData = NULL; #if defined(_CPU_X86_64_) - uint8_t *catchjmp = NULL; - for (const object::SymbolRef &sym_iter : Object.symbols()) { - StringRef sName = cantFail(sym_iter.getName()); - if (sName.equals("__UnwindData") || sName.equals("__catchjmp")) { - uint64_t Addr = cantFail(sym_iter.getAddress()); - auto Section = cantFail(sym_iter.getSection()); - assert(Section != EndSection && Section->isText()); - uint64_t SectionAddr = Section->getAddress(); - StringRef secName = cantFail(Section->getName()); - uint64_t SectionLoadAddr = getLoadAddress(secName); - assert(SectionLoadAddr); - if (SectionAddrCheck) // assert that all of the Sections are at the same location - assert(SectionAddrCheck == SectionAddr && - SectionLoadCheck == SectionLoadAddr); - SectionAddrCheck = SectionAddr; - SectionLoadCheck = SectionLoadAddr; - SectionWriteCheck = SectionLoadAddr; - if (lookupWriteAddress) - SectionWriteCheck = (uintptr_t)lookupWriteAddress((void*)SectionLoadAddr); - Addr += SectionWriteCheck - SectionLoadCheck; - if (sName.equals("__UnwindData")) { - UnwindData = (uint8_t*)Addr; - } - else if (sName.equals("__catchjmp")) { - catchjmp = (uint8_t*)Addr; - } - } - } - assert(catchjmp); - assert(UnwindData); - assert(SectionAddrCheck); - assert(SectionLoadCheck); - assert(!memcmp(catchjmp, "\0\0\0\0\0\0\0\0\0\0\0\0", 12) && - !memcmp(UnwindData, "\0\0\0\0\0\0\0\0\0\0\0\0", 12)); - catchjmp[0] = 0x48; - catchjmp[1] = 0xb8; // mov RAX, QWORD PTR [&__julia_personality] - *(uint64_t*)(&catchjmp[2]) = (uint64_t)&__julia_personality; - catchjmp[10] = 0xff; - catchjmp[11] = 0xe0; // jmp RAX - UnwindData[0] = 0x09; // version info, UNW_FLAG_EHANDLER - UnwindData[1] = 4; // size of prolog (bytes) - UnwindData[2] = 2; // count of unwind codes (slots) - UnwindData[3] = 0x05; // frame register (rbp) = rsp - UnwindData[4] = 4; // second instruction - UnwindData[5] = 0x03; // mov RBP, RSP - UnwindData[6] = 1; // first instruction - UnwindData[7] = 0x50; // push RBP - *(DWORD*)&UnwindData[8] = (DWORD)(catchjmp - (uint8_t*)SectionWriteCheck); // relative location of catchjmp - UnwindData -= SectionWriteCheck - SectionLoadCheck; -#endif // defined(_OS_X86_64_) -#endif // defined(_OS_WINDOWS_) - - auto symbols = object::computeSymbolSizes(Object); - bool first = true; - for (const auto &sym_size : symbols) { - const object::SymbolRef &sym_iter = sym_size.first; - object::SymbolRef::Type SymbolType = cantFail(sym_iter.getType()); - if (SymbolType != object::SymbolRef::ST_Function) continue; + uint8_t *catchjmp = NULL; + for (const object::SymbolRef &sym_iter : Object.symbols()) { + StringRef sName = cantFail(sym_iter.getName()); + if (sName.equals("__UnwindData") || sName.equals("__catchjmp")) { uint64_t Addr = cantFail(sym_iter.getAddress()); auto Section = cantFail(sym_iter.getSection()); - if (Section == EndSection) continue; - if (!Section->isText()) continue; + assert(Section != EndSection && Section->isText()); uint64_t SectionAddr = Section->getAddress(); StringRef secName = cantFail(Section->getName()); uint64_t SectionLoadAddr = getLoadAddress(secName); - Addr -= SectionAddr - SectionLoadAddr; - StringRef sName = cantFail(sym_iter.getName()); - uint64_t SectionSize = Section->getSize(); - size_t Size = sym_size.second; -#if defined(_OS_WINDOWS_) - if (SectionAddrCheck) + assert(SectionLoadAddr); + if (SectionAddrCheck) // assert that all of the Sections are at the same location assert(SectionAddrCheck == SectionAddr && - SectionLoadCheck == SectionLoadAddr); + SectionLoadCheck == SectionLoadAddr); SectionAddrCheck = SectionAddr; SectionLoadCheck = SectionLoadAddr; - create_PRUNTIME_FUNCTION( - (uint8_t*)(uintptr_t)Addr, (size_t)Size, sName, - (uint8_t*)(uintptr_t)SectionLoadAddr, (size_t)SectionSize, UnwindData); + SectionWriteCheck = SectionLoadAddr; + if (lookupWriteAddress) + SectionWriteCheck = (uintptr_t)lookupWriteAddress((void*)SectionLoadAddr); + Addr += SectionWriteCheck - SectionLoadCheck; + if (sName.equals("__UnwindData")) { + UnwindData = (uint8_t*)Addr; + } + else if (sName.equals("__catchjmp")) { + catchjmp = (uint8_t*)Addr; + } + } + } + assert(catchjmp); + assert(UnwindData); + assert(SectionAddrCheck); + assert(SectionLoadCheck); + assert(!memcmp(catchjmp, "\0\0\0\0\0\0\0\0\0\0\0\0", 12) && + !memcmp(UnwindData, "\0\0\0\0\0\0\0\0\0\0\0\0", 12)); + catchjmp[0] = 0x48; + catchjmp[1] = 0xb8; // mov RAX, QWORD PTR [&__julia_personality] + *(uint64_t*)(&catchjmp[2]) = (uint64_t)&__julia_personality; + catchjmp[10] = 0xff; + catchjmp[11] = 0xe0; // jmp RAX + UnwindData[0] = 0x09; // version info, UNW_FLAG_EHANDLER + UnwindData[1] = 4; // size of prolog (bytes) + UnwindData[2] = 2; // count of unwind codes (slots) + UnwindData[3] = 0x05; // frame register (rbp) = rsp + UnwindData[4] = 4; // second instruction + UnwindData[5] = 0x03; // mov RBP, RSP + UnwindData[6] = 1; // first instruction + UnwindData[7] = 0x50; // push RBP + *(DWORD*)&UnwindData[8] = (DWORD)(catchjmp - (uint8_t*)SectionWriteCheck); // relative location of catchjmp + UnwindData -= SectionWriteCheck - SectionLoadCheck; +#endif // defined(_OS_X86_64_) +#endif // defined(_OS_WINDOWS_) + + auto symbols = object::computeSymbolSizes(Object); + bool first = true; + for (const auto &sym_size : symbols) { + const object::SymbolRef &sym_iter = sym_size.first; + object::SymbolRef::Type SymbolType = cantFail(sym_iter.getType()); + if (SymbolType != object::SymbolRef::ST_Function) continue; + uint64_t Addr = cantFail(sym_iter.getAddress()); + auto Section = cantFail(sym_iter.getSection()); + if (Section == EndSection) continue; + if (!Section->isText()) continue; + uint64_t SectionAddr = Section->getAddress(); + StringRef secName = cantFail(Section->getName()); + uint64_t SectionLoadAddr = getLoadAddress(secName); + Addr -= SectionAddr - SectionLoadAddr; + StringRef sName = cantFail(sym_iter.getName()); + uint64_t SectionSize = Section->getSize(); + size_t Size = sym_size.second; +#if defined(_OS_WINDOWS_) + if (SectionAddrCheck) + assert(SectionAddrCheck == SectionAddr && + SectionLoadCheck == SectionLoadAddr); + SectionAddrCheck = SectionAddr; + SectionLoadCheck = SectionLoadAddr; + create_PRUNTIME_FUNCTION( + (uint8_t*)(uintptr_t)Addr, (size_t)Size, sName, + (uint8_t*)(uintptr_t)SectionLoadAddr, (size_t)SectionSize, UnwindData); #endif + jl_code_instance_t *codeinst = NULL; + { + auto lock = *this->codeinst_in_flight; + auto &codeinst_in_flight = *lock; StringMap::iterator codeinst_it = codeinst_in_flight.find(sName); - jl_code_instance_t *codeinst = NULL; if (codeinst_it != codeinst_in_flight.end()) { codeinst = codeinst_it->second; codeinst_in_flight.erase(codeinst_it); } - jl_profile_atomic([&]() { - if (codeinst) - linfomap[Addr] = std::make_pair(Size, codeinst->def); - if (first) { - ObjectInfo tmp = {&Object, - (size_t)SectionSize, - (ptrdiff_t)(SectionAddr - SectionLoadAddr), - *Section, - nullptr, - }; - objectmap[SectionLoadAddr] = tmp; - first = false; - } - }); } - jl_gc_safe_leave(ptls, gc_state); - } - - std::map& getObjectMap() JL_NOTSAFEPOINT - { - return objectmap; + jl_profile_atomic([&]() { + if (codeinst) + linfomap[Addr] = std::make_pair(Size, codeinst->def); + if (first) { + objectmap[SectionLoadAddr] = {&Object, + (size_t)SectionSize, + (ptrdiff_t)(SectionAddr - SectionLoadAddr), + *Section, + nullptr, + }; + first = false; + } + }); } -}; + jl_gc_safe_leave(ptls, gc_state); +} -static JITObjectRegistry jl_jit_object_registry; void jl_register_jit_object(const object::ObjectFile &Object, std::function getLoadAddress, std::function lookupWriteAddress) { - jl_jit_object_registry.registerJITObject(Object, getLoadAddress, lookupWriteAddress); + getJITDebugRegistry().registerJITObject(Object, getLoadAddress, lookupWriteAddress); } // TODO: convert the safe names from aotcomile.cpp:makeSafeName back into symbols @@ -462,10 +488,10 @@ static int lookup_pointer( // DWARFContext/DWARFUnit update some internal tables during these queries, so // a lock is needed. - assert(0 == (uintptr_t)pthread_getspecific(debuginfo_asyncsafe_held)); - uv_rwlock_wrlock(&debuginfo_asyncsafe); + assert(0 == getJITDebugRegistry().debuginfo_asyncsafe_held); + uv_rwlock_wrlock(&getJITDebugRegistry().debuginfo_asyncsafe); auto inlineInfo = context->getInliningInfoForAddress(makeAddress(Section, pointer + slide), infoSpec); - uv_rwlock_wrunlock(&debuginfo_asyncsafe); + uv_rwlock_wrunlock(&getJITDebugRegistry().debuginfo_asyncsafe); int fromC = (*frames)[0].fromC; int n_frames = inlineInfo.getNumberOfFrames(); @@ -488,9 +514,9 @@ static int lookup_pointer( info = inlineInfo.getFrame(i); } else { - uv_rwlock_wrlock(&debuginfo_asyncsafe); + uv_rwlock_wrlock(&getJITDebugRegistry().debuginfo_asyncsafe); info = context->getLineInfoForAddress(makeAddress(Section, pointer + slide), infoSpec); - uv_rwlock_wrunlock(&debuginfo_asyncsafe); + uv_rwlock_wrunlock(&getJITDebugRegistry().debuginfo_asyncsafe); } jl_frame_t *frame = &(*frames)[i]; @@ -534,13 +560,37 @@ static int lookup_pointer( #ifndef _OS_WINDOWS_ #include #endif -typedef struct { - const llvm::object::ObjectFile *obj; - DIContext *ctx; - int64_t slide; -} objfileentry_t; -typedef std::map obfiletype; -static obfiletype objfilemap; + + + +#if defined(_OS_DARWIN_) && defined(LLVM_SHLIB) + +void JITDebugInfoRegistry::libc_frames_t::libc_register_frame(const char *Entry) { + auto libc_register_frame_ = jl_atomic_load_relaxed(&this->libc_register_frame_); + if (!libc_register_frame_) { + libc_register_frame_ = (void(*)(void*))dlsym(RTLD_NEXT, "__register_frame"); + jl_atomic_store_relaxed(&this->libc_register_frame_, libc_register_frame_); + } + assert(libc_register_frame_); + jl_profile_atomic([&]() { + libc_register_frame_(const_cast(Entry)); + __register_frame(const_cast(Entry)); + }); +} + +void JITDebugInfoRegistry::libc_frames_t::libc_deregister_frame(const char *Entry) { + auto libc_deregister_frame_ = jl_atomic_load_relaxed(&this->libc_deregister_frame_); + if (!libc_deregister_frame_) { + libc_deregister_frame_ = (void(*)(void*))dlsym(RTLD_NEXT, "__deregister_frame"); + jl_atomic_store_relaxed(&this->libc_deregister_frame_, libc_deregister_frame_); + } + assert(libc_deregister_frame_); + jl_profile_atomic([&]() { + libc_deregister_frame_(const_cast(Entry)); + __deregister_frame(const_cast(Entry)); + }); +} +#endif static bool getObjUUID(llvm::object::MachOObjectFile *obj, uint8_t uuid[16]) JL_NOTSAFEPOINT { @@ -553,11 +603,6 @@ static bool getObjUUID(llvm::object::MachOObjectFile *obj, uint8_t uuid[16]) JL_ } return false; } - -struct debug_link_info { - StringRef filename; - uint32_t crc32; -}; static debug_link_info getDebuglink(const object::ObjectFile &Obj) JL_NOTSAFEPOINT { debug_link_info info = {}; @@ -668,19 +713,11 @@ openDebugInfo(StringRef debuginfopath, const debug_link_info &info) std::move(error_splitobj.get()), std::move(SplitFile.get())); } - -static uint64_t jl_sysimage_base; -static jl_sysimg_fptrs_t sysimg_fptrs; -static jl_method_instance_t **sysimg_fvars_linfo; -static size_t sysimg_fvars_n; extern "C" JL_DLLEXPORT void jl_register_fptrs_impl(uint64_t sysimage_base, const jl_sysimg_fptrs_t *fptrs, jl_method_instance_t **linfos, size_t n) { - jl_sysimage_base = (uintptr_t)sysimage_base; - sysimg_fptrs = *fptrs; - sysimg_fvars_linfo = linfos; - sysimg_fvars_n = n; + getJITDebugRegistry().set_sysimg_info({(uintptr_t) sysimage_base, *fptrs, linfos, n}); } template @@ -695,7 +732,7 @@ static void get_function_name_and_base(llvm::object::SectionRef Section, size_t void **saddr, char **name, bool untrusted_dladdr) JL_NOTSAFEPOINT { // Assume we only need base address for sysimg for now - if (!insysimage || !sysimg_fptrs.base) + if (!insysimage || !getJITDebugRegistry().get_sysimg_info()->sysimg_fptrs.base) saddr = nullptr; bool needs_saddr = saddr && (!*saddr || untrusted_dladdr); bool needs_name = name && (!*name || untrusted_dladdr); @@ -721,7 +758,7 @@ static void get_function_name_and_base(llvm::object::SectionRef Section, size_t } if (Section.getObject() && (needs_saddr || needs_name)) { size_t distance = (size_t)-1; - SymRef sym_found; + object::SymbolRef sym_found; for (auto sym : Section.getObject()->symbols()) { if (!Section.containsSymbol(sym)) continue; @@ -796,7 +833,7 @@ static void get_function_name_and_base(llvm::object::SectionRef Section, size_t #endif } -static objfileentry_t &find_object_file(uint64_t fbase, StringRef fname) JL_NOTSAFEPOINT +static objfileentry_t find_object_file(uint64_t fbase, StringRef fname) JL_NOTSAFEPOINT { int isdarwin = 0, islinux = 0, iswindows = 0; #if defined(_OS_DARWIN_) @@ -809,12 +846,11 @@ static objfileentry_t &find_object_file(uint64_t fbase, StringRef fname) JL_NOTS (void)iswindows; // GOAL: Read debuginfo from file - // TODO: need read/write lock here for objfilemap synchronization - obfiletype::iterator it = objfilemap.find(fbase); - if (it != objfilemap.end()) + objfileentry_t entry{nullptr, nullptr, 0}; + auto success = getJITDebugRegistry().get_objfile_map()->emplace(fbase, entry); + if (!success.second) // Return cached value - return it->second; - auto &entry = objfilemap[fbase]; // default initialized + return success.first->second; // GOAL: Assign errorobj StringRef objpath; @@ -984,8 +1020,9 @@ static objfileentry_t &find_object_file(uint64_t fbase, StringRef fname) JL_NOTS auto binary = errorobj->takeBinary(); binary.first.release(); binary.second.release(); - // update cache entry = {debugobj, context, slide}; + // update cache + (*getJITDebugRegistry().get_objfile_map())[fbase] = entry; } else { // TODO: report the error instead of silently consuming it? @@ -1043,7 +1080,7 @@ bool jl_dylib_DI_for_fptr(size_t pointer, object::SectionRef *Section, int64_t * if (fname.empty()) // empirically, LoadedImageName might be missing fname = ModuleInfo.ImageName; DWORD64 fbase = ModuleInfo.BaseOfImage; - bool insysimage = (fbase == jl_sysimage_base); + bool insysimage = (fbase == getJITDebugRegistry().get_sysimg_info()->jl_sysimage_base); if (isSysImg) *isSysImg = insysimage; if (onlySysImg && !insysimage) @@ -1083,7 +1120,7 @@ bool jl_dylib_DI_for_fptr(size_t pointer, object::SectionRef *Section, int64_t * fbase = (uintptr_t)dlinfo.dli_fbase; #endif StringRef fname; - bool insysimage = (fbase == jl_sysimage_base); + bool insysimage = (fbase == getJITDebugRegistry().get_sysimg_info()->jl_sysimage_base); if (saddr && !(insysimage && untrusted_dladdr)) *saddr = dlinfo.dli_saddr; if (isSysImg) @@ -1098,7 +1135,7 @@ bool jl_dylib_DI_for_fptr(size_t pointer, object::SectionRef *Section, int64_t * jl_copy_str(filename, dlinfo.dli_fname); fname = dlinfo.dli_fname; #endif // ifdef _OS_WINDOWS_ - auto &entry = find_object_file(fbase, fname); + auto entry = find_object_file(fbase, fname); *slide = entry.slide; *context = entry.ctx; if (entry.obj) @@ -1139,20 +1176,23 @@ static int jl_getDylibFunctionInfo(jl_frame_t **frames, size_t pointer, int skip return 1; } frame0->fromC = !isSysImg; - if (isSysImg && sysimg_fptrs.base && saddr) { - intptr_t diff = (uintptr_t)saddr - (uintptr_t)sysimg_fptrs.base; - for (size_t i = 0; i < sysimg_fptrs.nclones; i++) { - if (diff == sysimg_fptrs.clone_offsets[i]) { - uint32_t idx = sysimg_fptrs.clone_idxs[i] & jl_sysimg_val_mask; - if (idx < sysimg_fvars_n) // items after this were cloned but not referenced directly by a method (such as our ccall PLT thunks) - frame0->linfo = sysimg_fvars_linfo[idx]; - break; + { + auto sysimg_locked = getJITDebugRegistry().get_sysimg_info(); + if (isSysImg && sysimg_locked->sysimg_fptrs.base && saddr) { + intptr_t diff = (uintptr_t)saddr - (uintptr_t)sysimg_locked->sysimg_fptrs.base; + for (size_t i = 0; i < sysimg_locked->sysimg_fptrs.nclones; i++) { + if (diff == sysimg_locked->sysimg_fptrs.clone_offsets[i]) { + uint32_t idx = sysimg_locked->sysimg_fptrs.clone_idxs[i] & jl_sysimg_val_mask; + if (idx < sysimg_locked->sysimg_fvars_n) // items after this were cloned but not referenced directly by a method (such as our ccall PLT thunks) + frame0->linfo = sysimg_locked->sysimg_fvars_linfo[idx]; + break; + } } - } - for (size_t i = 0; i < sysimg_fvars_n; i++) { - if (diff == sysimg_fptrs.offsets[i]) { - frame0->linfo = sysimg_fvars_linfo[i]; - break; + for (size_t i = 0; i < sysimg_locked->sysimg_fvars_n; i++) { + if (diff == sysimg_locked->sysimg_fptrs.offsets[i]) { + frame0->linfo = sysimg_locked->sysimg_fvars_linfo[i]; + break; + } } } } @@ -1163,13 +1203,13 @@ int jl_DI_for_fptr(uint64_t fptr, uint64_t *symsize, int64_t *slide, object::SectionRef *Section, llvm::DIContext **context) JL_NOTSAFEPOINT { int found = 0; - assert(0 == (uintptr_t)pthread_getspecific(debuginfo_asyncsafe_held)); - uv_rwlock_wrlock(&debuginfo_asyncsafe); - std::map &objmap = jl_jit_object_registry.getObjectMap(); - std::map::iterator fit = objmap.lower_bound(fptr); - + assert(0 == getJITDebugRegistry().debuginfo_asyncsafe_held); + uv_rwlock_wrlock(&getJITDebugRegistry().debuginfo_asyncsafe); if (symsize) *symsize = 0; + + auto &objmap = getJITDebugRegistry().getObjectMap(); + auto fit = objmap.lower_bound(fptr); if (fit != objmap.end() && fptr < fit->first + fit->second.SectionSize) { *slide = fit->second.slide; *Section = fit->second.Section; @@ -1180,7 +1220,7 @@ int jl_DI_for_fptr(uint64_t fptr, uint64_t *symsize, int64_t *slide, } found = 1; } - uv_rwlock_wrunlock(&debuginfo_asyncsafe); + uv_rwlock_wrunlock(&getJITDebugRegistry().debuginfo_asyncsafe); return found; } @@ -1199,7 +1239,7 @@ extern "C" JL_DLLEXPORT int jl_getFunctionInfo_impl(jl_frame_t **frames_out, siz int64_t slide; uint64_t symsize; if (jl_DI_for_fptr(pointer, &symsize, &slide, &Section, &context)) { - frames[0].linfo = jl_jit_object_registry.lookupLinfo(pointer); + frames[0].linfo = getJITDebugRegistry().lookupLinfo(pointer); int nf = lookup_pointer(Section, context, frames_out, pointer, slide, true, noInline); return nf; } @@ -1208,36 +1248,9 @@ extern "C" JL_DLLEXPORT int jl_getFunctionInfo_impl(jl_frame_t **frames_out, siz extern "C" jl_method_instance_t *jl_gdblookuplinfo(void *p) JL_NOTSAFEPOINT { - return jl_jit_object_registry.lookupLinfo((size_t)p); + return getJITDebugRegistry().lookupLinfo((size_t)p); } -#if (defined(_OS_LINUX_) || defined(_OS_FREEBSD_) || (defined(_OS_DARWIN_) && defined(LLVM_SHLIB))) -extern "C" void __register_frame(void*); -extern "C" void __deregister_frame(void*); - -template -static void processFDEs(const char *EHFrameAddr, size_t EHFrameSize, callback f) -{ - const char *P = EHFrameAddr; - const char *End = P + EHFrameSize; - do { - const char *Entry = P; - P += 4; - assert(P <= End); - uint32_t Length = *(const uint32_t*)Entry; - // Length == 0: Terminator - if (Length == 0) - break; - assert(P + Length <= End); - uint32_t Offset = *(const uint32_t*)P; - // Offset == 0: CIE - if (Offset != 0) - f(Entry); - P += Length; - } while (P != End); -} -#endif - #if defined(_OS_DARWIN_) && defined(LLVM_SHLIB) /* @@ -1248,37 +1261,20 @@ static void processFDEs(const char *EHFrameAddr, size_t EHFrameSize, callback f) * ourselves to ensure the right one gets picked. */ -static void (*libc_register_frame)(void*) = NULL; -static void (*libc_deregister_frame)(void*) = NULL; - // This implementation handles frame registration for local targets. void register_eh_frames(uint8_t *Addr, size_t Size) { // On OS X OS X __register_frame takes a single FDE as an argument. // See http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-April/061768.html processFDEs((char*)Addr, Size, [](const char *Entry) { - if (!libc_register_frame) { - libc_register_frame = (void(*)(void*))dlsym(RTLD_NEXT, "__register_frame"); - } - assert(libc_register_frame); - jl_profile_atomic([&]() { - libc_register_frame(const_cast(Entry)); - __register_frame(const_cast(Entry)); - }); + getJITDebugRegistry().libc_frames.libc_register_frame(Entry); }); } void deregister_eh_frames(uint8_t *Addr, size_t Size) { processFDEs((char*)Addr, Size, [](const char *Entry) { - if (!libc_deregister_frame) { - libc_deregister_frame = (void(*)(void*))dlsym(RTLD_NEXT, "__deregister_frame"); - } - assert(libc_deregister_frame); - jl_profile_atomic([&]() { - libc_deregister_frame(const_cast(Entry)); - __deregister_frame(const_cast(Entry)); - }); + getJITDebugRegistry().libc_frames.libc_deregister_frame(Entry); }); } @@ -1287,12 +1283,6 @@ void deregister_eh_frames(uint8_t *Addr, size_t Size) !defined(_CPU_ARM_) // ARM does not have/use .eh_frame, so we handle this elsewhere #include -struct unw_table_entry -{ - int32_t start_ip_offset; - int32_t fde_offset; -}; - // Skip over an arbitrary long LEB128 encoding. // Return the pointer to the first unprocessed byte. static const uint8_t *consume_leb128(const uint8_t *Addr, const uint8_t *End) @@ -1630,8 +1620,8 @@ uint64_t jl_getUnwindInfo_impl(uint64_t dwAddr) { // Might be called from unmanaged thread jl_lock_profile_impl(); - std::map &objmap = jl_jit_object_registry.getObjectMap(); - std::map::iterator it = objmap.lower_bound(dwAddr); + auto &objmap = getJITDebugRegistry().getObjectMap(); + auto it = objmap.lower_bound(dwAddr); uint64_t ipstart = 0; // ip of the start of the section (if found) if (it != objmap.end() && dwAddr < it->first + it->second.SectionSize) { ipstart = (uint64_t)(uintptr_t)(*it).first; diff --git a/src/jitlayers.h b/src/jitlayers.h index ba3f81fa66997..af47102173a7b 100644 --- a/src/jitlayers.h +++ b/src/jitlayers.h @@ -11,6 +11,7 @@ #include #include "julia_assert.h" +#include "debug-registry.h" // As of LLVM 13, there are two runtime JIT linker implementations, the older // RuntimeDyld (used via orc::RTDyldObjectLinkingLayer) and the newer JITLink @@ -214,6 +215,10 @@ class JuliaOJIT { const DataLayout& getDataLayout() const; const Triple& getTargetTriple() const; size_t getTotalBytes() const; + + JITDebugInfoRegistry &getDebugInfoRegistry() JL_NOTSAFEPOINT { + return DebugRegistry; + } private: std::string getMangledName(StringRef Name); std::string getMangledName(const GlobalValue *GV); @@ -236,6 +241,8 @@ class JuliaOJIT { orc::JITDylib &GlobalJD; orc::JITDylib &JD; + JITDebugInfoRegistry DebugRegistry; + #ifndef JL_USE_JITLINK std::shared_ptr MemMgr; #endif diff --git a/src/processor.h b/src/processor.h index 1d385cfc80b98..f3b571cf9b937 100644 --- a/src/processor.h +++ b/src/processor.h @@ -1,5 +1,8 @@ // This file is a part of Julia. License is MIT: https://julialang.org/license +#ifndef JL_PROCESSOR_H +#define JL_PROCESSOR_H + #include "support/dtypes.h" #include "julia.h" @@ -215,3 +218,5 @@ extern "C" JL_DLLEXPORT std::vector jl_get_llvm_clone_targets( std::string jl_get_cpu_name_llvm(void); std::string jl_get_cpu_features_llvm(void); #endif + +#endif From 8bca2f4b3d92b1d4fc234ff516b7ba9a80c6f915 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki Date: Wed, 25 May 2022 16:52:23 +0900 Subject: [PATCH 173/369] fix #45440, improve the robustness of concrete-evaled callsite inlining --- base/compiler/ssair/inlining.jl | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/base/compiler/ssair/inlining.jl b/base/compiler/ssair/inlining.jl index 5e3ad4febe60f..f5fb200c03c98 100644 --- a/base/compiler/ssair/inlining.jl +++ b/base/compiler/ssair/inlining.jl @@ -735,20 +735,20 @@ end function compileable_specialization(et::Union{EdgeTracker, Nothing}, match::MethodMatch, effects::Effects) mi = specialize_method(match; compilesig=true) - mi !== nothing && et !== nothing && push!(et, mi::MethodInstance) mi === nothing && return nothing + et !== nothing && push!(et, mi) return InvokeCase(mi, effects) end function compileable_specialization(et::Union{EdgeTracker, Nothing}, linfo::MethodInstance, effects::Effects) mi = specialize_method(linfo.def::Method, linfo.specTypes, linfo.sparam_vals; compilesig=true) - mi !== nothing && et !== nothing && push!(et, mi::MethodInstance) mi === nothing && return nothing + et !== nothing && push!(et, mi) return InvokeCase(mi, effects) end -function compileable_specialization(et::Union{EdgeTracker, Nothing}, (; linfo)::InferenceResult, effects::Effects) - return compileable_specialization(et, linfo, effects) +function compileable_specialization(et::Union{EdgeTracker, Nothing}, result::InferenceResult, effects::Effects) + return compileable_specialization(et, result.linfo, effects) end function resolve_todo(todo::InliningTodo, state::InliningState, flag::UInt8) @@ -1257,7 +1257,11 @@ function handle_const_call!( result = results[j] if isa(result, ConstResult) case = const_result_item(result, state) - push!(cases, InliningCase(result.mi.specTypes, case)) + if case === nothing + fully_covered = false + else + push!(cases, InliningCase(result.mi.specTypes, case)) + end elseif isa(result, InferenceResult) fully_covered &= handle_inf_result!(result, argtypes, flag, state, cases) else From 9a8ddd0c4339c98566ee0c4d3166bc8fb0f118fd Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Fri, 27 May 2022 20:33:25 +0200 Subject: [PATCH 174/369] Disallow reinterpreting a non-singleton array into a singleton type (#45370) (#45467) (cherry picked from commit fc52b3f1a7386400e3035fe3ab4283df03e968bd) Co-authored-by: Lionel Zoubritzky --- base/reinterpretarray.jl | 8 ++++---- test/reinterpretarray.jl | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/base/reinterpretarray.jl b/base/reinterpretarray.jl index 3b54ed04089cd..9211a66a99cbe 100644 --- a/base/reinterpretarray.jl +++ b/base/reinterpretarray.jl @@ -19,9 +19,9 @@ struct ReinterpretArray{T,N,S,A<:AbstractArray{S},IsReshaped} <: AbstractArray{T @noinline throw(ArgumentError("cannot reinterpret a zero-dimensional `$(S)` array to `$(T)` which is of a $msg size")) end - function throwsingleton(S::Type, T::Type, kind) + function throwsingleton(S::Type, T::Type) @noinline - throw(ArgumentError("cannot reinterpret $kind `$(S)` array to `$(T)` which is a singleton type")) + throw(ArgumentError("cannot reinterpret a `$(S)` array to `$(T)` which is a singleton type")) end global reinterpret @@ -44,7 +44,7 @@ struct ReinterpretArray{T,N,S,A<:AbstractArray{S},IsReshaped} <: AbstractArray{T ax1 = axes(a)[1] dim = length(ax1) if issingletontype(T) - dim == 0 || throwsingleton(S, T, "a non-empty") + issingletontype(S) || throwsingleton(S, T) else rem(dim*sizeof(S),sizeof(T)) == 0 || thrownonint(S, T, dim) end @@ -75,7 +75,7 @@ struct ReinterpretArray{T,N,S,A<:AbstractArray{S},IsReshaped} <: AbstractArray{T if sizeof(S) == sizeof(T) N = ndims(a) elseif sizeof(S) > sizeof(T) - issingletontype(T) && throwsingleton(S, T, "with reshape a") + issingletontype(T) && throwsingleton(S, T) rem(sizeof(S), sizeof(T)) == 0 || throwintmult(S, T) N = ndims(a) + 1 else diff --git a/test/reinterpretarray.jl b/test/reinterpretarray.jl index e623b407f70a6..bc3ffa63b0b0c 100644 --- a/test/reinterpretarray.jl +++ b/test/reinterpretarray.jl @@ -465,9 +465,11 @@ end @test_throws ArgumentError reinterpret(Nothing, 1:6) @test_throws ArgumentError reinterpret(reshape, Missing, [0.0]) - # reintepret of empty array with reshape - @test reinterpret(reshape, Nothing, fill(missing, (0,0,0))) == fill(nothing, (0,0,0)) + # reintepret of empty array + @test reinterpret(reshape, Nothing, fill(missing, (1,0,3))) == fill(nothing, (1,0,3)) + @test reinterpret(reshape, Missing, fill((), (0,))) == fill(missing, (0,)) @test_throws ArgumentError reinterpret(reshape, Nothing, fill(3.2, (0,0))) + @test_throws ArgumentError reinterpret(Missing, fill(77, (0,1))) @test_throws ArgumentError reinterpret(reshape, Float64, fill(nothing, 0)) # reinterpret of 0-dimensional array From 6368fdc6565857b2f2332f8ce74259009184eb62 Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Fri, 27 May 2022 20:33:40 +0200 Subject: [PATCH 175/369] set VERSION to 1.8.0-rc1 (#45466) --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 431eaf9f034e2..5a77cc6287239 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.8.0-beta3 +1.8.0-rc1 From 63e55531583299d97e3d549530f6aa7620d6e0b9 Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Sun, 22 May 2022 15:00:20 -0400 Subject: [PATCH 176/369] Make `isdispatchtuple` consistent for `typeof(Union{})` (#45348) We have `typeof(Union{}) == Type{Union{}}`, but were treating them differently in the calculation of `isdispatchtuple`. The compiler expects `isdispatchtuple` to commute with type equality in various places, so try to make this consistent. Fixes #45347 (cherry picked from commit a37dd1641d7780af9c598f0e3f2a4d053c4c67f6) --- src/jltypes.c | 1 + test/subtype.jl | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/jltypes.c b/src/jltypes.c index 1686a4b57e500..72a9d257f140b 100644 --- a/src/jltypes.c +++ b/src/jltypes.c @@ -1199,6 +1199,7 @@ void jl_precompute_memoized_dt(jl_datatype_t *dt, int cacheable) if (dt->isdispatchtuple) { dt->isdispatchtuple = jl_is_datatype(p) && ((!jl_is_kind(p) && ((jl_datatype_t*)p)->isconcretetype) || + (p == (jl_value_t*)jl_typeofbottom_type) || // == Type{Union{}}, so needs to be consistent (((jl_datatype_t*)p)->name == jl_type_typename && !((jl_datatype_t*)p)->hasfreetypevars)); } if (istuple && dt->has_concrete_subtype) { diff --git a/test/subtype.jl b/test/subtype.jl index eff2c021b481f..a0a6c96c300d7 100644 --- a/test/subtype.jl +++ b/test/subtype.jl @@ -1982,3 +1982,8 @@ end @test_throws TypeError(:typeassert, Type, Vararg{Int}) typeintersect(Int, Vararg{Int}) @test_throws TypeError(:typeassert, Type, 1) typeintersect(1, Int) @test_throws TypeError(:typeassert, Type, 1) typeintersect(Int, 1) + +let A = Tuple{typeof(identity), Type{Union{}}}, + B = Tuple{typeof(identity), typeof(Union{})} + @test A == B && (Base.isdispatchtuple(A) == Base.isdispatchtuple(B)) +end From 25122e49a57aec5f767bfa085259dfa6441d21bd Mon Sep 17 00:00:00 2001 From: FX Coudert Date: Sat, 21 May 2022 23:20:21 +0200 Subject: [PATCH 177/369] Do not set MCPU on Apple Silicon (#45409) (cherry picked from commit a5438f997e7c84529b829721c8b1dff5440872f5) --- Make.inc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Make.inc b/Make.inc index 228cd99823c48..3fa153c7219c4 100644 --- a/Make.inc +++ b/Make.inc @@ -900,10 +900,6 @@ OPENBLAS_DYNAMIC_ARCH:=0 OPENBLAS_TARGET_ARCH:=ARMV8 USE_BLAS64:=1 BINARY:=64 -ifeq ($(OS),Darwin) -# Apple Chips are all at least A12Z -MCPU:=apple-a12 -endif endif # Set MARCH-specific flags From 0769bb5248ded5cd07ffbac2e7469874fd6bd7c0 Mon Sep 17 00:00:00 2001 From: FX Coudert Date: Sun, 29 May 2022 10:45:28 -0600 Subject: [PATCH 178/369] Update LibCURL to 7.83.1 (#45443) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This new build doesn't depend on Kerberos Co-authored-by: Mosè Giordano (cherry picked from commit 28d9326faf61d4a9404d1e6b34c44e0de82cbb0a) --- deps/Versions.make | 2 +- deps/checksums/curl | 68 ++++++++++++++++----------------- deps/curl.mk | 7 +--- stdlib/LibCURL_jll/Project.toml | 2 +- 4 files changed, 38 insertions(+), 41 deletions(-) diff --git a/deps/Versions.make b/deps/Versions.make index 7442543716ad4..e5218b296682d 100644 --- a/deps/Versions.make +++ b/deps/Versions.make @@ -26,7 +26,7 @@ GMP_VER := 6.2.1 GMP_JLL_NAME := GMP # LibCURL -CURL_VER := 7.81.0 +CURL_VER := 7.83.1 CURL_JLL_NAME := LibCURL # LAPACK, source-only diff --git a/deps/checksums/curl b/deps/checksums/curl index 4b6e8da990d69..77cb46923aefd 100644 --- a/deps/checksums/curl +++ b/deps/checksums/curl @@ -1,36 +1,36 @@ LibCURL-fd8af649b38ae20c3ff7f5dca53753512ca00376.tar.gz/md5/f082283e6a35fcba5b63c9a6219d8003 LibCURL-fd8af649b38ae20c3ff7f5dca53753512ca00376.tar.gz/sha512/3bea5fa3fb6d29651daa923ae6bcb8eeb356ab9f2a1f3e005a6b746b617b0cf609aed4cadda4181783959840873c04b18e34e45ab973549169d19775a05ea01e -LibCURL.v7.81.0+0.aarch64-apple-darwin.tar.gz/md5/16d584cdac9f1756de1935c844f2095c -LibCURL.v7.81.0+0.aarch64-apple-darwin.tar.gz/sha512/38f800e309fddb2cd103ef5c65ad1ef2f7ec0dd7711e9afdb716b96b802c7fe089b04ea8d2bd2e675d62adc3b8aca3c7a243780f097b3466a496dbb25d2f7807 -LibCURL.v7.81.0+0.aarch64-linux-gnu.tar.gz/md5/6f70f7df6325bf6b62531d52ad313ae6 -LibCURL.v7.81.0+0.aarch64-linux-gnu.tar.gz/sha512/303fb30e2859c9d11fe64e964405ec2d4bcff4bafaaa5815a5548fdb0b42fca91fdfdf85473737b03399817f0ca6e23d870f56c354b0e53dd6ec142f2c69b182 -LibCURL.v7.81.0+0.aarch64-linux-musl.tar.gz/md5/b7aedf4bcbadf952c600d30643a2e284 -LibCURL.v7.81.0+0.aarch64-linux-musl.tar.gz/sha512/8bedf575e4eb2d4844b97b13b00f3d2c1fffccf10c1adbe11392053f7f956bd7592ac32a1eada474c57cc8d77999e214945ad6cf5242e577fa9ada29b35eaebd -LibCURL.v7.81.0+0.armv6l-linux-gnueabihf.tar.gz/md5/ed25c1478101dce0e37c18c68bfc2287 -LibCURL.v7.81.0+0.armv6l-linux-gnueabihf.tar.gz/sha512/6bc00770fea95aa01e8144738833990fb9080807efc3bed31b8ebaa45c04fe2817d8bcb0179f0322d60b77e4dd59514032978a680320fcc20287a0ba549e9972 -LibCURL.v7.81.0+0.armv6l-linux-musleabihf.tar.gz/md5/ce3591ab3e9b5c1da0b7f44ac3c03ff5 -LibCURL.v7.81.0+0.armv6l-linux-musleabihf.tar.gz/sha512/355c9f5d278d49329dbc56219df64f5d2b37581e1ee6cf2100deb52102f90ae7c9fdc047b9a341489985062d2461c058c1c8feb557776e7cf1563d4f49cb0a08 -LibCURL.v7.81.0+0.armv7l-linux-gnueabihf.tar.gz/md5/1e86f1abdc9ba03f26155f46db952150 -LibCURL.v7.81.0+0.armv7l-linux-gnueabihf.tar.gz/sha512/cc305e36e7427cbfeed7d5ddb10d34eb6f7475e1e9695f829fcb6400498ed5307051ebd31a28193b99cf11e87f79cb4f8a66e589f10b76b9ed6898a11e917b09 -LibCURL.v7.81.0+0.armv7l-linux-musleabihf.tar.gz/md5/dfaf544cdcf189cd09951aaaa26fbdc2 -LibCURL.v7.81.0+0.armv7l-linux-musleabihf.tar.gz/sha512/a412fef9e80f956f10092996b29c86f3fd673421339a0c502b2230bbca97065877ef379b18380197d071234abcd818edea797c739410c78170244c7eeaa141f4 -LibCURL.v7.81.0+0.i686-linux-gnu.tar.gz/md5/b8561fde02ddfcb64f724cd037cb59e9 -LibCURL.v7.81.0+0.i686-linux-gnu.tar.gz/sha512/904c043db84bef78f1bbb7b7ae1ba177942ad316ec39cdd7f28f9b2d3c578b8a835eb86d8ee91b604ed14e10b9200ae60ed8312e8a1ab7684e20d75536242e60 -LibCURL.v7.81.0+0.i686-linux-musl.tar.gz/md5/5fc2e3fbe3ccc362488e79fbd5eab20b -LibCURL.v7.81.0+0.i686-linux-musl.tar.gz/sha512/495be4a6ae0526c5ac6983e96b342226cfb2fa5c203135f0a402bbf3e8486d820454b8964c1a9fac4695df1619e5555a61a8cb4a3174c99cf0e8a3546a7f8749 -LibCURL.v7.81.0+0.i686-w64-mingw32.tar.gz/md5/24aa660ea3f5c019fb81f609bda7c44c -LibCURL.v7.81.0+0.i686-w64-mingw32.tar.gz/sha512/64f75cde988dedc0abbabb912b90850b07c54b24f8544125d6ceac5989337266cf3ea78b0758b58e3a490c7335090b8ac45d1282a2fe15dfb4fa93f55d4a46ab -LibCURL.v7.81.0+0.powerpc64le-linux-gnu.tar.gz/md5/26568c1b5e75fe00189cb6ebe6fa9ec2 -LibCURL.v7.81.0+0.powerpc64le-linux-gnu.tar.gz/sha512/ca7b2bba5190500275236966b7014935285b22ff551698a532681b970e461feb507fbe682ea95833ef453bdb5bf0516948fd9ca8971e10349252d286593a4792 -LibCURL.v7.81.0+0.x86_64-apple-darwin.tar.gz/md5/07850295b3ab6bb6cd63fcd9d4a35e6d -LibCURL.v7.81.0+0.x86_64-apple-darwin.tar.gz/sha512/cfc9fdf3f0891ce26d077696a4059a9fe0d95793dd391fc530b94367d074ce96bbb9f8a3af4cb5dcbbcc8c4ae160fe17146011bf805263ae4fefc36f320402e2 -LibCURL.v7.81.0+0.x86_64-linux-gnu.tar.gz/md5/39dc13a4ed2492a9ce9675737e8b5b10 -LibCURL.v7.81.0+0.x86_64-linux-gnu.tar.gz/sha512/f6e1c439620717be028a28fc9878d1618329aefe92561a2d4d95026bbe88c91526bf98a3b2e4643f47ad3ac047986c4461c5ace67412386f2ed53084826e5523 -LibCURL.v7.81.0+0.x86_64-linux-musl.tar.gz/md5/c7dfa116097f19421bba42728567a543 -LibCURL.v7.81.0+0.x86_64-linux-musl.tar.gz/sha512/91d3d99d67243bf6eac3aca09bb59d6b41bb5dbc4d7ecd6e81f84a9f7bb9a619ba5317ba06bdbc59ba372b0a9c5ef26d6d9654e8661ec6c890ef8bb189fb44ff -LibCURL.v7.81.0+0.x86_64-unknown-freebsd.tar.gz/md5/a19342f14c554d1a4a8355c17ee9e662 -LibCURL.v7.81.0+0.x86_64-unknown-freebsd.tar.gz/sha512/45ef0edb6a850ed0a45e7094fb5766b59ad325c29612a269a3e3a89cbc5fe62b06f9967bee5bae1239d4884e12af751e8c5054eb124a4ecdd06993b04aa6ea05 -LibCURL.v7.81.0+0.x86_64-w64-mingw32.tar.gz/md5/cffc213693c62d651f9cee6ed726eb81 -LibCURL.v7.81.0+0.x86_64-w64-mingw32.tar.gz/sha512/4b15a3240152aec816e16a25778aa5f5c26e8d3fc6e1db326ff20bafe1dc1e84f665dbedbca3a12a9486768d6128c2d1f18d07f812c5b74878bfe3173f130229 -curl-7.81.0.tar.bz2/md5/f42ab772edb85374fc985ae65810439e -curl-7.81.0.tar.bz2/sha512/4889e94998cb9da3f05a70e61e7a0599a0fd3529455f5b3664ede255a834276f1d7898bd370e9b0fb21b0c0ffe4ce50c0757bb8bf896943726c538f8ead0cc41 +LibCURL.v7.83.1+1.aarch64-apple-darwin.tar.gz/md5/de0048ffcd0cf779f648c58df4d87ea9 +LibCURL.v7.83.1+1.aarch64-apple-darwin.tar.gz/sha512/874d1f83e0ff21ff8a5e39f29ca03588142e5f292a7e3bfb36f6f6f4f3e5b518b76dc8c0272a2df1167daed108b92f0e620277e6f3e2c091aa60934d18c292e4 +LibCURL.v7.83.1+1.aarch64-linux-gnu.tar.gz/md5/55bb17c62f5cf9894770bbc6e9fcce45 +LibCURL.v7.83.1+1.aarch64-linux-gnu.tar.gz/sha512/bb1e2246bb169ad7cc36749d56cf4bf6d3bd57bb9d141c5d807be5048ecc3cb3adeef95438d52c6360b5e70ba0ec75efb134c381affc812d0f5e1d8e76ff9884 +LibCURL.v7.83.1+1.aarch64-linux-musl.tar.gz/md5/52ce54a88113140c7f7c57895054d68c +LibCURL.v7.83.1+1.aarch64-linux-musl.tar.gz/sha512/dbd385d28ba6cf9e7c0ca05e9b10bafc041320c307ea7571bb972ae90b71a29ffa50d7c934d358c9e35cb168d3a378589cf0de66d5f13fe69da8a44ba1712284 +LibCURL.v7.83.1+1.armv6l-linux-gnueabihf.tar.gz/md5/68150dd7d41938065f444a1fc162d8d0 +LibCURL.v7.83.1+1.armv6l-linux-gnueabihf.tar.gz/sha512/0d8eccd3fc30160899789b91ff12ae08d97f48c08c25dcbcf737ceb9a9388fb082b7abac53da6e4711f9a5ff40700ac735d748f13895ea5205f919449182711b +LibCURL.v7.83.1+1.armv6l-linux-musleabihf.tar.gz/md5/963de5f46421087fc4f0c0e3674d6a5b +LibCURL.v7.83.1+1.armv6l-linux-musleabihf.tar.gz/sha512/a9b491384a19d4cb26ab48a09dff8e58989b0e2ba8f143a0740daa582ddcf4a29c21216045baaeec5d121922a2dc38e9072174aa8f5deaf2d38ea1997a1c6ba5 +LibCURL.v7.83.1+1.armv7l-linux-gnueabihf.tar.gz/md5/b64791ed06518e53d5e0bc713bf82af4 +LibCURL.v7.83.1+1.armv7l-linux-gnueabihf.tar.gz/sha512/30dcbbb3f944da18a9764728850fe24ba7612d11fe0b81f6c56e7735479128b0a55bd43d29cb326db20dc8f1fc9a1407bb7f54da1526d5fa182ab223e11377d0 +LibCURL.v7.83.1+1.armv7l-linux-musleabihf.tar.gz/md5/fc64fc8de930b1f2deee6910706da54e +LibCURL.v7.83.1+1.armv7l-linux-musleabihf.tar.gz/sha512/04e9cfdf55403ce2c7077356f05a98fe6a94772b5846ceff0cc81f0ebac95df85e259ecf4ded2baa369f55580892d083c74460e436a33c0286a797db60497558 +LibCURL.v7.83.1+1.i686-linux-gnu.tar.gz/md5/44a4f66754105b24102135fe62691aab +LibCURL.v7.83.1+1.i686-linux-gnu.tar.gz/sha512/9200ec12725fbf93039e534625f8cb14607be820df27ac4bcabcf8332f2e5214604b6c1efd6f4d1ae6c554b8cdd0808a1dda0f9e1fba7764484c0b00e351db7b +LibCURL.v7.83.1+1.i686-linux-musl.tar.gz/md5/bf0a521a03bb216430e66d29e9bd597e +LibCURL.v7.83.1+1.i686-linux-musl.tar.gz/sha512/ef549d533d1a1d40a0e10ec68611f586878fd3a218a9d388ae3328e4fad3dc613ed700671bbbd1f62554555073a7ab224c122fb31e7bcc6c751a7d0ce6fba9f6 +LibCURL.v7.83.1+1.i686-w64-mingw32.tar.gz/md5/c48af4c27cecbc38694cce627412eceb +LibCURL.v7.83.1+1.i686-w64-mingw32.tar.gz/sha512/9dbdbc8cbeafa913debfeed88b0514355fec89a48945716a43baae94e9855cb84cb9ba794cd022958636858a5be9f671f92a40ad3cd3b5145245c94cb26112d7 +LibCURL.v7.83.1+1.powerpc64le-linux-gnu.tar.gz/md5/50256b715d014ef9a2b328668a71a5dd +LibCURL.v7.83.1+1.powerpc64le-linux-gnu.tar.gz/sha512/730eef536baa0be00fc9f1e87f82fb84a051141bab277f11873e7e2fdaeced3964e9a0e4343504e1cb7b89fbf92df8890fa33eaed9b3c6555171c8a8adbf9dcf +LibCURL.v7.83.1+1.x86_64-apple-darwin.tar.gz/md5/367d7944167a83ff2a8d4982c8504e47 +LibCURL.v7.83.1+1.x86_64-apple-darwin.tar.gz/sha512/591f268ecbb0f5c43266876e9e0f33235b5c2e96aae4386d22c50785a4466e4b3f14e5b48117f1751733492c4ccc54638bfcf10c904d12145db7881e07778a23 +LibCURL.v7.83.1+1.x86_64-linux-gnu.tar.gz/md5/57bf4c88945b3f83e336754b075b35f7 +LibCURL.v7.83.1+1.x86_64-linux-gnu.tar.gz/sha512/71984f5240c5962422cf69069b3f0d0529a64c9ccb9995b9f26742a19dc12ae9700e888fe8b79b17edfcaa1b13b24a56b4d776453d83cce233dfa9c3fdb79660 +LibCURL.v7.83.1+1.x86_64-linux-musl.tar.gz/md5/64f3026a24b6a7df77e8325a108e76db +LibCURL.v7.83.1+1.x86_64-linux-musl.tar.gz/sha512/bf0c16b90b7b6ef33ed7d4678df539f88d041f5a78942ca5549d9d0e7ce8cef38af8da1f68d9d3999f969805dd1da546da3d289b32dad442ec1b2b5e44d158cb +LibCURL.v7.83.1+1.x86_64-unknown-freebsd.tar.gz/md5/578ba7e5607ce2de16132ab8f7a213d9 +LibCURL.v7.83.1+1.x86_64-unknown-freebsd.tar.gz/sha512/42c5892038aaedbbb19e192fc867e00d354da7cdf11c90151124f3c9006883960107663eaa865ee482895ee5784b5c5f487ea8aeef2a8ebbbe51f59d693e0778 +LibCURL.v7.83.1+1.x86_64-w64-mingw32.tar.gz/md5/5e5bb662234dd4520f4e4f73f8536daa +LibCURL.v7.83.1+1.x86_64-w64-mingw32.tar.gz/sha512/4553dc10d464771166b8a53473e68a23baa6fb8f65f09a5a274826d313dafc3289348e0e8026abcec6fea98e461aca31001176387526afcf3966167b71ec2178 +curl-7.83.1.tar.bz2/md5/08626822d50cbef47503f220718b920b +curl-7.83.1.tar.bz2/sha512/c43ec2da9c8609a312f723c0b3eff7e171ed1258c6ed1af16020190d4253e6bea63ca3905f04d0ca46a97986a8bb79be1d532f8d68fcbdbacfa80cc42f134db1 diff --git a/deps/curl.mk b/deps/curl.mk index f2cf21d19a354..2bf753f807f17 100644 --- a/deps/curl.mk +++ b/deps/curl.mk @@ -22,13 +22,11 @@ CURL_LDFLAGS += -lpthread endif $(SRCCACHE)/curl-$(CURL_VER).tar.bz2: | $(SRCCACHE) - $(JLDOWNLOAD) $@ https://curl.haxx.se/download/curl-$(CURL_VER).tar.bz2 + $(JLDOWNLOAD) $@ https://curl.se/download/curl-$(CURL_VER).tar.bz2 $(SRCCACHE)/curl-$(CURL_VER)/source-extracted: $(SRCCACHE)/curl-$(CURL_VER).tar.bz2 $(JLCHECKSUM) $< cd $(dir $<) && $(TAR) jxf $(notdir $<) - cp $(SRCDIR)/patches/config.sub $(SRCCACHE)/curl-$(CURL_VER)/config.sub - touch -c $(SRCCACHE)/curl-$(CURL_VER)/configure # old target echo 1 > $@ checksum-curl: $(SRCCACHE)/curl-$(CURL_VER).tar.bz2 @@ -51,8 +49,7 @@ $(BUILDDIR)/curl-$(CURL_VER)/build-configured: $(SRCCACHE)/curl-$(CURL_VER)/sour cd $(dir $@) && \ $(dir $<)/configure $(CONFIGURE_COMMON) --includedir=$(build_includedir) \ --without-ssl --without-gnutls --without-gssapi --disable-ares \ - --without-libidn --without-libidn2 --without-librtmp \ - --without-nss --without-polarssl --without-spnego --without-libpsl \ + --without-libidn2 --without-librtmp --without-nss --without-libpsl \ --disable-ldap --disable-ldaps --without-zsh-functions-dir --disable-static \ --with-libssh2=$(build_prefix) --with-zlib=$(build_prefix) --with-nghttp2=$(build_prefix) \ $(CURL_TLS_CONFIGURE_FLAGS) \ diff --git a/stdlib/LibCURL_jll/Project.toml b/stdlib/LibCURL_jll/Project.toml index e4da34909a7eb..3719fcbf37bef 100644 --- a/stdlib/LibCURL_jll/Project.toml +++ b/stdlib/LibCURL_jll/Project.toml @@ -1,6 +1,6 @@ name = "LibCURL_jll" uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" -version = "7.81.0+0" +version = "7.83.1+1" [deps] LibSSH2_jll = "29816b5a-b9ab-546f-933c-edad1886dfa8" From bde7223422264098d5383019d316e6175cc58aa4 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki Date: Mon, 30 May 2022 11:12:59 +0900 Subject: [PATCH 179/369] Revert "fix #45440, improve the robustness of concrete-evaled callsite inlining" This reverts commit 8bca2f4b3d92b1d4fc234ff516b7ba9a80c6f915. --- base/compiler/ssair/inlining.jl | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/base/compiler/ssair/inlining.jl b/base/compiler/ssair/inlining.jl index f5fb200c03c98..5e3ad4febe60f 100644 --- a/base/compiler/ssair/inlining.jl +++ b/base/compiler/ssair/inlining.jl @@ -735,20 +735,20 @@ end function compileable_specialization(et::Union{EdgeTracker, Nothing}, match::MethodMatch, effects::Effects) mi = specialize_method(match; compilesig=true) + mi !== nothing && et !== nothing && push!(et, mi::MethodInstance) mi === nothing && return nothing - et !== nothing && push!(et, mi) return InvokeCase(mi, effects) end function compileable_specialization(et::Union{EdgeTracker, Nothing}, linfo::MethodInstance, effects::Effects) mi = specialize_method(linfo.def::Method, linfo.specTypes, linfo.sparam_vals; compilesig=true) + mi !== nothing && et !== nothing && push!(et, mi::MethodInstance) mi === nothing && return nothing - et !== nothing && push!(et, mi) return InvokeCase(mi, effects) end -function compileable_specialization(et::Union{EdgeTracker, Nothing}, result::InferenceResult, effects::Effects) - return compileable_specialization(et, result.linfo, effects) +function compileable_specialization(et::Union{EdgeTracker, Nothing}, (; linfo)::InferenceResult, effects::Effects) + return compileable_specialization(et, linfo, effects) end function resolve_todo(todo::InliningTodo, state::InliningState, flag::UInt8) @@ -1257,11 +1257,7 @@ function handle_const_call!( result = results[j] if isa(result, ConstResult) case = const_result_item(result, state) - if case === nothing - fully_covered = false - else - push!(cases, InliningCase(result.mi.specTypes, case)) - end + push!(cases, InliningCase(result.mi.specTypes, case)) elseif isa(result, InferenceResult) fully_covered &= handle_inf_result!(result, argtypes, flag, state, cases) else From 801458da499e807664ba2e6ff9352ecd1b0f519b Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki Date: Fri, 27 May 2022 17:14:44 +0900 Subject: [PATCH 180/369] follow #45440, add assertion to check concrete-eval call is compileable --- base/compiler/ssair/inlining.jl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/base/compiler/ssair/inlining.jl b/base/compiler/ssair/inlining.jl index 5e3ad4febe60f..db2a6b1d33db3 100644 --- a/base/compiler/ssair/inlining.jl +++ b/base/compiler/ssair/inlining.jl @@ -735,20 +735,20 @@ end function compileable_specialization(et::Union{EdgeTracker, Nothing}, match::MethodMatch, effects::Effects) mi = specialize_method(match; compilesig=true) - mi !== nothing && et !== nothing && push!(et, mi::MethodInstance) mi === nothing && return nothing + et !== nothing && push!(et, mi) return InvokeCase(mi, effects) end function compileable_specialization(et::Union{EdgeTracker, Nothing}, linfo::MethodInstance, effects::Effects) mi = specialize_method(linfo.def::Method, linfo.specTypes, linfo.sparam_vals; compilesig=true) - mi !== nothing && et !== nothing && push!(et, mi::MethodInstance) mi === nothing && return nothing + et !== nothing && push!(et, mi) return InvokeCase(mi, effects) end -function compileable_specialization(et::Union{EdgeTracker, Nothing}, (; linfo)::InferenceResult, effects::Effects) - return compileable_specialization(et, linfo, effects) +function compileable_specialization(et::Union{EdgeTracker, Nothing}, result::InferenceResult, effects::Effects) + return compileable_specialization(et, result.linfo, effects) end function resolve_todo(todo::InliningTodo, state::InliningState, flag::UInt8) @@ -1310,7 +1310,9 @@ end function const_result_item(result::ConstResult, state::InliningState) if !isdefined(result, :result) || !is_inlineable_constant(result.result) - return compileable_specialization(state.et, result.mi, result.effects) + case = compileable_specialization(state.et, result.mi, result.effects) + @assert case !== nothing "concrete evaluation should never happen for uncompileable callsite" + return case end @assert result.effects === EFFECTS_TOTAL return ConstantCase(quoted(result.result)) From 8f1a4ce858feca49ce54bdc2b80c4567f3aabf73 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki Date: Tue, 31 May 2022 17:06:10 +0900 Subject: [PATCH 181/369] tweak NEWS.md --- NEWS.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 3e9eece2260ea..0e8aa7190348d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -43,7 +43,9 @@ Compiler/Runtime improvements `libjulia-codegen`. It is loaded by default, so normal usage should see no changes. In deployments that do not need the compiler (e.g. system images where all needed code is precompiled), this library (and its LLVM dependency) can simply be excluded ([#41936]). -* Conditional type constraints can now be forwarded interprocedurally (i.e. propagated from caller to callee) ([#42529]). +* Conditional type constraints are now be forwarded interprocedurally (i.e. propagated from caller to callee). + This allows inference to understand e.g. `Base.ifelse(isa(x, Int), x, 0)` returns `::Int`-value + even if the type of `x` is not known ([#42529]). * Julia-level SROA (Scalar Replacement of Aggregates) has been improved: allowing elimination of `getfield` calls with constant global fields ([#42355]), enabling elimination of mutable structs with uninitialized fields ([#43208]), improving performance ([#43232]), and handling more nested `getfield` @@ -53,7 +55,7 @@ Compiler/Runtime improvements * Inference now tracks various effects such as side-effectful-ness and nothrow-ness on a per-specialization basis. Code heavily dependent on constant propagation should see significant compile-time performance improvements and certain cases (e.g. calls to uninlinable functions that are nevertheless effect free) should see runtime performance - improvements. Effects may be overwritten manually with the `@Base.assume_effects` macro ([#43852]). + improvements. Effects may be overwritten manually with the `Base.@assume_effects` macro ([#43852]). * Precompilation (with explicit `precompile` directives or representative workloads) now saves more type-inferred code, resulting in reduced time-to-first task for packages that use precompilation. This change also eliminates the runtime performance degradation occasionally triggered by precompilation on older Julia versions. More specifically, From 32106ab46e42af50de3ffab23e5fe0865651fb70 Mon Sep 17 00:00:00 2001 From: Jerry Ling Date: Tue, 31 May 2022 20:21:36 -0500 Subject: [PATCH 182/369] note `@inline` inside body usage (#45531) --- NEWS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 0e8aa7190348d..a3ae8fe37e40b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -11,8 +11,8 @@ New language features e.g. `[;;;]` creates a 0×0×0 `Array` ([#41618]). * `try`-blocks can now optionally have an `else`-block which is executed right after the main body only if no errors were thrown ([#42211]). -* `@inline` and `@noinline` annotations can now be placed within a function body ([#41312]). -* `@inline` and `@noinline` annotations can now be applied to a function call site or block +* `@inline` and `@noinline` can now be placed within a function body, allowing one to annotate anonymous function ([#41312]). +* `@inline` and `@noinline` can now be applied to a function at callsite or block to enforce the involved function calls to be (or not to be) inlined ([#41328]). * `∀`, `∃`, and `∄` are now allowed as identifier characters ([#42314]). * Support for Unicode 14.0.0 ([#43443]). From 4c65dceeaa2bea7fd0d3999c8856672610d70395 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Wed, 1 Jun 2022 13:29:19 +0900 Subject: [PATCH 183/369] rename `Base.@assume_effects :total_may_throw` setting to `:foldable` (#45534) --- base/expr.jl | 10 +++++----- test/compiler/inference.jl | 2 +- test/compiler/inline.jl | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/base/expr.jl b/base/expr.jl index 9e603885a0037..905332a8f3e94 100644 --- a/base/expr.jl +++ b/base/expr.jl @@ -402,7 +402,7 @@ julia> code_typed() do 1 ─ return 479001600 ) => Int64 -julia> Base.@assume_effects :total_may_throw @ccall jl_type_intersection(Vector{Int}::Any, Vector{<:Integer}::Any)::Any +julia> Base.@assume_effects :foldable @ccall jl_type_intersection(Vector{Int}::Any, Vector{<:Integer}::Any)::Any Vector{Int64} (alias for Array{Int64, 1}) ``` @@ -541,7 +541,7 @@ This `setting` combines the following other assertions: and is a convenient shortcut. --- -# `:total_may_throw` +# `:foldable` This `setting` combines the following other assertions: - `:consistent` @@ -554,10 +554,10 @@ and is a convenient shortcut. the applied method when all the call arguments are fully known to be constant, no matter if the call results in an error or not. - `@assume_effects :total_may_throw` is similar to [`@pure`](@ref) with the primary + `@assume_effects :foldable` is similar to [`@pure`](@ref) with the primary distinction that the `:consistent`-cy requirement applies world-age wise rather than globally as described above. However, in particular, a method annotated - `@pure` should always be `:total` or `:total_may_throw`. + `@pure` should always be `:total` or `:foldable`. Another advantage is that effects introduced by `@assume_effects` are propagated to callers interprocedurally while a purity defined by `@pure` is not. """ @@ -580,7 +580,7 @@ macro assume_effects(args...) terminates_locally = true elseif setting === :total consistent = effect_free = nothrow = terminates_globally = true - elseif setting === :total_may_throw + elseif setting === :foldable consistent = effect_free = terminates_globally = true else throw(ArgumentError("@assume_effects $setting not supported")) diff --git a/test/compiler/inference.jl b/test/compiler/inference.jl index e36ec80b9e728..3c9650201cf6a 100644 --- a/test/compiler/inference.jl +++ b/test/compiler/inference.jl @@ -4079,7 +4079,7 @@ const CONST_DICT = let d = Dict() end d end -Base.@assume_effects :total_may_throw getcharid(c) = CONST_DICT[c] +Base.@assume_effects :foldable getcharid(c) = CONST_DICT[c] @noinline callf(f, args...) = f(args...) function entry_to_be_invalidated(c) return callf(getcharid, c) diff --git a/test/compiler/inline.jl b/test/compiler/inline.jl index c3a8499b621a5..8318b733727d7 100644 --- a/test/compiler/inline.jl +++ b/test/compiler/inline.jl @@ -1089,7 +1089,7 @@ recur_termination22(x) = x * recur_termination21(x-1) end const ___CONST_DICT___ = Dict{Any,Any}(Symbol(c) => i for (i, c) in enumerate('a':'z')) -Base.@assume_effects :total_may_throw concrete_eval( +Base.@assume_effects :foldable concrete_eval( f, args...; kwargs...) = f(args...; kwargs...) @test fully_eliminated() do concrete_eval(getindex, ___CONST_DICT___, :a) From ba72387ac0be5bec9b9c030e5522113af41e5da9 Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Thu, 24 Feb 2022 22:35:41 +0100 Subject: [PATCH 184/369] also set the version in `pkgorigins` (#44318) (cherry picked from commit 21e5a26a91088447dee56114f5e0927a803bf587) --- base/loading.jl | 42 ++++++++++++++++++++++++++++----------- test/TestPkg/Project.toml | 2 +- test/loading.jl | 1 + 3 files changed, 32 insertions(+), 13 deletions(-) diff --git a/base/loading.jl b/base/loading.jl index c1ddabda6c469..2e83a4296c238 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -411,6 +411,16 @@ const project_names = ("JuliaProject.toml", "Project.toml") const manifest_names = ("JuliaManifest.toml", "Manifest.toml") const preferences_names = ("JuliaLocalPreferences.toml", "LocalPreferences.toml") +function locate_project_file(env::String) + for proj in project_names + project_file = joinpath(env, proj) + if isfile_casesensitive(project_file) + return project_file + end + end + return true +end + # classify the LOAD_PATH entry to be one of: # - `false`: nonexistant / nothing to see here # - `true`: `env` is an implicit environment @@ -423,14 +433,7 @@ function env_project_file(env::String)::Union{Bool,String} project_file === nothing || return project_file end if isdir(env) - for proj in project_names - maybe_project_file = joinpath(env, proj) - if isfile_casesensitive(maybe_project_file) - project_file = maybe_project_file - break - end - end - project_file =true + project_file = locate_project_file(env) elseif basename(env) in project_names && isfile_casesensitive(env) project_file = env else @@ -1076,11 +1079,11 @@ function require(into::Module, mod::Symbol) end mutable struct PkgOrigin - # version::VersionNumber path::Union{String,Nothing} cachepath::Union{String,Nothing} + version::Union{VersionNumber,Nothing} end -PkgOrigin() = PkgOrigin(nothing, nothing) +PkgOrigin() = PkgOrigin(nothing, nothing, nothing) const pkgorigins = Dict{PkgId,PkgOrigin}() require(uuidkey::PkgId) = @lock require_lock _require_prelocked(uuidkey) @@ -1151,6 +1154,21 @@ function unreference_module(key::PkgId) end end +function set_pkgorigin_version_path(pkg, path) + pkgorigin = get!(PkgOrigin, pkgorigins, pkg) + if path !== nothing + project_file = locate_project_file(joinpath(dirname(path), "..")) + if project_file isa String + d = parsed_toml(project_file) + v = get(d, "version", nothing) + if v !== nothing + pkgorigin.version = VersionNumber(v) + end + end + end + pkgorigin.path = path +end + # Returns `nothing` or the name of the newly-created cachefile function _require(pkg::PkgId) # handle recursive calls to require @@ -1167,7 +1185,7 @@ function _require(pkg::PkgId) toplevel_load[] = false # perform the search operation to select the module file require intends to load path = locate_package(pkg) - get!(PkgOrigin, pkgorigins, pkg).path = path + set_pkgorigin_version_path(pkg, path) if path === nothing throw(ArgumentError(""" Package $pkg is required but does not seem to be installed: @@ -1941,11 +1959,11 @@ get_compiletime_preferences(::Nothing) = String[] else @label locate_branch path = locate_package(req_key) - get!(PkgOrigin, pkgorigins, req_key).path = path if path === nothing @debug "Rejecting cache file $cachefile because dependency $req_key not found." return true # Won't be able to fulfill dependency end + set_pkgorigin_version_path(req_key, path) depmods[i] = (path, req_key, req_build_id) end end diff --git a/test/TestPkg/Project.toml b/test/TestPkg/Project.toml index 0786722612bf3..0dfe48c3e9acb 100644 --- a/test/TestPkg/Project.toml +++ b/test/TestPkg/Project.toml @@ -1,6 +1,6 @@ name = "TestPkg" uuid = "69145d58-7df6-11e8-0660-cf7622583916" - +version = "1.2.3" [deps] Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" diff --git a/test/loading.jl b/test/loading.jl index 7dd6ce2935be6..930894bebc8ab 100644 --- a/test/loading.jl +++ b/test/loading.jl @@ -652,6 +652,7 @@ finally Base.set_active_project(old_act_proj) popfirst!(LOAD_PATH) end +@test Base.pkgorigins[Base.PkgId(UUID("69145d58-7df6-11e8-0660-cf7622583916"), "TestPkg")].version == v"1.2.3" @testset "--project and JULIA_PROJECT paths should be absolutified" begin mktempdir() do dir; cd(dir) do From 9e17fb6bb89a9258368b09881e2d568b8aeef8f6 Mon Sep 17 00:00:00 2001 From: FX Coudert Date: Sun, 29 May 2022 08:35:23 -0600 Subject: [PATCH 185/369] Make llvmunwind depend on llvm (#45380) (cherry picked from commit 6ea90344516dab972452056e94c954ed8289277e) --- deps/unwind.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deps/unwind.mk b/deps/unwind.mk index dbdffdae31996..62d0173007231 100644 --- a/deps/unwind.mk +++ b/deps/unwind.mk @@ -8,6 +8,10 @@ ifeq ($(USE_SYSTEM_ZLIB),0) $(BUILDDIR)/libunwind-$(UNWIND_VER)/build-configured: | $(build_prefix)/manifest/zlib endif +ifeq ($(USE_SYSTEM_LLVM),0) +$(BUILDDIR)/llvmunwind-$(LLVMUNWIND_VER)/build-configured: | $(build_prefix)/manifest/llvm +endif + $(SRCCACHE)/libunwind-$(UNWIND_VER).tar.gz: | $(SRCCACHE) $(JLDOWNLOAD) $@ https://github.com/libunwind/libunwind/releases/download/v$(UNWIND_VER_TAG)/libunwind-$(UNWIND_VER).tar.gz From b6e47d44608998c99c5287dcc631246edc04adf0 Mon Sep 17 00:00:00 2001 From: FX Coudert Date: Sun, 29 May 2022 15:13:02 -0600 Subject: [PATCH 186/369] csl.mk: use libgcc_s 1.1 on aarch64-darwin (#45504) (cherry picked from commit 6f8860c86cea80f34eb9fdcaf7fd00ebcf712464) --- deps/csl.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deps/csl.mk b/deps/csl.mk index 1940984fdc199..e3f84aa98974d 100644 --- a/deps/csl.mk +++ b/deps/csl.mk @@ -76,8 +76,12 @@ else $(eval $(call copy_csl,$(call versioned_libname,libgcc_s_seh,1))) endif else +ifeq ($(APPLE_ARCH),arm64) +$(eval $(call copy_csl,$(call versioned_libname,libgcc_s,1.1))) +else $(eval $(call copy_csl,$(call versioned_libname,libgcc_s,1))) endif +endif # winpthread is only Windows, pthread is only others ifeq ($(OS),WINNT) $(eval $(call copy_csl,$(call versioned_libname,libwinpthread,1))) From d6bbed63bd37cdfac2d48ba5f9a60a298d6e0940 Mon Sep 17 00:00:00 2001 From: Nicholas Bauer Date: Wed, 1 Jun 2022 06:11:14 -0400 Subject: [PATCH 187/369] Fix zero-length array concatenation validation (#45383) (cherry picked from commit 0a55a8e2d3486fdf186d07cfc3fbe5ae9fae1cc8) --- base/abstractarray.jl | 4 ++-- test/abstractarray.jl | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/base/abstractarray.jl b/base/abstractarray.jl index e7dda128fcadc..3922552668e24 100644 --- a/base/abstractarray.jl +++ b/base/abstractarray.jl @@ -2478,7 +2478,7 @@ function _typed_hvncat_shape(::Type{T}, shape::NTuple{N, Tuple}, row_first, as:: shapelength == lengthas || throw(ArgumentError("number of elements does not match shape; expected $(shapelength), got $lengthas)")) # discover dimensions nd = max(N, cat_ndims(as[1])) - outdims = zeros(Int, nd) + outdims = fill(-1, nd) currentdims = zeros(Int, nd) blockcounts = zeros(Int, nd) shapepos = ones(Int, nd) @@ -2503,7 +2503,7 @@ function _typed_hvncat_shape(::Type{T}, shape::NTuple{N, Tuple}, row_first, as:: isendblock = blockcounts[d] == shapev[d][shapepos[d]] if isendblock - if outdims[d] == 0 + if outdims[d] == -1 outdims[d] = currentdims[d] elseif outdims[d] != currentdims[d] throw(ArgumentError("argument $i has a mismatched number of elements along axis $ad; \ diff --git a/test/abstractarray.jl b/test/abstractarray.jl index cd084c747897c..a2894c139eeee 100644 --- a/test/abstractarray.jl +++ b/test/abstractarray.jl @@ -1465,9 +1465,7 @@ using Base: typed_hvncat v1 = zeros(Int, 0, 0, 0) for v2 ∈ (1, [1]) for v3 ∈ (2, [2]) - # current behavior, not potentially dangerous. - # should throw error like above loop - @test [v1 ;;; v2 v3] == [v2 v3;;;] + @test_throws ArgumentError [v1 ;;; v2 v3] @test_throws ArgumentError [v1 ;;; v2] @test_throws ArgumentError [v1 v1 ;;; v2 v3] end From a004142e09893570335462b75fb295a05c53bf3a Mon Sep 17 00:00:00 2001 From: Jishnu Bhattacharya Date: Thu, 2 Jun 2022 17:59:18 +0400 Subject: [PATCH 188/369] Fix segfault in `Diagonal` * `OffsetMatrix` (#45548) * diagonal*offset matrix should throw (cherry picked from commit 172bddc908fdb3583700ecd95a9d97d083ce4780) --- stdlib/LinearAlgebra/src/diagonal.jl | 2 ++ stdlib/LinearAlgebra/test/diagonal.jl | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/stdlib/LinearAlgebra/src/diagonal.jl b/stdlib/LinearAlgebra/src/diagonal.jl index b06ccdd77cc57..4af42d8f53eb4 100644 --- a/stdlib/LinearAlgebra/src/diagonal.jl +++ b/stdlib/LinearAlgebra/src/diagonal.jl @@ -285,6 +285,7 @@ function *(D::Diagonal, transA::Transpose{<:Any,<:AbstractMatrix}) end @inline function __muldiag!(out, D::Diagonal, B, alpha, beta) + require_one_based_indexing(B) require_one_based_indexing(out) if iszero(alpha) _rmul_or_fill!(out, beta) @@ -306,6 +307,7 @@ end return out end @inline function __muldiag!(out, A, D::Diagonal, alpha, beta) + require_one_based_indexing(A) require_one_based_indexing(out) if iszero(alpha) _rmul_or_fill!(out, beta) diff --git a/stdlib/LinearAlgebra/test/diagonal.jl b/stdlib/LinearAlgebra/test/diagonal.jl index 8bc84d93c6348..2801332e840e6 100644 --- a/stdlib/LinearAlgebra/test/diagonal.jl +++ b/stdlib/LinearAlgebra/test/diagonal.jl @@ -9,6 +9,9 @@ const BASE_TEST_PATH = joinpath(Sys.BINDIR, "..", "share", "julia", "test") isdefined(Main, :Furlongs) || @eval Main include(joinpath($(BASE_TEST_PATH), "testhelpers", "Furlongs.jl")) using .Main.Furlongs +isdefined(Main, :OffsetArrays) || @eval Main include(joinpath($(BASE_TEST_PATH), "testhelpers", "OffsetArrays.jl")) +using .Main.OffsetArrays + n=12 #Size of matrix problem to test Random.seed!(1) @@ -785,6 +788,16 @@ end @test_throws DimensionMismatch lmul!(Diagonal([1]), [1,2,3]) # nearby end +@testset "Multiplication of a Diagonal with an OffsetArray" begin + # Offset indices should throw + D = Diagonal(1:4) + A = OffsetArray(rand(4,4), 2, 2) + @test_throws ArgumentError D * A + @test_throws ArgumentError A * D + @test_throws ArgumentError mul!(similar(A, size(A)), A, D) + @test_throws ArgumentError mul!(similar(A, size(A)), D, A) +end + @testset "Triangular division by Diagonal #27989" begin K = 5 for elty in (Float32, Float64, ComplexF32, ComplexF64) From 6f0bfc24b6157c7280cc33d1791d45b322fa8d5b Mon Sep 17 00:00:00 2001 From: KristofferC Date: Wed, 8 Jun 2022 10:47:57 +0200 Subject: [PATCH 189/369] bump Pkg version to latest 1.8 --- .../Pkg-7c1544f092a006556ce46dfaf9a93cb408b705d3.tar.gz/md5 | 1 - .../Pkg-7c1544f092a006556ce46dfaf9a93cb408b705d3.tar.gz/sha512 | 1 - .../Pkg-f0bef8af0ab951d9cf3cceb3c709873737df9471.tar.gz/md5 | 1 + .../Pkg-f0bef8af0ab951d9cf3cceb3c709873737df9471.tar.gz/sha512 | 1 + stdlib/Pkg.version | 2 +- 5 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 deps/checksums/Pkg-7c1544f092a006556ce46dfaf9a93cb408b705d3.tar.gz/md5 delete mode 100644 deps/checksums/Pkg-7c1544f092a006556ce46dfaf9a93cb408b705d3.tar.gz/sha512 create mode 100644 deps/checksums/Pkg-f0bef8af0ab951d9cf3cceb3c709873737df9471.tar.gz/md5 create mode 100644 deps/checksums/Pkg-f0bef8af0ab951d9cf3cceb3c709873737df9471.tar.gz/sha512 diff --git a/deps/checksums/Pkg-7c1544f092a006556ce46dfaf9a93cb408b705d3.tar.gz/md5 b/deps/checksums/Pkg-7c1544f092a006556ce46dfaf9a93cb408b705d3.tar.gz/md5 deleted file mode 100644 index 7b3aa9f19c01b..0000000000000 --- a/deps/checksums/Pkg-7c1544f092a006556ce46dfaf9a93cb408b705d3.tar.gz/md5 +++ /dev/null @@ -1 +0,0 @@ -59386028556257c324385840a93bb43d diff --git a/deps/checksums/Pkg-7c1544f092a006556ce46dfaf9a93cb408b705d3.tar.gz/sha512 b/deps/checksums/Pkg-7c1544f092a006556ce46dfaf9a93cb408b705d3.tar.gz/sha512 deleted file mode 100644 index fbe82d95808ae..0000000000000 --- a/deps/checksums/Pkg-7c1544f092a006556ce46dfaf9a93cb408b705d3.tar.gz/sha512 +++ /dev/null @@ -1 +0,0 @@ -2cd00db324fab2ffe245f9804fc3d1cb8bc733e892d40ec18c02fd69b4c165111e42aacf4654a1d610f933d9bc6868fe9a01e3241116f796ef73fa7d48fd499c diff --git a/deps/checksums/Pkg-f0bef8af0ab951d9cf3cceb3c709873737df9471.tar.gz/md5 b/deps/checksums/Pkg-f0bef8af0ab951d9cf3cceb3c709873737df9471.tar.gz/md5 new file mode 100644 index 0000000000000..86b193c4518a1 --- /dev/null +++ b/deps/checksums/Pkg-f0bef8af0ab951d9cf3cceb3c709873737df9471.tar.gz/md5 @@ -0,0 +1 @@ +e02bd98209effd4e05361f29e0a4abbc diff --git a/deps/checksums/Pkg-f0bef8af0ab951d9cf3cceb3c709873737df9471.tar.gz/sha512 b/deps/checksums/Pkg-f0bef8af0ab951d9cf3cceb3c709873737df9471.tar.gz/sha512 new file mode 100644 index 0000000000000..59d2f75ab089f --- /dev/null +++ b/deps/checksums/Pkg-f0bef8af0ab951d9cf3cceb3c709873737df9471.tar.gz/sha512 @@ -0,0 +1 @@ +983ebbd8531dbccd12f757d4b79bee75a0f8cbeba5d8cdea9ecd945dc3c53cccfe68691952187736a00fb49d368239daa7b43e918809b61d5f6b91dbb7be9aac diff --git a/stdlib/Pkg.version b/stdlib/Pkg.version index b33656cecd56a..abaf21b3b6ba3 100644 --- a/stdlib/Pkg.version +++ b/stdlib/Pkg.version @@ -1,4 +1,4 @@ PKG_BRANCH = master -PKG_SHA1 = 7c1544f092a006556ce46dfaf9a93cb408b705d3 +PKG_SHA1 = f0bef8af0ab951d9cf3cceb3c709873737df9471 PKG_GIT_URL := https://github.com/JuliaLang/Pkg.jl.git PKG_TAR_URL = https://api.github.com/repos/JuliaLang/Pkg.jl/tarball/$1 From 087ba27576bf925136e6199e7c61a404aed7b030 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Thu, 2 Jun 2022 10:49:47 -0400 Subject: [PATCH 190/369] [Profile] `threads` here is wrong to use `nthreads` (#45547) Since the `data` argument possibly does not come from the current configuration, we should not use `nthreads` here either to filter out possibly significant data. (cherry picked from commit b46c14e73163715956b35264fae74eaab74240a8) --- stdlib/Profile/src/Profile.jl | 4 ++-- stdlib/Profile/test/runtests.jl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/stdlib/Profile/src/Profile.jl b/stdlib/Profile/src/Profile.jl index d3d5300c87527..e24544839fc5f 100644 --- a/stdlib/Profile/src/Profile.jl +++ b/stdlib/Profile/src/Profile.jl @@ -220,7 +220,7 @@ The keyword arguments can be any combination of: `:flatc` does the same but also includes collapsing of C frames (may do odd things around `jl_apply`). - `threads::Union{Int,AbstractVector{Int}}` -- Specify which threads to include snapshots from in the report. Note that - this does not control which threads samples are collected on. + this does not control which threads samples are collected on (which may also have been collected on another machine). - `tasks::Union{Int,AbstractVector{Int}}` -- Specify which tasks to include snapshots from in the report. Note that this does not control which tasks samples are collected within. @@ -238,7 +238,7 @@ function print(io::IO, sortedby::Symbol = :filefuncline, groupby::Union{Symbol,AbstractVector{Symbol}} = :none, recur::Symbol = :off, - threads::Union{Int,AbstractVector{Int}} = 1:Threads.nthreads(), + threads::Union{Int,AbstractVector{Int}} = 1:typemax(Int), tasks::Union{UInt,AbstractVector{UInt}} = typemin(UInt):typemax(UInt)) pf = ProfileFormat(;C, combine, maxdepth, mincount, noisefloor, sortedby, recur) diff --git a/stdlib/Profile/test/runtests.jl b/stdlib/Profile/test/runtests.jl index f8f8c52b93123..058158023cd25 100644 --- a/stdlib/Profile/test/runtests.jl +++ b/stdlib/Profile/test/runtests.jl @@ -64,8 +64,8 @@ end iobuf = IOBuffer() with_logger(NullLogger()) do @testset for format in [:flat, :tree] - @testset for threads in [1:Threads.nthreads(), 1, 1:1, 1:2, [1,2]] - @testset for groupby in [:none, :thread, :task, [:thread, :task], [:task, :thread]] + @testset for threads in Any[1:typemax(Int), 1, 1:1, 1:2, [1,2]] + @testset for groupby in Any[:none, :thread, :task, [:thread, :task], [:task, :thread]] Profile.print(iobuf; groupby, threads, format) @test !isempty(String(take!(iobuf))) end From 43df1f44283c3c7cd3e330d1eb7a637a502d8aa5 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Thu, 9 Jun 2022 09:20:50 +0900 Subject: [PATCH 191/369] rename `is_concrete_eval_eligible` utility query to `is_foldable` (#45615) `is_foldable` should be more aligned with `Base.@assume_effects`. This should be backported to 1.8 also. --- base/compiler/abstractinterpretation.jl | 2 +- base/compiler/types.jl | 4 ++-- test/compiler/inference.jl | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index 91063ee8d338c..ca68fca8f9be6 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -720,7 +720,7 @@ function concrete_eval_eligible(interp::AbstractInterpreter, isoverlayed(method_table(interp)) && !is_nonoverlayed(result.edge_effects) && return false return f !== nothing && result.edge !== nothing && - is_concrete_eval_eligible(result.edge_effects) && + is_foldable(result.edge_effects) && is_all_const_arg(arginfo) end diff --git a/base/compiler/types.jl b/base/compiler/types.jl index 75c2da979179d..8893866822102 100644 --- a/base/compiler/types.jl +++ b/base/compiler/types.jl @@ -113,13 +113,13 @@ is_nothrow(effects::Effects) = effects.nothrow === ALWAYS_TRUE is_terminates(effects::Effects) = effects.terminates === ALWAYS_TRUE is_nonoverlayed(effects::Effects) = effects.nonoverlayed -is_concrete_eval_eligible(effects::Effects) = +is_foldable(effects::Effects) = is_consistent(effects) && is_effect_free(effects) && is_terminates(effects) is_total(effects::Effects) = - is_concrete_eval_eligible(effects) && + is_foldable(effects) && is_nothrow(effects) is_removable_if_unused(effects::Effects) = diff --git a/test/compiler/inference.jl b/test/compiler/inference.jl index 3c9650201cf6a..7f7b14b1705c1 100644 --- a/test/compiler/inference.jl +++ b/test/compiler/inference.jl @@ -4086,14 +4086,14 @@ function entry_to_be_invalidated(c) end @test Base.infer_effects((Char,)) do x entry_to_be_invalidated(x) -end |> Core.Compiler.is_concrete_eval_eligible +end |> Core.Compiler.is_foldable @test fully_eliminated(; retval=97) do entry_to_be_invalidated('a') end getcharid(c) = CONST_DICT[c] # now this is not eligible for concrete evaluation @test Base.infer_effects((Char,)) do x entry_to_be_invalidated(x) -end |> !Core.Compiler.is_concrete_eval_eligible +end |> !Core.Compiler.is_foldable @test !fully_eliminated() do entry_to_be_invalidated('a') end From 3a2eb397faf511e12f0385c49bbe1b918cb6fffd Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Mon, 13 Jun 2022 09:44:46 +0200 Subject: [PATCH 192/369] Revert "codegen: explicitly handle Float16 intrinsics (#45249)" (#45627) This reverts commit eb82f1846fdc2d195ab1031fe192b27fd171f148. --- src/APInt-C.cpp | 6 +- src/julia.expmap | 6 + src/julia_internal.h | 14 +- src/llvm-demote-float16.cpp | 276 ++++++------------------------------ src/runtime_intrinsics.c | 64 ++++----- 5 files changed, 82 insertions(+), 284 deletions(-) diff --git a/src/APInt-C.cpp b/src/APInt-C.cpp index f06d4362bf958..bc0a62e21dd3e 100644 --- a/src/APInt-C.cpp +++ b/src/APInt-C.cpp @@ -316,7 +316,7 @@ void LLVMByteSwap(unsigned numbits, integerPart *pa, integerPart *pr) { void LLVMFPtoInt(unsigned numbits, void *pa, unsigned onumbits, integerPart *pr, bool isSigned, bool *isExact) { double Val; if (numbits == 16) - Val = julia__gnu_h2f_ieee(*(uint16_t*)pa); + Val = __gnu_h2f_ieee(*(uint16_t*)pa); else if (numbits == 32) Val = *(float*)pa; else if (numbits == 64) @@ -391,7 +391,7 @@ void LLVMSItoFP(unsigned numbits, integerPart *pa, unsigned onumbits, integerPar val = a.roundToDouble(true); } if (onumbits == 16) - *(uint16_t*)pr = julia__gnu_f2h_ieee(val); + *(uint16_t*)pr = __gnu_f2h_ieee(val); else if (onumbits == 32) *(float*)pr = val; else if (onumbits == 64) @@ -408,7 +408,7 @@ void LLVMUItoFP(unsigned numbits, integerPart *pa, unsigned onumbits, integerPar val = a.roundToDouble(false); } if (onumbits == 16) - *(uint16_t*)pr = julia__gnu_f2h_ieee(val); + *(uint16_t*)pr = __gnu_f2h_ieee(val); else if (onumbits == 32) *(float*)pr = val; else if (onumbits == 64) diff --git a/src/julia.expmap b/src/julia.expmap index 6717f8d00c621..2d801dceae044 100644 --- a/src/julia.expmap +++ b/src/julia.expmap @@ -37,6 +37,12 @@ environ; __progname; + /* compiler run-time intrinsics */ + __gnu_h2f_ieee; + __extendhfsf2; + __gnu_f2h_ieee; + __truncdfhf2; + local: *; }; diff --git a/src/julia_internal.h b/src/julia_internal.h index 8e7079f75364f..4f75cfa6ee299 100644 --- a/src/julia_internal.h +++ b/src/julia_internal.h @@ -1522,18 +1522,8 @@ jl_sym_t *_jl_symbol(const char *str, size_t len) JL_NOTSAFEPOINT; #define JL_GC_ASSERT_LIVE(x) (void)(x) #endif -JL_DLLEXPORT float julia__gnu_h2f_ieee(uint16_t param) JL_NOTSAFEPOINT; -JL_DLLEXPORT uint16_t julia__gnu_f2h_ieee(float param) JL_NOTSAFEPOINT; -JL_DLLEXPORT uint16_t julia__truncdfhf2(double param) JL_NOTSAFEPOINT; -//JL_DLLEXPORT double julia__extendhfdf2(uint16_t n) JL_NOTSAFEPOINT; -//JL_DLLEXPORT int32_t julia__fixhfsi(uint16_t n) JL_NOTSAFEPOINT; -//JL_DLLEXPORT int64_t julia__fixhfdi(uint16_t n) JL_NOTSAFEPOINT; -//JL_DLLEXPORT uint32_t julia__fixunshfsi(uint16_t n) JL_NOTSAFEPOINT; -//JL_DLLEXPORT uint64_t julia__fixunshfdi(uint16_t n) JL_NOTSAFEPOINT; -//JL_DLLEXPORT uint16_t julia__floatsihf(int32_t n) JL_NOTSAFEPOINT; -//JL_DLLEXPORT uint16_t julia__floatdihf(int64_t n) JL_NOTSAFEPOINT; -//JL_DLLEXPORT uint16_t julia__floatunsihf(uint32_t n) JL_NOTSAFEPOINT; -//JL_DLLEXPORT uint16_t julia__floatundihf(uint64_t n) JL_NOTSAFEPOINT; +float __gnu_h2f_ieee(uint16_t param) JL_NOTSAFEPOINT; +uint16_t __gnu_f2h_ieee(float param) JL_NOTSAFEPOINT; #ifdef __cplusplus } diff --git a/src/llvm-demote-float16.cpp b/src/llvm-demote-float16.cpp index a68f8faf2e3a7..3e328424e26d2 100644 --- a/src/llvm-demote-float16.cpp +++ b/src/llvm-demote-float16.cpp @@ -18,7 +18,6 @@ #include "support/dtypes.h" -#include #include #include #include @@ -29,193 +28,15 @@ using namespace llvm; namespace { -inline AttributeSet getFnAttrs(const AttributeList &Attrs) -{ -#if JL_LLVM_VERSION >= 140000 - return Attrs.getFnAttrs(); -#else - return Attrs.getFnAttributes(); -#endif -} - -inline AttributeSet getRetAttrs(const AttributeList &Attrs) -{ -#if JL_LLVM_VERSION >= 140000 - return Attrs.getRetAttrs(); -#else - return Attrs.getRetAttributes(); -#endif -} - -static Instruction *replaceIntrinsicWith(IntrinsicInst *call, Type *RetTy, ArrayRef args) -{ - Intrinsic::ID ID = call->getIntrinsicID(); - assert(ID); - auto oldfType = call->getFunctionType(); - auto nargs = oldfType->getNumParams(); - assert(args.size() > nargs); - SmallVector argTys(nargs); - for (unsigned i = 0; i < nargs; i++) - argTys[i] = args[i]->getType(); - auto newfType = FunctionType::get(RetTy, argTys, oldfType->isVarArg()); - - // Accumulate an array of overloaded types for the given intrinsic - // and compute the new name mangling schema - SmallVector overloadTys; - { - SmallVector Table; - getIntrinsicInfoTableEntries(ID, Table); - ArrayRef TableRef = Table; - auto res = Intrinsic::matchIntrinsicSignature(newfType, TableRef, overloadTys); - assert(res == Intrinsic::MatchIntrinsicTypes_Match); - (void)res; - bool matchvararg = !Intrinsic::matchIntrinsicVarArg(newfType->isVarArg(), TableRef); - assert(matchvararg); - (void)matchvararg; - } - auto newF = Intrinsic::getDeclaration(call->getModule(), ID, overloadTys); - assert(newF->getFunctionType() == newfType); - newF->setCallingConv(call->getCallingConv()); - assert(args.back() == call->getCalledFunction()); - auto newCall = CallInst::Create(newF, args.drop_back(), "", call); - newCall->setTailCallKind(call->getTailCallKind()); - auto old_attrs = call->getAttributes(); - newCall->setAttributes(AttributeList::get(call->getContext(), getFnAttrs(old_attrs), - getRetAttrs(old_attrs), {})); // drop parameter attributes - return newCall; -} - - -static Value* CreateFPCast(Instruction::CastOps opcode, Value *V, Type *DestTy, IRBuilder<> &builder) -{ - Type *SrcTy = V->getType(); - Type *RetTy = DestTy; - if (auto *VC = dyn_cast(V)) { - // The input IR often has things of the form - // fcmp olt half %0, 0xH7C00 - // and we would like to avoid turning that constant into a call here - // if we can simply constant fold it to the new type. - VC = ConstantExpr::getCast(opcode, VC, DestTy, true); - if (VC) - return VC; - } - assert(SrcTy->isVectorTy() == DestTy->isVectorTy()); - if (SrcTy->isVectorTy()) { - unsigned NumElems = cast(SrcTy)->getNumElements(); - assert(cast(DestTy)->getNumElements() == NumElems && "Mismatched cast"); - Value *NewV = UndefValue::get(DestTy); - RetTy = RetTy->getScalarType(); - for (unsigned i = 0; i < NumElems; ++i) { - Value *I = builder.getInt32(i); - Value *Vi = builder.CreateExtractElement(V, I); - Vi = CreateFPCast(opcode, Vi, RetTy, builder); - NewV = builder.CreateInsertElement(NewV, Vi, I); - } - return NewV; - } - auto &M = *builder.GetInsertBlock()->getModule(); - auto &ctx = M.getContext(); - // Pick the Function to call in the Julia runtime - StringRef Name; - switch (opcode) { - case Instruction::FPExt: - // this is exact, so we only need one conversion - assert(SrcTy->isHalfTy()); - Name = "julia__gnu_h2f_ieee"; - RetTy = Type::getFloatTy(ctx); - break; - case Instruction::FPTrunc: - assert(DestTy->isHalfTy()); - if (SrcTy->isFloatTy()) - Name = "julia__gnu_f2h_ieee"; - else if (SrcTy->isDoubleTy()) - Name = "julia__truncdfhf2"; - break; - // All F16 fit exactly in Int32 (-65504 to 65504) - case Instruction::FPToSI: JL_FALLTHROUGH; - case Instruction::FPToUI: - assert(SrcTy->isHalfTy()); - Name = "julia__gnu_h2f_ieee"; - RetTy = Type::getFloatTy(ctx); - break; - case Instruction::SIToFP: JL_FALLTHROUGH; - case Instruction::UIToFP: - assert(DestTy->isHalfTy()); - Name = "julia__gnu_f2h_ieee"; - SrcTy = Type::getFloatTy(ctx); - break; - default: - errs() << Instruction::getOpcodeName(opcode) << ' '; - V->getType()->print(errs()); - errs() << " to "; - DestTy->print(errs()); - errs() << " is an "; - llvm_unreachable("invalid cast"); - } - if (Name.empty()) { - errs() << Instruction::getOpcodeName(opcode) << ' '; - V->getType()->print(errs()); - errs() << " to "; - DestTy->print(errs()); - errs() << " is an "; - llvm_unreachable("illegal cast"); - } - // Coerce the source to the required size and type - auto T_int16 = Type::getInt16Ty(ctx); - if (SrcTy->isHalfTy()) - SrcTy = T_int16; - if (opcode == Instruction::SIToFP) - V = builder.CreateSIToFP(V, SrcTy); - else if (opcode == Instruction::UIToFP) - V = builder.CreateUIToFP(V, SrcTy); - else - V = builder.CreateBitCast(V, SrcTy); - // Call our intrinsic - if (RetTy->isHalfTy()) - RetTy = T_int16; - auto FT = FunctionType::get(RetTy, {SrcTy}, false); - FunctionCallee F = M.getOrInsertFunction(Name, FT); - Value *I = builder.CreateCall(F, {V}); - // Coerce the result to the expected type - if (opcode == Instruction::FPToSI) - I = builder.CreateFPToSI(I, DestTy); - else if (opcode == Instruction::FPToUI) - I = builder.CreateFPToUI(I, DestTy); - else if (opcode == Instruction::FPExt) - I = builder.CreateFPCast(I, DestTy); - else - I = builder.CreateBitCast(I, DestTy); - return I; -} - static bool demoteFloat16(Function &F) { auto &ctx = F.getContext(); + auto T_float16 = Type::getHalfTy(ctx); auto T_float32 = Type::getFloatTy(ctx); SmallVector erase; for (auto &BB : F) { for (auto &I : BB) { - // extend Float16 operands to Float32 - bool Float16 = I.getType()->getScalarType()->isHalfTy(); - for (size_t i = 0; !Float16 && i < I.getNumOperands(); i++) { - Value *Op = I.getOperand(i); - if (Op->getType()->getScalarType()->isHalfTy()) - Float16 = true; - } - if (!Float16) - continue; - - if (auto CI = dyn_cast(&I)) { - if (CI->getOpcode() != Instruction::BitCast) { // aka !CI->isNoopCast(DL) - IRBuilder<> builder(&I); - Value *NewI = CreateFPCast(CI->getOpcode(), I.getOperand(0), I.getType(), builder); - I.replaceAllUsesWith(NewI); - erase.push_back(&I); - } - continue; - } - switch (I.getOpcode()) { case Instruction::FNeg: case Instruction::FAdd: @@ -226,9 +47,6 @@ static bool demoteFloat16(Function &F) case Instruction::FCmp: break; default: - if (auto intrinsic = dyn_cast(&I)) - if (intrinsic->getIntrinsicID()) - break; continue; } @@ -240,67 +58,61 @@ static bool demoteFloat16(Function &F) IRBuilder<> builder(&I); // extend Float16 operands to Float32 - // XXX: Calls to llvm.fma.f16 may need to go to f64 to be correct? + bool OperandsChanged = false; SmallVector Operands(I.getNumOperands()); for (size_t i = 0; i < I.getNumOperands(); i++) { Value *Op = I.getOperand(i); - if (Op->getType()->getScalarType()->isHalfTy()) { - Op = CreateFPCast(Instruction::FPExt, Op, Op->getType()->getWithNewType(T_float32), builder); + if (Op->getType() == T_float16) { + Op = builder.CreateFPExt(Op, T_float32); + OperandsChanged = true; } Operands[i] = (Op); } // recreate the instruction if any operands changed, // truncating the result back to Float16 - Value *NewI; - switch (I.getOpcode()) { - case Instruction::FNeg: - assert(Operands.size() == 1); - NewI = builder.CreateFNeg(Operands[0]); - break; - case Instruction::FAdd: - assert(Operands.size() == 2); - NewI = builder.CreateFAdd(Operands[0], Operands[1]); - break; - case Instruction::FSub: - assert(Operands.size() == 2); - NewI = builder.CreateFSub(Operands[0], Operands[1]); - break; - case Instruction::FMul: - assert(Operands.size() == 2); - NewI = builder.CreateFMul(Operands[0], Operands[1]); - break; - case Instruction::FDiv: - assert(Operands.size() == 2); - NewI = builder.CreateFDiv(Operands[0], Operands[1]); - break; - case Instruction::FRem: - assert(Operands.size() == 2); - NewI = builder.CreateFRem(Operands[0], Operands[1]); - break; - case Instruction::FCmp: - assert(Operands.size() == 2); - NewI = builder.CreateFCmp(cast(&I)->getPredicate(), - Operands[0], Operands[1]); - break; - default: - if (auto intrinsic = dyn_cast(&I)) { - // XXX: this is not correct in general - // some obvious failures include llvm.convert.to.fp16.*, llvm.vp.*to*, llvm.experimental.constrained.*to*, llvm.masked.* - Type *RetTy = I.getType(); - if (RetTy->getScalarType()->isHalfTy()) - RetTy = RetTy->getWithNewType(T_float32); - NewI = replaceIntrinsicWith(intrinsic, RetTy, Operands); + if (OperandsChanged) { + Value *NewI; + switch (I.getOpcode()) { + case Instruction::FNeg: + assert(Operands.size() == 1); + NewI = builder.CreateFNeg(Operands[0]); + break; + case Instruction::FAdd: + assert(Operands.size() == 2); + NewI = builder.CreateFAdd(Operands[0], Operands[1]); + break; + case Instruction::FSub: + assert(Operands.size() == 2); + NewI = builder.CreateFSub(Operands[0], Operands[1]); + break; + case Instruction::FMul: + assert(Operands.size() == 2); + NewI = builder.CreateFMul(Operands[0], Operands[1]); + break; + case Instruction::FDiv: + assert(Operands.size() == 2); + NewI = builder.CreateFDiv(Operands[0], Operands[1]); + break; + case Instruction::FRem: + assert(Operands.size() == 2); + NewI = builder.CreateFRem(Operands[0], Operands[1]); + break; + case Instruction::FCmp: + assert(Operands.size() == 2); + NewI = builder.CreateFCmp(cast(&I)->getPredicate(), + Operands[0], Operands[1]); break; + default: + abort(); } - abort(); + cast(NewI)->copyMetadata(I); + cast(NewI)->copyFastMathFlags(&I); + if (NewI->getType() != I.getType()) + NewI = builder.CreateFPTrunc(NewI, I.getType()); + I.replaceAllUsesWith(NewI); + erase.push_back(&I); } - cast(NewI)->copyMetadata(I); - cast(NewI)->copyFastMathFlags(&I); - if (NewI->getType() != I.getType()) - NewI = CreateFPCast(Instruction::FPTrunc, NewI, I.getType(), builder); - I.replaceAllUsesWith(NewI); - erase.push_back(&I); } } diff --git a/src/runtime_intrinsics.c b/src/runtime_intrinsics.c index f505a9d5e5d5a..9525b655dc5e3 100644 --- a/src/runtime_intrinsics.c +++ b/src/runtime_intrinsics.c @@ -15,6 +15,9 @@ const unsigned int host_char_bit = 8; // float16 intrinsics +// TODO: use LLVM's compiler-rt on all platforms (Xcode already links compiler-rt) + +#if !defined(_OS_DARWIN_) static inline float half_to_float(uint16_t ival) JL_NOTSAFEPOINT { @@ -185,17 +188,22 @@ static inline uint16_t float_to_half(float param) JL_NOTSAFEPOINT return h; } -JL_DLLEXPORT float julia__gnu_h2f_ieee(uint16_t param) +JL_DLLEXPORT float __gnu_h2f_ieee(uint16_t param) { return half_to_float(param); } -JL_DLLEXPORT uint16_t julia__gnu_f2h_ieee(float param) +JL_DLLEXPORT float __extendhfsf2(uint16_t param) +{ + return half_to_float(param); +} + +JL_DLLEXPORT uint16_t __gnu_f2h_ieee(float param) { return float_to_half(param); } -JL_DLLEXPORT uint16_t julia__truncdfhf2(double param) +JL_DLLEXPORT uint16_t __truncdfhf2(double param) { float res = (float)param; uint32_t resi; @@ -217,25 +225,7 @@ JL_DLLEXPORT uint16_t julia__truncdfhf2(double param) return float_to_half(res); } -//JL_DLLEXPORT double julia__extendhfdf2(uint16_t n) { return (double)julia__gnu_h2f_ieee(n); } -//JL_DLLEXPORT int32_t julia__fixhfsi(uint16_t n) { return (int32_t)julia__gnu_h2f_ieee(n); } -//JL_DLLEXPORT int64_t julia__fixhfdi(uint16_t n) { return (int64_t)julia__gnu_h2f_ieee(n); } -//JL_DLLEXPORT uint32_t julia__fixunshfsi(uint16_t n) { return (uint32_t)julia__gnu_h2f_ieee(n); } -//JL_DLLEXPORT uint64_t julia__fixunshfdi(uint16_t n) { return (uint64_t)julia__gnu_h2f_ieee(n); } -//JL_DLLEXPORT uint16_t julia__floatsihf(int32_t n) { return julia__gnu_f2h_ieee((float)n); } -//JL_DLLEXPORT uint16_t julia__floatdihf(int64_t n) { return julia__gnu_f2h_ieee((float)n); } -//JL_DLLEXPORT uint16_t julia__floatunsihf(uint32_t n) { return julia__gnu_f2h_ieee((float)n); } -//JL_DLLEXPORT uint16_t julia__floatundihf(uint64_t n) { return julia__gnu_f2h_ieee((float)n); } -//HANDLE_LIBCALL(F16, F128, __extendhftf2) -//HANDLE_LIBCALL(F16, F80, __extendhfxf2) -//HANDLE_LIBCALL(F80, F16, __truncxfhf2) -//HANDLE_LIBCALL(F128, F16, __trunctfhf2) -//HANDLE_LIBCALL(PPCF128, F16, __trunctfhf2) -//HANDLE_LIBCALL(F16, I128, __fixhfti) -//HANDLE_LIBCALL(F16, I128, __fixunshfti) -//HANDLE_LIBCALL(I128, F16, __floattihf) -//HANDLE_LIBCALL(I128, F16, __floatuntihf) - +#endif // run time version of bitcast intrinsic JL_DLLEXPORT jl_value_t *jl_bitcast(jl_value_t *ty, jl_value_t *v) @@ -561,9 +551,9 @@ static inline unsigned select_by_size(unsigned sz) JL_NOTSAFEPOINT } #define fp_select(a, func) \ - sizeof(a) <= sizeof(float) ? func##f((float)a) : func(a) + sizeof(a) == sizeof(float) ? func##f((float)a) : func(a) #define fp_select2(a, b, func) \ - sizeof(a) <= sizeof(float) ? func##f(a, b) : func(a, b) + sizeof(a) == sizeof(float) ? func##f(a, b) : func(a, b) // fast-function generators // @@ -607,11 +597,11 @@ static inline void name(unsigned osize, void *pa, void *pr) JL_NOTSAFEPOINT \ static inline void name(unsigned osize, void *pa, void *pr) JL_NOTSAFEPOINT \ { \ uint16_t a = *(uint16_t*)pa; \ - float A = julia__gnu_h2f_ieee(a); \ + float A = __gnu_h2f_ieee(a); \ if (osize == 16) { \ float R; \ OP(&R, A); \ - *(uint16_t*)pr = julia__gnu_f2h_ieee(R); \ + *(uint16_t*)pr = __gnu_f2h_ieee(R); \ } else { \ OP((uint16_t*)pr, A); \ } \ @@ -635,11 +625,11 @@ static void jl_##name##16(unsigned runtime_nbits, void *pa, void *pb, void *pr) { \ uint16_t a = *(uint16_t*)pa; \ uint16_t b = *(uint16_t*)pb; \ - float A = julia__gnu_h2f_ieee(a); \ - float B = julia__gnu_h2f_ieee(b); \ + float A = __gnu_h2f_ieee(a); \ + float B = __gnu_h2f_ieee(b); \ runtime_nbits = 16; \ float R = OP(A, B); \ - *(uint16_t*)pr = julia__gnu_f2h_ieee(R); \ + *(uint16_t*)pr = __gnu_f2h_ieee(R); \ } // float or integer inputs, bool output @@ -660,8 +650,8 @@ static int jl_##name##16(unsigned runtime_nbits, void *pa, void *pb) JL_NOTSAFEP { \ uint16_t a = *(uint16_t*)pa; \ uint16_t b = *(uint16_t*)pb; \ - float A = julia__gnu_h2f_ieee(a); \ - float B = julia__gnu_h2f_ieee(b); \ + float A = __gnu_h2f_ieee(a); \ + float B = __gnu_h2f_ieee(b); \ runtime_nbits = 16; \ return OP(A, B); \ } @@ -701,12 +691,12 @@ static void jl_##name##16(unsigned runtime_nbits, void *pa, void *pb, void *pc, uint16_t a = *(uint16_t*)pa; \ uint16_t b = *(uint16_t*)pb; \ uint16_t c = *(uint16_t*)pc; \ - float A = julia__gnu_h2f_ieee(a); \ - float B = julia__gnu_h2f_ieee(b); \ - float C = julia__gnu_h2f_ieee(c); \ + float A = __gnu_h2f_ieee(a); \ + float B = __gnu_h2f_ieee(b); \ + float C = __gnu_h2f_ieee(c); \ runtime_nbits = 16; \ float R = OP(A, B, C); \ - *(uint16_t*)pr = julia__gnu_f2h_ieee(R); \ + *(uint16_t*)pr = __gnu_f2h_ieee(R); \ } @@ -1328,7 +1318,7 @@ static inline int fpiseq##nbits(c_type a, c_type b) JL_NOTSAFEPOINT { \ fpiseq_n(float, 32) fpiseq_n(double, 64) #define fpiseq(a,b) \ - sizeof(a) <= sizeof(float) ? fpiseq32(a, b) : fpiseq64(a, b) + sizeof(a) == sizeof(float) ? fpiseq32(a, b) : fpiseq64(a, b) bool_fintrinsic(eq,eq_float) bool_fintrinsic(ne,ne_float) @@ -1377,7 +1367,7 @@ cvt_iintrinsic(LLVMFPtoUI, fptoui) if (!(osize < 8 * sizeof(a))) \ jl_error("fptrunc: output bitsize must be < input bitsize"); \ else if (osize == 16) \ - *(uint16_t*)pr = julia__gnu_f2h_ieee(a); \ + *(uint16_t*)pr = __gnu_f2h_ieee(a); \ else if (osize == 32) \ *(float*)pr = a; \ else if (osize == 64) \ From 8fd0b2a4fdf37b94529dfca97971686223aec5c6 Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Tue, 14 Jun 2022 14:19:20 +0300 Subject: [PATCH 193/369] AMD Zen 3 CPU support (Fixes #45657) (#45663) (#45667) I've omitted `invpcid` feature since it's clearly omitted for other CPU's. Fixes https://github.com/JuliaLang/julia/issues/45657 (cherry picked from commit 3f047f7efb00a555716e2122c71954392685f014) --- src/processor_x86.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/processor_x86.cpp b/src/processor_x86.cpp index f18c7069fa2c2..3b1f4be4fe932 100644 --- a/src/processor_x86.cpp +++ b/src/processor_x86.cpp @@ -92,6 +92,7 @@ enum class CPU : uint32_t { amd_barcelona, amd_znver1, amd_znver2, + amd_znver3, }; static constexpr size_t feature_sz = 11; @@ -222,6 +223,7 @@ constexpr auto bdver4 = bdver3 | get_feature_masks(avx2, bmi2, mwaitx, movbe, rd constexpr auto znver1 = haswell | get_feature_masks(adx, aes, clflushopt, clzero, mwaitx, prfchw, rdseed, sha, sse4a, xsavec, xsaves); constexpr auto znver2 = znver1 | get_feature_masks(clwb, rdpid, wbnoinvd); +constexpr auto znver3 = znver2 | get_feature_masks(shstk, pku, vaes, vpclmulqdq); } @@ -280,6 +282,7 @@ static constexpr CPUSpec cpus[] = { {"znver1", CPU::amd_znver1, CPU::generic, 0, Feature::znver1}, {"znver2", CPU::amd_znver2, CPU::generic, 0, Feature::znver2}, + {"znver3", CPU::amd_znver3, CPU::amd_znver2, 120000, Feature::znver3}, }; static constexpr size_t ncpu_names = sizeof(cpus) / sizeof(cpus[0]); @@ -543,6 +546,10 @@ static CPU get_amd_processor_name(uint32_t family, uint32_t model, const uint32_ if (model >= 0x30) return CPU::amd_znver2; return CPU::amd_znver1; + case 0x19: // AMD Family 19h + if (model <= 0x0f || model == 0x21) + return CPU::amd_znver3; // 00h-0Fh, 21h: Zen3 + return CPU::amd_znver3; // fallback } } From 8b2e4067f5fc411623a2067900233fed17cf9185 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki Date: Wed, 15 Jun 2022 11:38:35 +0900 Subject: [PATCH 194/369] update `@assume_effects` --- base/expr.jl | 112 ++++++++++++++++++++++++++++++++++----------------- 1 file changed, 74 insertions(+), 38 deletions(-) diff --git a/base/expr.jl b/base/expr.jl index 905332a8f3e94..0ddcf8049656a 100644 --- a/base/expr.jl +++ b/base/expr.jl @@ -381,6 +381,9 @@ end `@assume_effects` overrides the compiler's effect modeling for the given method. `ex` must be a method definition or `@ccall` expression. +!!! compat "Julia 1.8" + Using `Base.@assume_effects` requires Julia version 1.8. + ```jldoctest julia> Base.@assume_effects :terminates_locally function pow(x) # this :terminates_locally allows `pow` to be constant-folded @@ -402,7 +405,7 @@ julia> code_typed() do 1 ─ return 479001600 ) => Int64 -julia> Base.@assume_effects :foldable @ccall jl_type_intersection(Vector{Int}::Any, Vector{<:Integer}::Any)::Any +julia> Base.@assume_effects :total !:nothrow @ccall jl_type_intersection(Vector{Int}::Any, Vector{<:Integer}::Any)::Any Vector{Int64} (alias for Array{Int64, 1}) ``` @@ -423,12 +426,15 @@ The following `setting`s are supported. - `:nothrow` - `:terminates_globally` - `:terminates_locally` +- `:foldable` - `:total` +# Extended help + --- -# `:consistent` +## `:consistent` -The `:consistent` setting asserts that for egal inputs: +The `:consistent` setting asserts that for egal (`===`) inputs: - The manner of termination (return value, exception, non-termination) will always be the same. - If the method returns, the results will always be egal. @@ -461,7 +467,7 @@ The `:consistent` setting asserts that for egal inputs: itself is not required to meet the egality requirement specified above. --- -# `:effect_free` +## `:effect_free` The `:effect_free` setting asserts that the method is free of externally semantically visible side effects. The following is an incomplete list of externally semantically @@ -491,7 +497,7 @@ were not executed. valid for all world ages and limit use of this assertion accordingly. --- -# `:nothrow` +## `:nothrow` The `:nothrow` settings asserts that this method does not terminate abnormally (i.e. will either always return a value or never return). @@ -505,7 +511,7 @@ The `:nothrow` settings asserts that this method does not terminate abnormally `MethodErrors` and similar exceptions count as abnormal termination. --- -# `:terminates_globally` +## `:terminates_globally` The `:terminates_globally` settings asserts that this method will eventually terminate (either normally or abnormally), i.e. does not loop indefinitely. @@ -520,7 +526,7 @@ The `:terminates_globally` settings asserts that this method will eventually ter on a method that *technically*, but not *practically*, terminates. --- -# `:terminates_locally` +## `:terminates_locally` The `:terminates_locally` setting is like `:terminates_globally`, except that it only applies to syntactic control flow *within* the annotated method. It is thus @@ -531,59 +537,79 @@ non-termination if the method calls some other method that does not terminate. `:terminates_globally` implies `:terminates_locally`. --- -# `:total` +## `:foldable` + +This setting is a convenient shortcut for the set of effects that the compiler +requires to be guaranteed to constant fold a call at compile time. It is +currently equivalent to the following `setting`s: -This `setting` combines the following other assertions: - `:consistent` - `:effect_free` -- `:nothrow` - `:terminates_globally` -and is a convenient shortcut. + +!!! note + This list in particular does not include `:nothrow`. The compiler will still + attempt constant propagation and note any thrown error at compile time. Note + however, that by the `:consistent`-cy requirements, any such annotated call + must consistently throw given the same argument values. --- -# `:foldable` +## `:total` -This `setting` combines the following other assertions: +This `setting` is the maximum possible set of effects. It currently implies +the following other `setting`s: - `:consistent` - `:effect_free` +- `:nothrow` - `:terminates_globally` -and is a convenient shortcut. -!!! note - This setting is particularly useful since it allows the compiler to evaluate a call of - the applied method when all the call arguments are fully known to be constant, no matter - if the call results in an error or not. - - `@assume_effects :foldable` is similar to [`@pure`](@ref) with the primary - distinction that the `:consistent`-cy requirement applies world-age wise rather - than globally as described above. However, in particular, a method annotated - `@pure` should always be `:total` or `:foldable`. - Another advantage is that effects introduced by `@assume_effects` are propagated to - callers interprocedurally while a purity defined by `@pure` is not. +!!! warning + `:total` is a very strong assertion and will likely gain additional semantics + in future versions of Julia (e.g. if additional effects are added and included + in the definition of `:total`). As a result, it should be used with care. + Whenever possible, prefer to use the minimum possible set of specific effect + assertions required for a particular application. In cases where a large + number of effect overrides apply to a set of functions, a custom macro is + recommended over the use of `:total`. + +--- +## Negated effects + +Effect names may be prefixed by `!` to indicate that the effect should be removed +from an earlier meta effect. For example, `:total !:nothrow` indicates that while +the call is generally total, it may however throw. + +--- +## Comparison to `@pure` + +`@assume_effects :foldable` is similar to [`@pure`](@ref) with the primary +distinction that the `:consistent`-cy requirement applies world-age wise rather +than globally as described above. However, in particular, a method annotated +`@pure` should always be at least `:foldable`. +Another advantage is that effects introduced by `@assume_effects` are propagated to +callers interprocedurally while a purity defined by `@pure` is not. """ macro assume_effects(args...) (consistent, effect_free, nothrow, terminates_globally, terminates_locally) = (false, false, false, false, false, false) - for setting in args[1:end-1] - if isa(setting, QuoteNode) - setting = setting.value - end + for org_setting in args[1:end-1] + (setting, val) = compute_assumed_setting(org_setting) if setting === :consistent - consistent = true + consistent = val elseif setting === :effect_free - effect_free = true + effect_free = val elseif setting === :nothrow - nothrow = true + nothrow = val elseif setting === :terminates_globally - terminates_globally = true + terminates_globally = val elseif setting === :terminates_locally - terminates_locally = true - elseif setting === :total - consistent = effect_free = nothrow = terminates_globally = true + terminates_locally = val elseif setting === :foldable - consistent = effect_free = terminates_globally = true + consistent = effect_free = terminates_globally = val + elseif setting === :total + consistent = effect_free = nothrow = terminates_globally = val else - throw(ArgumentError("@assume_effects $setting not supported")) + throw(ArgumentError("@assume_effects $org_setting not supported")) end end ex = args[end] @@ -598,6 +624,16 @@ macro assume_effects(args...) return esc(pushmeta!(ex, :purity, consistent, effect_free, nothrow, terminates_globally, terminates_locally)) end +function compute_assumed_setting(@nospecialize(setting), val::Bool=true) + if isexpr(setting, :call) && setting.args[1] === :(!) + return compute_assumed_setting(setting.args[2], !val) + elseif isa(setting, QuoteNode) + return compute_assumed_setting(setting.value, val) + else + return (setting, val) + end +end + """ @propagate_inbounds From 38b836a35a8cc61187308eb29526f2923f851cc9 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Sun, 19 Jun 2022 18:25:39 -0400 Subject: [PATCH 195/369] Update LLVM to 13.0.1+1 --- deps/Versions.make | 8 +- deps/checksums/clang | 116 ++++---- deps/checksums/llvm | 498 +++++++++++++++++--------------- stdlib/libLLVM_jll/Project.toml | 2 +- 4 files changed, 329 insertions(+), 295 deletions(-) diff --git a/deps/Versions.make b/deps/Versions.make index e5218b296682d..eedc380a95822 100644 --- a/deps/Versions.make +++ b/deps/Versions.make @@ -15,7 +15,7 @@ CSL_JLL_NAME := CompilerSupportLibraries # Clang (paired with LLVM, only here as a JLL download) CLANG_JLL_NAME := Clang -CLANG_JLL_VER := 13.0.1+0 +CLANG_JLL_VER := 13.0.1+1 # DSFMT DSFMT_VER := 2.2.4 @@ -45,13 +45,13 @@ LIBUV_JLL_NAME := LibUV # LLVM LLVM_VER := 13.0.1 -LLVM_ASSERT_JLL_VER := 13.0.1+0 +LLVM_ASSERT_JLL_VER := 13.0.1+1 LLVM_JLL_NAME := libLLVM # LLVM_tools (downloads LLVM_jll to get things like `lit` and `opt`) LLVM_TOOLS_JLL_NAME := LLVM -LLVM_TOOLS_JLL_VER := 13.0.1+0 -LLVM_TOOLS_ASSERT_JLL_VER := 13.0.1+0 +LLVM_TOOLS_JLL_VER := 13.0.1+1 +LLVM_TOOLS_ASSERT_JLL_VER := 13.0.1+1 # LLVM libunwind LLVMUNWIND_VER := 12.0.1 diff --git a/deps/checksums/clang b/deps/checksums/clang index 68f28d9640b21..882d4476797a9 100644 --- a/deps/checksums/clang +++ b/deps/checksums/clang @@ -1,58 +1,58 @@ -Clang.v13.0.1+0.aarch64-apple-darwin.tar.gz/md5/e94db5924ccf13ba54642df7c93c69a9 -Clang.v13.0.1+0.aarch64-apple-darwin.tar.gz/sha512/1f77b8ea9f67e46a6fc65f58ba5cf5c451d97e8f94c3842e228886fb7571a07e544de78872e5d7f201e03a6b43ab0d94b9bfd538a3f73d7b6b53f442871c61df -Clang.v13.0.1+0.aarch64-linux-gnu-cxx03.tar.gz/md5/ed984baafbcd36c4627a45dc0edf9a11 -Clang.v13.0.1+0.aarch64-linux-gnu-cxx03.tar.gz/sha512/13ca14c74e4544bbc069ac562f296a73bfa347cb5cd015638f1bffc047f9395aaf49947040a61ceab360a50cea928d002752b1b01210662c286981832844c584 -Clang.v13.0.1+0.aarch64-linux-gnu-cxx11.tar.gz/md5/1f1207b0522351e57a55f0e05c98d6ce -Clang.v13.0.1+0.aarch64-linux-gnu-cxx11.tar.gz/sha512/7fa39fe15b3aaeec37cba5563a46423990b48bfc8a1f185797050de0bce9293ef0893603aec578c3aadbebab53d07caf33198eda7507876a49be9ec15cdbb1fd -Clang.v13.0.1+0.aarch64-linux-musl-cxx03.tar.gz/md5/37b49d0d02a5911b74523cb8f8a1abf1 -Clang.v13.0.1+0.aarch64-linux-musl-cxx03.tar.gz/sha512/1a5307498c9a1eec6e80bc1641fbd5819847ce504ee0c53c07cd09a5b15976649750364755b3ff5f851ffa197eaf6d69a74c4a96cc3b3e6d44c6ca66afd3cff9 -Clang.v13.0.1+0.aarch64-linux-musl-cxx11.tar.gz/md5/ea5974f42ceea627ba96fac88e0f0ed9 -Clang.v13.0.1+0.aarch64-linux-musl-cxx11.tar.gz/sha512/15d2c0526accb8610e64f9a4bf9cd9d72c3c903727fa4af129fbdce0af350295546c8a5e58c3a59196d511e30e57d7b0c448a087fadb60806cc0ac2fc5dba2f9 -Clang.v13.0.1+0.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/3db46a89eb9323734fc4a4f6dcdb558e -Clang.v13.0.1+0.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/bdd974cdc6ce4974fd1a0e594535efc66ffd14d9cc4f6421046b836337e950d983d67f23e7af12b59c62d0254df05b5a8dd19a5503e67b00d5d9442d85a789ef -Clang.v13.0.1+0.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/fa0f8ba9ed675da78f19b7212a3f8a89 -Clang.v13.0.1+0.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/b96b4121bd327fe004dc335382e2aa5193acdee411ec5b5a5fc449c209bf94d2645d40f43f15e9ddd92d5848a1f87c792e2852dccba2d469de2e1a9ea95f5ef6 -Clang.v13.0.1+0.armv6l-linux-musleabihf-cxx03.tar.gz/md5/33e2cc2bc2883ee2d34c19b89927f736 -Clang.v13.0.1+0.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/a35f10aa8412b008ec181d71dd575284ecdc103cf41f0e1c52c1e856cc26e77f566cfc3a581394b52b87d4fcb11616b7824631c389ee711c5786d43dc5ff52de -Clang.v13.0.1+0.armv6l-linux-musleabihf-cxx11.tar.gz/md5/8990c4b777810f1335bfd2d2ace2cf3e -Clang.v13.0.1+0.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/e92999e8112316b7806756967cbb1424a68c9415e03c7f9c1203a0450485f4f1d48d6e8341439ce3d63a9e88c4b6db46ce4f886db353e31dbcf3111f8e5744fd -Clang.v13.0.1+0.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/91a4810d844aea695f7114bf1ac80207 -Clang.v13.0.1+0.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/310ce9579c637de268e18c4f5cc31f5023784be36f3073273927c9ade7299326fb801759f0f5828cdf04580104502651e9b532d4a6b2934aa8d39acbad118956 -Clang.v13.0.1+0.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/73c0c2c6533af4964892dba587c8b5fe -Clang.v13.0.1+0.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/b0b311acc95a731fc791d578b6b1fc65834c98e1b551d91f0a4ac03f79c27af16427f0397a1f6f380ad4b77c9aa38465a207cf472f39e0651b39e54695150481 -Clang.v13.0.1+0.armv7l-linux-musleabihf-cxx03.tar.gz/md5/e6b6bb1aa23fbbf60ac52bad871e9dbf -Clang.v13.0.1+0.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/66e90be4aed8a5cf9becb929915156b3c2fb0bb8b2ee8c3a8f06c3e7c24fa84b69b37493843d0609020b6a7263b0df7ab2793dd0f6ce01b79d7f5a350cde2ac1 -Clang.v13.0.1+0.armv7l-linux-musleabihf-cxx11.tar.gz/md5/9dcd26df744a47a1cefea19f17935b29 -Clang.v13.0.1+0.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/a72d97d581f99be56cf8a6853662c77cabb3001eec4fcb802ec3278ab84517e96726373414f67c87c0926e25ce170f22c930b2bf804b0067b1511d6cfc61b00f -Clang.v13.0.1+0.i686-linux-gnu-cxx03.tar.gz/md5/9c1094a09da852d4bb48f7a60e0c83cb -Clang.v13.0.1+0.i686-linux-gnu-cxx03.tar.gz/sha512/6f62fb75f64c8b8adbae1ca8db44c4a4795ad6eae0673982aa18122282fb784c796107cc3a9a54e435694b4a898c63c86797317d7e37a0d8f1110f4fcbe4ef58 -Clang.v13.0.1+0.i686-linux-gnu-cxx11.tar.gz/md5/5d22a3bedc62200471878a42001fc39d -Clang.v13.0.1+0.i686-linux-gnu-cxx11.tar.gz/sha512/7fb2041030245c2e997f51cb3406ed5307def6dd5c23b1a32fff19b3dc03b59de1a0f2d6d530abb89ab0a2514110dfdffb53bb0178337f29f28d3fcaf00f8ce1 -Clang.v13.0.1+0.i686-linux-musl-cxx03.tar.gz/md5/fcc97104506c26f5161fd94b973dbb46 -Clang.v13.0.1+0.i686-linux-musl-cxx03.tar.gz/sha512/99a42e5d583442432175357546811c7fede695f4d3d6026eb9d02585539d7c21ccf1adb449de47bb248d602a5297ae1923766fadd52487806729f95381ebcfd5 -Clang.v13.0.1+0.i686-linux-musl-cxx11.tar.gz/md5/1a712b6fa8672da1db6528dd655a8bf7 -Clang.v13.0.1+0.i686-linux-musl-cxx11.tar.gz/sha512/eafc025c261f79dc646766aced9962b1901c820a2691e230f2610f499687905b34feffe65a241b885187f79dd83688dc796cd5adcd3af304effe75190098d6d4 -Clang.v13.0.1+0.i686-w64-mingw32-cxx03.tar.gz/md5/7d9f36bc0be2b02443adafb6e57a180f -Clang.v13.0.1+0.i686-w64-mingw32-cxx03.tar.gz/sha512/0642c87e349ae10c7ea8f48388a600ff97a276b23b7936ca35ac6d9a1f686c70d1ec4cc7e4a893aca13f8109b5368d2ca52113021d18ba33912c375007ac1051 -Clang.v13.0.1+0.i686-w64-mingw32-cxx11.tar.gz/md5/034d5fb31a4b749f7fcf13742d5d211c -Clang.v13.0.1+0.i686-w64-mingw32-cxx11.tar.gz/sha512/9313dcf2a807d349be44b827d34f44f9780f14a93e7b432ff99346c7e352c42e3938fc6fee508f9b1896853823f524410ce7fb85a7b3e542e474df3c20d810d3 -Clang.v13.0.1+0.powerpc64le-linux-gnu-cxx03.tar.gz/md5/7b7286c7ce9e383a6180442ada1b21c2 -Clang.v13.0.1+0.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/c9a10e970a93c2d0fe7cd1952f4c152a51c51648376ab0ebf41a736d89a20121c2f9744104290ca4377a397ee612d6af85f117817aea0c49a2ac8d4a861664e8 -Clang.v13.0.1+0.powerpc64le-linux-gnu-cxx11.tar.gz/md5/53f47082122cd88d411af8ad98adf344 -Clang.v13.0.1+0.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/8672668843e4aed4fa0c8acfc28066a2acfaffa47f46c3a4f6bfeeec4824269fc063860c848c737b76e009b15e8c0132ed6b63b2904b96bb1d0df5cf7d835022 -Clang.v13.0.1+0.x86_64-apple-darwin.tar.gz/md5/deb4584aa670642d499454aafe32b809 -Clang.v13.0.1+0.x86_64-apple-darwin.tar.gz/sha512/e4de906392344ba21a7ebee11a8bbce0e422f8460d39de31980a9637a52e88d49db6ea22b094d3ea1c27283062d7abc6d45fc570aeddc067d1e28f573c00c8fd -Clang.v13.0.1+0.x86_64-linux-gnu-cxx03.tar.gz/md5/8c999db749701fd4a4df7486f740c89f -Clang.v13.0.1+0.x86_64-linux-gnu-cxx03.tar.gz/sha512/ea9661825f40a31ae238b5644693767106710a9e157e1f7d715dab5faf63ff8433117e2507eeb863f0a25deed669cc0bfee750af961f6d167db27d7cf8b75819 -Clang.v13.0.1+0.x86_64-linux-gnu-cxx11.tar.gz/md5/7f09aa135ce9ae07586d075414a44e87 -Clang.v13.0.1+0.x86_64-linux-gnu-cxx11.tar.gz/sha512/93f75720fd620ca46997c7fd6f401cb45063afc8f860eb3c361f285d85ab5c4e902a13ca3abefae48cfe1e8fb902adde4341f2aabf72c3b188573054b81c6b9e -Clang.v13.0.1+0.x86_64-linux-musl-cxx03.tar.gz/md5/fd701653e03d835e67b5c0930c281034 -Clang.v13.0.1+0.x86_64-linux-musl-cxx03.tar.gz/sha512/7cf9180caa5d4b333842a41f3f451cd389457aee9ea83fa2405f655804f3c74d9be2d9e887bd6a787fe817afbde36ad658d4ae49b63ec1ebce0ed77c62326442 -Clang.v13.0.1+0.x86_64-linux-musl-cxx11.tar.gz/md5/15fb3d47ee056a15d8f14799ff5fe45a -Clang.v13.0.1+0.x86_64-linux-musl-cxx11.tar.gz/sha512/3cc641ebe266d959e0c5699c59d655095a5b596340e991cc9d4462a5674fa50d89d7cc1937582011464c8568306babe21cef0c4bd1d99430687fd17f3a6f479e -Clang.v13.0.1+0.x86_64-unknown-freebsd.tar.gz/md5/b4f855841995f513a632905184e6271c -Clang.v13.0.1+0.x86_64-unknown-freebsd.tar.gz/sha512/d3390ea1ee311b49d355f9a6c41669575fbd3b66ddbc9791cfcb47673e19796d3cdd210469fecf351a57060d7447d9678980f022bbae1b4cda5799e8ece6aecf -Clang.v13.0.1+0.x86_64-w64-mingw32-cxx03.tar.gz/md5/323038a69d2760ac4c4cb6f3f712231b -Clang.v13.0.1+0.x86_64-w64-mingw32-cxx03.tar.gz/sha512/51073b2862447c184c54b47a02d27d20733024f1d11d4d2f15938c47bb47f94002b56dc60994165cf416079b74d1850445d521811356070bccec0e32f09071fc -Clang.v13.0.1+0.x86_64-w64-mingw32-cxx11.tar.gz/md5/a7e7405baa541ca5bcf44468274c179d -Clang.v13.0.1+0.x86_64-w64-mingw32-cxx11.tar.gz/sha512/07590b6f3ea2456f5bbf7aa87248b8462e60b8ca0f8c4c4ea419bf093efec232057551aee9e93114bff2cd7ee9a76ccec9515be632b94f4e6c17af4aae3478d6 +Clang.v13.0.1+1.aarch64-apple-darwin.tar.gz/md5/05f7af4b9ba5370ea9fc4e7fd3391a58 +Clang.v13.0.1+1.aarch64-apple-darwin.tar.gz/sha512/df4a859bae20ecb02ddb5f187aab79901770125840f059daee12bfc5cb3a838fe01d01b40c01753daf986c77e6fe272bd64f520cb58ad5add0858a08b2382e0d +Clang.v13.0.1+1.aarch64-linux-gnu-cxx03.tar.gz/md5/dbec252a66a927c49a2d02a6ee8d0b4b +Clang.v13.0.1+1.aarch64-linux-gnu-cxx03.tar.gz/sha512/ac3f44f14079b6a03efe961857781fc5cf806f433501c14825f2b512e0b43e8d4dfaf24938259bf8f496f2ca71044d2cff3be319caeb16330e7c883a1829796b +Clang.v13.0.1+1.aarch64-linux-gnu-cxx11.tar.gz/md5/ab811581c7c80d899c90e1006396e3d2 +Clang.v13.0.1+1.aarch64-linux-gnu-cxx11.tar.gz/sha512/ec40a541c16a1856e5862407b07e97e9281ae05ca058091f5b08444ae13cdfe5e2cb8f64acc10726cc063d1686cf3d45e1843d5610887e323d195806502f65d9 +Clang.v13.0.1+1.aarch64-linux-musl-cxx03.tar.gz/md5/9ebebc4eab0da13f62671a83c4d55c8a +Clang.v13.0.1+1.aarch64-linux-musl-cxx03.tar.gz/sha512/b49aaedef528e25f326d9f50bbe117426096084b488e856aa645b76c649d9b3065db8e8d0c807dad1e2195465246c66118dda29aebdccd6406c1447ae235853c +Clang.v13.0.1+1.aarch64-linux-musl-cxx11.tar.gz/md5/e06a0861882f944265d238c704d5a186 +Clang.v13.0.1+1.aarch64-linux-musl-cxx11.tar.gz/sha512/eddcdbdce00918dffb9886ecd23c721e71a8829af7e5278295c0e46af724609426bc41075add6d672e26f916ad6e92fba9267f9873d639a6b58f68e974129458 +Clang.v13.0.1+1.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/bd62242e87f2ae395d2916496861239d +Clang.v13.0.1+1.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/2da9e09095e0018d10bcce799414b322ac5c16b9498a0363dcee8959e5ada1318048a883069fcab22fccc31e431dc5cb7574c92d6c248839917d43a8777ccc0f +Clang.v13.0.1+1.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/37e292b042d32e4f3715c0197fae843d +Clang.v13.0.1+1.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/01d2f8a716292219f3f67b2fa419e4c94dadc313e9a65fc82e5d6ededcbd0f238349c9bb9536918426dad2b29bc83bedaa6cc60e7c65c35357992458b7224909 +Clang.v13.0.1+1.armv6l-linux-musleabihf-cxx03.tar.gz/md5/b821a30f9b9d6654738292b717d7a453 +Clang.v13.0.1+1.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/c0acb5a3d8200aa4d6c49c89b3d743e32a842723f4ee38a74a93a2e782cb7092da473bc1744ec5c04ec06ba63f80cd3ee201cccd09d1141b3e353014e28b6344 +Clang.v13.0.1+1.armv6l-linux-musleabihf-cxx11.tar.gz/md5/14330caa3c8e69063aae2fdf911a38b7 +Clang.v13.0.1+1.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/6186042e7452fc1002899b222f36c1ff88f4c9520508c43b37116c44724f6f15e0108fd98333bd5bc909df4ba569e07431ab42f48804f1d438526d7a07907699 +Clang.v13.0.1+1.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/2bd49548dfeb0fc4f42ba433986ab3bf +Clang.v13.0.1+1.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/a370e05e14de148e7fc0ba8f9767ffe864b27d71893678303fe42f7c7dcfd163216fb02ea56a483498a2f39a8ed3f89e18a3c34fb3dd04189a240220810d95e9 +Clang.v13.0.1+1.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/32fc735c395f6f6337e0d7521afcface +Clang.v13.0.1+1.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/1ce34f426b28a67d0e9b1edef12b508d57cd23ade1cf34b3b32896cc8fc923dceed7e0e1c85cebc719f7a185281bac9ce402bebe325e6fedbdcb9800876fa5ac +Clang.v13.0.1+1.armv7l-linux-musleabihf-cxx03.tar.gz/md5/dd5e7b0e1d8c11835fbf0e51f0b5b7ac +Clang.v13.0.1+1.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/49019a4baeb44860978ae40ca89f589806d0119ca545e93f783afc43d3b648a2ea5dce8a442307ed280dea1bff54b73404165042aaaed5ec5fb804809da3ff31 +Clang.v13.0.1+1.armv7l-linux-musleabihf-cxx11.tar.gz/md5/4349bc24cc4ec33bf572b364232e4440 +Clang.v13.0.1+1.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/f45aa5d7434b4510488c7b030b1e612a11e9b96cc5355c2e84b650f4f5fbda8583100d37a3a01fa64930c57d2c07e441a74ab8f7cd20767158633b56381d7bef +Clang.v13.0.1+1.i686-linux-gnu-cxx03.tar.gz/md5/c6c2e8b945bf2c995cdc47b6de93aa54 +Clang.v13.0.1+1.i686-linux-gnu-cxx03.tar.gz/sha512/32d68ee12b14c233e7ac96d7a6c0ecfd54783781c2ba87d3efd628cf08d1ec45522bdb731e860c21bb318795182abb91dccdcd32d371c0cdf23201d013f29ce5 +Clang.v13.0.1+1.i686-linux-gnu-cxx11.tar.gz/md5/49eb5eb68f665f90ad224d108d8edd08 +Clang.v13.0.1+1.i686-linux-gnu-cxx11.tar.gz/sha512/ee089f59c85469c15d8fe657f9ca6472b6ec02b18ac247b2e0c0f46ca29500f3e3adac528690992f7553cabc8143be57104cb818dc693bd7943fcf2c76b464d2 +Clang.v13.0.1+1.i686-linux-musl-cxx03.tar.gz/md5/54e66afa5e0214779ad85023af0dd03b +Clang.v13.0.1+1.i686-linux-musl-cxx03.tar.gz/sha512/2ef046bc58aa58fc89472f72d5198b7f582412aba80903def0e3999dadd0a27ab09315d78f233b88367a7da95e15b1e991ec760b32116c47d54cb39e3c3e254d +Clang.v13.0.1+1.i686-linux-musl-cxx11.tar.gz/md5/26186d54f1c54b546421020ecb4c9b42 +Clang.v13.0.1+1.i686-linux-musl-cxx11.tar.gz/sha512/2e1e49ac2bae1d8acda519a44ddcf592bf79c779a054a0bf6427e3ca9e71feba82990f9284bbb3f43380445dd9ab5b42156def1f9057ed66024c3680afcd7f9e +Clang.v13.0.1+1.i686-w64-mingw32-cxx03.tar.gz/md5/4d85b5669fb8255ed0385f5b8072bffb +Clang.v13.0.1+1.i686-w64-mingw32-cxx03.tar.gz/sha512/9fe8af9550abee09ca8165c77d3e951da8985680800428af064812103fb6320415a1985b9a6547f840e85283e81b3869d8921a600735cfc15f98c080275c4858 +Clang.v13.0.1+1.i686-w64-mingw32-cxx11.tar.gz/md5/134da223a307a12d74dad19b3b4c7eb4 +Clang.v13.0.1+1.i686-w64-mingw32-cxx11.tar.gz/sha512/3b05f2e3bf40a923cd3ee7eea2edd5706147475ada69607ec37ebbf9fad76dc25eb8c6a85a10ac51975ee4da67a69775f11bc4691475f30510b0e1359e6c5287 +Clang.v13.0.1+1.powerpc64le-linux-gnu-cxx03.tar.gz/md5/cb157fa29f1dc74cdbe902b615bb9c3c +Clang.v13.0.1+1.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/6d13489974543a65a090cebe2846825ff42a2332111e76790bb08c3189f7120b6fb5621a723d2afca2d002d9cd13ee69ec23e1d137de3769866cf0b85afbf714 +Clang.v13.0.1+1.powerpc64le-linux-gnu-cxx11.tar.gz/md5/92b51bc77c86138a0de5d46f3e931258 +Clang.v13.0.1+1.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/0363458dcf55ec8f766ef556faecb73e1ae64cc90454aa890333e4b9ba4e1154990639adda61927857bf8ab6ce1fd2f8372f77a90d8dfcd0a1caba1b09ccc092 +Clang.v13.0.1+1.x86_64-apple-darwin.tar.gz/md5/27ea4c510f2e13ad8ad126e1bb7975d5 +Clang.v13.0.1+1.x86_64-apple-darwin.tar.gz/sha512/fd598a49518c18ec1ac02c17da7fd2a0a2da569e98611e3a62612d7b4a8603c5984d1a0bce5d7040fdb727b76ceeafb5cd2cf6488dc12f3eb6f5152cd47bbd30 +Clang.v13.0.1+1.x86_64-linux-gnu-cxx03.tar.gz/md5/1f84ef2b7e7c6b53ea6d4d1aec82d548 +Clang.v13.0.1+1.x86_64-linux-gnu-cxx03.tar.gz/sha512/90f7945c4d3ce89d749f13902cd889c9f7851ed705b9d7cc28bb6cc7ac066c97617b7dcc16c189f50754f3129d7dd0138f7e1423f43110d6bb4d8b2f64f03c6d +Clang.v13.0.1+1.x86_64-linux-gnu-cxx11.tar.gz/md5/86aae8993938bc5ca72b58b843a83f00 +Clang.v13.0.1+1.x86_64-linux-gnu-cxx11.tar.gz/sha512/b5c2a3026fd7ab8b87e4bd8cf7e8f70b1365d68c49a8603e366e6bfc8cdf8ec198f3eb88958d2d2b8c287cf4cca193bab7f1b41bb0e521c0e392ede98bf26c9a +Clang.v13.0.1+1.x86_64-linux-musl-cxx03.tar.gz/md5/518f4b30c12a2d9ef0784757fdcfe482 +Clang.v13.0.1+1.x86_64-linux-musl-cxx03.tar.gz/sha512/96f58786bb8ca96f64dd8a32fd77c2754d8d708b8e6d1e0c5c0e05bffc32391d97034b8a4a371e2457ca30e16df5d8cd60357da1dd7ebc791ea6c3a1ca3e8a89 +Clang.v13.0.1+1.x86_64-linux-musl-cxx11.tar.gz/md5/102cb3d4607be09856bceb5dd9411381 +Clang.v13.0.1+1.x86_64-linux-musl-cxx11.tar.gz/sha512/82dea651ed8cf6a49493bf94141e867c8f2fdb182c25e8ab888ec8ee8f2d5180596ceb57a52cb2f76f57c5426a4d087f65ff064072b7aae292d0b38e736228a8 +Clang.v13.0.1+1.x86_64-unknown-freebsd.tar.gz/md5/3dcfdb2c9a4725813e03a9ef5eb1f9bf +Clang.v13.0.1+1.x86_64-unknown-freebsd.tar.gz/sha512/f39f2e034456427dd555b83cfd56522a184f2998a1b817518fd59fba0628900c7715084194211b077f4c302ef581f2163447daa83d828afb02f888c381c12d12 +Clang.v13.0.1+1.x86_64-w64-mingw32-cxx03.tar.gz/md5/7759171242e4e80a08a17138057daee6 +Clang.v13.0.1+1.x86_64-w64-mingw32-cxx03.tar.gz/sha512/f5a516b1aa3637dbf6d975cf2562e45e6e347e3ed0df4f754a02bd0baab730f3c1c3727c1ca4cfba7e20c961c9f2f333e4452c970f39c5f29f58e42e281749d7 +Clang.v13.0.1+1.x86_64-w64-mingw32-cxx11.tar.gz/md5/2ad677cfbab8bf6e4c2db583cb708003 +Clang.v13.0.1+1.x86_64-w64-mingw32-cxx11.tar.gz/sha512/81aeec84c945a1055a0e95d17050a862ed8742547355fa3e8686fd511eb451f80f6fa89bfedc46e44d45aec5f678029f5ccddf80480121654eb620f86f76d1cd diff --git a/deps/checksums/llvm b/deps/checksums/llvm index 6cb85ecdc0d3b..c8b39ced22cdd 100644 --- a/deps/checksums/llvm +++ b/deps/checksums/llvm @@ -1,234 +1,268 @@ -LLVM.v13.0.1+0.aarch64-apple-darwin.tar.gz/md5/de198200e72a0176aeb383bdc916b472 -LLVM.v13.0.1+0.aarch64-apple-darwin.tar.gz/sha512/84e5472df5a89821baa7c7f5f787d576a4fb312738da194af3d79dda916c5f69bcff05e693d76f15e00af6c6832a26e01933fb0c33b57225dca5a048869c9ea8 -LLVM.v13.0.1+0.aarch64-linux-gnu-cxx03.tar.gz/md5/ad3571e776e2fdc16d7ea54b236929b4 -LLVM.v13.0.1+0.aarch64-linux-gnu-cxx03.tar.gz/sha512/f9ceb4c1389301fd8d85bebf966f9482fcea31a5767fd2dc89c460f4404549ae9df68ac1d52e0948c75910665b857090d62ca53e84a09cc191ca265f460f2975 -LLVM.v13.0.1+0.aarch64-linux-gnu-cxx11.tar.gz/md5/27ce9c71e0c41e1f72e54b7a4c6f4826 -LLVM.v13.0.1+0.aarch64-linux-gnu-cxx11.tar.gz/sha512/941de4e99e24ea33944a3e93fc4c486b9adb9c721a641656803996785138eff9dff929ee4b3261dd57916086da3ee2dc7489a255c44ed8d2f0a1d2a915bf875c -LLVM.v13.0.1+0.aarch64-linux-musl-cxx03.tar.gz/md5/e4a26e2ffd866a29d276f20565a0e76d -LLVM.v13.0.1+0.aarch64-linux-musl-cxx03.tar.gz/sha512/0c5c7b8641a02c53ce24d40183638986651e644e423fe43b58f3657a6dd21f294c43dcca588dd04c044d65745f8d493f1353cfd168be0cb4f5b68f63df921468 -LLVM.v13.0.1+0.aarch64-linux-musl-cxx11.tar.gz/md5/ff6fe3eb7392178db4fe8fa65a61dd7b -LLVM.v13.0.1+0.aarch64-linux-musl-cxx11.tar.gz/sha512/1e69c89cb616d9ea9b2f6a863f44d0fa83e2e181f8de66dc478faf3881a06d8b6a81a032607064a952b37b1ee5d25df06105ba4d2758e2da3698e7394ab69a7d -LLVM.v13.0.1+0.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/a0498659a1f2e896762421cb4f6d2a9f -LLVM.v13.0.1+0.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/8811f7ad799f0a31191eb7d8dc3e13fae3b47b1372aef99e02b3477e3e75de87da6d7dc3a8f7972ffa5ebbef4c58846d57981021b944ef8a7b303083322559d9 -LLVM.v13.0.1+0.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/2f5ecc129ff7d58eaf224c703973c157 -LLVM.v13.0.1+0.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/562d16c8b9de1489d655c1a3faf58b44a69b195b5d97fbbb3b60baf886a357ffff232c0ed1daded6b5aa1b635615aa3d9de497c7e87b081ba83d2c408507acf9 -LLVM.v13.0.1+0.armv6l-linux-musleabihf-cxx03.tar.gz/md5/9308ce36b9b3f9f23719b8ec4c7eed0d -LLVM.v13.0.1+0.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/01330f93f15fa56b5485c0444e2c6aad82df61170579499b0a1b586871ab05a783651cd903043c39bdd955c8036e8511fd33fd541358210bd3d801b21d31750a -LLVM.v13.0.1+0.armv6l-linux-musleabihf-cxx11.tar.gz/md5/9e60c460dcc29228d137f13d3c04798f -LLVM.v13.0.1+0.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/0bbac99fcd2b7e6fb958c1966ecd135898666b313938b8fec13154fb16069ec2dac06f19626a6cbad973a967ea99bcfe7c21930486715af0a666cb850ccc7ec4 -LLVM.v13.0.1+0.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/b4aacd37b274cd86f0d74150a6481e80 -LLVM.v13.0.1+0.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/fd7cc8368fdf27805155e25c94f099b65e01d0b3edddfc3934e81da84e480801967960bdef4ef68e5cfa325f5445cda6f3e1ab9d60729e86f4aaa39c20729af8 -LLVM.v13.0.1+0.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/ed180a5375b1198dfd58bb1de07db4fa -LLVM.v13.0.1+0.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/09077792ea1eb299bc5215ecc7904098467dec48f1f3cab532ec673bfcd9711120e77744440d5a28a1496b50490d3f551b4d8e14958396964d40991adaf8252c -LLVM.v13.0.1+0.armv7l-linux-musleabihf-cxx03.tar.gz/md5/53503aca7737a92abff745a3ad23f270 -LLVM.v13.0.1+0.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/12d388a6b5dfd45f8c0fe29453f49cc17bd1ea54ba281b92cf84d8698b03c9204feefab79245e7d9e8063a311b96679f849456366064b021f86c284417c43d71 -LLVM.v13.0.1+0.armv7l-linux-musleabihf-cxx11.tar.gz/md5/f9f002f64d325fade65076f5912377ab -LLVM.v13.0.1+0.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/c87ce1742babd909ed4faa66aef71301d9da48c01fe772e8775af7b5b41f49ba3f24b0f8e26694ba93a8c2f14fdda698a157bdb3d95bd114e2bc90dd85acb340 -LLVM.v13.0.1+0.i686-linux-gnu-cxx03.tar.gz/md5/39e654c42cf3b5a4a752e46566b8b9fa -LLVM.v13.0.1+0.i686-linux-gnu-cxx03.tar.gz/sha512/4fc6e48cae0e33843b875dcc39fc2b860380cd6ad6f9214367827049b29e2db85593544866107bc8950ea844be09671092ef133aa764dab48119105332b932bd -LLVM.v13.0.1+0.i686-linux-gnu-cxx11.tar.gz/md5/a5928523eff8a9fd2ef66012eb3ab556 -LLVM.v13.0.1+0.i686-linux-gnu-cxx11.tar.gz/sha512/2595eb66b23fb9013f866578a829e07c4144996ae660a7448c196255aec43e6959caef2bd074db0690d91e0a39275b09c935d634855eb69613ae834426844f7c -LLVM.v13.0.1+0.i686-linux-musl-cxx03.tar.gz/md5/47d3b87788b3269da6aea81069ea13dc -LLVM.v13.0.1+0.i686-linux-musl-cxx03.tar.gz/sha512/0721c1440daaeecc95beec69e7493dca098d619ad27125df51429704f3d463fa8ab86685f9f486378a028a99b445705dd052d9cfa9c1e729ff80fc2e1b46d508 -LLVM.v13.0.1+0.i686-linux-musl-cxx11.tar.gz/md5/0604eae4ea2d2dc715924976d006b026 -LLVM.v13.0.1+0.i686-linux-musl-cxx11.tar.gz/sha512/6ba0acc9f08d1308c07ceb587e9bcc3de3d167a133d053326eb24d0660d18b52c789a8dd86612b85c894c9faa5d4fe6b9dc65bba1c8ffe649999b8458348dd19 -LLVM.v13.0.1+0.i686-w64-mingw32-cxx03.tar.gz/md5/7879e8a03f4db12585ad2f8545fe5e06 -LLVM.v13.0.1+0.i686-w64-mingw32-cxx03.tar.gz/sha512/e0d23395b0962870df1c13edf4aa67bb2ac9372ede4160e7347fb94a47d90e76e738a2224b82a604926a8fd4a3f685935be0d9c0e4697b4c5ed53183ae5e9bf6 -LLVM.v13.0.1+0.i686-w64-mingw32-cxx11.tar.gz/md5/fac7f70937406d1c06d84cee96f61a61 -LLVM.v13.0.1+0.i686-w64-mingw32-cxx11.tar.gz/sha512/5b987b3a3b4ae677dfc11f9dad75a5db0f4affd6447061f0996fe81d978760f9553c9f7a89a1a229ecacb6a159b9e7728da2c7bcdb49c8a2fdd4b1498d117e6a -LLVM.v13.0.1+0.powerpc64le-linux-gnu-cxx03.tar.gz/md5/8852de922ee08484018d8b8f4a4459f7 -LLVM.v13.0.1+0.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/17412ebd9e63f370eee499e883fa0da0fa05a3ccb6ee3149648b4e55241166d2f5b34d759b23d654ff58b0167ace2cbe10329bcf984cc84b7c7690b6528063b9 -LLVM.v13.0.1+0.powerpc64le-linux-gnu-cxx11.tar.gz/md5/c172ee499e60fe6e22dcb135854d9f39 -LLVM.v13.0.1+0.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/79773c87795f5251095473d5797a0fbc7a4a4e7eeea45eadccbe01f62eacbba0b6159370675088907297b91e020be2bf1339c211682f7525c03c1033b91178c9 -LLVM.v13.0.1+0.x86_64-apple-darwin.tar.gz/md5/730d568f05aad99f6eb596d623c18763 -LLVM.v13.0.1+0.x86_64-apple-darwin.tar.gz/sha512/fecde3420de9051f32a1753c30d83436f9ebe2e5805d2dcbddbcb10eed6d84f0b5af81d33ff05d1c34996fa3d1198f20db56d8fec302e64d85e1322893acce2a -LLVM.v13.0.1+0.x86_64-linux-gnu-cxx03.tar.gz/md5/2dcc7db78138d81c6548c59e9ad2625f -LLVM.v13.0.1+0.x86_64-linux-gnu-cxx03.tar.gz/sha512/48e18a31f149c0101f80d34e8e293078c5332194821a33c290aebd0701249a8130876752938b6af4346b1985f8c16dea575248f4e862d019c3290dd1c2570e6a -LLVM.v13.0.1+0.x86_64-linux-gnu-cxx11.tar.gz/md5/f101a354d0b9b777f4754505a0d7f677 -LLVM.v13.0.1+0.x86_64-linux-gnu-cxx11.tar.gz/sha512/f77a338d4e0c379e5958457ce5b3d1cf323c3869616a4ab6f40be3753493966a893699de9c09946f4712c6684cdf08e235cb2d33b724e87dc8a2970f677ca952 -LLVM.v13.0.1+0.x86_64-linux-musl-cxx03.tar.gz/md5/155c5015da0e2ffd94fcdf9496e855df -LLVM.v13.0.1+0.x86_64-linux-musl-cxx03.tar.gz/sha512/a1b2e1f5f8aaba0d74efb0819e39ad5ddb1740ad7955ad41c44b0a3483ee5d17db2b32f5d548200493c390cadd08dfae3f277833dd774c95c90ff989c6bf5969 -LLVM.v13.0.1+0.x86_64-linux-musl-cxx11.tar.gz/md5/d3f804be18541fa1102af46da18a743d -LLVM.v13.0.1+0.x86_64-linux-musl-cxx11.tar.gz/sha512/bb0ab78b3c03081f352bca252f2ebab3e5a47a83ee4c2dd0504543457c6f32dbe1449de97a2b5d8f970980497a77f78bebae3dcdb7d0c1c346e9df46721eb32f -LLVM.v13.0.1+0.x86_64-unknown-freebsd.tar.gz/md5/7f7de7e59d22411068a35977a6fef75d -LLVM.v13.0.1+0.x86_64-unknown-freebsd.tar.gz/sha512/29c9531e6ed6d0b5d85d58bb5122531212c39ecd10f4a78ea1eb42311f3328813fcc4d2ad2311eb5cc3030778492a6b8bc5c9b12653f1ba36f16e0a50c4e0272 -LLVM.v13.0.1+0.x86_64-w64-mingw32-cxx03.tar.gz/md5/1823541a9a6c9e9134ac7645501399f5 -LLVM.v13.0.1+0.x86_64-w64-mingw32-cxx03.tar.gz/sha512/2dbee2c1f01e5cc4f0b70c0147352ad95f0b91f5cb1efcde7ed61b54b2baa1b0bcea0b97e0c0ff6c55526e6b037f25808cf995f861ce46da56195bfe0b0e48e3 -LLVM.v13.0.1+0.x86_64-w64-mingw32-cxx11.tar.gz/md5/454453a2afb04e3c4d6cdffb37591a3d -LLVM.v13.0.1+0.x86_64-w64-mingw32-cxx11.tar.gz/sha512/21bda5f9ceb9d4030121eb9c563233bcdab5b9d1d5b0b9b0fd22cfba3d507ec59ab4c98211d0d5c2cc5ac0b0695d1fbe4707a0264fde423833cd7a461193b556 -LLVM_assert.v13.0.1+0.aarch64-apple-darwin.tar.gz/md5/edbc793469fb7c14af3c33f8584d22df -LLVM_assert.v13.0.1+0.aarch64-apple-darwin.tar.gz/sha512/a3137f2d2d4847e6db1acfc834e686379cdd80712feb3d36d616f73af473599356ade48c98a865d3c233a59d395d40114083fbd78617001b95ebe363fe12cde5 -LLVM_assert.v13.0.1+0.aarch64-linux-gnu-cxx03.tar.gz/md5/00176b5cd73dea5f9265155574c08dd5 -LLVM_assert.v13.0.1+0.aarch64-linux-gnu-cxx03.tar.gz/sha512/a911c597ebfdd66bc5e20af38e2456cd1e2be051642abf939d6290017ea4426ad6c68dd17b8f59b9e5e942dff62bc2627a7d66df0c628c100d4bc948251afc58 -LLVM_assert.v13.0.1+0.aarch64-linux-gnu-cxx11.tar.gz/md5/b494be6cdca661a43cb07e55a185cdd9 -LLVM_assert.v13.0.1+0.aarch64-linux-gnu-cxx11.tar.gz/sha512/3338abf24c2dd710d0d356e785f30d72c6a83eff5ff91a7e0113f66a213bc39f241e9886f09d41b3e5ccd56f19cc431565d391a4ae88d590a47fc5ce35b57bcb -LLVM_assert.v13.0.1+0.aarch64-linux-musl-cxx03.tar.gz/md5/8bdd207d78547f38d599010272b7beca -LLVM_assert.v13.0.1+0.aarch64-linux-musl-cxx03.tar.gz/sha512/f349ef36df2dfa76f915353f3e3e1f0a336614c89e33fd9516a604e6d72b541fd83e0862576c3d0864b518e6fa038749a9c510788f1c07148fa5924fda357e25 -LLVM_assert.v13.0.1+0.aarch64-linux-musl-cxx11.tar.gz/md5/b7659747556ff940eb0093153ad01dd6 -LLVM_assert.v13.0.1+0.aarch64-linux-musl-cxx11.tar.gz/sha512/6e0f04738beb2533cb83891c45d9f3bfc701ec1f83ed1c1e06e885c5b5bb4b51c1b6cffbc0a2cae648df1c65b01a8af378d35cd743e72ae3fdb8047774e8d54a -LLVM_assert.v13.0.1+0.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/79d6bca4a7660422a43185066350f9d2 -LLVM_assert.v13.0.1+0.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/094a750a1e4f98a39e0e8a30a3a3e55e55317cab5084115ff33714db82c6645d9fa3ce0599f773930e47ef9261805a7e1bde51c1d067d07e2e844147ce180c4b -LLVM_assert.v13.0.1+0.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/7790a193f05283eb60f2668ddd6e4a47 -LLVM_assert.v13.0.1+0.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/a41689262509178100866588964d5da99736c87e47f23fccaedc53128484e8f24e693858bd82ca63eecdd5af2ef627e3a37ca83df27d103affb015c93c3d2372 -LLVM_assert.v13.0.1+0.armv6l-linux-musleabihf-cxx03.tar.gz/md5/67a56a20625adfec51210d86cca998eb -LLVM_assert.v13.0.1+0.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/00a950e6fc1b9447dc63fa0905088d6b8f441fd48e4a234018aa0b9fabdc3c173174fa3a22a6707bafd1f4476b3da436bf6f3a5d388095502e07ae9df4de2373 -LLVM_assert.v13.0.1+0.armv6l-linux-musleabihf-cxx11.tar.gz/md5/77377f6eed3c5393ed2af8205eef67d1 -LLVM_assert.v13.0.1+0.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/edf79f368c23501883ae850fc5a293dbed4fa4b22da322af43233e55799a34887fc090f7ed3a865c73692be60484c770f754af54edffad800da35e17a9a4bf39 -LLVM_assert.v13.0.1+0.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/f3df2582d0c31fa17ec40a20aab9b684 -LLVM_assert.v13.0.1+0.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/99905914383be921e9279a8f304daec4f3155bd88cf33c716f4a7967441f8ad4c544ded404c946b1f8270172a797cf17598bb8a05118da455e1ee5c24b7d7bda -LLVM_assert.v13.0.1+0.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/4ff964f982c57cfd279ff101e923fdbb -LLVM_assert.v13.0.1+0.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/d13eb4378e014d6370b5dc9929c0247ce73dadcac17be446f6aa3db227c466193fa3034252f26ebe06069a6da87120ea6d41ed2087ad3f8a9d64d4c54c8c28d8 -LLVM_assert.v13.0.1+0.armv7l-linux-musleabihf-cxx03.tar.gz/md5/1324fd002337d2b69abd203bda0d9b6a -LLVM_assert.v13.0.1+0.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/d0f69d9ff0f997f9c72f70060040825a11b377a3518f2060bcd4a85253b46ed2e8eec773732547dab436f1cffde5883b24e52f75d295cbf3f7096dd0d9c90173 -LLVM_assert.v13.0.1+0.armv7l-linux-musleabihf-cxx11.tar.gz/md5/313006aa96874279764a7b7c4666ea23 -LLVM_assert.v13.0.1+0.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/59c4a59a7e0184643077a45b5da6c5693123d3678e010fd3ccce88761a4434c1321082e056bf16beb88131bc6a98f40515338e2faa8bf5353e448926d80213b9 -LLVM_assert.v13.0.1+0.i686-linux-gnu-cxx03.tar.gz/md5/3333f1d17d5a8fd8ad07b1ef42c50f12 -LLVM_assert.v13.0.1+0.i686-linux-gnu-cxx03.tar.gz/sha512/cc244bc19588ce041159f6b251141565b31190fd8da44bccb2bc8fb7dab4cdfb6c3aaad166e4e2ffb1796cf28296bb53f94715eeeb110f4dda0852f328fd8db5 -LLVM_assert.v13.0.1+0.i686-linux-gnu-cxx11.tar.gz/md5/8aaf25616a93aa95819b2d95de9a11b7 -LLVM_assert.v13.0.1+0.i686-linux-gnu-cxx11.tar.gz/sha512/cd0c65cf2cac76cb813eee1e87dcdfea0735a01a296a9d9483c75dd1268b1b48d8ecbbb2bb7321954503686754b78c0c0cd07c428a5722e5e3781d6323046fab -LLVM_assert.v13.0.1+0.i686-linux-musl-cxx03.tar.gz/md5/c13905bd6d398ac5369161a177687508 -LLVM_assert.v13.0.1+0.i686-linux-musl-cxx03.tar.gz/sha512/40719ed2c074a3b18b8811c0c0d204bb4c38e007daf3eb09844fd2fe59737fe850e448f4c650412ff611370f767b04b44fd02c4550ec2d120828c5577451ed7d -LLVM_assert.v13.0.1+0.i686-linux-musl-cxx11.tar.gz/md5/95944a48b2360c17e0a40cef17fee9ab -LLVM_assert.v13.0.1+0.i686-linux-musl-cxx11.tar.gz/sha512/5554935d3932744fb15feb0cba3e86aa98059e037d8c71d3413f2c986e88ec1a58b454d884ac0e0583fa612c546009a27a7287dd240058e79bdbc41f445cfb7d -LLVM_assert.v13.0.1+0.i686-w64-mingw32-cxx03.tar.gz/md5/391138eb01ed8be350669e6e22ae9fb9 -LLVM_assert.v13.0.1+0.i686-w64-mingw32-cxx03.tar.gz/sha512/5e25e8b941e60950c5889e1f51c05bc70ea3ca75ab7bc950b674cd1f93a44a7621d1dee89b6f6be6fd0d5982b6618c36e0b4b4ec443d19856fbc8f4832fee6c6 -LLVM_assert.v13.0.1+0.i686-w64-mingw32-cxx11.tar.gz/md5/22dd78fd71f93c062f090afb96529912 -LLVM_assert.v13.0.1+0.i686-w64-mingw32-cxx11.tar.gz/sha512/21f3008287015ef9d3bbbb76f6b7a320a6a4ec96ba49a126cee97648e6ce48f4dbd4df46f05c551187f3f681ed622aa2392b7c08ac060deea27f7f74ddb2d0cf -LLVM_assert.v13.0.1+0.powerpc64le-linux-gnu-cxx03.tar.gz/md5/ee9b9db47c5745d12620c6e52e7fcc6a -LLVM_assert.v13.0.1+0.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/e15d831588352e6404ea766852d9479dc0d5b78f88eb4108694c4fed8b123a17cd9f4211cef31ff45f4f18274622b43f54c5928c17eddfb2f195ecd59646f5bf -LLVM_assert.v13.0.1+0.powerpc64le-linux-gnu-cxx11.tar.gz/md5/c9e22ebe1f7c7e046d142b699b0649d8 -LLVM_assert.v13.0.1+0.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/72e59f38647daafa323f55f6259c9091b39df90b6736f09244e48f2cef8230b03eae689aa8a83c2f0031a9225bafa33bccb5f1badf8fb71d5a4d22efd6de9410 -LLVM_assert.v13.0.1+0.x86_64-apple-darwin.tar.gz/md5/9c5db337206c28fb567e96a0b2f18533 -LLVM_assert.v13.0.1+0.x86_64-apple-darwin.tar.gz/sha512/cc67489ec1c086640c9969eca1d8a0868840cff375775d1c60fdcfbbb84714d960549a5ec314077dec9409eb5fab5bdaecd9e6f4605c7c654a0b52f7b791ffeb -LLVM_assert.v13.0.1+0.x86_64-linux-gnu-cxx03.tar.gz/md5/a188fad8f09c3080618b6861476b9252 -LLVM_assert.v13.0.1+0.x86_64-linux-gnu-cxx03.tar.gz/sha512/2c5f95a1386b5a7f122e2af6d754173512eef72b637c9e3d1250b1bd1b1ad993a9cdadc9e71947c15e09cea308b1f30a84a2ff937fad3693b8b3c84145deeec9 -LLVM_assert.v13.0.1+0.x86_64-linux-gnu-cxx11.tar.gz/md5/d27c6edc49622f79d61face403301f13 -LLVM_assert.v13.0.1+0.x86_64-linux-gnu-cxx11.tar.gz/sha512/9b778434293bc2da965ecfa314dca1190677372a61553dc25bc6146ae1dcf553b3b71f473df9c1ff661f17fd56e75ff6715233859a5de1a91e2d1663abaaa71a -LLVM_assert.v13.0.1+0.x86_64-linux-musl-cxx03.tar.gz/md5/5c6f3e570a3c3d6af0ebcaed3139c27d -LLVM_assert.v13.0.1+0.x86_64-linux-musl-cxx03.tar.gz/sha512/1754a7dcf4a4fb9f88e9d5e451b5185ca5d72cf51a6675abe87cd059df1cd8b10388a3f90335e2a5f12864aa3baa7504299b90924439609e66eed24dc60c0965 -LLVM_assert.v13.0.1+0.x86_64-linux-musl-cxx11.tar.gz/md5/8fc7c0e358d2c98bce2dfce7f3c2f507 -LLVM_assert.v13.0.1+0.x86_64-linux-musl-cxx11.tar.gz/sha512/81f7032f5e7ed45e3d84619c18b4f588a570a3cb36f8ce9792fd41a9442ac73cccb64b4243128a07445f6b412b20048aef98a6501efdd9b526ea0e6a1c803f57 -LLVM_assert.v13.0.1+0.x86_64-unknown-freebsd.tar.gz/md5/f8c750975059dfed1633735f9dbecdf6 -LLVM_assert.v13.0.1+0.x86_64-unknown-freebsd.tar.gz/sha512/d01efc6da3de4172aa4c085a6c90d8410ca33d1dc470f1b908b5836a7873c68963fa2fcfbbe24a4a7c6ad016f869084d430e113e71e6c94a8078c46a860b3f80 -LLVM_assert.v13.0.1+0.x86_64-w64-mingw32-cxx03.tar.gz/md5/70e2d1e2e84e7f8b19be1f518949d753 -LLVM_assert.v13.0.1+0.x86_64-w64-mingw32-cxx03.tar.gz/sha512/df5caf19b914f194266dd27d05218bbf11c5d0bfc2cdc589391bb40ebacf7384f9dc691a9d882dec873c8db594c1b8c158e80c1cec60965daacbf42b6486add2 -LLVM_assert.v13.0.1+0.x86_64-w64-mingw32-cxx11.tar.gz/md5/f5c5d3f2a55d6c5bf89fd9bfe1166969 -LLVM_assert.v13.0.1+0.x86_64-w64-mingw32-cxx11.tar.gz/sha512/f97aa158391b35f4f62ba7bc2398382f16f33161384478ddb10c5d64d24ee4d64c6ce9439fa05a997521f2f1d391f8a13f4d5a8b29d14eb22c7bca121d4a10c8 -libLLVM.v13.0.1+0.aarch64-apple-darwin.tar.gz/md5/90c59343fc5a9ad5ffd6258467e6603c -libLLVM.v13.0.1+0.aarch64-apple-darwin.tar.gz/sha512/97a49af9f0e68f76a10e13813900c2ad0d4575ed31ee703ce86bc19490f6dcc282d47b5b641499fff0b949f5330e1e0e58559f84987e9230b1c5f3f33a4caf7b -libLLVM.v13.0.1+0.aarch64-linux-gnu-cxx03.tar.gz/md5/ab3c2b357634a2660820012df34414f5 -libLLVM.v13.0.1+0.aarch64-linux-gnu-cxx03.tar.gz/sha512/6038edbe7aa305dd35660592dd37fe0ad207e074126766623573be8d7b3b8a06056a626b6da210957264e74192e40bdfc0f396dc9961757dfe6dc8d85a0ad0bc -libLLVM.v13.0.1+0.aarch64-linux-gnu-cxx11.tar.gz/md5/3f1572194c43db046610d4043b7eadaf -libLLVM.v13.0.1+0.aarch64-linux-gnu-cxx11.tar.gz/sha512/d8be84d5627aa37d65bd81c2c3e0248eb053cc88ce13c38189f53e785d1df7858669045271cea40f1ea6b0516a99b8d4e01d747fe23384c4b39e69c8e509b32e -libLLVM.v13.0.1+0.aarch64-linux-musl-cxx03.tar.gz/md5/bb96b1a1ade79e3970759b137d83f350 -libLLVM.v13.0.1+0.aarch64-linux-musl-cxx03.tar.gz/sha512/80f586b763a32ed2efeec2b30c931477fea6f707388180dddbf9147129ab8e3a765ae921642fcc0b75319a5de5af80b358926604d16ab5b162453faa73521db2 -libLLVM.v13.0.1+0.aarch64-linux-musl-cxx11.tar.gz/md5/7bbc79416781ae9de6983879ba7b6566 -libLLVM.v13.0.1+0.aarch64-linux-musl-cxx11.tar.gz/sha512/db1f5ac2d3e0a44f69a19284fe91b4d06ec438f295db7564160257e10c0de010ba7d2f346277060ec93126ccf9cd2194a87a73a7ddc4141f9dfc0a6a16fd1ae0 -libLLVM.v13.0.1+0.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/cd2cedf55992338a3a72d65fd317a6f2 -libLLVM.v13.0.1+0.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/979069f43f8215adc0c4d527e7341e3cb42faa287b697d4fae781bb9f321c513fcada965796033d01ffd2b8169d8e4936bff6c953a860f758f5eceaad46c8162 -libLLVM.v13.0.1+0.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/5ca3a104123a63acbc05aa5c9a372db9 -libLLVM.v13.0.1+0.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/8fd77092ea76499efd78898f1179e6c37a08c6c161558986459491863344edf6a7baac7c4c8cca45c8d82269ba073b8fecc259e5bfde99f2abd5c56e87344502 -libLLVM.v13.0.1+0.armv6l-linux-musleabihf-cxx03.tar.gz/md5/4e56e434d66a5bdb3e5a34a99972270c -libLLVM.v13.0.1+0.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/41f32d057c2be5f771be3ae96c4642401285a1024ce4aabf8ae3255b4557635adec1485c4afa5d57f672c1b5de57cb723f488361e54eedf65a8a43161552d5c9 -libLLVM.v13.0.1+0.armv6l-linux-musleabihf-cxx11.tar.gz/md5/037399603a44f4ffd2ff98e6b9456236 -libLLVM.v13.0.1+0.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/0e01a8b286f99b98382b35905653c573776c9858465cf21d70e0d5842871aac27fd1b3da759644894e0bdc29351891edff159246cbc523e7ff0a8bcec67e852e -libLLVM.v13.0.1+0.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/60e8fbacfa5c23f90ddfc4b13917c9f9 -libLLVM.v13.0.1+0.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/7125b3dbeeadb0513ea12bf8bc04f44de98da11a60dd1a1886fd5210416408cc6484ef814f5176e19338e7ba7c8a4a8aef085ebd00f2853056e549d2c6bff55a -libLLVM.v13.0.1+0.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/3decd9bef6de6b3e5a306fee9f6af2a9 -libLLVM.v13.0.1+0.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/622a60f4f256a802aa9413aed830f57546f28ef7c5a4ff09c3c66736ed958a1b8fa0169de002de26ddef3ce1151fc1352235668f4da51640615339e6d7bb271a -libLLVM.v13.0.1+0.armv7l-linux-musleabihf-cxx03.tar.gz/md5/5c8370e3462987d15d0edc21c6e8af9c -libLLVM.v13.0.1+0.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/eb961730e622074e0f2c05b7729a33d088cf084d2162e8a428d3f763d39b782bc5d341a60823d1b3f4fee9a03a995c0ff8251e2cfcd0fe13f8e09b60c3fe231d -libLLVM.v13.0.1+0.armv7l-linux-musleabihf-cxx11.tar.gz/md5/6e659916b90b66cec5fb1f1d424eb177 -libLLVM.v13.0.1+0.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/2489c0d76d46a10479eb2197324dae1556f330848f8efbcd545e155d871652ea0692fae2063665f3bfe02ab165567ae5d7dbeabf287fd38e180141ed9714f29f -libLLVM.v13.0.1+0.i686-linux-gnu-cxx03.tar.gz/md5/569dbeb437cb438636244ffa0248f2f9 -libLLVM.v13.0.1+0.i686-linux-gnu-cxx03.tar.gz/sha512/6dc44b2458dcbd59d695f20d4786a39a92d7affd2cfd8e25536f0fcf46489930c7315887e2f611d0b9f27ac04ea1bfc1ffc9b770dcb8328cfcccc8f419705466 -libLLVM.v13.0.1+0.i686-linux-gnu-cxx11.tar.gz/md5/2e9e078ca524ecf96a801f3361e47798 -libLLVM.v13.0.1+0.i686-linux-gnu-cxx11.tar.gz/sha512/5833103547bea7614447ad27e7bfae7f7fa4e3bf6bfe49301d57974f50de26c8c43747aff60504cf923958b53189030b4016b8d381244f92be8a3cde82147a42 -libLLVM.v13.0.1+0.i686-linux-musl-cxx03.tar.gz/md5/babec2df18c459f4bd068c711e4f3fcf -libLLVM.v13.0.1+0.i686-linux-musl-cxx03.tar.gz/sha512/c3660a02a8215a0becb17d6e2ec2317e65d3c312172048ab6d867de11b3c618f4d31e8f215b349a049130fcfbe7b59f018e12c89138a1965704a84a403b3995c -libLLVM.v13.0.1+0.i686-linux-musl-cxx11.tar.gz/md5/3aa2b9f877a34a8ba83fd03f9aff59ea -libLLVM.v13.0.1+0.i686-linux-musl-cxx11.tar.gz/sha512/1e02a817fef96628ee4ab2ed62bcd49156d7df5a61463420e0e8d9c208d242994d09d6999d6ff223b46de516b8b3bc3448d2807dee422128d729f44594dbaf91 -libLLVM.v13.0.1+0.i686-w64-mingw32-cxx03.tar.gz/md5/767865e3ed6fdc200ac9b6ae569d7fc4 -libLLVM.v13.0.1+0.i686-w64-mingw32-cxx03.tar.gz/sha512/034904561e6715b8ee1b5d9f5d3669f3765cec05357e21de0e1b875346b8dfc199e545d87747f1676cf16329f4122b4e574eaf4bb91573b9893ff72dc7a0b33b -libLLVM.v13.0.1+0.i686-w64-mingw32-cxx11.tar.gz/md5/be8fcb1eceeb0b0b1064bfd1459c440c -libLLVM.v13.0.1+0.i686-w64-mingw32-cxx11.tar.gz/sha512/1b8011e432fd570a34a90bb449082ca086a311159b3b699a9a176e9f7dfa916bfb58e06f82a4f1e40c7896d1781acfed40eff77d447070186f193f2605a2521a -libLLVM.v13.0.1+0.powerpc64le-linux-gnu-cxx03.tar.gz/md5/bd14e02f94880856d9cbdc531bbc2d9a -libLLVM.v13.0.1+0.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/4fd86b2562e96ccf8327c4791be34a1c03be7f96382626201076104e3cf04226e76fcb628f36e977487f8c4a717f4e25626713f8e2967b42a335a4cfa8836909 -libLLVM.v13.0.1+0.powerpc64le-linux-gnu-cxx11.tar.gz/md5/2da035de66d4e2af430b21c5ff04c8f9 -libLLVM.v13.0.1+0.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/d86ed30cc3e3a42058436059f8aaa74b910ebe8ed8df65add637214e21118173f7863e834c7fc87f71b9d7014643fc129363f97e5e8e4e9694da6b31e9e21970 -libLLVM.v13.0.1+0.x86_64-apple-darwin.tar.gz/md5/513383b4044ac84dcde32afee478c1a7 -libLLVM.v13.0.1+0.x86_64-apple-darwin.tar.gz/sha512/552b09934c77bc5d44057c6a47fc5af413a5ce636a6f79308a8a304a4f5ef6d9714147d7babb9c0fe207d7526086834583cd77cb2ed3cdbce07978d4e1f2be3a -libLLVM.v13.0.1+0.x86_64-linux-gnu-cxx03.tar.gz/md5/732f0349aa40bb2b81ea78bfe0c41f96 -libLLVM.v13.0.1+0.x86_64-linux-gnu-cxx03.tar.gz/sha512/8ae7d1c7b38dee47a9e8758a11c27da897cac1ba0766a300018b72dd5263299bce61fd93ed58f95b6d3afcb70be091503d78613a346e6e1bfda2261af35da895 -libLLVM.v13.0.1+0.x86_64-linux-gnu-cxx11.tar.gz/md5/07ef28642d4d8e1fb0557937f55e2106 -libLLVM.v13.0.1+0.x86_64-linux-gnu-cxx11.tar.gz/sha512/aeae745dccdc86d3af6c2332d26f152683f2b9bcca4942de880096e6d4e55457bb5bf75d51095db57dbf44e222876bd88292d9aeb06f5037c4d2752593a30c79 -libLLVM.v13.0.1+0.x86_64-linux-musl-cxx03.tar.gz/md5/db6f67a674141e999fc113a3a016fcac -libLLVM.v13.0.1+0.x86_64-linux-musl-cxx03.tar.gz/sha512/f64558e48b04f36386c1a908ed08d8975f385e4449a98b3fad3068fab760956a15c77af0f1bfe9443781779b3856c87aa537062abe608b2b33eea8a26f8a0d72 -libLLVM.v13.0.1+0.x86_64-linux-musl-cxx11.tar.gz/md5/d0ab18c49c5bac39ba7e42f034d73ed7 -libLLVM.v13.0.1+0.x86_64-linux-musl-cxx11.tar.gz/sha512/8b012d61d7040a14feffc81346fae3034905f45f04ecf67ad63f589097a2f66f15bce573627145a4c20e9b96fb742773c31ae628c5ff9ac0b80b212d4180973d -libLLVM.v13.0.1+0.x86_64-unknown-freebsd.tar.gz/md5/ea4034d5e3168a88b2ec93ce19ef4368 -libLLVM.v13.0.1+0.x86_64-unknown-freebsd.tar.gz/sha512/c88d998522b35159589dd153fbdd4d0fe318af5b7bd21ccb76993315e7cb88237b86c0b1d3926112b82de6c1a01a568db3e4e7ab782b377169a9b4ce16362859 -libLLVM.v13.0.1+0.x86_64-w64-mingw32-cxx03.tar.gz/md5/3abb0ab78813dde21bdac01c2abe0f56 -libLLVM.v13.0.1+0.x86_64-w64-mingw32-cxx03.tar.gz/sha512/f0e9f8f5b51bd88a3bc44a31cfd17ee5fee5693e58335e15e75a02edb633eccb20b4b550272f62fb94accf0601c0ffeda90b651386d5f4533f53efcaa737b62a -libLLVM.v13.0.1+0.x86_64-w64-mingw32-cxx11.tar.gz/md5/6cd7c931f078cd4e7fdaa7100f849fdc -libLLVM.v13.0.1+0.x86_64-w64-mingw32-cxx11.tar.gz/sha512/5d1627125bc08887a6115d90e9fc82b489e1181508b949dae5d4bae556cae6de21d2db7a70f72f28af79db9b3e24e410f36edf7e1b8e6bbeb58f88c579739f12 -libLLVM_assert.v13.0.1+0.aarch64-apple-darwin.tar.gz/md5/106b3e9243647066dea672db53433830 -libLLVM_assert.v13.0.1+0.aarch64-apple-darwin.tar.gz/sha512/443fcf037bf415e8fc80ba54549d7562cdcff4a8b9f3904f7f9340dbca2c2f696812205d65dcd243a0272858e33ff5990eac25b67dfafd4bb43432cbe7894c8e -libLLVM_assert.v13.0.1+0.aarch64-linux-gnu-cxx03.tar.gz/md5/96a08126d18c388cbf465823180e50d0 -libLLVM_assert.v13.0.1+0.aarch64-linux-gnu-cxx03.tar.gz/sha512/764cd65e04e3366eaa8b37464e446494d7da51fefbdb036ce1694d8e2ac690464a12c4f02e8e0001f513fd96df3387bf947d786309faa3c2ca105f2a962cc703 -libLLVM_assert.v13.0.1+0.aarch64-linux-gnu-cxx11.tar.gz/md5/f0cd12f061e008b0fffc8f5a0e59f694 -libLLVM_assert.v13.0.1+0.aarch64-linux-gnu-cxx11.tar.gz/sha512/e16a9ed2da79448297f89a0e1d85f9c482aa9f181b5b1e10b00f8f8411f46fde85b0ff6c1b5fded0c1ca05f22d578b9f1fc3b57d2f2e51adbfbabf0bc36eeca2 -libLLVM_assert.v13.0.1+0.aarch64-linux-musl-cxx03.tar.gz/md5/2cb2998d7da32b8b0ca5086c1b1c65fb -libLLVM_assert.v13.0.1+0.aarch64-linux-musl-cxx03.tar.gz/sha512/cec31970c67541ff979bd94780f5369c72a63576eeaa2803598ad453e72c273f238eff492410b38c372a616e992ab02b229232e5e23eba0d15a0a61a23f179ff -libLLVM_assert.v13.0.1+0.aarch64-linux-musl-cxx11.tar.gz/md5/3541fd14098d5d673a75b39d1171842a -libLLVM_assert.v13.0.1+0.aarch64-linux-musl-cxx11.tar.gz/sha512/6320d5e3b8b3b4839e90ae66c0d5639816de9bb74e463125ad05566ca394733bc83fea9a4bc49366a0ee6e31c83acbd5408d388cfd957b6918b4986d639f104c -libLLVM_assert.v13.0.1+0.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/11b71aa8a64a8580dd297a72c6b44303 -libLLVM_assert.v13.0.1+0.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/4468015d50d8cae071b7abcae525e2e2c05eb6cbaa138ab59c9c2092b4cd3c9616a0b22a222accb0c9d0564e975587e638afa892d1cd480a2f5db7295bf510ea -libLLVM_assert.v13.0.1+0.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/106a99c91928b5dcf7f214bf9f0a0b9f -libLLVM_assert.v13.0.1+0.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/94da8219ad4cf7c1155bea4878d6b6306487e9bcd7e3cd4a5f88f0106dd60fe8a5b89edf62f6db6fafdaca728b0195bc0032c3a404119930c7b5e0c7443d20c9 -libLLVM_assert.v13.0.1+0.armv6l-linux-musleabihf-cxx03.tar.gz/md5/f9a037108728810c78636e9ca5bdfd7f -libLLVM_assert.v13.0.1+0.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/2d04f17e72f505ad908433d3ee9781480bb90ea78a405c892c02f4af899a0bcaec9b8c6e8e1554aaf4241912532db59cb1719edd328edf6a75f65393a1db32b6 -libLLVM_assert.v13.0.1+0.armv6l-linux-musleabihf-cxx11.tar.gz/md5/6e0d147ccab5f63b61b330d6e4e261f2 -libLLVM_assert.v13.0.1+0.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/43aece34e5be174628e7e645d163a442e379f10bca6988f768d3f45e2f449b0262e3a789cb71dde5431c7fea4305bffed591009c467a902bd5e079c9e0797035 -libLLVM_assert.v13.0.1+0.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/ffff6ccd75cb9e9cc59e0fef9133efd7 -libLLVM_assert.v13.0.1+0.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/8d7201223badb90ac932e31f63b46af7bf004af32f1316e2552d7646ebd65fc69bf3d267ede2502f743f0d41e567d1448a1550c942d223e218678bbaba3d39da -libLLVM_assert.v13.0.1+0.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/ec045bb81ffd9d9a4fa34990018e4c8d -libLLVM_assert.v13.0.1+0.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/bcdfb4bca9088bb6d02755fb50e6531a4c7414123810e75d13ed1f71a85aef709a8164110e5d21769578ff6a43b659476bcf274d3df721f9c49183f7e3683169 -libLLVM_assert.v13.0.1+0.armv7l-linux-musleabihf-cxx03.tar.gz/md5/92d538e671e3bce0619181499198d6bf -libLLVM_assert.v13.0.1+0.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/8ef2004e7cf30327ea6ab91cf89e5bde22a378439870811969b79199ca9ddfa5825b92241cfc8e606b893c17da2a6dda665ed6dc09c34ccb95e8e3a843bcf059 -libLLVM_assert.v13.0.1+0.armv7l-linux-musleabihf-cxx11.tar.gz/md5/988828fe05b1564f43218978438b6395 -libLLVM_assert.v13.0.1+0.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/97aa19516ada176a689118f27c6be1423316bc4f047812e1b8c0a4037b227fa20b0398e63ff764de0b75174d6fc41c656854de201121845ea66917551003526f -libLLVM_assert.v13.0.1+0.i686-linux-gnu-cxx03.tar.gz/md5/38434f9d60b437c3ca3216696f194e8f -libLLVM_assert.v13.0.1+0.i686-linux-gnu-cxx03.tar.gz/sha512/dcc7f39f46268883a6890d70bcab0efb5c9b752ed724d0a1ec0379da0d090599db47d82d0ddd9e8acae0a351df4caee2cd0f7283e84439b702788e2d4f3a9588 -libLLVM_assert.v13.0.1+0.i686-linux-gnu-cxx11.tar.gz/md5/7fbe5817d732c50a59736d4c048effd5 -libLLVM_assert.v13.0.1+0.i686-linux-gnu-cxx11.tar.gz/sha512/aeb7090365053c653273e0d592485c7bfba1e63f758ecf57545261540ee045df9fb2b58b91658cd087e78d15f3fb8ecfd280b64ab8af8f04dd7589085d8e1ddb -libLLVM_assert.v13.0.1+0.i686-linux-musl-cxx03.tar.gz/md5/7cbb0d59fec17b98b633f47b7eeb80e6 -libLLVM_assert.v13.0.1+0.i686-linux-musl-cxx03.tar.gz/sha512/2579ebd9b9b50fdbf9f3b38c0c2ca22312bdf6712a0d3c6c51058691107cb05dba9e5f4d5b27acd165f74258eb493d1680a320ed4c821943efcd2f600f68e44f -libLLVM_assert.v13.0.1+0.i686-linux-musl-cxx11.tar.gz/md5/354dc055ea15b8e4c866fbe439b3ec83 -libLLVM_assert.v13.0.1+0.i686-linux-musl-cxx11.tar.gz/sha512/2ef407435ad00d605c28b255eafc0b748d26a868e58a4508431a427b4aedb5c4182268d95dafda000f3ee190ce0b2d32a488641a627834b6b3ce22c171b039bc -libLLVM_assert.v13.0.1+0.i686-w64-mingw32-cxx03.tar.gz/md5/27f88f260b1175132be84d00834ec825 -libLLVM_assert.v13.0.1+0.i686-w64-mingw32-cxx03.tar.gz/sha512/b904c91bca86286db662b4889dd4815a87482aeb20c49ac0e59f6adda4524a8f6385277f9aee24197aa1539096baa7445ff3caa6110432b0861966872234868c -libLLVM_assert.v13.0.1+0.i686-w64-mingw32-cxx11.tar.gz/md5/0e1e5267c63088088065a69846fac5f3 -libLLVM_assert.v13.0.1+0.i686-w64-mingw32-cxx11.tar.gz/sha512/ecce393ce899991f7eec3ca07887306bb002bd54270f0ccf3f8e93318024b9ea8024c8151e639c71d719c956bfbd3ed5c38c0b52f1cec40ea893d2da7b6172d3 -libLLVM_assert.v13.0.1+0.powerpc64le-linux-gnu-cxx03.tar.gz/md5/090a448043257587a7b9001162b0d982 -libLLVM_assert.v13.0.1+0.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/67e5bdaa89ad657f98bbe9012b06e89a6ee30306afcd09ab46e518d7b552bcef47fc37cf166259bffdf98cfa4d7b1cd7e04851de1fe3a16507f7b354067c1393 -libLLVM_assert.v13.0.1+0.powerpc64le-linux-gnu-cxx11.tar.gz/md5/5eaa7afa170aa19b9f31183c47d82354 -libLLVM_assert.v13.0.1+0.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/147f5a6ab233b42277e42ebab197616a6a0b0a265128fbd619b20bdf1b2af6e0ad524c990e31a5836dcdb2c0c500657021f974d91de7e8b02a761ffd29bec624 -libLLVM_assert.v13.0.1+0.x86_64-apple-darwin.tar.gz/md5/90f43cb235a3525ade4e250be1a0a7f6 -libLLVM_assert.v13.0.1+0.x86_64-apple-darwin.tar.gz/sha512/9ea0b79a16b4697276915c7dac9dc4a426213f48e4c1e1db2705c5810aa3b17ecbd9dde2ca562b472be65f7063d85e239d4948b9743407c095c910e97ae24bf6 -libLLVM_assert.v13.0.1+0.x86_64-linux-gnu-cxx03.tar.gz/md5/12d3dde26ccf6aa21fc13a2dd9aa3768 -libLLVM_assert.v13.0.1+0.x86_64-linux-gnu-cxx03.tar.gz/sha512/b8b362345fb550b8af61d851d9918413ff23f1f7b78b7817f103384af110dca3383d4c8067a56748cb97fca7d1f75957b0dd2ce323d61a56cb9a266a378361b9 -libLLVM_assert.v13.0.1+0.x86_64-linux-gnu-cxx11.tar.gz/md5/d1673dae2652f131c6ebee2ba257f629 -libLLVM_assert.v13.0.1+0.x86_64-linux-gnu-cxx11.tar.gz/sha512/47a7f634256a3df1f7ff56875ce969a550b217cfc897e9796b60fc4c45d7c4b1a22ba56a33cb7932ec40c0e987d407678234716447ef51123c5060c713a61948 -libLLVM_assert.v13.0.1+0.x86_64-linux-musl-cxx03.tar.gz/md5/6454e1cf23e77ced847cd623995a234c -libLLVM_assert.v13.0.1+0.x86_64-linux-musl-cxx03.tar.gz/sha512/30ce182636afcdccf265ffec468c9954434d3f0a135878cb55698799cb829c138e828a28b0493d8226d80a36d00250be0c0dae083efcd63b0e939f5fb75b1f6e -libLLVM_assert.v13.0.1+0.x86_64-linux-musl-cxx11.tar.gz/md5/cd24ac0e5a37b5db288b265a90f5fe9f -libLLVM_assert.v13.0.1+0.x86_64-linux-musl-cxx11.tar.gz/sha512/d90aa1a0e4edb57e2a940d63ae28e198c1e515e7892008f1b04289828be466662aa38596c02884dd787798c04d00ff6314f884be5a859287f840d18f79ac8c3c -libLLVM_assert.v13.0.1+0.x86_64-unknown-freebsd.tar.gz/md5/7164700b24a94828b17abf8aa2e44477 -libLLVM_assert.v13.0.1+0.x86_64-unknown-freebsd.tar.gz/sha512/5ba54ec75cde0df60253efe694963b7a2eadff5f23028b2cb8ba612530acfc148cfe738d2d2e65bf9dcc419aa9998bd8544e7852167300ffdcebecfd0ac6821e -libLLVM_assert.v13.0.1+0.x86_64-w64-mingw32-cxx03.tar.gz/md5/a17f42d502120079943a1695128ae7f8 -libLLVM_assert.v13.0.1+0.x86_64-w64-mingw32-cxx03.tar.gz/sha512/e4f6a370c96c29ba6bc5e979fd3660becdcb95d5c26299e4f7f31d1ca089d4acf6915371e1452dc538551aed2db4beaa2903dddb35e72a131f4a5262cd266334 -libLLVM_assert.v13.0.1+0.x86_64-w64-mingw32-cxx11.tar.gz/md5/a458b0572d77d3d79b66a53e94a6436c -libLLVM_assert.v13.0.1+0.x86_64-w64-mingw32-cxx11.tar.gz/sha512/43b6ab2becd9b3179f91f2f856854d4795e53c4078dda26607e5b6a8dfde37cdc28f9fec6c0ca9e0d0d8de5f2304d5775d5c6b7a03c0f6feb2b93e43053997c4 +LLVM.v13.0.1+1.aarch64-apple-darwin.tar.gz/md5/fe3c5650453eb06823381174f7091ec8 +LLVM.v13.0.1+1.aarch64-apple-darwin.tar.gz/sha512/17033e4244e1c3bc7a8dde23de27e79be8464f7de538fb6913c933b91fec221d11cb33ec60a37555d1fcb22a7c1e8266573e348d080547ddec0649127322b1c3 +LLVM.v13.0.1+1.aarch64-linux-gnu-cxx03.tar.gz/md5/a447df02f61c8258e158f4fda491bcb2 +LLVM.v13.0.1+1.aarch64-linux-gnu-cxx03.tar.gz/sha512/b99c4f4c1fd3a56dbcbce7cd64fced5926942cc1eb7a712901a2089c130a0ef39736ce00b5a69d32506b6f6608e3179331dd0e3c8e29d850a4c0ea9bc1b509e9 +LLVM.v13.0.1+1.aarch64-linux-gnu-cxx11.tar.gz/md5/7ef97f16089e9a5b683f9977d229bdb5 +LLVM.v13.0.1+1.aarch64-linux-gnu-cxx11.tar.gz/sha512/c9b4f91ab9adf7fd3a57023a2358f50981b2930d0d47db35af08da3da633bece06c7f54145fa08056d105e6130f9be0ab6bbb61a817800251438d4256b365ccf +LLVM.v13.0.1+1.aarch64-linux-musl-cxx03.tar.gz/md5/09595b767af7aa37c35cb790fde8a107 +LLVM.v13.0.1+1.aarch64-linux-musl-cxx03.tar.gz/sha512/61a737f9bd6d0038e94d6f637af6b3f5316ccae1c5bcc2bcf33ad5d83b03427922089ab8e1c89c51d0592bc52a506c75b9664920fd5d97f5940b7951f4c9b3d8 +LLVM.v13.0.1+1.aarch64-linux-musl-cxx11.tar.gz/md5/9b8bf385c9a648836e9d9591c14058ed +LLVM.v13.0.1+1.aarch64-linux-musl-cxx11.tar.gz/sha512/99e6483f425b0953a71c05d4ced734d697ca807e9f711763822b9daebb1b74a4396642566d26ae1bdda1cf23e9151ecc411182362b6a1cb3568115a8c5cc32ea +LLVM.v13.0.1+1.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/80b92fa00ecc02e3e446e4fe1aa5db69 +LLVM.v13.0.1+1.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/53e6e0620a48f95005e787537b42208c591725c91584bcc20c190c268fabf09a00f8b80ed3acacd78e0cb6ab2a930eb4592e8097ea89b7b834f7ea21bea330f9 +LLVM.v13.0.1+1.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/d9020bc2ec6fcf9756614d5bbceca658 +LLVM.v13.0.1+1.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/9f172f46846f978b2b348357ecb5355c9f0ad83ecefa2a85808e1149f4703c3fb1d6b95cc3f03d66bdf80cc39051c7353bb2f1b41f278a65ec5db99b89d86298 +LLVM.v13.0.1+1.armv6l-linux-musleabihf-cxx03.tar.gz/md5/c1347e80f2ccc64e0ad27833859ab9b0 +LLVM.v13.0.1+1.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/d5b430d47f01c7af052dfbb9ba0231ca05b287e36112f1879c553c96b76329aa55c0db67f164107961624c56482f870863af27791d8fdba07d7da3e8af7f12c9 +LLVM.v13.0.1+1.armv6l-linux-musleabihf-cxx11.tar.gz/md5/4bf8917cefcfcbc569506cc5ea2a921f +LLVM.v13.0.1+1.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/bc759d48dd3025997f64ba8d1624f21548da0428340bc1c41a83675bf3fbe9c224db2f4df008aee4870445abe85067cfa2423e4ef957221f737de685297430e3 +LLVM.v13.0.1+1.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/74c54f6d4ecff9ba68d576700f0a5ae1 +LLVM.v13.0.1+1.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/82524c68c82e79c01784c1489370a3f118ed4b950396c3890d76e0019436e6c0db7e66970f59be76252b8bcff0e8be84ee02b18fbfd9a2c704aa9efb58c0ecd8 +LLVM.v13.0.1+1.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/3bd838e1c589779da736f76b37e9726e +LLVM.v13.0.1+1.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/ffaded30472825ee8ec3c280c13795937c2e5a064da2ec9227ce9028993eff255390ed2ccab226bd6876f776413b8e7b67d10fa46aa96c2436233733326e932f +LLVM.v13.0.1+1.armv7l-linux-musleabihf-cxx03.tar.gz/md5/49c0fd781b0d2ffbea924916ffb17a40 +LLVM.v13.0.1+1.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/ada8ba753839987ef120b367377cab1399577de54a93b64ec2c2ebf6dee5e1fbe04b588f2a9744e99fa4537b49f1334522f34a9f4e7402a30d18c4f4a2deb527 +LLVM.v13.0.1+1.armv7l-linux-musleabihf-cxx11.tar.gz/md5/97fc742c0aa6e8b03a7483940bf11495 +LLVM.v13.0.1+1.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/dd9b33235bf061dfd76def89c34a7ec7968f7fe0e28f1959cfc9b8f37cadee4d896ff0ffac00a268b25eecc4b244b70bc8ac4c1d9b9676322195dbdce3ac04d6 +LLVM.v13.0.1+1.i686-linux-gnu-cxx03.tar.gz/md5/41e3fec7a5fff4f3ced547056f009ba9 +LLVM.v13.0.1+1.i686-linux-gnu-cxx03.tar.gz/sha512/199aa5baf3b4278e3c9ac7477d9e0e7074b71647f40ebe18c4b5ee81464af671391aaa40e8203fa88b2d1b9a32bbe396beba1ad561766736034be29cd8af1c07 +LLVM.v13.0.1+1.i686-linux-gnu-cxx11.tar.gz/md5/43642e655bf47bc58d950c0aaf925a28 +LLVM.v13.0.1+1.i686-linux-gnu-cxx11.tar.gz/sha512/07172e2b94e6dcf6d6f13786bcf182b60c81bdfc9aab50a80cba5dc4e7db2a788f71a879050e272dce85c86480eaaebfa6d2c3b23338733994981df6d7126aa8 +LLVM.v13.0.1+1.i686-linux-musl-cxx03.tar.gz/md5/1031d0c377fd2cfd22cf8103006dfd8a +LLVM.v13.0.1+1.i686-linux-musl-cxx03.tar.gz/sha512/36effc03c1bd7518840a30f35f1d8d33c0bcd40e2fce325b887a107617abc3299123e31abf505667a3675e3f454eee75578eae0a2f37442ec0d9cc90ccb0300f +LLVM.v13.0.1+1.i686-linux-musl-cxx11.tar.gz/md5/f830d33ab7967dfffb7192d340d18716 +LLVM.v13.0.1+1.i686-linux-musl-cxx11.tar.gz/sha512/5286886448394c0fa977ac8e0c2be5d55bc0d4aac1806ac8d1da31bd753d30d2d6ab37f38ef8e7e2c8ea7d124bd1b71200a791ed6ac2cadd02ed16b610ffbfac +LLVM.v13.0.1+1.i686-w64-mingw32-cxx03.tar.gz/md5/c5538b4b76735ba6d9928ed32685cfca +LLVM.v13.0.1+1.i686-w64-mingw32-cxx03.tar.gz/sha512/6594e624c5bc0ef97e2b474d4def660c2d9166fa45249a20ad315146ebd8f25f8ec868a3390a92bd7c39540e593691f8336e1dc07740c95f8ee04fe45d8e42f6 +LLVM.v13.0.1+1.i686-w64-mingw32-cxx11.tar.gz/md5/abbee8dcaf6c8003bb0291dd6b51c1bc +LLVM.v13.0.1+1.i686-w64-mingw32-cxx11.tar.gz/sha512/4a6449c3efa41b3b1e81e215376045b6b1a29277bb1edb3c3910c6b2e80e533bf8ff5280a83f7f9f3b76e1278634802cf75ec59f946f8d870b8022bc21c2c1c5 +LLVM.v13.0.1+1.powerpc64le-linux-gnu-cxx03.tar.gz/md5/5c8d9e09817cb0e988072a417e6be77c +LLVM.v13.0.1+1.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/2f692f3ba758f019342db61fb0ba5c7e4953b0572eb4d2a6939dc3575812850f594fdeaa5f941e99c8e4618c6dba16fdd7d36e209bea8a081ecebdaff6b415bf +LLVM.v13.0.1+1.powerpc64le-linux-gnu-cxx11.tar.gz/md5/d32a4956624fc613e84df4f59cad17df +LLVM.v13.0.1+1.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/ceff900a146ab6fb9df8529c403c410ffa123c0892a8f8a929919f1083de51f6fe01c3e1e8e60c905c919357b1623889aa22b5442347172217a550879e7f5665 +LLVM.v13.0.1+1.x86_64-apple-darwin.tar.gz/md5/c81b4dca08db8d9e1039383f3ed647b5 +LLVM.v13.0.1+1.x86_64-apple-darwin.tar.gz/sha512/77b3c6ff0d01f3313d395a61fa3da6154068ecd28cef0a05c1b60dce2290891f94009ea07a760475efb1e9643be9246c9b0509d27a5e3fb158670532501da774 +LLVM.v13.0.1+1.x86_64-linux-gnu-cxx03.tar.gz/md5/7f0d303184900896b578fd0a02a2f10a +LLVM.v13.0.1+1.x86_64-linux-gnu-cxx03.tar.gz/sha512/7ec84fe0b831b781f7764fe519f390be1e8eeff770abbb742f33a5f481b23200c3bff488463af00939a4483288649dd57fdc13219adfdb1f380562bb7fbe6519 +LLVM.v13.0.1+1.x86_64-linux-gnu-cxx11.tar.gz/md5/dee8746ce02b304467708ed6a5381b0d +LLVM.v13.0.1+1.x86_64-linux-gnu-cxx11.tar.gz/sha512/776fb9e9c257f6a428b15f0a4debc082c873868c0d693d72841b10bbb14783f123d6bde2cfb267df4cb35a79703d845fa0484b85390f3a802e9ca3d31ee1470e +LLVM.v13.0.1+1.x86_64-linux-musl-cxx03.tar.gz/md5/64c2893a9067976543ac4fe91f8ce217 +LLVM.v13.0.1+1.x86_64-linux-musl-cxx03.tar.gz/sha512/fe6d69b551f891dfcbb8c26dacae1fd401019de498de366fbcb31122ebb737638b84a43de11bd036cf2c2f7bb681cbfbc57e4e2190e499a7d3b004c2e8fb2e69 +LLVM.v13.0.1+1.x86_64-linux-musl-cxx11.tar.gz/md5/6b7b963ee1db6a8da2921520b6bf264e +LLVM.v13.0.1+1.x86_64-linux-musl-cxx11.tar.gz/sha512/4f3fc77ea6da3f57559e3cc8cc45bfe5527b8af032358b17f66b0641af2e61a3e200fb8dd9099d69205d34bfd3b3a21944e65900fb47f06b1320fadb9d78c26d +LLVM.v13.0.1+1.x86_64-unknown-freebsd.tar.gz/md5/c3fb628d6afcfddd16edfb71ee0fe1a4 +LLVM.v13.0.1+1.x86_64-unknown-freebsd.tar.gz/sha512/ea23621b7a226dec2eb1f50e1a9bbce840dd0dd62e6a11e3fd52398521e0ca60aa9731f80154d2987c5507cc945d6410c8a98153223b9558a6eb0eaa687ddb98 +LLVM.v13.0.1+1.x86_64-w64-mingw32-cxx03.tar.gz/md5/a133f710ee0fb29ffe8f4bf37e591b86 +LLVM.v13.0.1+1.x86_64-w64-mingw32-cxx03.tar.gz/sha512/50ec3a3391e65224fb1c2a404f6d3c3f8ad2590c5feaddc438f7fd43a3c93b2c2956461f8f840ebea4a0a2ffc80b3b1de41ec75dd27b679adb54138d0c14bd14 +LLVM.v13.0.1+1.x86_64-w64-mingw32-cxx11.tar.gz/md5/77b8348a49d6b5eb4c5074934761e94c +LLVM.v13.0.1+1.x86_64-w64-mingw32-cxx11.tar.gz/sha512/41069cee40bf0b852601a397beaac05d3bf9d1c00560c9ec1077883d8b5ed58d82f357b286746b02a53db8d9e2c0ba2976af8b9e565a35214fd43e961dd7b8ff +LLVMLibUnwind.v12.0.1+0.aarch64-apple-darwin.tar.gz/md5/b95ad4844e649bf46db43683b55b9f4f +LLVMLibUnwind.v12.0.1+0.aarch64-apple-darwin.tar.gz/sha512/15e0996aebe6db91fe58121001aa7ea4b23685ead3c26b5d89afae34b535e34b4e801a971f4854d8e1a1fbc805cece06272470622eef863e225358113a127913 +LLVMLibUnwind.v12.0.1+0.aarch64-linux-gnu.tar.gz/md5/6d8783dc9b86c9884e0877f0d8ac4167 +LLVMLibUnwind.v12.0.1+0.aarch64-linux-gnu.tar.gz/sha512/d3b0c81498220d77e4f3cc684fb2cc0653792c381207390e695ac30bc74249f96a333a406b2cebdaca14e0b0a27b188cba6209bb5c1cbbb5c184d5626dbdc7a0 +LLVMLibUnwind.v12.0.1+0.aarch64-linux-musl.tar.gz/md5/052a35e879d52244e4b0804be875a38f +LLVMLibUnwind.v12.0.1+0.aarch64-linux-musl.tar.gz/sha512/d1b34fb97f9928e046d3131a050454710a93d38e60287b7e3c92f179f436586d3230cf90b0ca0eb8a3f9ef89fef7b1ffd7d52871645dfa233a8b07ca87ea2ee4 +LLVMLibUnwind.v12.0.1+0.armv6l-linux-gnueabihf.tar.gz/md5/1ad96a03a5dde506b5c05773b1849ec4 +LLVMLibUnwind.v12.0.1+0.armv6l-linux-gnueabihf.tar.gz/sha512/82306fb7b920fa7c71bd53b23d6915e7f256e8da9679cc926a53bb0d879f1f4469f43efe556ca32c9ef59e27b435572c7b39859090652635db4eeefdec0d1685 +LLVMLibUnwind.v12.0.1+0.armv6l-linux-musleabihf.tar.gz/md5/6a24fcd3a4dc3b1a98bb7963b1bb4930 +LLVMLibUnwind.v12.0.1+0.armv6l-linux-musleabihf.tar.gz/sha512/9ba6b83ccec061a1e5260c807dc8afd6e18799431b25a7e65b97662cc4db02509d02ea07fe12025d80914cec7383624b1c8fc9add46511c668e184ede263ac52 +LLVMLibUnwind.v12.0.1+0.armv7l-linux-gnueabihf.tar.gz/md5/09f1bfcf58a4124561553ab5005f9538 +LLVMLibUnwind.v12.0.1+0.armv7l-linux-gnueabihf.tar.gz/sha512/b0907cb857131183ffc338780c6c6dd1d48bf0ba61c3da1b8f20cf9a943373173b621cf9b2e8f1fbc657059a896b84aa025e6d4f0f1d1e8b623fac3e96541765 +LLVMLibUnwind.v12.0.1+0.armv7l-linux-musleabihf.tar.gz/md5/19158bcfae716b26f924d67c4e719342 +LLVMLibUnwind.v12.0.1+0.armv7l-linux-musleabihf.tar.gz/sha512/a90be57990b6699cb737ba96904e94e1f082601ca9d01e670f025b5500f526980741921c9cf672accab78cb5327714ab6ecdbb875174088f0773ebb627a98819 +LLVMLibUnwind.v12.0.1+0.i686-linux-gnu.tar.gz/md5/ba75556eb96b2bcdaf73ff68386d3bc3 +LLVMLibUnwind.v12.0.1+0.i686-linux-gnu.tar.gz/sha512/612fb765695b7aae11ef29608eedf8b959f60c021287a67b03a2a0f57a5814001ffa9b261c9d60d5f3d0582c06c2b41f75fd3afb66a045a248bd43d29e304c97 +LLVMLibUnwind.v12.0.1+0.i686-linux-musl.tar.gz/md5/2fcbceeb1bfde29be0cbca8bb6718bfe +LLVMLibUnwind.v12.0.1+0.i686-linux-musl.tar.gz/sha512/58f281cfc70b3f8a59cf4faa7732824637c811ddc5ea6a058f294f4c3ed4fa6c8ddab5c007567b439f2854635cf4fd146284059bfbc73e7006000ced9383f705 +LLVMLibUnwind.v12.0.1+0.i686-w64-mingw32.tar.gz/md5/153c028d97dceb6924414a7a9a137e1e +LLVMLibUnwind.v12.0.1+0.i686-w64-mingw32.tar.gz/sha512/7ae1f197600eabde9036ae58623de34a6d25636d7861777e324eb97902f65e26c6f3775e757178f8914b0cb6c2e925413f5ffc6abc9b6138470dc9e67a17f212 +LLVMLibUnwind.v12.0.1+0.powerpc64le-linux-gnu.tar.gz/md5/c08a6cf3e1baf156eb05003ed4e9ebe9 +LLVMLibUnwind.v12.0.1+0.powerpc64le-linux-gnu.tar.gz/sha512/f74e44986622329990842cb3ff549ff9254c81863d8bee468b0e58b7621067e7e7f7f18e4cbeafad6a05e0c107323de6828a78dc7afbcd7cd1892383ff417968 +LLVMLibUnwind.v12.0.1+0.x86_64-apple-darwin.tar.gz/md5/caf151150e56827be09acca6964d2b18 +LLVMLibUnwind.v12.0.1+0.x86_64-apple-darwin.tar.gz/sha512/cb3e7aa71367ec4a115bccc2e8ac6bd5d9f22b3935b3889eee1fbf7303c5f553d7d3108977bc1f6c9b6917a6ed9e10bff211fd56b8169233ceae287b112894c2 +LLVMLibUnwind.v12.0.1+0.x86_64-linux-gnu.tar.gz/md5/d95874cbf6f8b55bc314c3968a6a4563 +LLVMLibUnwind.v12.0.1+0.x86_64-linux-gnu.tar.gz/sha512/4986a8d9cc9d8761a99a4f02d017b424484233d4cbe2d4f49ccd371591384b1b8d1c4d31cb908505b86b00f2b164568e57751dd949d91af203ee4a582971798a +LLVMLibUnwind.v12.0.1+0.x86_64-linux-musl.tar.gz/md5/89077d871e15425b1f4c2451fb19a1b2 +LLVMLibUnwind.v12.0.1+0.x86_64-linux-musl.tar.gz/sha512/b65a218b05ade2e2d1582188897b036a4596d09cf65558f178c49c1a1a62b7d992b1d99fbe86a027dc83b614f178e6061f3dfb695b18a8e2b6bf76779b741d96 +LLVMLibUnwind.v12.0.1+0.x86_64-unknown-freebsd.tar.gz/md5/54ac594b4c8e7f261034a8829dad5e34 +LLVMLibUnwind.v12.0.1+0.x86_64-unknown-freebsd.tar.gz/sha512/a43756afd92081e6dd7244d162862fc318b41ca110a5e8be6e4ee2d8fdfd8fb0f79961ae55e48913e055779791bd1c0ecd34fd59281fb66b3c4f24a1f44128f0 +LLVMLibUnwind.v12.0.1+0.x86_64-w64-mingw32.tar.gz/md5/83cf8fc2a085a73b8af4245a82b7d32f +LLVMLibUnwind.v12.0.1+0.x86_64-w64-mingw32.tar.gz/sha512/297a5c7b33bd3f57878871eccb3b9879ea5549639523a1b9db356b710cafb232906a74d668315340d60ba0c5087d3400f14ab92c3704e32e062e6b546abf7df6 +LLVM_assert.v13.0.1+1.aarch64-apple-darwin.tar.gz/md5/6c98fd5f7efcccf684cabf7d62c25262 +LLVM_assert.v13.0.1+1.aarch64-apple-darwin.tar.gz/sha512/6c59835132dac1d887b825d37044186e55c28dadbc37a5dea51c60d4a2e9803f164925012e57e6d4b38a01d57003f115dbe9d2c1d7e113f6ead6c9eef50713a9 +LLVM_assert.v13.0.1+1.aarch64-linux-gnu-cxx03.tar.gz/md5/aa5e09c8662a69b46f4ee701d7f577d7 +LLVM_assert.v13.0.1+1.aarch64-linux-gnu-cxx03.tar.gz/sha512/60ea007ca638af2c8792581a26b19452f7e5d82c915571e5f8d9203a5c9faeda2abf30dcf2ec4f5d17d9d05796b68293115f7ce595271fcfb348ee6cd64b634e +LLVM_assert.v13.0.1+1.aarch64-linux-gnu-cxx11.tar.gz/md5/815f787ad01df95c6a35fd79770eb0a6 +LLVM_assert.v13.0.1+1.aarch64-linux-gnu-cxx11.tar.gz/sha512/be65247fe8ce5bf955053c08253e3b7de9cbe09709dd0e5d94b8aa9601fff661e4c0ef1a3653f35daf272c0adcb8507f229b8c0c3223b01c6e966d7590414929 +LLVM_assert.v13.0.1+1.aarch64-linux-musl-cxx03.tar.gz/md5/d09a02c6fa57a76d3502c3824497186c +LLVM_assert.v13.0.1+1.aarch64-linux-musl-cxx03.tar.gz/sha512/c4432427a21e6b2e976cc400041df237aaebfc360880f55b425a825ba0f22b9640771c96d41383fdfd0bf5ddb455847f75dbc55e0929e07fff660a74499326a3 +LLVM_assert.v13.0.1+1.aarch64-linux-musl-cxx11.tar.gz/md5/30a651c1f84eb59505df55f8fbc3ff3d +LLVM_assert.v13.0.1+1.aarch64-linux-musl-cxx11.tar.gz/sha512/1852bea90b7528f3b7731b53f74c6f4b84e9fa552144b42753092151fb1fc4bba4a27c5aa2dcc4668fb465d32ee5def708df859a87893e5fdcdaf4d880b55413 +LLVM_assert.v13.0.1+1.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/8e93a45105c655e0445c243bc24b8e00 +LLVM_assert.v13.0.1+1.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/06417a56eeb811305fcbbd04318054606c7f16eef4008ae2ebcd580c4216a478005cde84afa1070b71d34e85e1e69de7f3a004fa8d70da6e4f1e27cad5751795 +LLVM_assert.v13.0.1+1.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/6e1161bb8b5e0a4f7a686615e249fdfb +LLVM_assert.v13.0.1+1.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/e1de1a368c0d900cfa05baaf16c8d5ce5de80b698d4c6026338e1172ff9710f2175a68f16281400eaef0f50468f9a9277a2e347828595cf0f2115ea901ca2bfd +LLVM_assert.v13.0.1+1.armv6l-linux-musleabihf-cxx03.tar.gz/md5/95d1b1ac0b13625697e59507f0749c8b +LLVM_assert.v13.0.1+1.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/e1ab81e12010f0dcaa15f3078732fe24a0286ed8fb8230f70f7d69da830eeca97989bf4d498d5cfb31058c69c1601856a6b7dda4001985796c58a2348c85b481 +LLVM_assert.v13.0.1+1.armv6l-linux-musleabihf-cxx11.tar.gz/md5/83e7416f1111a6a71c3e2cb619084501 +LLVM_assert.v13.0.1+1.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/c9d58630b45ef874d9014bdb08ce94bf8b26cd1cbde58f38a048d1f29022e6e37d0e8d9ba99ad612dfb38741829b4639ddc37b725f1f400f869d842cb53483ae +LLVM_assert.v13.0.1+1.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/ddbe27b3ced2f75d47373f0e97a697eb +LLVM_assert.v13.0.1+1.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/64b0e9520bec92d38016dc66d2f4fa372a0acd6241ddd26d5bb306574c796d607a814ce286d914ece61689815db190b9a89730f48ad6b1e929d17989da196318 +LLVM_assert.v13.0.1+1.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/77572b25fb89f2a637335aead21d42b4 +LLVM_assert.v13.0.1+1.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/25e2811939222d52380ce3f8888315b57aca317639173ffa33012d8271cfc6112f4044785929e2fcfb9dc92f87eb4410b3fae30d8d20444323737a87cb269ee9 +LLVM_assert.v13.0.1+1.armv7l-linux-musleabihf-cxx03.tar.gz/md5/4d4fb6f08355c8cbd575ee3ce14159ef +LLVM_assert.v13.0.1+1.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/8968e4f8cf63358d411b9f2b557d2fe6d93326a98126f3cc9519aa877ea464246fcea26631a64fffc2940dd338d285a6c749b7cdeae65a345bfa72f3f6d3434e +LLVM_assert.v13.0.1+1.armv7l-linux-musleabihf-cxx11.tar.gz/md5/0ec14582a4a503e3555f628541f1ff85 +LLVM_assert.v13.0.1+1.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/112dc4de847d4765ad8a25695ffa5d03232dc19bb8ed57c7d0835ef55c64cce70d33a6c7cdd51a84351d12c6517c6694859f822ac929cec1370c0b9cfa8240cc +LLVM_assert.v13.0.1+1.i686-linux-gnu-cxx03.tar.gz/md5/e26493c11edc45d10043386edfee3c03 +LLVM_assert.v13.0.1+1.i686-linux-gnu-cxx03.tar.gz/sha512/044b593ce5908445be949e2e08385ee3cfaf0e8dfa4139cf9f2070a7306606b8db7e1cbfc40ce755ecf43bdd3f150c47b3cf5692fa24c0a19fb305f929c3f5d2 +LLVM_assert.v13.0.1+1.i686-linux-gnu-cxx11.tar.gz/md5/11f67fa770f24d6d60a0b859bd7b75b5 +LLVM_assert.v13.0.1+1.i686-linux-gnu-cxx11.tar.gz/sha512/5d11c7b953932646c24a1c3d35ca246ddb0610140a5c34c265191448256b63c92acba314b795cbe1989473e663fd8ecc1867584e76f75c326cd12fe33a0b076b +LLVM_assert.v13.0.1+1.i686-linux-musl-cxx03.tar.gz/md5/da133e8a9b6e90ff76ac9dbba4a2d2b7 +LLVM_assert.v13.0.1+1.i686-linux-musl-cxx03.tar.gz/sha512/abc8bed798e3c500e11125c5994eb96040a05d9d718a8d29628d99512192e1618df9f6576566b12e0e3ec59b512f1064475a9ed1c4dd53dfc2a88dcb3d27cf50 +LLVM_assert.v13.0.1+1.i686-linux-musl-cxx11.tar.gz/md5/f1af34cfbe0fc0f18e8d30dc62e77d1f +LLVM_assert.v13.0.1+1.i686-linux-musl-cxx11.tar.gz/sha512/7ed27d934b3cde836713d09c02ae821ee5660ed07296d85aa04102709b7ea920fdf45134bcf652051d1d74b36f9df61014805dfe70d7c1a57a4397a7415d9ffd +LLVM_assert.v13.0.1+1.i686-w64-mingw32-cxx03.tar.gz/md5/b205c549f0cb5570160d545dbfdf391a +LLVM_assert.v13.0.1+1.i686-w64-mingw32-cxx03.tar.gz/sha512/84458fa31a2e4e093202d086b79b6234e4437d450eb11ff12196013d9f5add4c40062648e580751d8e5e2afdd60ae662409f22386fe69baaaf9a264b9cc006dc +LLVM_assert.v13.0.1+1.i686-w64-mingw32-cxx11.tar.gz/md5/1bb2d407a4e1f773759be323777a6081 +LLVM_assert.v13.0.1+1.i686-w64-mingw32-cxx11.tar.gz/sha512/ab04ed3531a6750896e79ef6ea07bdd08b628d90ad7509330531224ba83f9c32e78e95b8c0e3cb1c24a3646b3b121ddb3bea607a686d3c325ebc96c72448b25b +LLVM_assert.v13.0.1+1.powerpc64le-linux-gnu-cxx03.tar.gz/md5/63cb23ce79a0fbada294bda3a6b895d1 +LLVM_assert.v13.0.1+1.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/be0b9206c20953084eeddb886b270b47587fb816caa0d0080aa45052f5d539aa80a9b0d42a64dbfed1242181e21b275e12fc57d332614dafe6dc976db00ac362 +LLVM_assert.v13.0.1+1.powerpc64le-linux-gnu-cxx11.tar.gz/md5/98649e7b5e2b107ae17464bde6458d07 +LLVM_assert.v13.0.1+1.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/f99839654d169657a55f7ef70466a09c7d05b3d01462c71816b06a42554a4ddf937b858caa98267380b30aaa42721621972a3fa4064dee469a16ec19dcc63c1d +LLVM_assert.v13.0.1+1.x86_64-apple-darwin.tar.gz/md5/f90da7b778bb622d289f64f8fd640734 +LLVM_assert.v13.0.1+1.x86_64-apple-darwin.tar.gz/sha512/40576946286e9c73d000616620aaa4b3fec06fe81072b4fedb66ed45e2c264da7214ef1af32b5e0c395dc84285d9d14032dfe9e52271293330379aab9834b2d4 +LLVM_assert.v13.0.1+1.x86_64-linux-gnu-cxx03.tar.gz/md5/2b19d54c50591f4bb074021916acd09e +LLVM_assert.v13.0.1+1.x86_64-linux-gnu-cxx03.tar.gz/sha512/1d0e95a821f15a5505c5154609f531f34cb09e3acb5bdb0568e998ee542a4d408837fa86086bf417fc2094d9ee01ef60759bec97598fd39a2c5d5af731338368 +LLVM_assert.v13.0.1+1.x86_64-linux-gnu-cxx11.tar.gz/md5/a677a9611f5b7af2a54d1236d3c443f0 +LLVM_assert.v13.0.1+1.x86_64-linux-gnu-cxx11.tar.gz/sha512/1f758073c19c56c6328b44555c7df91adeb33c56e52d4f60ab93a9dfa607d99feec0248231f10ce537aaee282796278b2f0ba581a1b539de22dcbd0446404e06 +LLVM_assert.v13.0.1+1.x86_64-linux-musl-cxx03.tar.gz/md5/465d2f0894047ab482ec889a2e8d8a44 +LLVM_assert.v13.0.1+1.x86_64-linux-musl-cxx03.tar.gz/sha512/e394a86d612daf7b8de6ed680750e176c90390886e57b3cc34bbc923f2c90f6d2e45d52ec32907d857783ec2113e1a916a4bf50320d000db9380fbbea103c53d +LLVM_assert.v13.0.1+1.x86_64-linux-musl-cxx11.tar.gz/md5/c0cc32691485f15fdacd21045906ba3f +LLVM_assert.v13.0.1+1.x86_64-linux-musl-cxx11.tar.gz/sha512/cfb1c921cb8c5ea8815a50cb06c6394032301d356baf35688a455e146faaee1bf8bdaaec5688e09620c8cd030503e2cdab1cc96180e17424579661816843e13f +LLVM_assert.v13.0.1+1.x86_64-unknown-freebsd.tar.gz/md5/806572a7335c5b4ac524c77477ebc517 +LLVM_assert.v13.0.1+1.x86_64-unknown-freebsd.tar.gz/sha512/01cf7c04185281276883ff7a6ad84bccaaa2d60fabaf29f16f7195c0ea532d547ea5c59b35fc7a3e61a8945cc766563b7c9ada2daaa52a32aef9e9fca386ad34 +LLVM_assert.v13.0.1+1.x86_64-w64-mingw32-cxx03.tar.gz/md5/ae71c714190e3e73a7c7c18110c6fd2e +LLVM_assert.v13.0.1+1.x86_64-w64-mingw32-cxx03.tar.gz/sha512/afbda02397f8533b4cf6644ba1c7bd812f5961408159974e81a98058586f9fa22d731f88a19c4593d1e5bb785b0be27e8793b2c4f772c287f61b713e4627d1ea +LLVM_assert.v13.0.1+1.x86_64-w64-mingw32-cxx11.tar.gz/md5/02f40ff65e065aed77b279dca396bfa2 +LLVM_assert.v13.0.1+1.x86_64-w64-mingw32-cxx11.tar.gz/sha512/e7b88384bc960ee4e8cfb020f64eba6b9a357ae0bcd8ac49bae38c2b0a1c5ec01514ae55ba20abd543d36ad42e10d80ea8dd3846ba69ba75d710ff8efe47fc97 +libLLVM.v13.0.1+1.aarch64-apple-darwin.tar.gz/md5/4c97b4d36ddc239694bd66e5b3456b3b +libLLVM.v13.0.1+1.aarch64-apple-darwin.tar.gz/sha512/29851622fa6643c40141a6bfb2c00b26c8601bf76bf79d78aaf885fe5563987b8626e7d866442d196a26b047f33fe920e199c6d3322b3b7e9fc3bd248bd2da1f +libLLVM.v13.0.1+1.aarch64-linux-gnu-cxx03.tar.gz/md5/3c4487a8c7e1cb43812a44ebed5929c3 +libLLVM.v13.0.1+1.aarch64-linux-gnu-cxx03.tar.gz/sha512/da17361c92289aac0d832d1a7cadaf2108f5bd00df4cad6711b457f005d4985194522dcd8b8e91c5bb475dcfba7b48975aaa8cb5bddaaf33ce90df775d500712 +libLLVM.v13.0.1+1.aarch64-linux-gnu-cxx11.tar.gz/md5/9d7c6f5740453aacd20daad05f9cc03c +libLLVM.v13.0.1+1.aarch64-linux-gnu-cxx11.tar.gz/sha512/164203d120b0ce15e9736d7965fe2df584db331fc4505c37ffe0bcace9805a28267eb9365c263cc2e60331b273956562ed74a00b0fdeff00d6b1f5b38a7b7b60 +libLLVM.v13.0.1+1.aarch64-linux-musl-cxx03.tar.gz/md5/421c48ac0afb81809db85cef1fbb1aa2 +libLLVM.v13.0.1+1.aarch64-linux-musl-cxx03.tar.gz/sha512/ee8bd8ebd0e83a49cc076fcf3f6d21f1e487395da7c5b6ba71cb8e6f7bc1c34e8073b17073adb621dc40c4898458dfe3ad2ce011123e5af336f6039896eafcfb +libLLVM.v13.0.1+1.aarch64-linux-musl-cxx11.tar.gz/md5/21d0ab81dece9885e718f604bde68762 +libLLVM.v13.0.1+1.aarch64-linux-musl-cxx11.tar.gz/sha512/f7432188ce001c54e123bc083ae31a954065eba1e203684f5f8b551d31cf1e382fd931831cde794eb794bed0e17fbfe99df34bcc51d945bfda0b9ffd941f5b97 +libLLVM.v13.0.1+1.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/130a750f65b168868c80d47a2e05d746 +libLLVM.v13.0.1+1.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/495ff715fda14baf9317c80846e6cb764473d4cfbdf73d448e7dbab769d347dee65cd017ff2e602fb25218769d16558a76048ab17bf4454784f525ba014d9d9c +libLLVM.v13.0.1+1.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/aa12e89bef25e218081b86fed74c32a6 +libLLVM.v13.0.1+1.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/29817fb6aa36dc962ee0e3b61d30144c11bd7a2e122cd0b44a2d809a84f9c0b4035bfba10bf1139ebaa91fae93a9c31f160db4edbf72c62d35db373a54bdd716 +libLLVM.v13.0.1+1.armv6l-linux-musleabihf-cxx03.tar.gz/md5/c05e58b05a1a61ab5ef35c6c3cf90795 +libLLVM.v13.0.1+1.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/c7cd5a71808f7e3a85956fa5ea1d043a4901faab4d1da02750b5e10168c85cb47c17466ff7df972fef98bca0733af0a8224ff2fbeebda1740fd8c6381c4a79a3 +libLLVM.v13.0.1+1.armv6l-linux-musleabihf-cxx11.tar.gz/md5/72face6e0d19a79e6810af1acbb6c227 +libLLVM.v13.0.1+1.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/716eacc8cfa5be5cacb4ab795ea343375cf58238950dd088dd61cac6df2b3e9552814c6bd64638b2a8233e00ac8d7e6dde4deccb73218b5f93fbf901953197ed +libLLVM.v13.0.1+1.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/89750604a80dcde35a44c6686a73d170 +libLLVM.v13.0.1+1.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/309998d51fa076e95dca0164eed41106305a8ddb83bcb044cec1b6b4525ee0d924370f84d731d05141a5403f23dee4ce0f3b679ce73c119fcee2a1e0f46fcb66 +libLLVM.v13.0.1+1.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/c9d0bc580f4da0d770cfdc6e948b4e5b +libLLVM.v13.0.1+1.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/b6965203f440bf68557a368285039f1ba69929305f743baa10eb021a41c63ebdbabbba6f38131f2d2d0ec5e5d1ae0f5f8b0744de6ab826cbabd8beeb1121464a +libLLVM.v13.0.1+1.armv7l-linux-musleabihf-cxx03.tar.gz/md5/466bbd7139fca2a0246d7de235c156e1 +libLLVM.v13.0.1+1.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/a7b970f380b3bd48eb623a522d72ad4aa9c76c2af1e602182198c0ffde40e06bdc8e8159053ed708568fbeef76481fc4c9cadb2b5d1f1a87730829d1e57135a6 +libLLVM.v13.0.1+1.armv7l-linux-musleabihf-cxx11.tar.gz/md5/f6ad4d6ec08a7ae00b689de6990d3396 +libLLVM.v13.0.1+1.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/75288712e076a6e84e7a4c1ec7f50fe81c5f45e827381edefcf6c1b0ef0e0190950aeb34fe9ea5889ec33cabd310957814237582d979d44233a813a6202318a5 +libLLVM.v13.0.1+1.i686-linux-gnu-cxx03.tar.gz/md5/32a0301b14f526bddd918cd86f809b74 +libLLVM.v13.0.1+1.i686-linux-gnu-cxx03.tar.gz/sha512/bed19b14b8dddb058bb67616157b81117cecdd71547720837de987824ccf3c48e2d5b38acf9e5e0e121b06a70b2878e5808d76e2e519ccc6b112bf55bda09a0e +libLLVM.v13.0.1+1.i686-linux-gnu-cxx11.tar.gz/md5/4f523f2fa72c6d4671ecd7d784f37e43 +libLLVM.v13.0.1+1.i686-linux-gnu-cxx11.tar.gz/sha512/ff07f577207ef5400c1c09d653ac59360a9dd0b18056b6aa51179289ae16b39cfa7ea6b35c1636d5dcd50e4ac671546751deb0a5e4f463a2bdd5b3e61428f97e +libLLVM.v13.0.1+1.i686-linux-musl-cxx03.tar.gz/md5/5375202117e4c229388ab98a934cdc8b +libLLVM.v13.0.1+1.i686-linux-musl-cxx03.tar.gz/sha512/7b3c4aa98e9d759de1562e1a661cc7c55ba0772c8a4ef89149f77d101275a1df3e99e834a4393dc2345799b89ae07a2dc86c26a6106a5a8a269ffa19ef629cb5 +libLLVM.v13.0.1+1.i686-linux-musl-cxx11.tar.gz/md5/971ee2c968fef0371104ca6ae6edd847 +libLLVM.v13.0.1+1.i686-linux-musl-cxx11.tar.gz/sha512/a9165d017e14dd6454a8ab6845d81dd5e1b923532745d9b404e1736158dfbfe164ddb4d261f576492e83b6090817d014d89fa4884a05f9282f6e8cc0916231f3 +libLLVM.v13.0.1+1.i686-w64-mingw32-cxx03.tar.gz/md5/a34e45eff44c295b35048aea9b395414 +libLLVM.v13.0.1+1.i686-w64-mingw32-cxx03.tar.gz/sha512/4802763ce26a9124f2d4221d5dbffafd4578e696dbaa1a2188acc9412fad572b46164f780e0a68745c1662d749fc31b38f7d5f5b72a3507e3b817f79c6f89a8b +libLLVM.v13.0.1+1.i686-w64-mingw32-cxx11.tar.gz/md5/d2005b97458811e9b77ee33fcd65b314 +libLLVM.v13.0.1+1.i686-w64-mingw32-cxx11.tar.gz/sha512/7e04b5223d65f8077a2fadb980c6bf8a55d826da5d8f667b27509987760b4ee9a6030163e690c5bd941f012946a7b78cc05c05ad923d61467c1e70dd85e38d7b +libLLVM.v13.0.1+1.powerpc64le-linux-gnu-cxx03.tar.gz/md5/a498dab635555f766140eba36f13ebb2 +libLLVM.v13.0.1+1.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/a06564f21c850e1aa504fbe3e4265980a7ce0c01824f022fef08b1ca0f6aeed336e469573d01608949ac50e44b85a371ee65a1e214184b3f9470685de92cc785 +libLLVM.v13.0.1+1.powerpc64le-linux-gnu-cxx11.tar.gz/md5/3f38df08f0ea1dde652a1eb4fb3ea7b2 +libLLVM.v13.0.1+1.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/3525bc139e704a63e218893543594bfd9185b372309f82dba36269ec28b66c40669fbb402f0cd7203528ce1ebd2e383cb936557b1309fe8b8eef6ee5605a05d0 +libLLVM.v13.0.1+1.x86_64-apple-darwin.tar.gz/md5/bf734ea5bf98ddbe7585ad4b848b9f61 +libLLVM.v13.0.1+1.x86_64-apple-darwin.tar.gz/sha512/adf5f0f8ec593ded7a248a3920c3265fb406f5545d1ac4521eccab688e75f9b4cb5cc265f1b2cf8cd9dbb44e4119dbcac0bfad03ff2e708819c7b488d026d52e +libLLVM.v13.0.1+1.x86_64-linux-gnu-cxx03.tar.gz/md5/0f2f7ec9551066ad25b907fc4348e009 +libLLVM.v13.0.1+1.x86_64-linux-gnu-cxx03.tar.gz/sha512/6be9fd9ffedf814b8946e70a0b26ca4263141a132ceb34b2a6f82c2429fa1111dfc385e9250073b5afc62169ead6e9196e2d4dced8fd8f611e955c8e4ccdc346 +libLLVM.v13.0.1+1.x86_64-linux-gnu-cxx11.tar.gz/md5/3f34a598fa9c9b5549b6d60582a5fd62 +libLLVM.v13.0.1+1.x86_64-linux-gnu-cxx11.tar.gz/sha512/74c461bfa4b061abd9c7fb915c6d8e069da609ec6fdadbe4fb8e97e0a6f39a024a416d43d23e9ff52ce8e00b7de14da451a5a7dd2594c70b8fe33f94f28b105b +libLLVM.v13.0.1+1.x86_64-linux-musl-cxx03.tar.gz/md5/3d8922dc384f9ce77525624a9cfbeb5b +libLLVM.v13.0.1+1.x86_64-linux-musl-cxx03.tar.gz/sha512/efc3e1054f7b37d4ee39fadf1f6940364c89258f4501a0f31bac957139e1bf3c09270b308ad33132c34bef1860c0c315e9296f827bbcad5808bee5687ce4651d +libLLVM.v13.0.1+1.x86_64-linux-musl-cxx11.tar.gz/md5/1b5b48486990824c206e690f68b8bb25 +libLLVM.v13.0.1+1.x86_64-linux-musl-cxx11.tar.gz/sha512/a9e7b98de0f963fddd88e7a74ccb82bdd602fd69d3024c00c57230da26ad39c5bf0fabfc019fabddc364861ea111aad1b2659adcf425d46528172363bf3396a8 +libLLVM.v13.0.1+1.x86_64-unknown-freebsd.tar.gz/md5/83fd917c7ff47e8d95407348e4789f76 +libLLVM.v13.0.1+1.x86_64-unknown-freebsd.tar.gz/sha512/2504681fa9a2fa7d3154444823a8d14b8c3949b21eb0cd6d1e29082f0327a03d16942da34af1b915169ca73ad9f89a22d60d27868380a5a4c5be7b052c77438e +libLLVM.v13.0.1+1.x86_64-w64-mingw32-cxx03.tar.gz/md5/bf4b7a1084913542e9f621fc1899591a +libLLVM.v13.0.1+1.x86_64-w64-mingw32-cxx03.tar.gz/sha512/688b9308555cb44152421338d105fb680911bb227cf1edbbfaeb0e79a3ea831bae0256c36ac365e2992e6edada36e3d28f95f02816b5647e79aa13cf8ccf3eb9 +libLLVM.v13.0.1+1.x86_64-w64-mingw32-cxx11.tar.gz/md5/dfbe93a16955386947536639eb9660c4 +libLLVM.v13.0.1+1.x86_64-w64-mingw32-cxx11.tar.gz/sha512/94ad039587176cddae1323fbf2e6908203c04a8c2017036ddeb11aef1ffa2b5344641a5cf72939ab37338fa533aca1ffce606f234067d0df6f45f98c19a9b3b5 +libLLVM_assert.v13.0.1+1.aarch64-apple-darwin.tar.gz/md5/3c2f22bfef748efdd4cfb118ac91ea62 +libLLVM_assert.v13.0.1+1.aarch64-apple-darwin.tar.gz/sha512/f7e985249a75a8d192a261855ba698251f090abc564b1b9458fc147c351b026f0ca2e84968efab8b357ee5a9361972e3ff8498672d161cebbb4f1b5bbc00ea35 +libLLVM_assert.v13.0.1+1.aarch64-linux-gnu-cxx03.tar.gz/md5/09030fa894c1cf380094e7c8edee287c +libLLVM_assert.v13.0.1+1.aarch64-linux-gnu-cxx03.tar.gz/sha512/3761dfb8e40d35725910fd98bc800ce2948bcfc7f1afa879d92735553009dee14e326bd8c66c2728c1c268f4d107787d4829a6b20a43f75dda200938309d3136 +libLLVM_assert.v13.0.1+1.aarch64-linux-gnu-cxx11.tar.gz/md5/58d698b70fa0ee9d67a078045da6efb1 +libLLVM_assert.v13.0.1+1.aarch64-linux-gnu-cxx11.tar.gz/sha512/4e40954fbebdfa92b15221b5db6cf4a83d9250aab8cf47eceeb35e8356af42711c937a3e1f7ef91f108679143a6a41b8eb372ab71afbf1fd574adfeb63ab7fef +libLLVM_assert.v13.0.1+1.aarch64-linux-musl-cxx03.tar.gz/md5/7feee1018241b6a2caa322e3c9fdd129 +libLLVM_assert.v13.0.1+1.aarch64-linux-musl-cxx03.tar.gz/sha512/e12bd26d9fc329fded28c37bc3427e797137cb93d15c9d4d2ddd5f938159f4debd71582636e2767aba09c50d046fe85f321e5c7f7a22ef5e6ce11fdd2c0ac924 +libLLVM_assert.v13.0.1+1.aarch64-linux-musl-cxx11.tar.gz/md5/26378b37166b3c1e16c5a9d24e7d2b54 +libLLVM_assert.v13.0.1+1.aarch64-linux-musl-cxx11.tar.gz/sha512/d19fbd149aadb6f7e947385ea3624efb4a52d8afd4874cd6d213de4597bfb944477257bb6259b3af7fb5371c34d9675309ae70661c90c1ae90e5f2960e6cff5f +libLLVM_assert.v13.0.1+1.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/f637cefdafaa9f658d8940337145b633 +libLLVM_assert.v13.0.1+1.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/78ce54c177462b54731519fec86977169ec6728b6b34fe084f21ea9caa72654c03fd01f98a59e2b846bc42a028cb94e1aad59be7cecaef7d4d7c9189ec134255 +libLLVM_assert.v13.0.1+1.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/793f841ab9013c74df8db6f20b589771 +libLLVM_assert.v13.0.1+1.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/45b0d014f79f7bd0be151599c1e65bd931388dbd2784b52b2b3552c60ef70a4c8217f5542943e4237fdd77a6b63f0b10a268a06599b32e9af36a3247e62ab2c8 +libLLVM_assert.v13.0.1+1.armv6l-linux-musleabihf-cxx03.tar.gz/md5/719bfb9ce878d5fdd4c3e94247a53b69 +libLLVM_assert.v13.0.1+1.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/e5a01d55ae90ba1e5987cd4c6f18ec5180800efc958938916c6d1b11c0b49fa21d7155f27b016f07ce28653445ccbfd9314141492f1b28bf7127449b47a8f905 +libLLVM_assert.v13.0.1+1.armv6l-linux-musleabihf-cxx11.tar.gz/md5/3437dfbd103912bb11f7097276e49c5e +libLLVM_assert.v13.0.1+1.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/a7fea196af95e8a9dd5153b05f417512481cd50e356826e5ab2f92e15b61eb5351db86b4a61210d0814bcbe0afa31ef13cc1eaa8dbd38c2d41548880a05e1c39 +libLLVM_assert.v13.0.1+1.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/c8f7eed3171c37abe12f089639795363 +libLLVM_assert.v13.0.1+1.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/7a2b6ed788745d036916b13706f3f0d33eb4d1f41a2da0d3a64193f908e6d80e6a8e8bd222c13304fca7b579c926ef6996e281125e6d91700f9a1e6ddfdd4837 +libLLVM_assert.v13.0.1+1.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/11f2ba96fc1509603e8d939a4b7a734d +libLLVM_assert.v13.0.1+1.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/7615914bbf907d881bdf64a97ebea7ec1b3dff48a45177a77c3eac6928c3419b977e48cdb5c34cba33e4185bf92a9d1f42d8232a4d59aa70c43bcfdb3b8b8457 +libLLVM_assert.v13.0.1+1.armv7l-linux-musleabihf-cxx03.tar.gz/md5/eeaf0665249bb941eb2ff20c1193005d +libLLVM_assert.v13.0.1+1.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/8cbde302d0f435c53d9bed4890d5888686aa57e4be0bb9e3b5ac34b05e6f7e1b63941dde08ee20ccd0b2ee60fb78f232c486760a7ba49d98d6985d6300b93ab1 +libLLVM_assert.v13.0.1+1.armv7l-linux-musleabihf-cxx11.tar.gz/md5/d398c137fd4b9a2fd03761f692052df6 +libLLVM_assert.v13.0.1+1.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/bac9c99bc7d19b96844d6a6dc6709619290ca73987cd60276ae76e87d48289478a32aac5e8219c35173615606ae9d12623310e33ad39d0d28c625d7540ad51bf +libLLVM_assert.v13.0.1+1.i686-linux-gnu-cxx03.tar.gz/md5/9ab80644b6447f841e98af29c62296f3 +libLLVM_assert.v13.0.1+1.i686-linux-gnu-cxx03.tar.gz/sha512/8721a56e9260da1def9017c9bbb5f0cef64579c923714a27ad171be57d98fca63aefc741e72ca884d7517cf20926ff5b4e4dd0f83831599ebae8d4fc4d2f694a +libLLVM_assert.v13.0.1+1.i686-linux-gnu-cxx11.tar.gz/md5/a1f5cc82855df35082e1bf97c1fa290d +libLLVM_assert.v13.0.1+1.i686-linux-gnu-cxx11.tar.gz/sha512/616c43636b9c03e4eb0a91c7ac495ba63c832c2d01b671e51acd98503a3b88fc403ad60a1b254612b739b3f79964108e239ff13cff49aee455698e4c88fbdb31 +libLLVM_assert.v13.0.1+1.i686-linux-musl-cxx03.tar.gz/md5/d80716e108435f92c96aaf13d9cab76f +libLLVM_assert.v13.0.1+1.i686-linux-musl-cxx03.tar.gz/sha512/712eb57da4ec0a96e0498f603601d3beb95d3ab23d17ac2a3dd434218040c04b2ab6891538483c4d6bab540063fa241ef3a5b1030767e788b2249a39f6c0335c +libLLVM_assert.v13.0.1+1.i686-linux-musl-cxx11.tar.gz/md5/81986c49977a6fea10f4fb0d51e6d77f +libLLVM_assert.v13.0.1+1.i686-linux-musl-cxx11.tar.gz/sha512/15abd937df88e9247ef4799db2d512e872c619bf1613da9a809b4024dd8dda720ec9eaea1af44f8be382e435b5032a450d91ce6f966ab8d27bf0223192380108 +libLLVM_assert.v13.0.1+1.i686-w64-mingw32-cxx03.tar.gz/md5/71993c77be2155b6ec2270ef5ae15137 +libLLVM_assert.v13.0.1+1.i686-w64-mingw32-cxx03.tar.gz/sha512/b348e4694164ba4bac699a5cff622aa8834c2ebd7f24452e3260c82883dcf4d1c62c9dd8e5a83b69352587d3900365e9ccaa7948d67ef648cac8eda6ef4e7ab1 +libLLVM_assert.v13.0.1+1.i686-w64-mingw32-cxx11.tar.gz/md5/55b558443d23825df516342d8f7dfc97 +libLLVM_assert.v13.0.1+1.i686-w64-mingw32-cxx11.tar.gz/sha512/b4307e4fa2675b96aefcd7f529a3de2b37f0d5d7e63da2167d9e6d43dabedef93e661b3958d186833161aa93875596ca16f4811d7fed6ee27e0e0a9be7d1eabf +libLLVM_assert.v13.0.1+1.powerpc64le-linux-gnu-cxx03.tar.gz/md5/fdbe30e67a19f47490f743e137ce3d64 +libLLVM_assert.v13.0.1+1.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/b09ff2c29a15954306e02577a9e488e4170aa512a4853fb6f19ed7ab01ec6f347aeefcc53f40d091104b0f0bc72140daa45416f9c9afc3b5722a224e859c564e +libLLVM_assert.v13.0.1+1.powerpc64le-linux-gnu-cxx11.tar.gz/md5/1c92f7ada7534843c76702a2954cd470 +libLLVM_assert.v13.0.1+1.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/1516c43185c481347eff8bed32d1010a027ec22dd005839f6bfcad5107a72e958561c32859ea388b2261e5ec5fc1c2f4cc14ac1b0a61e96e57fa846765de6a6d +libLLVM_assert.v13.0.1+1.x86_64-apple-darwin.tar.gz/md5/bdca8d4433c763078bd45f12abbeb640 +libLLVM_assert.v13.0.1+1.x86_64-apple-darwin.tar.gz/sha512/bc7fa455e1bae61b80ea365edbd39875ee87374f72f1c3963726c68b72c2a0fe33e65f82baac62d272227b86e7a4308778cceffb298f4dcb9fc3763d58f54b21 +libLLVM_assert.v13.0.1+1.x86_64-linux-gnu-cxx03.tar.gz/md5/75d2936a377e346927edb11ff26c253b +libLLVM_assert.v13.0.1+1.x86_64-linux-gnu-cxx03.tar.gz/sha512/1b853f9fbf69bc67f018861cb39ff28282f3492df5be417116658f98a2cfde32debc59943fa965adf6761d71d85488bba049e8fe73a298dd990e2404a0516f0d +libLLVM_assert.v13.0.1+1.x86_64-linux-gnu-cxx11.tar.gz/md5/7477e0a3d685cc31b4cbb7f56fe6b395 +libLLVM_assert.v13.0.1+1.x86_64-linux-gnu-cxx11.tar.gz/sha512/36c2c363dd2f071b55ee351097e048d8b31f1c27d543dc84669d300fb6f68399a892f78ba327e20243fbbc6a30d1afab5056e06877bdedfa1ec5532a43562fab +libLLVM_assert.v13.0.1+1.x86_64-linux-musl-cxx03.tar.gz/md5/061c51c4c5dab76a3bd5a37d9e05b772 +libLLVM_assert.v13.0.1+1.x86_64-linux-musl-cxx03.tar.gz/sha512/cc549affe17d8b440274be86c579fc7132c9cfd5c88876476cf386e3ef14c58cc32f12e14615bd025b03fc753477f71c963945a0d053d17f32e2f30d3fa6371d +libLLVM_assert.v13.0.1+1.x86_64-linux-musl-cxx11.tar.gz/md5/0588aba28941777c87a6bd180e46ea23 +libLLVM_assert.v13.0.1+1.x86_64-linux-musl-cxx11.tar.gz/sha512/44b75207b05a6e972724045bcf3b8049ef4c2717a89cd71c709f39cc75a3a59bef1bb05ababaf01b22b6add7d97425e01aa55b27d309f63d7d4a9bfa2aa48096 +libLLVM_assert.v13.0.1+1.x86_64-unknown-freebsd.tar.gz/md5/c5037e526298885f4f517928290439a4 +libLLVM_assert.v13.0.1+1.x86_64-unknown-freebsd.tar.gz/sha512/077b79753183cc4bc004990ff81bcba33024ab9cb3ba740c256cb62bde919f9940b33d2685c779d7875e10ae1d61f35600e20b932d14613d071d46d9b105ad12 +libLLVM_assert.v13.0.1+1.x86_64-w64-mingw32-cxx03.tar.gz/md5/9b2af6b43a87d8a59dabc8f7b036b5e6 +libLLVM_assert.v13.0.1+1.x86_64-w64-mingw32-cxx03.tar.gz/sha512/01e93ca78afdd7b3b4cfdd5231b3e2db3e1fcefa491766832643fdb98a2f4dfeda1aca86d8140254938023dfa4263e2e0b1865e66e8e83ab2ce3d9c292a0c7d4 +libLLVM_assert.v13.0.1+1.x86_64-w64-mingw32-cxx11.tar.gz/md5/58e151b3524d9fa073e7e2689aa2e5a7 +libLLVM_assert.v13.0.1+1.x86_64-w64-mingw32-cxx11.tar.gz/sha512/108146008f83e9c6ad09fee07fabc34cbe31077f3681a3499ded76613f69dc7cdd812ffde6eaca1f7fc6b7613c3d32485cb94e67b983e76a0a2d225c2b29bcb7 llvm-julia-13.0.1-0.tar.gz/md5/34edc9f707d86fe8c5758b0ae8c35206 llvm-julia-13.0.1-0.tar.gz/sha512/0d55c1bf3c581551faa077aab7046d1f020e8775ed16f1fbd8ccee65bc8f43173504f5ce1215227fa5e565f2804f8772e2cda039bc333bb23677067a4a3f9f87 +llvmunwind-12.0.1.tar.xz/md5/4ec327cee517fdb1f6a20e83748e2c7b +llvmunwind-12.0.1.tar.xz/sha512/847b6ba03010a43f4fdbfdc49bf16d18fd18474d01584712e651b11191814bf7c1cf53475021d9ee447ed78413202b4ed97973d7bdd851d3e49f8d06f55a7af4 diff --git a/stdlib/libLLVM_jll/Project.toml b/stdlib/libLLVM_jll/Project.toml index 64de5adc434ba..38fb77588fb66 100644 --- a/stdlib/libLLVM_jll/Project.toml +++ b/stdlib/libLLVM_jll/Project.toml @@ -1,6 +1,6 @@ name = "libLLVM_jll" uuid = "8f36deef-c2a5-5394-99ed-8e07531fb29a" -version = "13.0.1+0" +version = "13.0.1+1" [deps] Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" From 4acdabe72ecc98a9f5690dfa703ade28416a99c1 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Mon, 20 Jun 2022 11:22:09 -0400 Subject: [PATCH 196/369] fixup! Update LLVM to 13.0.1+1 --- deps/llvm.version | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deps/llvm.version b/deps/llvm.version index ed9cfbcfc7a25..95f9796624933 100644 --- a/deps/llvm.version +++ b/deps/llvm.version @@ -1,2 +1,2 @@ -LLVM_BRANCH=julia-13.0.1-0 -LLVM_SHA1=julia-13.0.1-0 +LLVM_BRANCH=julia-13.0.1-1 +LLVM_SHA1=julia-13.0.1-1 From 853dff91907161f0a925ade1a6eaac86f4884218 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Mon, 20 Jun 2022 11:23:54 -0400 Subject: [PATCH 197/369] fixup! fixup! Update LLVM to 13.0.1+1 --- deps/checksums/llvm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deps/checksums/llvm b/deps/checksums/llvm index c8b39ced22cdd..14b96e1b4ca06 100644 --- a/deps/checksums/llvm +++ b/deps/checksums/llvm @@ -262,7 +262,7 @@ libLLVM_assert.v13.0.1+1.x86_64-w64-mingw32-cxx03.tar.gz/md5/9b2af6b43a87d8a59da libLLVM_assert.v13.0.1+1.x86_64-w64-mingw32-cxx03.tar.gz/sha512/01e93ca78afdd7b3b4cfdd5231b3e2db3e1fcefa491766832643fdb98a2f4dfeda1aca86d8140254938023dfa4263e2e0b1865e66e8e83ab2ce3d9c292a0c7d4 libLLVM_assert.v13.0.1+1.x86_64-w64-mingw32-cxx11.tar.gz/md5/58e151b3524d9fa073e7e2689aa2e5a7 libLLVM_assert.v13.0.1+1.x86_64-w64-mingw32-cxx11.tar.gz/sha512/108146008f83e9c6ad09fee07fabc34cbe31077f3681a3499ded76613f69dc7cdd812ffde6eaca1f7fc6b7613c3d32485cb94e67b983e76a0a2d225c2b29bcb7 -llvm-julia-13.0.1-0.tar.gz/md5/34edc9f707d86fe8c5758b0ae8c35206 -llvm-julia-13.0.1-0.tar.gz/sha512/0d55c1bf3c581551faa077aab7046d1f020e8775ed16f1fbd8ccee65bc8f43173504f5ce1215227fa5e565f2804f8772e2cda039bc333bb23677067a4a3f9f87 +llvm-julia-13.0.1-1.tar.gz/md5/db436789b8cae6ece401acc12a261b7a +llvm-julia-13.0.1-1.tar.gz/sha512/e7836aa18f6cc721fb46b555f00a79b3e256763c1d277b1c92b1125c39b84206813bd9c42b8844a696501606072ad5960df52f2f1c0000159a949680028c8300 llvmunwind-12.0.1.tar.xz/md5/4ec327cee517fdb1f6a20e83748e2c7b llvmunwind-12.0.1.tar.xz/sha512/847b6ba03010a43f4fdbfdc49bf16d18fd18474d01584712e651b11191814bf7c1cf53475021d9ee447ed78413202b4ed97973d7bdd851d3e49f8d06f55a7af4 From 67f365c1e39ca7a1cc147bdc12fd87c4f70e3a14 Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Thu, 3 Mar 2022 09:22:52 -0600 Subject: [PATCH 198/369] Improve inference in typejoin (#44390) This fixes hundreds of invalidations from Unitful. Co-authored by: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> --- base/essentials.jl | 2 +- base/promotion.jl | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/base/essentials.jl b/base/essentials.jl index 04df906628e36..365cdc3b82ba6 100644 --- a/base/essentials.jl +++ b/base/essentials.jl @@ -766,7 +766,7 @@ function invoke_in_world(world::UInt, @nospecialize(f), @nospecialize args...; k end # TODO: possibly make this an intrinsic -inferencebarrier(@nospecialize(x)) = Ref{Any}(x)[] +inferencebarrier(@nospecialize(x)) = RefValue{Any}(x).x """ isempty(collection) -> Bool diff --git a/base/promotion.jl b/base/promotion.jl index 845e16ca499d3..24d0835a8b94a 100644 --- a/base/promotion.jl +++ b/base/promotion.jl @@ -29,11 +29,15 @@ function typejoin(@nospecialize(a), @nospecialize(b)) return typejoin(typejoin(a.a, a.b), b) elseif isa(b, Union) return typejoin(a, typejoin(b.a, b.b)) - elseif a <: Tuple + end + # a and b are DataTypes + # We have to hide Constant info from inference, see #44390 + a, b = inferencebarrier(a)::DataType, inferencebarrier(b)::DataType + if a <: Tuple if !(b <: Tuple) return Any end - ap, bp = a.parameters::Core.SimpleVector, b.parameters::Core.SimpleVector + ap, bp = a.parameters, b.parameters lar = length(ap) lbr = length(bp) if lar == 0 @@ -77,7 +81,6 @@ function typejoin(@nospecialize(a), @nospecialize(b)) elseif b <: Tuple return Any end - a, b = a::DataType, b::DataType while b !== Any if a <: b.name.wrapper while a.name !== b.name @@ -207,16 +210,17 @@ function typejoin_union_tuple(T::DataType) end # Returns length, isfixed -function full_va_len(p) +function full_va_len(p::Core.SimpleVector) isempty(p) && return 0, true last = p[end] if isvarargtype(last) - if isdefined(last, :N) && isa(last.N, Int) - return length(p)::Int + last.N - 1, true + if isdefined(last, :N) + N = last.N + isa(N, Int) && return length(p) + N - 1, true end - return length(p)::Int, false + return length(p), false end - return length(p)::Int, true + return length(p), true end # reduce typejoin over A[i:end] From f83a9b3312d11456734f591c6858919cba43a1f1 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Mon, 4 Jul 2022 04:54:01 -0400 Subject: [PATCH 199/369] [1.8] Update LLVM to 13.0.2-2 (#45917) --- deps/Versions.make | 8 +- deps/checksums/clang | 116 ++++---- deps/checksums/llvm | 468 ++++++++++++++++---------------- deps/checksums/llvmunwind | 34 --- deps/llvm.version | 4 +- stdlib/libLLVM_jll/Project.toml | 2 +- 6 files changed, 299 insertions(+), 333 deletions(-) delete mode 100644 deps/checksums/llvmunwind diff --git a/deps/Versions.make b/deps/Versions.make index eedc380a95822..529bf25d4c634 100644 --- a/deps/Versions.make +++ b/deps/Versions.make @@ -15,7 +15,7 @@ CSL_JLL_NAME := CompilerSupportLibraries # Clang (paired with LLVM, only here as a JLL download) CLANG_JLL_NAME := Clang -CLANG_JLL_VER := 13.0.1+1 +CLANG_JLL_VER := 13.0.1+2 # DSFMT DSFMT_VER := 2.2.4 @@ -45,13 +45,13 @@ LIBUV_JLL_NAME := LibUV # LLVM LLVM_VER := 13.0.1 -LLVM_ASSERT_JLL_VER := 13.0.1+1 +LLVM_ASSERT_JLL_VER := 13.0.1+2 LLVM_JLL_NAME := libLLVM # LLVM_tools (downloads LLVM_jll to get things like `lit` and `opt`) LLVM_TOOLS_JLL_NAME := LLVM -LLVM_TOOLS_JLL_VER := 13.0.1+1 -LLVM_TOOLS_ASSERT_JLL_VER := 13.0.1+1 +LLVM_TOOLS_JLL_VER := 13.0.1+2 +LLVM_TOOLS_ASSERT_JLL_VER := 13.0.1+2 # LLVM libunwind LLVMUNWIND_VER := 12.0.1 diff --git a/deps/checksums/clang b/deps/checksums/clang index 882d4476797a9..33424cdb4ac49 100644 --- a/deps/checksums/clang +++ b/deps/checksums/clang @@ -1,58 +1,58 @@ -Clang.v13.0.1+1.aarch64-apple-darwin.tar.gz/md5/05f7af4b9ba5370ea9fc4e7fd3391a58 -Clang.v13.0.1+1.aarch64-apple-darwin.tar.gz/sha512/df4a859bae20ecb02ddb5f187aab79901770125840f059daee12bfc5cb3a838fe01d01b40c01753daf986c77e6fe272bd64f520cb58ad5add0858a08b2382e0d -Clang.v13.0.1+1.aarch64-linux-gnu-cxx03.tar.gz/md5/dbec252a66a927c49a2d02a6ee8d0b4b -Clang.v13.0.1+1.aarch64-linux-gnu-cxx03.tar.gz/sha512/ac3f44f14079b6a03efe961857781fc5cf806f433501c14825f2b512e0b43e8d4dfaf24938259bf8f496f2ca71044d2cff3be319caeb16330e7c883a1829796b -Clang.v13.0.1+1.aarch64-linux-gnu-cxx11.tar.gz/md5/ab811581c7c80d899c90e1006396e3d2 -Clang.v13.0.1+1.aarch64-linux-gnu-cxx11.tar.gz/sha512/ec40a541c16a1856e5862407b07e97e9281ae05ca058091f5b08444ae13cdfe5e2cb8f64acc10726cc063d1686cf3d45e1843d5610887e323d195806502f65d9 -Clang.v13.0.1+1.aarch64-linux-musl-cxx03.tar.gz/md5/9ebebc4eab0da13f62671a83c4d55c8a -Clang.v13.0.1+1.aarch64-linux-musl-cxx03.tar.gz/sha512/b49aaedef528e25f326d9f50bbe117426096084b488e856aa645b76c649d9b3065db8e8d0c807dad1e2195465246c66118dda29aebdccd6406c1447ae235853c -Clang.v13.0.1+1.aarch64-linux-musl-cxx11.tar.gz/md5/e06a0861882f944265d238c704d5a186 -Clang.v13.0.1+1.aarch64-linux-musl-cxx11.tar.gz/sha512/eddcdbdce00918dffb9886ecd23c721e71a8829af7e5278295c0e46af724609426bc41075add6d672e26f916ad6e92fba9267f9873d639a6b58f68e974129458 -Clang.v13.0.1+1.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/bd62242e87f2ae395d2916496861239d -Clang.v13.0.1+1.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/2da9e09095e0018d10bcce799414b322ac5c16b9498a0363dcee8959e5ada1318048a883069fcab22fccc31e431dc5cb7574c92d6c248839917d43a8777ccc0f -Clang.v13.0.1+1.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/37e292b042d32e4f3715c0197fae843d -Clang.v13.0.1+1.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/01d2f8a716292219f3f67b2fa419e4c94dadc313e9a65fc82e5d6ededcbd0f238349c9bb9536918426dad2b29bc83bedaa6cc60e7c65c35357992458b7224909 -Clang.v13.0.1+1.armv6l-linux-musleabihf-cxx03.tar.gz/md5/b821a30f9b9d6654738292b717d7a453 -Clang.v13.0.1+1.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/c0acb5a3d8200aa4d6c49c89b3d743e32a842723f4ee38a74a93a2e782cb7092da473bc1744ec5c04ec06ba63f80cd3ee201cccd09d1141b3e353014e28b6344 -Clang.v13.0.1+1.armv6l-linux-musleabihf-cxx11.tar.gz/md5/14330caa3c8e69063aae2fdf911a38b7 -Clang.v13.0.1+1.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/6186042e7452fc1002899b222f36c1ff88f4c9520508c43b37116c44724f6f15e0108fd98333bd5bc909df4ba569e07431ab42f48804f1d438526d7a07907699 -Clang.v13.0.1+1.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/2bd49548dfeb0fc4f42ba433986ab3bf -Clang.v13.0.1+1.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/a370e05e14de148e7fc0ba8f9767ffe864b27d71893678303fe42f7c7dcfd163216fb02ea56a483498a2f39a8ed3f89e18a3c34fb3dd04189a240220810d95e9 -Clang.v13.0.1+1.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/32fc735c395f6f6337e0d7521afcface -Clang.v13.0.1+1.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/1ce34f426b28a67d0e9b1edef12b508d57cd23ade1cf34b3b32896cc8fc923dceed7e0e1c85cebc719f7a185281bac9ce402bebe325e6fedbdcb9800876fa5ac -Clang.v13.0.1+1.armv7l-linux-musleabihf-cxx03.tar.gz/md5/dd5e7b0e1d8c11835fbf0e51f0b5b7ac -Clang.v13.0.1+1.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/49019a4baeb44860978ae40ca89f589806d0119ca545e93f783afc43d3b648a2ea5dce8a442307ed280dea1bff54b73404165042aaaed5ec5fb804809da3ff31 -Clang.v13.0.1+1.armv7l-linux-musleabihf-cxx11.tar.gz/md5/4349bc24cc4ec33bf572b364232e4440 -Clang.v13.0.1+1.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/f45aa5d7434b4510488c7b030b1e612a11e9b96cc5355c2e84b650f4f5fbda8583100d37a3a01fa64930c57d2c07e441a74ab8f7cd20767158633b56381d7bef -Clang.v13.0.1+1.i686-linux-gnu-cxx03.tar.gz/md5/c6c2e8b945bf2c995cdc47b6de93aa54 -Clang.v13.0.1+1.i686-linux-gnu-cxx03.tar.gz/sha512/32d68ee12b14c233e7ac96d7a6c0ecfd54783781c2ba87d3efd628cf08d1ec45522bdb731e860c21bb318795182abb91dccdcd32d371c0cdf23201d013f29ce5 -Clang.v13.0.1+1.i686-linux-gnu-cxx11.tar.gz/md5/49eb5eb68f665f90ad224d108d8edd08 -Clang.v13.0.1+1.i686-linux-gnu-cxx11.tar.gz/sha512/ee089f59c85469c15d8fe657f9ca6472b6ec02b18ac247b2e0c0f46ca29500f3e3adac528690992f7553cabc8143be57104cb818dc693bd7943fcf2c76b464d2 -Clang.v13.0.1+1.i686-linux-musl-cxx03.tar.gz/md5/54e66afa5e0214779ad85023af0dd03b -Clang.v13.0.1+1.i686-linux-musl-cxx03.tar.gz/sha512/2ef046bc58aa58fc89472f72d5198b7f582412aba80903def0e3999dadd0a27ab09315d78f233b88367a7da95e15b1e991ec760b32116c47d54cb39e3c3e254d -Clang.v13.0.1+1.i686-linux-musl-cxx11.tar.gz/md5/26186d54f1c54b546421020ecb4c9b42 -Clang.v13.0.1+1.i686-linux-musl-cxx11.tar.gz/sha512/2e1e49ac2bae1d8acda519a44ddcf592bf79c779a054a0bf6427e3ca9e71feba82990f9284bbb3f43380445dd9ab5b42156def1f9057ed66024c3680afcd7f9e -Clang.v13.0.1+1.i686-w64-mingw32-cxx03.tar.gz/md5/4d85b5669fb8255ed0385f5b8072bffb -Clang.v13.0.1+1.i686-w64-mingw32-cxx03.tar.gz/sha512/9fe8af9550abee09ca8165c77d3e951da8985680800428af064812103fb6320415a1985b9a6547f840e85283e81b3869d8921a600735cfc15f98c080275c4858 -Clang.v13.0.1+1.i686-w64-mingw32-cxx11.tar.gz/md5/134da223a307a12d74dad19b3b4c7eb4 -Clang.v13.0.1+1.i686-w64-mingw32-cxx11.tar.gz/sha512/3b05f2e3bf40a923cd3ee7eea2edd5706147475ada69607ec37ebbf9fad76dc25eb8c6a85a10ac51975ee4da67a69775f11bc4691475f30510b0e1359e6c5287 -Clang.v13.0.1+1.powerpc64le-linux-gnu-cxx03.tar.gz/md5/cb157fa29f1dc74cdbe902b615bb9c3c -Clang.v13.0.1+1.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/6d13489974543a65a090cebe2846825ff42a2332111e76790bb08c3189f7120b6fb5621a723d2afca2d002d9cd13ee69ec23e1d137de3769866cf0b85afbf714 -Clang.v13.0.1+1.powerpc64le-linux-gnu-cxx11.tar.gz/md5/92b51bc77c86138a0de5d46f3e931258 -Clang.v13.0.1+1.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/0363458dcf55ec8f766ef556faecb73e1ae64cc90454aa890333e4b9ba4e1154990639adda61927857bf8ab6ce1fd2f8372f77a90d8dfcd0a1caba1b09ccc092 -Clang.v13.0.1+1.x86_64-apple-darwin.tar.gz/md5/27ea4c510f2e13ad8ad126e1bb7975d5 -Clang.v13.0.1+1.x86_64-apple-darwin.tar.gz/sha512/fd598a49518c18ec1ac02c17da7fd2a0a2da569e98611e3a62612d7b4a8603c5984d1a0bce5d7040fdb727b76ceeafb5cd2cf6488dc12f3eb6f5152cd47bbd30 -Clang.v13.0.1+1.x86_64-linux-gnu-cxx03.tar.gz/md5/1f84ef2b7e7c6b53ea6d4d1aec82d548 -Clang.v13.0.1+1.x86_64-linux-gnu-cxx03.tar.gz/sha512/90f7945c4d3ce89d749f13902cd889c9f7851ed705b9d7cc28bb6cc7ac066c97617b7dcc16c189f50754f3129d7dd0138f7e1423f43110d6bb4d8b2f64f03c6d -Clang.v13.0.1+1.x86_64-linux-gnu-cxx11.tar.gz/md5/86aae8993938bc5ca72b58b843a83f00 -Clang.v13.0.1+1.x86_64-linux-gnu-cxx11.tar.gz/sha512/b5c2a3026fd7ab8b87e4bd8cf7e8f70b1365d68c49a8603e366e6bfc8cdf8ec198f3eb88958d2d2b8c287cf4cca193bab7f1b41bb0e521c0e392ede98bf26c9a -Clang.v13.0.1+1.x86_64-linux-musl-cxx03.tar.gz/md5/518f4b30c12a2d9ef0784757fdcfe482 -Clang.v13.0.1+1.x86_64-linux-musl-cxx03.tar.gz/sha512/96f58786bb8ca96f64dd8a32fd77c2754d8d708b8e6d1e0c5c0e05bffc32391d97034b8a4a371e2457ca30e16df5d8cd60357da1dd7ebc791ea6c3a1ca3e8a89 -Clang.v13.0.1+1.x86_64-linux-musl-cxx11.tar.gz/md5/102cb3d4607be09856bceb5dd9411381 -Clang.v13.0.1+1.x86_64-linux-musl-cxx11.tar.gz/sha512/82dea651ed8cf6a49493bf94141e867c8f2fdb182c25e8ab888ec8ee8f2d5180596ceb57a52cb2f76f57c5426a4d087f65ff064072b7aae292d0b38e736228a8 -Clang.v13.0.1+1.x86_64-unknown-freebsd.tar.gz/md5/3dcfdb2c9a4725813e03a9ef5eb1f9bf -Clang.v13.0.1+1.x86_64-unknown-freebsd.tar.gz/sha512/f39f2e034456427dd555b83cfd56522a184f2998a1b817518fd59fba0628900c7715084194211b077f4c302ef581f2163447daa83d828afb02f888c381c12d12 -Clang.v13.0.1+1.x86_64-w64-mingw32-cxx03.tar.gz/md5/7759171242e4e80a08a17138057daee6 -Clang.v13.0.1+1.x86_64-w64-mingw32-cxx03.tar.gz/sha512/f5a516b1aa3637dbf6d975cf2562e45e6e347e3ed0df4f754a02bd0baab730f3c1c3727c1ca4cfba7e20c961c9f2f333e4452c970f39c5f29f58e42e281749d7 -Clang.v13.0.1+1.x86_64-w64-mingw32-cxx11.tar.gz/md5/2ad677cfbab8bf6e4c2db583cb708003 -Clang.v13.0.1+1.x86_64-w64-mingw32-cxx11.tar.gz/sha512/81aeec84c945a1055a0e95d17050a862ed8742547355fa3e8686fd511eb451f80f6fa89bfedc46e44d45aec5f678029f5ccddf80480121654eb620f86f76d1cd +Clang.v13.0.1+2.aarch64-apple-darwin.tar.gz/md5/49ca7159ca2c064ded33a7a223d6f409 +Clang.v13.0.1+2.aarch64-apple-darwin.tar.gz/sha512/354a600f210e0b6b6fa4db3315145c4eea8aa3ae2fc3d800c99c02f1a62798181dfd7b75eaf82fe0df1ddbb81e78906c5376a2fcf9f367317a08d3502bba5f80 +Clang.v13.0.1+2.aarch64-linux-gnu-cxx03.tar.gz/md5/66bb905108af01561661d0a7d7f62ff5 +Clang.v13.0.1+2.aarch64-linux-gnu-cxx03.tar.gz/sha512/706e5950194988ffb7c6de59442744d2613141e00c2485e369d1fbfccb816090d7043fd8de368c7c46bded1dd1d9a258491ec552fc0de1fdddb2de3ae858ccdc +Clang.v13.0.1+2.aarch64-linux-gnu-cxx11.tar.gz/md5/f8afd07e400ba048659ccc488c26dacc +Clang.v13.0.1+2.aarch64-linux-gnu-cxx11.tar.gz/sha512/f708eebb2b505b1841af007a5e60a5a41d09c8c01546ef5eb66c25d3b9cfbb17a58fac2cfb29d5f4522c91d36d203577611ed49cb29f8f81825db031b93d7cdc +Clang.v13.0.1+2.aarch64-linux-musl-cxx03.tar.gz/md5/d03e27c1f08a63364a15d9c479b9bebe +Clang.v13.0.1+2.aarch64-linux-musl-cxx03.tar.gz/sha512/1ba08f194abae2af4af742815edc1f73d52449065c9d515dc35ee18dc1aaf5486dfdc0e691709f78b98b191b208fa66fb6e2850f021a472b2f6e699576966a6e +Clang.v13.0.1+2.aarch64-linux-musl-cxx11.tar.gz/md5/00050161006c9ff42b6685e4784f7fc0 +Clang.v13.0.1+2.aarch64-linux-musl-cxx11.tar.gz/sha512/9502305b02bf01d96f1261f31db826374aff4c65b6ec7f043d2b80bf2693a9ef2688fddfb7d53a78254a0b18e40e2d13f035d1cadaf5d0aeec001efaf5ba12c8 +Clang.v13.0.1+2.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/7300c2fcbd210d201a7a3fb773f5d815 +Clang.v13.0.1+2.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/145b44ca3b98ee2450db5f738aaafb3d8560a2eed269d5ddb79f6730024d12d46dbb1e791617eeb2bae27b3474c344d72c22ae610651e083a00d9315d3718d7e +Clang.v13.0.1+2.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/3252d02cef57383411ccb906f29b062a +Clang.v13.0.1+2.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/cc0851d831684e8b7ebf8f43a5d159f041302c0905c2035efcf1bb45dc92073db32570fed63ac73df20271b6e3dddf5a637a99c8b687096de2fb85369f8fe8f5 +Clang.v13.0.1+2.armv6l-linux-musleabihf-cxx03.tar.gz/md5/011545522e96b09e6766be3eddb7d86c +Clang.v13.0.1+2.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/e1c1db11dd7e408ff6d47c0d6247c2fe8aff1b85160deb0f5a8bbfb35c0faf50f12d07296e5f5b30c38c879a3c45f0dec2005e710adad5336ebf46acbde53572 +Clang.v13.0.1+2.armv6l-linux-musleabihf-cxx11.tar.gz/md5/f94ba0082e8823b0bd41f15a38502718 +Clang.v13.0.1+2.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/492ef0d7af2e4176b43751a6f6ffd88c89404589964f7a8c9a957537e3d2ef3d0a9bf277e539589bd4b2b705b43f13ed22f7fec8a75f0400d185833537226331 +Clang.v13.0.1+2.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/c899ce799934067a8037a16e4347d26f +Clang.v13.0.1+2.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/424af8ae2d6735495751d9183c1189afe67a135cc8acd5ca1b2ee6598e6efba3efd1f45a7d1b14cf67c2aa6512a4b088581a4da879ec9e184c9125684e5ccaa3 +Clang.v13.0.1+2.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/66b9e334eb7a2ac5552460d51aa1b895 +Clang.v13.0.1+2.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/01b29f509355fd054e7ba656d7349de90a191ab4992af86f90dfb7de3631a23b3dddc43743ce1dee9e7a5d7855f3a9d6c3525ae9f6581c271139dc7796a50bd7 +Clang.v13.0.1+2.armv7l-linux-musleabihf-cxx03.tar.gz/md5/5bbdc99bf639afcd1079d8c78cd483af +Clang.v13.0.1+2.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/250533d74c4dddc7f5a0ae16deb5d2ee53b1c6870e59e569452bc986e2bc2ccc20bdba5bd0e13124715d924beae531f51d7f9127670f0a3a29d5e4f8fdc59740 +Clang.v13.0.1+2.armv7l-linux-musleabihf-cxx11.tar.gz/md5/6ecb7768b76798d3aca784649da83409 +Clang.v13.0.1+2.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/fb88840b95c1426406b2ea80ee9c399a4ab32157154feddc72e4de8636ebe400849eb302b7744fb8ee506c7f2613aa65bf1e886fdc4bddace1db1aea009e022c +Clang.v13.0.1+2.i686-linux-gnu-cxx03.tar.gz/md5/ebc9cefaa748a0488a2ca4e5e499dd8e +Clang.v13.0.1+2.i686-linux-gnu-cxx03.tar.gz/sha512/13c6743745416b5e67e77c0cc430bb827288311e80d48bd06e03540f7b98e1456d7c73f78fd93240832f08ba43128ac65c5d10bafe517eb0ab953304ebdb4567 +Clang.v13.0.1+2.i686-linux-gnu-cxx11.tar.gz/md5/02761e159f30691376a1874c9a795d34 +Clang.v13.0.1+2.i686-linux-gnu-cxx11.tar.gz/sha512/903a44718282a5625c445536e31576fb91e429ee1bc48b1b033f099f24b293933deac6dcd378fa49257c19f01a35b34f80af42cd355759c3acda1afd3c9ac1b7 +Clang.v13.0.1+2.i686-linux-musl-cxx03.tar.gz/md5/cf269ef3cf165dfc2c7882eaca1f0463 +Clang.v13.0.1+2.i686-linux-musl-cxx03.tar.gz/sha512/d23230838f282a3771939766ac31a2e0e93c5a4e3040b10443e9aee14125700c1cf5c9d92e46e49d9095c7a5709d1bad5178a34e1e0336135772c7f752b8fc01 +Clang.v13.0.1+2.i686-linux-musl-cxx11.tar.gz/md5/152bf5b8acefb741d6a2231945d4d43f +Clang.v13.0.1+2.i686-linux-musl-cxx11.tar.gz/sha512/ed0f9622e44be508a792bc467c87846e672ac2750598dcd416b8b4418ba0e5dbc85e99ced40dc8184db68c2e27e342ecf8609feb077cac395805ab3088f150f7 +Clang.v13.0.1+2.i686-w64-mingw32-cxx03.tar.gz/md5/d676f0e17e2d4f235a571d00f0eeb46a +Clang.v13.0.1+2.i686-w64-mingw32-cxx03.tar.gz/sha512/f2b31fef42800796fab7961508de8aa9baee4cc095af6d7eb441c63a70b3b9a0447d1926b1044190f8fb0d22b3215dfc03277178fdfe96ccd458c6ce28b71421 +Clang.v13.0.1+2.i686-w64-mingw32-cxx11.tar.gz/md5/2bd3ce011bc7da537edf0579a5e4ac68 +Clang.v13.0.1+2.i686-w64-mingw32-cxx11.tar.gz/sha512/67f8d59304f77170a6f8780a750980f946e4aa129f855c97d92039569311077aeda93ed437794752494934e46a4e09fbe42b7f85f001c522bd81e33a8b170dec +Clang.v13.0.1+2.powerpc64le-linux-gnu-cxx03.tar.gz/md5/a51cce404a43140a71c146a5375ed69b +Clang.v13.0.1+2.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/9e45a6b2bd44c6cbcf158972c2bb0a55efbb4c0af135fa4487d9c43c36d643a29aa466666ecfb388722285cf0d20456528a6042b5b5c925f54479b84db3fbbde +Clang.v13.0.1+2.powerpc64le-linux-gnu-cxx11.tar.gz/md5/f0b3becd447111213d206f33d3ceb224 +Clang.v13.0.1+2.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/6ace1ccb0bf924b41db73bde2fe3d987a79c94119fe1017b7fc1ca94482542a35e4a436ff201c5be16034bbdf5b2a8d52fb3bdb7dc1c4077ad2fe1dc26911610 +Clang.v13.0.1+2.x86_64-apple-darwin.tar.gz/md5/15505fa8dde3298bfbb2b9e5f13ad376 +Clang.v13.0.1+2.x86_64-apple-darwin.tar.gz/sha512/dfb2b4dafd6c2f225e6ef098c28aa9555aba798f355efd50b811bfb42d1b2c1cf8d27e67bf25dd5e624821e967aee0c68f3e708e762c4bd4ef973d0d6b05e7d9 +Clang.v13.0.1+2.x86_64-linux-gnu-cxx03.tar.gz/md5/2297ddee8beae10360bf3e287139bd87 +Clang.v13.0.1+2.x86_64-linux-gnu-cxx03.tar.gz/sha512/c5937a52caa13b443f7bc2e3796a9da78a917040bc74684c564f535097c88be5e8714e83d166bb1c073c4783d6783c32598edfd8e121ba640bc672b818e484f2 +Clang.v13.0.1+2.x86_64-linux-gnu-cxx11.tar.gz/md5/f7ecda67d25d35fe3a62159b5fb32bbf +Clang.v13.0.1+2.x86_64-linux-gnu-cxx11.tar.gz/sha512/5b38cff3629043ae4c9bfbe353afe845ff6afdcfc628e5223ca654d52b1be33af439afbf3684c9283360f4f4f4d13611c151c1591cd3e4dae45e1e91665709c6 +Clang.v13.0.1+2.x86_64-linux-musl-cxx03.tar.gz/md5/b13aa15779d1e1a3764fc4600ffb9bc3 +Clang.v13.0.1+2.x86_64-linux-musl-cxx03.tar.gz/sha512/a667b7043b19b6f6c8d9f8c264101ffe05a318bdc93e3541e0719b761422f2cbeda01b9337777b6b327292637fc96a811827978b318564d44b5cb53eed3c2e83 +Clang.v13.0.1+2.x86_64-linux-musl-cxx11.tar.gz/md5/aaba70ed189ccd9723577d9fe3ff918b +Clang.v13.0.1+2.x86_64-linux-musl-cxx11.tar.gz/sha512/4b9fefa074bdf1d98dbde4c3a6394151e0c368228297b876b1fbd3bc64934204cdeae40e4f1d1cac31cde2a2a290a1ed86ea543a43862c4f36fe0f865752dad1 +Clang.v13.0.1+2.x86_64-unknown-freebsd.tar.gz/md5/46dbfa6898be4df10993cdc714193c82 +Clang.v13.0.1+2.x86_64-unknown-freebsd.tar.gz/sha512/d44619dd528bd1ed7e16c96b119fc9bb0b39e761641380b9dec67147f42131572a5e467a86cdad79fb61d10a26ed211e9752f7fad513259188cf7b6402715a9d +Clang.v13.0.1+2.x86_64-w64-mingw32-cxx03.tar.gz/md5/68e1fb6d07e89cc4b7d4b29fef74181d +Clang.v13.0.1+2.x86_64-w64-mingw32-cxx03.tar.gz/sha512/8dae7e50872d83758f89aba5d8bd240916bf21f16ccee747ce1a9f01d05bc06cc706e05f62a1667393af6570aa8057e008321dbdfc5235e066150258be3dc220 +Clang.v13.0.1+2.x86_64-w64-mingw32-cxx11.tar.gz/md5/b4a562ec746df756eaec1ef6b2edf81f +Clang.v13.0.1+2.x86_64-w64-mingw32-cxx11.tar.gz/sha512/d75c40b84069885f21ad4f6a2a30a7714df8f0f978329a112c92917b74974259421551b58494337846d8f3a476927dcbe3fc2f15c11b0abff69778e8cff15777 diff --git a/deps/checksums/llvm b/deps/checksums/llvm index 14b96e1b4ca06..d1dfdc0d7f2a5 100644 --- a/deps/checksums/llvm +++ b/deps/checksums/llvm @@ -1,61 +1,61 @@ -LLVM.v13.0.1+1.aarch64-apple-darwin.tar.gz/md5/fe3c5650453eb06823381174f7091ec8 -LLVM.v13.0.1+1.aarch64-apple-darwin.tar.gz/sha512/17033e4244e1c3bc7a8dde23de27e79be8464f7de538fb6913c933b91fec221d11cb33ec60a37555d1fcb22a7c1e8266573e348d080547ddec0649127322b1c3 -LLVM.v13.0.1+1.aarch64-linux-gnu-cxx03.tar.gz/md5/a447df02f61c8258e158f4fda491bcb2 -LLVM.v13.0.1+1.aarch64-linux-gnu-cxx03.tar.gz/sha512/b99c4f4c1fd3a56dbcbce7cd64fced5926942cc1eb7a712901a2089c130a0ef39736ce00b5a69d32506b6f6608e3179331dd0e3c8e29d850a4c0ea9bc1b509e9 -LLVM.v13.0.1+1.aarch64-linux-gnu-cxx11.tar.gz/md5/7ef97f16089e9a5b683f9977d229bdb5 -LLVM.v13.0.1+1.aarch64-linux-gnu-cxx11.tar.gz/sha512/c9b4f91ab9adf7fd3a57023a2358f50981b2930d0d47db35af08da3da633bece06c7f54145fa08056d105e6130f9be0ab6bbb61a817800251438d4256b365ccf -LLVM.v13.0.1+1.aarch64-linux-musl-cxx03.tar.gz/md5/09595b767af7aa37c35cb790fde8a107 -LLVM.v13.0.1+1.aarch64-linux-musl-cxx03.tar.gz/sha512/61a737f9bd6d0038e94d6f637af6b3f5316ccae1c5bcc2bcf33ad5d83b03427922089ab8e1c89c51d0592bc52a506c75b9664920fd5d97f5940b7951f4c9b3d8 -LLVM.v13.0.1+1.aarch64-linux-musl-cxx11.tar.gz/md5/9b8bf385c9a648836e9d9591c14058ed -LLVM.v13.0.1+1.aarch64-linux-musl-cxx11.tar.gz/sha512/99e6483f425b0953a71c05d4ced734d697ca807e9f711763822b9daebb1b74a4396642566d26ae1bdda1cf23e9151ecc411182362b6a1cb3568115a8c5cc32ea -LLVM.v13.0.1+1.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/80b92fa00ecc02e3e446e4fe1aa5db69 -LLVM.v13.0.1+1.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/53e6e0620a48f95005e787537b42208c591725c91584bcc20c190c268fabf09a00f8b80ed3acacd78e0cb6ab2a930eb4592e8097ea89b7b834f7ea21bea330f9 -LLVM.v13.0.1+1.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/d9020bc2ec6fcf9756614d5bbceca658 -LLVM.v13.0.1+1.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/9f172f46846f978b2b348357ecb5355c9f0ad83ecefa2a85808e1149f4703c3fb1d6b95cc3f03d66bdf80cc39051c7353bb2f1b41f278a65ec5db99b89d86298 -LLVM.v13.0.1+1.armv6l-linux-musleabihf-cxx03.tar.gz/md5/c1347e80f2ccc64e0ad27833859ab9b0 -LLVM.v13.0.1+1.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/d5b430d47f01c7af052dfbb9ba0231ca05b287e36112f1879c553c96b76329aa55c0db67f164107961624c56482f870863af27791d8fdba07d7da3e8af7f12c9 -LLVM.v13.0.1+1.armv6l-linux-musleabihf-cxx11.tar.gz/md5/4bf8917cefcfcbc569506cc5ea2a921f -LLVM.v13.0.1+1.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/bc759d48dd3025997f64ba8d1624f21548da0428340bc1c41a83675bf3fbe9c224db2f4df008aee4870445abe85067cfa2423e4ef957221f737de685297430e3 -LLVM.v13.0.1+1.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/74c54f6d4ecff9ba68d576700f0a5ae1 -LLVM.v13.0.1+1.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/82524c68c82e79c01784c1489370a3f118ed4b950396c3890d76e0019436e6c0db7e66970f59be76252b8bcff0e8be84ee02b18fbfd9a2c704aa9efb58c0ecd8 -LLVM.v13.0.1+1.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/3bd838e1c589779da736f76b37e9726e -LLVM.v13.0.1+1.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/ffaded30472825ee8ec3c280c13795937c2e5a064da2ec9227ce9028993eff255390ed2ccab226bd6876f776413b8e7b67d10fa46aa96c2436233733326e932f -LLVM.v13.0.1+1.armv7l-linux-musleabihf-cxx03.tar.gz/md5/49c0fd781b0d2ffbea924916ffb17a40 -LLVM.v13.0.1+1.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/ada8ba753839987ef120b367377cab1399577de54a93b64ec2c2ebf6dee5e1fbe04b588f2a9744e99fa4537b49f1334522f34a9f4e7402a30d18c4f4a2deb527 -LLVM.v13.0.1+1.armv7l-linux-musleabihf-cxx11.tar.gz/md5/97fc742c0aa6e8b03a7483940bf11495 -LLVM.v13.0.1+1.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/dd9b33235bf061dfd76def89c34a7ec7968f7fe0e28f1959cfc9b8f37cadee4d896ff0ffac00a268b25eecc4b244b70bc8ac4c1d9b9676322195dbdce3ac04d6 -LLVM.v13.0.1+1.i686-linux-gnu-cxx03.tar.gz/md5/41e3fec7a5fff4f3ced547056f009ba9 -LLVM.v13.0.1+1.i686-linux-gnu-cxx03.tar.gz/sha512/199aa5baf3b4278e3c9ac7477d9e0e7074b71647f40ebe18c4b5ee81464af671391aaa40e8203fa88b2d1b9a32bbe396beba1ad561766736034be29cd8af1c07 -LLVM.v13.0.1+1.i686-linux-gnu-cxx11.tar.gz/md5/43642e655bf47bc58d950c0aaf925a28 -LLVM.v13.0.1+1.i686-linux-gnu-cxx11.tar.gz/sha512/07172e2b94e6dcf6d6f13786bcf182b60c81bdfc9aab50a80cba5dc4e7db2a788f71a879050e272dce85c86480eaaebfa6d2c3b23338733994981df6d7126aa8 -LLVM.v13.0.1+1.i686-linux-musl-cxx03.tar.gz/md5/1031d0c377fd2cfd22cf8103006dfd8a -LLVM.v13.0.1+1.i686-linux-musl-cxx03.tar.gz/sha512/36effc03c1bd7518840a30f35f1d8d33c0bcd40e2fce325b887a107617abc3299123e31abf505667a3675e3f454eee75578eae0a2f37442ec0d9cc90ccb0300f -LLVM.v13.0.1+1.i686-linux-musl-cxx11.tar.gz/md5/f830d33ab7967dfffb7192d340d18716 -LLVM.v13.0.1+1.i686-linux-musl-cxx11.tar.gz/sha512/5286886448394c0fa977ac8e0c2be5d55bc0d4aac1806ac8d1da31bd753d30d2d6ab37f38ef8e7e2c8ea7d124bd1b71200a791ed6ac2cadd02ed16b610ffbfac -LLVM.v13.0.1+1.i686-w64-mingw32-cxx03.tar.gz/md5/c5538b4b76735ba6d9928ed32685cfca -LLVM.v13.0.1+1.i686-w64-mingw32-cxx03.tar.gz/sha512/6594e624c5bc0ef97e2b474d4def660c2d9166fa45249a20ad315146ebd8f25f8ec868a3390a92bd7c39540e593691f8336e1dc07740c95f8ee04fe45d8e42f6 -LLVM.v13.0.1+1.i686-w64-mingw32-cxx11.tar.gz/md5/abbee8dcaf6c8003bb0291dd6b51c1bc -LLVM.v13.0.1+1.i686-w64-mingw32-cxx11.tar.gz/sha512/4a6449c3efa41b3b1e81e215376045b6b1a29277bb1edb3c3910c6b2e80e533bf8ff5280a83f7f9f3b76e1278634802cf75ec59f946f8d870b8022bc21c2c1c5 -LLVM.v13.0.1+1.powerpc64le-linux-gnu-cxx03.tar.gz/md5/5c8d9e09817cb0e988072a417e6be77c -LLVM.v13.0.1+1.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/2f692f3ba758f019342db61fb0ba5c7e4953b0572eb4d2a6939dc3575812850f594fdeaa5f941e99c8e4618c6dba16fdd7d36e209bea8a081ecebdaff6b415bf -LLVM.v13.0.1+1.powerpc64le-linux-gnu-cxx11.tar.gz/md5/d32a4956624fc613e84df4f59cad17df -LLVM.v13.0.1+1.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/ceff900a146ab6fb9df8529c403c410ffa123c0892a8f8a929919f1083de51f6fe01c3e1e8e60c905c919357b1623889aa22b5442347172217a550879e7f5665 -LLVM.v13.0.1+1.x86_64-apple-darwin.tar.gz/md5/c81b4dca08db8d9e1039383f3ed647b5 -LLVM.v13.0.1+1.x86_64-apple-darwin.tar.gz/sha512/77b3c6ff0d01f3313d395a61fa3da6154068ecd28cef0a05c1b60dce2290891f94009ea07a760475efb1e9643be9246c9b0509d27a5e3fb158670532501da774 -LLVM.v13.0.1+1.x86_64-linux-gnu-cxx03.tar.gz/md5/7f0d303184900896b578fd0a02a2f10a -LLVM.v13.0.1+1.x86_64-linux-gnu-cxx03.tar.gz/sha512/7ec84fe0b831b781f7764fe519f390be1e8eeff770abbb742f33a5f481b23200c3bff488463af00939a4483288649dd57fdc13219adfdb1f380562bb7fbe6519 -LLVM.v13.0.1+1.x86_64-linux-gnu-cxx11.tar.gz/md5/dee8746ce02b304467708ed6a5381b0d -LLVM.v13.0.1+1.x86_64-linux-gnu-cxx11.tar.gz/sha512/776fb9e9c257f6a428b15f0a4debc082c873868c0d693d72841b10bbb14783f123d6bde2cfb267df4cb35a79703d845fa0484b85390f3a802e9ca3d31ee1470e -LLVM.v13.0.1+1.x86_64-linux-musl-cxx03.tar.gz/md5/64c2893a9067976543ac4fe91f8ce217 -LLVM.v13.0.1+1.x86_64-linux-musl-cxx03.tar.gz/sha512/fe6d69b551f891dfcbb8c26dacae1fd401019de498de366fbcb31122ebb737638b84a43de11bd036cf2c2f7bb681cbfbc57e4e2190e499a7d3b004c2e8fb2e69 -LLVM.v13.0.1+1.x86_64-linux-musl-cxx11.tar.gz/md5/6b7b963ee1db6a8da2921520b6bf264e -LLVM.v13.0.1+1.x86_64-linux-musl-cxx11.tar.gz/sha512/4f3fc77ea6da3f57559e3cc8cc45bfe5527b8af032358b17f66b0641af2e61a3e200fb8dd9099d69205d34bfd3b3a21944e65900fb47f06b1320fadb9d78c26d -LLVM.v13.0.1+1.x86_64-unknown-freebsd.tar.gz/md5/c3fb628d6afcfddd16edfb71ee0fe1a4 -LLVM.v13.0.1+1.x86_64-unknown-freebsd.tar.gz/sha512/ea23621b7a226dec2eb1f50e1a9bbce840dd0dd62e6a11e3fd52398521e0ca60aa9731f80154d2987c5507cc945d6410c8a98153223b9558a6eb0eaa687ddb98 -LLVM.v13.0.1+1.x86_64-w64-mingw32-cxx03.tar.gz/md5/a133f710ee0fb29ffe8f4bf37e591b86 -LLVM.v13.0.1+1.x86_64-w64-mingw32-cxx03.tar.gz/sha512/50ec3a3391e65224fb1c2a404f6d3c3f8ad2590c5feaddc438f7fd43a3c93b2c2956461f8f840ebea4a0a2ffc80b3b1de41ec75dd27b679adb54138d0c14bd14 -LLVM.v13.0.1+1.x86_64-w64-mingw32-cxx11.tar.gz/md5/77b8348a49d6b5eb4c5074934761e94c -LLVM.v13.0.1+1.x86_64-w64-mingw32-cxx11.tar.gz/sha512/41069cee40bf0b852601a397beaac05d3bf9d1c00560c9ec1077883d8b5ed58d82f357b286746b02a53db8d9e2c0ba2976af8b9e565a35214fd43e961dd7b8ff +LLVM.v13.0.1+2.aarch64-apple-darwin.tar.gz/md5/6815ee15551aa80f13f9eb61605c5e22 +LLVM.v13.0.1+2.aarch64-apple-darwin.tar.gz/sha512/a8fa0e03574965227b764c05bc4c8621e691d94515c3d07d47ec5f01c0559f98ff8aba7ef6f40e38cf4870de45f39ad070a80b4c1be8b70eed6916d6a4060323 +LLVM.v13.0.1+2.aarch64-linux-gnu-cxx03.tar.gz/md5/b728279d46118d1956e0cadb4baddbcc +LLVM.v13.0.1+2.aarch64-linux-gnu-cxx03.tar.gz/sha512/01975b8759cbbc10dfac452aab57e1d64b71930812854c6875895d32456400548327940c2fa17d3ddec6671bced60fa81c9080fda1179e213b1f3e2ce621546f +LLVM.v13.0.1+2.aarch64-linux-gnu-cxx11.tar.gz/md5/9baa16cdbb3d061d011495d169181dd9 +LLVM.v13.0.1+2.aarch64-linux-gnu-cxx11.tar.gz/sha512/28dd7d67609cdf3d28464eda565a28c893d13e3019ec2d8969fe118cd90a4caea3b5c5ade8215b14bb2db96ca704e94893e800d4130d85aea1a757eecd6d325a +LLVM.v13.0.1+2.aarch64-linux-musl-cxx03.tar.gz/md5/6dbbabf22fac39bf2ae0b457ecf7b33a +LLVM.v13.0.1+2.aarch64-linux-musl-cxx03.tar.gz/sha512/460355189f72a47afca677c119d34dc58897612121219c482decb447272409a1558904346692cdc05fd83571d8af71ec058c2cf48a30473c16665e46d83b236c +LLVM.v13.0.1+2.aarch64-linux-musl-cxx11.tar.gz/md5/d590608235f692f974168702490963ac +LLVM.v13.0.1+2.aarch64-linux-musl-cxx11.tar.gz/sha512/56a89ac86b9d1a28baf1d2f246c9353e7d51931189c02a96aeaea23e3094fe48785085efa986ab01b7ac4118f42c3fac0f1844907ed0f2fa0375ff4d789f4c60 +LLVM.v13.0.1+2.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/341b2814710a2d012f2ea47e0ecb9a33 +LLVM.v13.0.1+2.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/9af49ea105a90199163f34ef4f6cc480a125e7d637d3ed26122476d8facba3d2beabd70b12239ec00c123ddbdcd8332cbe79476ea2a0d507fe169270cfdf57bc +LLVM.v13.0.1+2.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/c20bf6b9e83179745451ad077a66d789 +LLVM.v13.0.1+2.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/15a1be3aa4791036bd30d39a541ffe131ecf5e2b8636b7617aac82dd4ab8aadae937d526de35c5aaeed3c9ff2598a2f4da07b7601b549d047b07c01979dc49c3 +LLVM.v13.0.1+2.armv6l-linux-musleabihf-cxx03.tar.gz/md5/366ea65aab6eff78d311d4e68ee4f008 +LLVM.v13.0.1+2.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/665556314ff0a9faaf8813f691c9f4d0fcb9f01878543c30113259233d22652ec3750cde8deca3e9d08eed7930568d68d71fc7913299a065f90e0c2db15b01d7 +LLVM.v13.0.1+2.armv6l-linux-musleabihf-cxx11.tar.gz/md5/386a521b3bd07787ae39d1bdd04749c6 +LLVM.v13.0.1+2.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/fae5cadf82a25c32df40744d831ff499f7a38b3e67622fe6bad25735bda921b42cdf46ae97476eba34097070625e2d389c13658d33383d9c30434ec6fb0c86a7 +LLVM.v13.0.1+2.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/a8f5a44968b76c3b9ffc9f167b8d7019 +LLVM.v13.0.1+2.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/1194766a8b9e8383ce9571b118800b5dd8638bc6bd81b70f0748bff2904155b1d3dc12b04a2cd49b569cbabbe5838e1aca80fb932159d4f6131a3b301fcc25d8 +LLVM.v13.0.1+2.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/929e2cb09e3ee879d079c756ed45e807 +LLVM.v13.0.1+2.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/05076dd00ead60efe0565e2429f28b7c8db8e18b375ddff9839924d0edd2fb8c5de75c3e8096c8b4425a85e3d79bfc9e3f05c8e445ed185d4024a2101bd98324 +LLVM.v13.0.1+2.armv7l-linux-musleabihf-cxx03.tar.gz/md5/2cab2db22a48a03e58e37371cb60fb95 +LLVM.v13.0.1+2.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/a8420c326d21b975cd2be24809b523722dfcb44f3721a10fa9ff9e37b20d28a9ecf868cef84fa8ab01fac14fd321487fe555c06427aa1776cca4712a22dc2008 +LLVM.v13.0.1+2.armv7l-linux-musleabihf-cxx11.tar.gz/md5/ce5efd7e8646572719f2faf39df99f0e +LLVM.v13.0.1+2.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/752c66ed76d25970c796e92900a371e42e1812cb5aad5440a5f769f7bdbea8d9984ac0822b15dcf6bb59209bada33427cafba57abf2100c27bf97db603f6032e +LLVM.v13.0.1+2.i686-linux-gnu-cxx03.tar.gz/md5/477bf71f1757565fac29bfcf25a89ebd +LLVM.v13.0.1+2.i686-linux-gnu-cxx03.tar.gz/sha512/56114bf02a2d84a2e3c875c486b8186c07b6300fc4433b277010c0931365e582dfc820a357af4a23c831ef5ca84d7214764d4787c53f543f75f5b57c2569ad72 +LLVM.v13.0.1+2.i686-linux-gnu-cxx11.tar.gz/md5/e21d6ac180e25cd60e10beeb32702152 +LLVM.v13.0.1+2.i686-linux-gnu-cxx11.tar.gz/sha512/1baf767b024d5d0ffd5040c7cddf8f31f66f47819aa924bfb3545dcf63eeaf611518b802d29957b8009b03df553d6b3f018e4090885cc0cf7d9d79385e8f4bf3 +LLVM.v13.0.1+2.i686-linux-musl-cxx03.tar.gz/md5/ff449600df86f6ded0798ced95e7db36 +LLVM.v13.0.1+2.i686-linux-musl-cxx03.tar.gz/sha512/eb379ce9f84f36665a17002c86b0f59733e23809267736b628123f82482ac5af17ce649f7bd77751921db58a7a79a82ccb95e27a5214ad0abe6ac465f66da995 +LLVM.v13.0.1+2.i686-linux-musl-cxx11.tar.gz/md5/087a933781b85de3729d5db84fa20cd7 +LLVM.v13.0.1+2.i686-linux-musl-cxx11.tar.gz/sha512/7a52633e487273d82637e3a24c7efd788fcfc01be424505fb34aed4665cfe60b6ae04953c808476bfecf4f2022bccf01ee245b99f759baa9de9cd1f163faf12b +LLVM.v13.0.1+2.i686-w64-mingw32-cxx03.tar.gz/md5/b4ecd35d0e0dc5e675e62169f217f191 +LLVM.v13.0.1+2.i686-w64-mingw32-cxx03.tar.gz/sha512/8bc51431c5852df4c6145f7a5518fbb2bc4b5a8710aab8d8a5af4f0a128356fb259f9eff477abd0c91506c22e480af496fd9c05728b6b45993c26688eebb3b50 +LLVM.v13.0.1+2.i686-w64-mingw32-cxx11.tar.gz/md5/fec011e6f4eabde8123402aa8f1c35ae +LLVM.v13.0.1+2.i686-w64-mingw32-cxx11.tar.gz/sha512/a3f5d8849cf35cb27aec8241187fb60c1de7c4bc6248b7e777c18407c005f57e5a2e843886f1a514419f4abbf8c5df2ff2cbbc7a973b1620630ee8c8794f02e0 +LLVM.v13.0.1+2.powerpc64le-linux-gnu-cxx03.tar.gz/md5/26f7fc57f435a103511f2808b14abe3e +LLVM.v13.0.1+2.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/2364470348b727771919bfc5dc92d2e81532c8021e7a7c47df3595f546cd0e155a8dcce5a899ff593de46ffdee1bc574e5b5591941648593057ad118c8d3904f +LLVM.v13.0.1+2.powerpc64le-linux-gnu-cxx11.tar.gz/md5/c9acc3d5378866db53f51e4347e59f37 +LLVM.v13.0.1+2.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/b6d1db7096bbf831619990e8e4307b8ae6483ab004649412346afdff64ba14d355ae829dd993a10d418396b001754f40030ad1ea7f3bc89acf7ff044671f7a0d +LLVM.v13.0.1+2.x86_64-apple-darwin.tar.gz/md5/c9d2b7b516d61602ae26bf6e3de02a5f +LLVM.v13.0.1+2.x86_64-apple-darwin.tar.gz/sha512/2ae15491e51828f60d35a6c16b63ca3ccc5089f84418fbc317834439a4160d95370139cbde0e62010e64020067eafafbcea28bbaf05fde19dd407f497eae6b4f +LLVM.v13.0.1+2.x86_64-linux-gnu-cxx03.tar.gz/md5/5fcd6aaaa858b1540a84dc766147289f +LLVM.v13.0.1+2.x86_64-linux-gnu-cxx03.tar.gz/sha512/7bb91cb89fd50afee9613d117cbad32b53dd101d6b58d6f8e134dba5462129e856837dafd9faa745f5c5412d6a3b8de237e691cb70189c90bee04f4308669c59 +LLVM.v13.0.1+2.x86_64-linux-gnu-cxx11.tar.gz/md5/a021bf040adc51fcebc64da3c4b6a84c +LLVM.v13.0.1+2.x86_64-linux-gnu-cxx11.tar.gz/sha512/0b6dff3addf1cf48f384738a83b99aaeb540d28089f86196532e2b103b2671f440ab469599c261f9a3644361766e3f397bc4f834e0718a75db12beea0c81cd1a +LLVM.v13.0.1+2.x86_64-linux-musl-cxx03.tar.gz/md5/d1387495bd3fa2aa4418cf589670d473 +LLVM.v13.0.1+2.x86_64-linux-musl-cxx03.tar.gz/sha512/37c19f25ddbf44ede9a6942a6118ea38b54368e97b0d7c12d23498623c5bd6cacc7c784a85df491c682d34d6a96e3aa6063bb9fbc4f4828bfa440c4e49b93390 +LLVM.v13.0.1+2.x86_64-linux-musl-cxx11.tar.gz/md5/5240bb7c39a0a91893d5aea6064c1364 +LLVM.v13.0.1+2.x86_64-linux-musl-cxx11.tar.gz/sha512/60898ab7e662f5eb86ddda86debb6dff1a6b86732c2eda1dccd89b7782edaaa554af2e8a2e29e5d4dd5a7d1407d8ca7a94e4db93f1c8e7cf7468d79b4cda9a85 +LLVM.v13.0.1+2.x86_64-unknown-freebsd.tar.gz/md5/b086062730235e7669ed3df473be9a41 +LLVM.v13.0.1+2.x86_64-unknown-freebsd.tar.gz/sha512/8ebe5230c59ebd9066d339878dca2c0fb7f9e505ca5f00c87cedc6a2b3b9b621a3a33da077611f7fcfdd940a8268790b9fdde3bf5339137a7a958a9c8a01d81d +LLVM.v13.0.1+2.x86_64-w64-mingw32-cxx03.tar.gz/md5/ecc17eefa6e0f6e329b248a734d1836d +LLVM.v13.0.1+2.x86_64-w64-mingw32-cxx03.tar.gz/sha512/337a47ebf8740e63caeb342756107d6cbf2fda2af298ed948790b8aedc0f68d56dd930130958d2bbb42cdd54e94d647c0b954f324399a407b6326e2f6cf93c60 +LLVM.v13.0.1+2.x86_64-w64-mingw32-cxx11.tar.gz/md5/8be5b54888fa98967a73268842d5cfcf +LLVM.v13.0.1+2.x86_64-w64-mingw32-cxx11.tar.gz/sha512/0fcb7ed50d27cf8a830f62c53ffee0a95f79934f302b92c660a6955b26439b794b036a7958ab4597fe28001955f9fb02ded533104b9932bed310f19ce0cfe681 LLVMLibUnwind.v12.0.1+0.aarch64-apple-darwin.tar.gz/md5/b95ad4844e649bf46db43683b55b9f4f LLVMLibUnwind.v12.0.1+0.aarch64-apple-darwin.tar.gz/sha512/15e0996aebe6db91fe58121001aa7ea4b23685ead3c26b5d89afae34b535e34b4e801a971f4854d8e1a1fbc805cece06272470622eef863e225358113a127913 LLVMLibUnwind.v12.0.1+0.aarch64-linux-gnu.tar.gz/md5/6d8783dc9b86c9884e0877f0d8ac4167 @@ -88,181 +88,181 @@ LLVMLibUnwind.v12.0.1+0.x86_64-unknown-freebsd.tar.gz/md5/54ac594b4c8e7f261034a8 LLVMLibUnwind.v12.0.1+0.x86_64-unknown-freebsd.tar.gz/sha512/a43756afd92081e6dd7244d162862fc318b41ca110a5e8be6e4ee2d8fdfd8fb0f79961ae55e48913e055779791bd1c0ecd34fd59281fb66b3c4f24a1f44128f0 LLVMLibUnwind.v12.0.1+0.x86_64-w64-mingw32.tar.gz/md5/83cf8fc2a085a73b8af4245a82b7d32f LLVMLibUnwind.v12.0.1+0.x86_64-w64-mingw32.tar.gz/sha512/297a5c7b33bd3f57878871eccb3b9879ea5549639523a1b9db356b710cafb232906a74d668315340d60ba0c5087d3400f14ab92c3704e32e062e6b546abf7df6 -LLVM_assert.v13.0.1+1.aarch64-apple-darwin.tar.gz/md5/6c98fd5f7efcccf684cabf7d62c25262 -LLVM_assert.v13.0.1+1.aarch64-apple-darwin.tar.gz/sha512/6c59835132dac1d887b825d37044186e55c28dadbc37a5dea51c60d4a2e9803f164925012e57e6d4b38a01d57003f115dbe9d2c1d7e113f6ead6c9eef50713a9 -LLVM_assert.v13.0.1+1.aarch64-linux-gnu-cxx03.tar.gz/md5/aa5e09c8662a69b46f4ee701d7f577d7 -LLVM_assert.v13.0.1+1.aarch64-linux-gnu-cxx03.tar.gz/sha512/60ea007ca638af2c8792581a26b19452f7e5d82c915571e5f8d9203a5c9faeda2abf30dcf2ec4f5d17d9d05796b68293115f7ce595271fcfb348ee6cd64b634e -LLVM_assert.v13.0.1+1.aarch64-linux-gnu-cxx11.tar.gz/md5/815f787ad01df95c6a35fd79770eb0a6 -LLVM_assert.v13.0.1+1.aarch64-linux-gnu-cxx11.tar.gz/sha512/be65247fe8ce5bf955053c08253e3b7de9cbe09709dd0e5d94b8aa9601fff661e4c0ef1a3653f35daf272c0adcb8507f229b8c0c3223b01c6e966d7590414929 -LLVM_assert.v13.0.1+1.aarch64-linux-musl-cxx03.tar.gz/md5/d09a02c6fa57a76d3502c3824497186c -LLVM_assert.v13.0.1+1.aarch64-linux-musl-cxx03.tar.gz/sha512/c4432427a21e6b2e976cc400041df237aaebfc360880f55b425a825ba0f22b9640771c96d41383fdfd0bf5ddb455847f75dbc55e0929e07fff660a74499326a3 -LLVM_assert.v13.0.1+1.aarch64-linux-musl-cxx11.tar.gz/md5/30a651c1f84eb59505df55f8fbc3ff3d -LLVM_assert.v13.0.1+1.aarch64-linux-musl-cxx11.tar.gz/sha512/1852bea90b7528f3b7731b53f74c6f4b84e9fa552144b42753092151fb1fc4bba4a27c5aa2dcc4668fb465d32ee5def708df859a87893e5fdcdaf4d880b55413 -LLVM_assert.v13.0.1+1.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/8e93a45105c655e0445c243bc24b8e00 -LLVM_assert.v13.0.1+1.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/06417a56eeb811305fcbbd04318054606c7f16eef4008ae2ebcd580c4216a478005cde84afa1070b71d34e85e1e69de7f3a004fa8d70da6e4f1e27cad5751795 -LLVM_assert.v13.0.1+1.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/6e1161bb8b5e0a4f7a686615e249fdfb -LLVM_assert.v13.0.1+1.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/e1de1a368c0d900cfa05baaf16c8d5ce5de80b698d4c6026338e1172ff9710f2175a68f16281400eaef0f50468f9a9277a2e347828595cf0f2115ea901ca2bfd -LLVM_assert.v13.0.1+1.armv6l-linux-musleabihf-cxx03.tar.gz/md5/95d1b1ac0b13625697e59507f0749c8b -LLVM_assert.v13.0.1+1.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/e1ab81e12010f0dcaa15f3078732fe24a0286ed8fb8230f70f7d69da830eeca97989bf4d498d5cfb31058c69c1601856a6b7dda4001985796c58a2348c85b481 -LLVM_assert.v13.0.1+1.armv6l-linux-musleabihf-cxx11.tar.gz/md5/83e7416f1111a6a71c3e2cb619084501 -LLVM_assert.v13.0.1+1.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/c9d58630b45ef874d9014bdb08ce94bf8b26cd1cbde58f38a048d1f29022e6e37d0e8d9ba99ad612dfb38741829b4639ddc37b725f1f400f869d842cb53483ae -LLVM_assert.v13.0.1+1.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/ddbe27b3ced2f75d47373f0e97a697eb -LLVM_assert.v13.0.1+1.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/64b0e9520bec92d38016dc66d2f4fa372a0acd6241ddd26d5bb306574c796d607a814ce286d914ece61689815db190b9a89730f48ad6b1e929d17989da196318 -LLVM_assert.v13.0.1+1.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/77572b25fb89f2a637335aead21d42b4 -LLVM_assert.v13.0.1+1.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/25e2811939222d52380ce3f8888315b57aca317639173ffa33012d8271cfc6112f4044785929e2fcfb9dc92f87eb4410b3fae30d8d20444323737a87cb269ee9 -LLVM_assert.v13.0.1+1.armv7l-linux-musleabihf-cxx03.tar.gz/md5/4d4fb6f08355c8cbd575ee3ce14159ef -LLVM_assert.v13.0.1+1.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/8968e4f8cf63358d411b9f2b557d2fe6d93326a98126f3cc9519aa877ea464246fcea26631a64fffc2940dd338d285a6c749b7cdeae65a345bfa72f3f6d3434e -LLVM_assert.v13.0.1+1.armv7l-linux-musleabihf-cxx11.tar.gz/md5/0ec14582a4a503e3555f628541f1ff85 -LLVM_assert.v13.0.1+1.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/112dc4de847d4765ad8a25695ffa5d03232dc19bb8ed57c7d0835ef55c64cce70d33a6c7cdd51a84351d12c6517c6694859f822ac929cec1370c0b9cfa8240cc -LLVM_assert.v13.0.1+1.i686-linux-gnu-cxx03.tar.gz/md5/e26493c11edc45d10043386edfee3c03 -LLVM_assert.v13.0.1+1.i686-linux-gnu-cxx03.tar.gz/sha512/044b593ce5908445be949e2e08385ee3cfaf0e8dfa4139cf9f2070a7306606b8db7e1cbfc40ce755ecf43bdd3f150c47b3cf5692fa24c0a19fb305f929c3f5d2 -LLVM_assert.v13.0.1+1.i686-linux-gnu-cxx11.tar.gz/md5/11f67fa770f24d6d60a0b859bd7b75b5 -LLVM_assert.v13.0.1+1.i686-linux-gnu-cxx11.tar.gz/sha512/5d11c7b953932646c24a1c3d35ca246ddb0610140a5c34c265191448256b63c92acba314b795cbe1989473e663fd8ecc1867584e76f75c326cd12fe33a0b076b -LLVM_assert.v13.0.1+1.i686-linux-musl-cxx03.tar.gz/md5/da133e8a9b6e90ff76ac9dbba4a2d2b7 -LLVM_assert.v13.0.1+1.i686-linux-musl-cxx03.tar.gz/sha512/abc8bed798e3c500e11125c5994eb96040a05d9d718a8d29628d99512192e1618df9f6576566b12e0e3ec59b512f1064475a9ed1c4dd53dfc2a88dcb3d27cf50 -LLVM_assert.v13.0.1+1.i686-linux-musl-cxx11.tar.gz/md5/f1af34cfbe0fc0f18e8d30dc62e77d1f -LLVM_assert.v13.0.1+1.i686-linux-musl-cxx11.tar.gz/sha512/7ed27d934b3cde836713d09c02ae821ee5660ed07296d85aa04102709b7ea920fdf45134bcf652051d1d74b36f9df61014805dfe70d7c1a57a4397a7415d9ffd -LLVM_assert.v13.0.1+1.i686-w64-mingw32-cxx03.tar.gz/md5/b205c549f0cb5570160d545dbfdf391a -LLVM_assert.v13.0.1+1.i686-w64-mingw32-cxx03.tar.gz/sha512/84458fa31a2e4e093202d086b79b6234e4437d450eb11ff12196013d9f5add4c40062648e580751d8e5e2afdd60ae662409f22386fe69baaaf9a264b9cc006dc -LLVM_assert.v13.0.1+1.i686-w64-mingw32-cxx11.tar.gz/md5/1bb2d407a4e1f773759be323777a6081 -LLVM_assert.v13.0.1+1.i686-w64-mingw32-cxx11.tar.gz/sha512/ab04ed3531a6750896e79ef6ea07bdd08b628d90ad7509330531224ba83f9c32e78e95b8c0e3cb1c24a3646b3b121ddb3bea607a686d3c325ebc96c72448b25b -LLVM_assert.v13.0.1+1.powerpc64le-linux-gnu-cxx03.tar.gz/md5/63cb23ce79a0fbada294bda3a6b895d1 -LLVM_assert.v13.0.1+1.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/be0b9206c20953084eeddb886b270b47587fb816caa0d0080aa45052f5d539aa80a9b0d42a64dbfed1242181e21b275e12fc57d332614dafe6dc976db00ac362 -LLVM_assert.v13.0.1+1.powerpc64le-linux-gnu-cxx11.tar.gz/md5/98649e7b5e2b107ae17464bde6458d07 -LLVM_assert.v13.0.1+1.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/f99839654d169657a55f7ef70466a09c7d05b3d01462c71816b06a42554a4ddf937b858caa98267380b30aaa42721621972a3fa4064dee469a16ec19dcc63c1d -LLVM_assert.v13.0.1+1.x86_64-apple-darwin.tar.gz/md5/f90da7b778bb622d289f64f8fd640734 -LLVM_assert.v13.0.1+1.x86_64-apple-darwin.tar.gz/sha512/40576946286e9c73d000616620aaa4b3fec06fe81072b4fedb66ed45e2c264da7214ef1af32b5e0c395dc84285d9d14032dfe9e52271293330379aab9834b2d4 -LLVM_assert.v13.0.1+1.x86_64-linux-gnu-cxx03.tar.gz/md5/2b19d54c50591f4bb074021916acd09e -LLVM_assert.v13.0.1+1.x86_64-linux-gnu-cxx03.tar.gz/sha512/1d0e95a821f15a5505c5154609f531f34cb09e3acb5bdb0568e998ee542a4d408837fa86086bf417fc2094d9ee01ef60759bec97598fd39a2c5d5af731338368 -LLVM_assert.v13.0.1+1.x86_64-linux-gnu-cxx11.tar.gz/md5/a677a9611f5b7af2a54d1236d3c443f0 -LLVM_assert.v13.0.1+1.x86_64-linux-gnu-cxx11.tar.gz/sha512/1f758073c19c56c6328b44555c7df91adeb33c56e52d4f60ab93a9dfa607d99feec0248231f10ce537aaee282796278b2f0ba581a1b539de22dcbd0446404e06 -LLVM_assert.v13.0.1+1.x86_64-linux-musl-cxx03.tar.gz/md5/465d2f0894047ab482ec889a2e8d8a44 -LLVM_assert.v13.0.1+1.x86_64-linux-musl-cxx03.tar.gz/sha512/e394a86d612daf7b8de6ed680750e176c90390886e57b3cc34bbc923f2c90f6d2e45d52ec32907d857783ec2113e1a916a4bf50320d000db9380fbbea103c53d -LLVM_assert.v13.0.1+1.x86_64-linux-musl-cxx11.tar.gz/md5/c0cc32691485f15fdacd21045906ba3f -LLVM_assert.v13.0.1+1.x86_64-linux-musl-cxx11.tar.gz/sha512/cfb1c921cb8c5ea8815a50cb06c6394032301d356baf35688a455e146faaee1bf8bdaaec5688e09620c8cd030503e2cdab1cc96180e17424579661816843e13f -LLVM_assert.v13.0.1+1.x86_64-unknown-freebsd.tar.gz/md5/806572a7335c5b4ac524c77477ebc517 -LLVM_assert.v13.0.1+1.x86_64-unknown-freebsd.tar.gz/sha512/01cf7c04185281276883ff7a6ad84bccaaa2d60fabaf29f16f7195c0ea532d547ea5c59b35fc7a3e61a8945cc766563b7c9ada2daaa52a32aef9e9fca386ad34 -LLVM_assert.v13.0.1+1.x86_64-w64-mingw32-cxx03.tar.gz/md5/ae71c714190e3e73a7c7c18110c6fd2e -LLVM_assert.v13.0.1+1.x86_64-w64-mingw32-cxx03.tar.gz/sha512/afbda02397f8533b4cf6644ba1c7bd812f5961408159974e81a98058586f9fa22d731f88a19c4593d1e5bb785b0be27e8793b2c4f772c287f61b713e4627d1ea -LLVM_assert.v13.0.1+1.x86_64-w64-mingw32-cxx11.tar.gz/md5/02f40ff65e065aed77b279dca396bfa2 -LLVM_assert.v13.0.1+1.x86_64-w64-mingw32-cxx11.tar.gz/sha512/e7b88384bc960ee4e8cfb020f64eba6b9a357ae0bcd8ac49bae38c2b0a1c5ec01514ae55ba20abd543d36ad42e10d80ea8dd3846ba69ba75d710ff8efe47fc97 -libLLVM.v13.0.1+1.aarch64-apple-darwin.tar.gz/md5/4c97b4d36ddc239694bd66e5b3456b3b -libLLVM.v13.0.1+1.aarch64-apple-darwin.tar.gz/sha512/29851622fa6643c40141a6bfb2c00b26c8601bf76bf79d78aaf885fe5563987b8626e7d866442d196a26b047f33fe920e199c6d3322b3b7e9fc3bd248bd2da1f -libLLVM.v13.0.1+1.aarch64-linux-gnu-cxx03.tar.gz/md5/3c4487a8c7e1cb43812a44ebed5929c3 -libLLVM.v13.0.1+1.aarch64-linux-gnu-cxx03.tar.gz/sha512/da17361c92289aac0d832d1a7cadaf2108f5bd00df4cad6711b457f005d4985194522dcd8b8e91c5bb475dcfba7b48975aaa8cb5bddaaf33ce90df775d500712 -libLLVM.v13.0.1+1.aarch64-linux-gnu-cxx11.tar.gz/md5/9d7c6f5740453aacd20daad05f9cc03c -libLLVM.v13.0.1+1.aarch64-linux-gnu-cxx11.tar.gz/sha512/164203d120b0ce15e9736d7965fe2df584db331fc4505c37ffe0bcace9805a28267eb9365c263cc2e60331b273956562ed74a00b0fdeff00d6b1f5b38a7b7b60 -libLLVM.v13.0.1+1.aarch64-linux-musl-cxx03.tar.gz/md5/421c48ac0afb81809db85cef1fbb1aa2 -libLLVM.v13.0.1+1.aarch64-linux-musl-cxx03.tar.gz/sha512/ee8bd8ebd0e83a49cc076fcf3f6d21f1e487395da7c5b6ba71cb8e6f7bc1c34e8073b17073adb621dc40c4898458dfe3ad2ce011123e5af336f6039896eafcfb -libLLVM.v13.0.1+1.aarch64-linux-musl-cxx11.tar.gz/md5/21d0ab81dece9885e718f604bde68762 -libLLVM.v13.0.1+1.aarch64-linux-musl-cxx11.tar.gz/sha512/f7432188ce001c54e123bc083ae31a954065eba1e203684f5f8b551d31cf1e382fd931831cde794eb794bed0e17fbfe99df34bcc51d945bfda0b9ffd941f5b97 -libLLVM.v13.0.1+1.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/130a750f65b168868c80d47a2e05d746 -libLLVM.v13.0.1+1.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/495ff715fda14baf9317c80846e6cb764473d4cfbdf73d448e7dbab769d347dee65cd017ff2e602fb25218769d16558a76048ab17bf4454784f525ba014d9d9c -libLLVM.v13.0.1+1.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/aa12e89bef25e218081b86fed74c32a6 -libLLVM.v13.0.1+1.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/29817fb6aa36dc962ee0e3b61d30144c11bd7a2e122cd0b44a2d809a84f9c0b4035bfba10bf1139ebaa91fae93a9c31f160db4edbf72c62d35db373a54bdd716 -libLLVM.v13.0.1+1.armv6l-linux-musleabihf-cxx03.tar.gz/md5/c05e58b05a1a61ab5ef35c6c3cf90795 -libLLVM.v13.0.1+1.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/c7cd5a71808f7e3a85956fa5ea1d043a4901faab4d1da02750b5e10168c85cb47c17466ff7df972fef98bca0733af0a8224ff2fbeebda1740fd8c6381c4a79a3 -libLLVM.v13.0.1+1.armv6l-linux-musleabihf-cxx11.tar.gz/md5/72face6e0d19a79e6810af1acbb6c227 -libLLVM.v13.0.1+1.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/716eacc8cfa5be5cacb4ab795ea343375cf58238950dd088dd61cac6df2b3e9552814c6bd64638b2a8233e00ac8d7e6dde4deccb73218b5f93fbf901953197ed -libLLVM.v13.0.1+1.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/89750604a80dcde35a44c6686a73d170 -libLLVM.v13.0.1+1.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/309998d51fa076e95dca0164eed41106305a8ddb83bcb044cec1b6b4525ee0d924370f84d731d05141a5403f23dee4ce0f3b679ce73c119fcee2a1e0f46fcb66 -libLLVM.v13.0.1+1.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/c9d0bc580f4da0d770cfdc6e948b4e5b -libLLVM.v13.0.1+1.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/b6965203f440bf68557a368285039f1ba69929305f743baa10eb021a41c63ebdbabbba6f38131f2d2d0ec5e5d1ae0f5f8b0744de6ab826cbabd8beeb1121464a -libLLVM.v13.0.1+1.armv7l-linux-musleabihf-cxx03.tar.gz/md5/466bbd7139fca2a0246d7de235c156e1 -libLLVM.v13.0.1+1.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/a7b970f380b3bd48eb623a522d72ad4aa9c76c2af1e602182198c0ffde40e06bdc8e8159053ed708568fbeef76481fc4c9cadb2b5d1f1a87730829d1e57135a6 -libLLVM.v13.0.1+1.armv7l-linux-musleabihf-cxx11.tar.gz/md5/f6ad4d6ec08a7ae00b689de6990d3396 -libLLVM.v13.0.1+1.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/75288712e076a6e84e7a4c1ec7f50fe81c5f45e827381edefcf6c1b0ef0e0190950aeb34fe9ea5889ec33cabd310957814237582d979d44233a813a6202318a5 -libLLVM.v13.0.1+1.i686-linux-gnu-cxx03.tar.gz/md5/32a0301b14f526bddd918cd86f809b74 -libLLVM.v13.0.1+1.i686-linux-gnu-cxx03.tar.gz/sha512/bed19b14b8dddb058bb67616157b81117cecdd71547720837de987824ccf3c48e2d5b38acf9e5e0e121b06a70b2878e5808d76e2e519ccc6b112bf55bda09a0e -libLLVM.v13.0.1+1.i686-linux-gnu-cxx11.tar.gz/md5/4f523f2fa72c6d4671ecd7d784f37e43 -libLLVM.v13.0.1+1.i686-linux-gnu-cxx11.tar.gz/sha512/ff07f577207ef5400c1c09d653ac59360a9dd0b18056b6aa51179289ae16b39cfa7ea6b35c1636d5dcd50e4ac671546751deb0a5e4f463a2bdd5b3e61428f97e -libLLVM.v13.0.1+1.i686-linux-musl-cxx03.tar.gz/md5/5375202117e4c229388ab98a934cdc8b -libLLVM.v13.0.1+1.i686-linux-musl-cxx03.tar.gz/sha512/7b3c4aa98e9d759de1562e1a661cc7c55ba0772c8a4ef89149f77d101275a1df3e99e834a4393dc2345799b89ae07a2dc86c26a6106a5a8a269ffa19ef629cb5 -libLLVM.v13.0.1+1.i686-linux-musl-cxx11.tar.gz/md5/971ee2c968fef0371104ca6ae6edd847 -libLLVM.v13.0.1+1.i686-linux-musl-cxx11.tar.gz/sha512/a9165d017e14dd6454a8ab6845d81dd5e1b923532745d9b404e1736158dfbfe164ddb4d261f576492e83b6090817d014d89fa4884a05f9282f6e8cc0916231f3 -libLLVM.v13.0.1+1.i686-w64-mingw32-cxx03.tar.gz/md5/a34e45eff44c295b35048aea9b395414 -libLLVM.v13.0.1+1.i686-w64-mingw32-cxx03.tar.gz/sha512/4802763ce26a9124f2d4221d5dbffafd4578e696dbaa1a2188acc9412fad572b46164f780e0a68745c1662d749fc31b38f7d5f5b72a3507e3b817f79c6f89a8b -libLLVM.v13.0.1+1.i686-w64-mingw32-cxx11.tar.gz/md5/d2005b97458811e9b77ee33fcd65b314 -libLLVM.v13.0.1+1.i686-w64-mingw32-cxx11.tar.gz/sha512/7e04b5223d65f8077a2fadb980c6bf8a55d826da5d8f667b27509987760b4ee9a6030163e690c5bd941f012946a7b78cc05c05ad923d61467c1e70dd85e38d7b -libLLVM.v13.0.1+1.powerpc64le-linux-gnu-cxx03.tar.gz/md5/a498dab635555f766140eba36f13ebb2 -libLLVM.v13.0.1+1.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/a06564f21c850e1aa504fbe3e4265980a7ce0c01824f022fef08b1ca0f6aeed336e469573d01608949ac50e44b85a371ee65a1e214184b3f9470685de92cc785 -libLLVM.v13.0.1+1.powerpc64le-linux-gnu-cxx11.tar.gz/md5/3f38df08f0ea1dde652a1eb4fb3ea7b2 -libLLVM.v13.0.1+1.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/3525bc139e704a63e218893543594bfd9185b372309f82dba36269ec28b66c40669fbb402f0cd7203528ce1ebd2e383cb936557b1309fe8b8eef6ee5605a05d0 -libLLVM.v13.0.1+1.x86_64-apple-darwin.tar.gz/md5/bf734ea5bf98ddbe7585ad4b848b9f61 -libLLVM.v13.0.1+1.x86_64-apple-darwin.tar.gz/sha512/adf5f0f8ec593ded7a248a3920c3265fb406f5545d1ac4521eccab688e75f9b4cb5cc265f1b2cf8cd9dbb44e4119dbcac0bfad03ff2e708819c7b488d026d52e -libLLVM.v13.0.1+1.x86_64-linux-gnu-cxx03.tar.gz/md5/0f2f7ec9551066ad25b907fc4348e009 -libLLVM.v13.0.1+1.x86_64-linux-gnu-cxx03.tar.gz/sha512/6be9fd9ffedf814b8946e70a0b26ca4263141a132ceb34b2a6f82c2429fa1111dfc385e9250073b5afc62169ead6e9196e2d4dced8fd8f611e955c8e4ccdc346 -libLLVM.v13.0.1+1.x86_64-linux-gnu-cxx11.tar.gz/md5/3f34a598fa9c9b5549b6d60582a5fd62 -libLLVM.v13.0.1+1.x86_64-linux-gnu-cxx11.tar.gz/sha512/74c461bfa4b061abd9c7fb915c6d8e069da609ec6fdadbe4fb8e97e0a6f39a024a416d43d23e9ff52ce8e00b7de14da451a5a7dd2594c70b8fe33f94f28b105b -libLLVM.v13.0.1+1.x86_64-linux-musl-cxx03.tar.gz/md5/3d8922dc384f9ce77525624a9cfbeb5b -libLLVM.v13.0.1+1.x86_64-linux-musl-cxx03.tar.gz/sha512/efc3e1054f7b37d4ee39fadf1f6940364c89258f4501a0f31bac957139e1bf3c09270b308ad33132c34bef1860c0c315e9296f827bbcad5808bee5687ce4651d -libLLVM.v13.0.1+1.x86_64-linux-musl-cxx11.tar.gz/md5/1b5b48486990824c206e690f68b8bb25 -libLLVM.v13.0.1+1.x86_64-linux-musl-cxx11.tar.gz/sha512/a9e7b98de0f963fddd88e7a74ccb82bdd602fd69d3024c00c57230da26ad39c5bf0fabfc019fabddc364861ea111aad1b2659adcf425d46528172363bf3396a8 -libLLVM.v13.0.1+1.x86_64-unknown-freebsd.tar.gz/md5/83fd917c7ff47e8d95407348e4789f76 -libLLVM.v13.0.1+1.x86_64-unknown-freebsd.tar.gz/sha512/2504681fa9a2fa7d3154444823a8d14b8c3949b21eb0cd6d1e29082f0327a03d16942da34af1b915169ca73ad9f89a22d60d27868380a5a4c5be7b052c77438e -libLLVM.v13.0.1+1.x86_64-w64-mingw32-cxx03.tar.gz/md5/bf4b7a1084913542e9f621fc1899591a -libLLVM.v13.0.1+1.x86_64-w64-mingw32-cxx03.tar.gz/sha512/688b9308555cb44152421338d105fb680911bb227cf1edbbfaeb0e79a3ea831bae0256c36ac365e2992e6edada36e3d28f95f02816b5647e79aa13cf8ccf3eb9 -libLLVM.v13.0.1+1.x86_64-w64-mingw32-cxx11.tar.gz/md5/dfbe93a16955386947536639eb9660c4 -libLLVM.v13.0.1+1.x86_64-w64-mingw32-cxx11.tar.gz/sha512/94ad039587176cddae1323fbf2e6908203c04a8c2017036ddeb11aef1ffa2b5344641a5cf72939ab37338fa533aca1ffce606f234067d0df6f45f98c19a9b3b5 -libLLVM_assert.v13.0.1+1.aarch64-apple-darwin.tar.gz/md5/3c2f22bfef748efdd4cfb118ac91ea62 -libLLVM_assert.v13.0.1+1.aarch64-apple-darwin.tar.gz/sha512/f7e985249a75a8d192a261855ba698251f090abc564b1b9458fc147c351b026f0ca2e84968efab8b357ee5a9361972e3ff8498672d161cebbb4f1b5bbc00ea35 -libLLVM_assert.v13.0.1+1.aarch64-linux-gnu-cxx03.tar.gz/md5/09030fa894c1cf380094e7c8edee287c -libLLVM_assert.v13.0.1+1.aarch64-linux-gnu-cxx03.tar.gz/sha512/3761dfb8e40d35725910fd98bc800ce2948bcfc7f1afa879d92735553009dee14e326bd8c66c2728c1c268f4d107787d4829a6b20a43f75dda200938309d3136 -libLLVM_assert.v13.0.1+1.aarch64-linux-gnu-cxx11.tar.gz/md5/58d698b70fa0ee9d67a078045da6efb1 -libLLVM_assert.v13.0.1+1.aarch64-linux-gnu-cxx11.tar.gz/sha512/4e40954fbebdfa92b15221b5db6cf4a83d9250aab8cf47eceeb35e8356af42711c937a3e1f7ef91f108679143a6a41b8eb372ab71afbf1fd574adfeb63ab7fef -libLLVM_assert.v13.0.1+1.aarch64-linux-musl-cxx03.tar.gz/md5/7feee1018241b6a2caa322e3c9fdd129 -libLLVM_assert.v13.0.1+1.aarch64-linux-musl-cxx03.tar.gz/sha512/e12bd26d9fc329fded28c37bc3427e797137cb93d15c9d4d2ddd5f938159f4debd71582636e2767aba09c50d046fe85f321e5c7f7a22ef5e6ce11fdd2c0ac924 -libLLVM_assert.v13.0.1+1.aarch64-linux-musl-cxx11.tar.gz/md5/26378b37166b3c1e16c5a9d24e7d2b54 -libLLVM_assert.v13.0.1+1.aarch64-linux-musl-cxx11.tar.gz/sha512/d19fbd149aadb6f7e947385ea3624efb4a52d8afd4874cd6d213de4597bfb944477257bb6259b3af7fb5371c34d9675309ae70661c90c1ae90e5f2960e6cff5f -libLLVM_assert.v13.0.1+1.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/f637cefdafaa9f658d8940337145b633 -libLLVM_assert.v13.0.1+1.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/78ce54c177462b54731519fec86977169ec6728b6b34fe084f21ea9caa72654c03fd01f98a59e2b846bc42a028cb94e1aad59be7cecaef7d4d7c9189ec134255 -libLLVM_assert.v13.0.1+1.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/793f841ab9013c74df8db6f20b589771 -libLLVM_assert.v13.0.1+1.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/45b0d014f79f7bd0be151599c1e65bd931388dbd2784b52b2b3552c60ef70a4c8217f5542943e4237fdd77a6b63f0b10a268a06599b32e9af36a3247e62ab2c8 -libLLVM_assert.v13.0.1+1.armv6l-linux-musleabihf-cxx03.tar.gz/md5/719bfb9ce878d5fdd4c3e94247a53b69 -libLLVM_assert.v13.0.1+1.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/e5a01d55ae90ba1e5987cd4c6f18ec5180800efc958938916c6d1b11c0b49fa21d7155f27b016f07ce28653445ccbfd9314141492f1b28bf7127449b47a8f905 -libLLVM_assert.v13.0.1+1.armv6l-linux-musleabihf-cxx11.tar.gz/md5/3437dfbd103912bb11f7097276e49c5e -libLLVM_assert.v13.0.1+1.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/a7fea196af95e8a9dd5153b05f417512481cd50e356826e5ab2f92e15b61eb5351db86b4a61210d0814bcbe0afa31ef13cc1eaa8dbd38c2d41548880a05e1c39 -libLLVM_assert.v13.0.1+1.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/c8f7eed3171c37abe12f089639795363 -libLLVM_assert.v13.0.1+1.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/7a2b6ed788745d036916b13706f3f0d33eb4d1f41a2da0d3a64193f908e6d80e6a8e8bd222c13304fca7b579c926ef6996e281125e6d91700f9a1e6ddfdd4837 -libLLVM_assert.v13.0.1+1.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/11f2ba96fc1509603e8d939a4b7a734d -libLLVM_assert.v13.0.1+1.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/7615914bbf907d881bdf64a97ebea7ec1b3dff48a45177a77c3eac6928c3419b977e48cdb5c34cba33e4185bf92a9d1f42d8232a4d59aa70c43bcfdb3b8b8457 -libLLVM_assert.v13.0.1+1.armv7l-linux-musleabihf-cxx03.tar.gz/md5/eeaf0665249bb941eb2ff20c1193005d -libLLVM_assert.v13.0.1+1.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/8cbde302d0f435c53d9bed4890d5888686aa57e4be0bb9e3b5ac34b05e6f7e1b63941dde08ee20ccd0b2ee60fb78f232c486760a7ba49d98d6985d6300b93ab1 -libLLVM_assert.v13.0.1+1.armv7l-linux-musleabihf-cxx11.tar.gz/md5/d398c137fd4b9a2fd03761f692052df6 -libLLVM_assert.v13.0.1+1.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/bac9c99bc7d19b96844d6a6dc6709619290ca73987cd60276ae76e87d48289478a32aac5e8219c35173615606ae9d12623310e33ad39d0d28c625d7540ad51bf -libLLVM_assert.v13.0.1+1.i686-linux-gnu-cxx03.tar.gz/md5/9ab80644b6447f841e98af29c62296f3 -libLLVM_assert.v13.0.1+1.i686-linux-gnu-cxx03.tar.gz/sha512/8721a56e9260da1def9017c9bbb5f0cef64579c923714a27ad171be57d98fca63aefc741e72ca884d7517cf20926ff5b4e4dd0f83831599ebae8d4fc4d2f694a -libLLVM_assert.v13.0.1+1.i686-linux-gnu-cxx11.tar.gz/md5/a1f5cc82855df35082e1bf97c1fa290d -libLLVM_assert.v13.0.1+1.i686-linux-gnu-cxx11.tar.gz/sha512/616c43636b9c03e4eb0a91c7ac495ba63c832c2d01b671e51acd98503a3b88fc403ad60a1b254612b739b3f79964108e239ff13cff49aee455698e4c88fbdb31 -libLLVM_assert.v13.0.1+1.i686-linux-musl-cxx03.tar.gz/md5/d80716e108435f92c96aaf13d9cab76f -libLLVM_assert.v13.0.1+1.i686-linux-musl-cxx03.tar.gz/sha512/712eb57da4ec0a96e0498f603601d3beb95d3ab23d17ac2a3dd434218040c04b2ab6891538483c4d6bab540063fa241ef3a5b1030767e788b2249a39f6c0335c -libLLVM_assert.v13.0.1+1.i686-linux-musl-cxx11.tar.gz/md5/81986c49977a6fea10f4fb0d51e6d77f -libLLVM_assert.v13.0.1+1.i686-linux-musl-cxx11.tar.gz/sha512/15abd937df88e9247ef4799db2d512e872c619bf1613da9a809b4024dd8dda720ec9eaea1af44f8be382e435b5032a450d91ce6f966ab8d27bf0223192380108 -libLLVM_assert.v13.0.1+1.i686-w64-mingw32-cxx03.tar.gz/md5/71993c77be2155b6ec2270ef5ae15137 -libLLVM_assert.v13.0.1+1.i686-w64-mingw32-cxx03.tar.gz/sha512/b348e4694164ba4bac699a5cff622aa8834c2ebd7f24452e3260c82883dcf4d1c62c9dd8e5a83b69352587d3900365e9ccaa7948d67ef648cac8eda6ef4e7ab1 -libLLVM_assert.v13.0.1+1.i686-w64-mingw32-cxx11.tar.gz/md5/55b558443d23825df516342d8f7dfc97 -libLLVM_assert.v13.0.1+1.i686-w64-mingw32-cxx11.tar.gz/sha512/b4307e4fa2675b96aefcd7f529a3de2b37f0d5d7e63da2167d9e6d43dabedef93e661b3958d186833161aa93875596ca16f4811d7fed6ee27e0e0a9be7d1eabf -libLLVM_assert.v13.0.1+1.powerpc64le-linux-gnu-cxx03.tar.gz/md5/fdbe30e67a19f47490f743e137ce3d64 -libLLVM_assert.v13.0.1+1.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/b09ff2c29a15954306e02577a9e488e4170aa512a4853fb6f19ed7ab01ec6f347aeefcc53f40d091104b0f0bc72140daa45416f9c9afc3b5722a224e859c564e -libLLVM_assert.v13.0.1+1.powerpc64le-linux-gnu-cxx11.tar.gz/md5/1c92f7ada7534843c76702a2954cd470 -libLLVM_assert.v13.0.1+1.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/1516c43185c481347eff8bed32d1010a027ec22dd005839f6bfcad5107a72e958561c32859ea388b2261e5ec5fc1c2f4cc14ac1b0a61e96e57fa846765de6a6d -libLLVM_assert.v13.0.1+1.x86_64-apple-darwin.tar.gz/md5/bdca8d4433c763078bd45f12abbeb640 -libLLVM_assert.v13.0.1+1.x86_64-apple-darwin.tar.gz/sha512/bc7fa455e1bae61b80ea365edbd39875ee87374f72f1c3963726c68b72c2a0fe33e65f82baac62d272227b86e7a4308778cceffb298f4dcb9fc3763d58f54b21 -libLLVM_assert.v13.0.1+1.x86_64-linux-gnu-cxx03.tar.gz/md5/75d2936a377e346927edb11ff26c253b -libLLVM_assert.v13.0.1+1.x86_64-linux-gnu-cxx03.tar.gz/sha512/1b853f9fbf69bc67f018861cb39ff28282f3492df5be417116658f98a2cfde32debc59943fa965adf6761d71d85488bba049e8fe73a298dd990e2404a0516f0d -libLLVM_assert.v13.0.1+1.x86_64-linux-gnu-cxx11.tar.gz/md5/7477e0a3d685cc31b4cbb7f56fe6b395 -libLLVM_assert.v13.0.1+1.x86_64-linux-gnu-cxx11.tar.gz/sha512/36c2c363dd2f071b55ee351097e048d8b31f1c27d543dc84669d300fb6f68399a892f78ba327e20243fbbc6a30d1afab5056e06877bdedfa1ec5532a43562fab -libLLVM_assert.v13.0.1+1.x86_64-linux-musl-cxx03.tar.gz/md5/061c51c4c5dab76a3bd5a37d9e05b772 -libLLVM_assert.v13.0.1+1.x86_64-linux-musl-cxx03.tar.gz/sha512/cc549affe17d8b440274be86c579fc7132c9cfd5c88876476cf386e3ef14c58cc32f12e14615bd025b03fc753477f71c963945a0d053d17f32e2f30d3fa6371d -libLLVM_assert.v13.0.1+1.x86_64-linux-musl-cxx11.tar.gz/md5/0588aba28941777c87a6bd180e46ea23 -libLLVM_assert.v13.0.1+1.x86_64-linux-musl-cxx11.tar.gz/sha512/44b75207b05a6e972724045bcf3b8049ef4c2717a89cd71c709f39cc75a3a59bef1bb05ababaf01b22b6add7d97425e01aa55b27d309f63d7d4a9bfa2aa48096 -libLLVM_assert.v13.0.1+1.x86_64-unknown-freebsd.tar.gz/md5/c5037e526298885f4f517928290439a4 -libLLVM_assert.v13.0.1+1.x86_64-unknown-freebsd.tar.gz/sha512/077b79753183cc4bc004990ff81bcba33024ab9cb3ba740c256cb62bde919f9940b33d2685c779d7875e10ae1d61f35600e20b932d14613d071d46d9b105ad12 -libLLVM_assert.v13.0.1+1.x86_64-w64-mingw32-cxx03.tar.gz/md5/9b2af6b43a87d8a59dabc8f7b036b5e6 -libLLVM_assert.v13.0.1+1.x86_64-w64-mingw32-cxx03.tar.gz/sha512/01e93ca78afdd7b3b4cfdd5231b3e2db3e1fcefa491766832643fdb98a2f4dfeda1aca86d8140254938023dfa4263e2e0b1865e66e8e83ab2ce3d9c292a0c7d4 -libLLVM_assert.v13.0.1+1.x86_64-w64-mingw32-cxx11.tar.gz/md5/58e151b3524d9fa073e7e2689aa2e5a7 -libLLVM_assert.v13.0.1+1.x86_64-w64-mingw32-cxx11.tar.gz/sha512/108146008f83e9c6ad09fee07fabc34cbe31077f3681a3499ded76613f69dc7cdd812ffde6eaca1f7fc6b7613c3d32485cb94e67b983e76a0a2d225c2b29bcb7 -llvm-julia-13.0.1-1.tar.gz/md5/db436789b8cae6ece401acc12a261b7a -llvm-julia-13.0.1-1.tar.gz/sha512/e7836aa18f6cc721fb46b555f00a79b3e256763c1d277b1c92b1125c39b84206813bd9c42b8844a696501606072ad5960df52f2f1c0000159a949680028c8300 +LLVM_assert.v13.0.1+2.aarch64-apple-darwin.tar.gz/md5/e474b6580bd1347d9342b648d69d52b4 +LLVM_assert.v13.0.1+2.aarch64-apple-darwin.tar.gz/sha512/3c5b4b623e6c47e63eb1297988aa9070adf8cb587cb6b2f7a02bffca1d1c8a6cb56423df0072d7af028f4caece652af57f695ac3ffae8c53075be39014b2af54 +LLVM_assert.v13.0.1+2.aarch64-linux-gnu-cxx03.tar.gz/md5/0e2c5c7a0e8929294bd757e5d6e94ab5 +LLVM_assert.v13.0.1+2.aarch64-linux-gnu-cxx03.tar.gz/sha512/c486dc9181d23c2f97d2405100ed9b8eebff83c3b1db82486d3c60643523bd2a27ea8b4825a1a918f4a5e44ec5da25d791b1751f1c4b84d896dd3df8e7cda759 +LLVM_assert.v13.0.1+2.aarch64-linux-gnu-cxx11.tar.gz/md5/2b1d4d10434d57925ac3d60312b40522 +LLVM_assert.v13.0.1+2.aarch64-linux-gnu-cxx11.tar.gz/sha512/1fae1e2a5d0713961d465bbfaff758d360df11bf5aa62b8f400e6604024adff081c378a79c32c954cf6918ac92115a9b8e18201b14f303883772609ce87ba9a2 +LLVM_assert.v13.0.1+2.aarch64-linux-musl-cxx03.tar.gz/md5/e9af424fa0186fbf7a7a40dd300a41e6 +LLVM_assert.v13.0.1+2.aarch64-linux-musl-cxx03.tar.gz/sha512/ef21ca4f7b3ab2a2e58b031254fecc740c63c770a3634b5f47a2a8cf6d84f1cc16e22b84d643916902831a6bbbe743622e3a8cf4ff6a4ca793975331500560da +LLVM_assert.v13.0.1+2.aarch64-linux-musl-cxx11.tar.gz/md5/3f97399e3965a1cc0d6460933e0a9aea +LLVM_assert.v13.0.1+2.aarch64-linux-musl-cxx11.tar.gz/sha512/49a7141b3c94fb7112974d378dfa61740971d80aab4fbd4454f47177d90413aa324e70bdf39de0ccd2c91f5698a12af77b8b71bd848c0b7036da52578a7f15b0 +LLVM_assert.v13.0.1+2.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/b170cec3c1fddce17990ea922b7817ff +LLVM_assert.v13.0.1+2.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/93a89ca141392831a4eed79d0634e8bb0607bf9bfb45e6e8b91883c57991da4f244eeb8debde510697de09d19b527218c50a47d960387aa81149f4d22c37a73e +LLVM_assert.v13.0.1+2.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/a0bcae6c39c024f7a0601a82fe89532e +LLVM_assert.v13.0.1+2.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/5a2f7b34c9b30b21635567603e34c0bd0c1705788f5e44e549fb5387a0122ac6d481702daf90738fc5aa8447cb74b941a93e6ee17a231031f3f0727029d27d9e +LLVM_assert.v13.0.1+2.armv6l-linux-musleabihf-cxx03.tar.gz/md5/76c423b23300174364fababd773ffbe6 +LLVM_assert.v13.0.1+2.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/be0c48f6f634a8e95dc68d4f134570ace8190afa58640e5fa49cd07eeeec047f64b9e9a27e7503773fc3264fd97d979175a7ab6608a92cc4dfba6e9ee28d0557 +LLVM_assert.v13.0.1+2.armv6l-linux-musleabihf-cxx11.tar.gz/md5/0b68aedeacc9edd33e9cfa9f0fcdfaf2 +LLVM_assert.v13.0.1+2.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/14ef3bc186ff354a16e4282b8658726d77c4c70e7907218647e5ee240a2693783c9db1507a6ec2b6a40645e21f257f764ba5d8b6423a8ed4c3b3a3c4a3c2728a +LLVM_assert.v13.0.1+2.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/0aed5cc59441335062cda8b07688c913 +LLVM_assert.v13.0.1+2.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/a898a4ed9b53c6089665f4c0c9bf6645ef78a11ca05d1ea7435eca0c074c95d8de50b722d2b0e2d01b43def5007e08e87dac44276ba8050d95ca230cb799070e +LLVM_assert.v13.0.1+2.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/773f3b5191e14e67750e74597a4dd441 +LLVM_assert.v13.0.1+2.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/f9ec71d14b2db4ebe7c9a859e299e33fdc16a0e36b41e02e58a25682c5aa16a68000bc47991ab93013aa09806f6deb1e5f6f0a0f92c1c035b977ee6ef32c09a1 +LLVM_assert.v13.0.1+2.armv7l-linux-musleabihf-cxx03.tar.gz/md5/c779f1595078e720f80263a93626498c +LLVM_assert.v13.0.1+2.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/d5ce18e405d304607c28fbd1a3f8d4bf12d70eb26fc987214ab631297c0e977fa6408a7f282562ad4fc32387edadbe13a8a4d78e00e4e6d6749f04e1babd32df +LLVM_assert.v13.0.1+2.armv7l-linux-musleabihf-cxx11.tar.gz/md5/e8a9fa7f10b552e4734e6136a2067f75 +LLVM_assert.v13.0.1+2.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/ccc278d988f59349db4998cab399f0610a9c6daff1e3e2ba0d3c5c66febe2228cc42022040b505e1e6298a0495293a7d8a37359a5cc33050ea574050f6ca675c +LLVM_assert.v13.0.1+2.i686-linux-gnu-cxx03.tar.gz/md5/790620f4cd621c78b898c843222b2bbb +LLVM_assert.v13.0.1+2.i686-linux-gnu-cxx03.tar.gz/sha512/ef3b4390701a5ad4f449c77052466183af824762d3ac050afb0c5154a72c6256c31dc642c2fbb9f024121125a06f74aed522483de0e3c05805dd90f79721a836 +LLVM_assert.v13.0.1+2.i686-linux-gnu-cxx11.tar.gz/md5/85d2cb6f80252d8421f489400ef775bd +LLVM_assert.v13.0.1+2.i686-linux-gnu-cxx11.tar.gz/sha512/00dc218b38d0400a80ab6f4a657d57db663a8f3ef43e2adbd01a563d8c4640086c644eb248a2fce82e48718300ac03517ec9592956275bb173bf9f520f7eb359 +LLVM_assert.v13.0.1+2.i686-linux-musl-cxx03.tar.gz/md5/736ce38ce38e817768366cd0d0e6d97d +LLVM_assert.v13.0.1+2.i686-linux-musl-cxx03.tar.gz/sha512/15e1ba329e0d938ad80ef729e2b10f12f95ec85aea28a072847caef15b53afe6a6679d666027cc83f18affed67228fa9e18e3ca02f297b283c44c155ddb5077f +LLVM_assert.v13.0.1+2.i686-linux-musl-cxx11.tar.gz/md5/c6ed71b0915b6bae9f215129a20b47df +LLVM_assert.v13.0.1+2.i686-linux-musl-cxx11.tar.gz/sha512/f34851f8796d92b6be16f055b2fbc447ad937e9b6f2b3c4e1fed82780863a433d8c60802fdc95fb321e15713736db4b745f6218078b88dbc5272bb6ce348e567 +LLVM_assert.v13.0.1+2.i686-w64-mingw32-cxx03.tar.gz/md5/83e20f2c5756e4aa8930c5bfda1cda61 +LLVM_assert.v13.0.1+2.i686-w64-mingw32-cxx03.tar.gz/sha512/5c69109d543ea4bf10a2e2031ae3bd5f3a049344144dcf6897ce7d7b1c76025ecf4dc86fa4ac77093993141286bc63e762894f4f064383cd2dccc60734988064 +LLVM_assert.v13.0.1+2.i686-w64-mingw32-cxx11.tar.gz/md5/bae6a74bc87765e25e8bd36beb664acd +LLVM_assert.v13.0.1+2.i686-w64-mingw32-cxx11.tar.gz/sha512/8787e0c6afd4bbe430c41bd624afb665ad1900957c0a86bdc670c745b187085c210fbb17f5fad34626d59da1b21dfa5055ac0101db3f020fd1fd8f9bcd727b30 +LLVM_assert.v13.0.1+2.powerpc64le-linux-gnu-cxx03.tar.gz/md5/da4418b577f3ae2300629454620f1d28 +LLVM_assert.v13.0.1+2.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/dff6844546dcd7da8c3c0f1857ca8a91a283e65b16143502c0f3f1791f66faf7ec78ef9e7e9753f931984883c777d75b7e73b917ae10765dca29e4730a2151e8 +LLVM_assert.v13.0.1+2.powerpc64le-linux-gnu-cxx11.tar.gz/md5/7bd0dac8b19f07d4abb0eb58c42b021d +LLVM_assert.v13.0.1+2.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/17feb6913fe13f85c2373171e4fb2ad1064ed57439993db3f01af8464647615dc4486fac76cec665460f8f6bcca392dc2762f550cc3382b2fce3e9950d90d051 +LLVM_assert.v13.0.1+2.x86_64-apple-darwin.tar.gz/md5/9c8143eb5281f6d8661ccac98587c181 +LLVM_assert.v13.0.1+2.x86_64-apple-darwin.tar.gz/sha512/4ace34db86319706cf3b7fde5af326b03dad6b0e615fd3ce8f0fa0598b2d9e8c527ca030444f3e9a15bd6ffe6b0081af2dd9aea1934c699846dadae681cb39cf +LLVM_assert.v13.0.1+2.x86_64-linux-gnu-cxx03.tar.gz/md5/0f495b3e6ab2142723e939445fa15a9d +LLVM_assert.v13.0.1+2.x86_64-linux-gnu-cxx03.tar.gz/sha512/2d27a8bdcd3c64f858ea4cc0b5d5856b00fd93b31027d9cc928f90ad4b344b64696b80b5e238f59f99d400186c359b97894a4e32c2cf514da626db848d75ab10 +LLVM_assert.v13.0.1+2.x86_64-linux-gnu-cxx11.tar.gz/md5/6d68a06c05e13591753331c909dc6d83 +LLVM_assert.v13.0.1+2.x86_64-linux-gnu-cxx11.tar.gz/sha512/4685898829542b686012fc2d3114cc5d11fa2ada310562847b598f72b1549f2e1b00b6f6806f6205422af6a24339d52a6d53c597e6e9a657029b8bac0c43ef10 +LLVM_assert.v13.0.1+2.x86_64-linux-musl-cxx03.tar.gz/md5/da06328307b31df461875cf5ec2488b3 +LLVM_assert.v13.0.1+2.x86_64-linux-musl-cxx03.tar.gz/sha512/ed74c3bbcefef5495b006cfcfd848af36a7faca78d8b6d4ee84b515413ff061e002b942d91b8d25dde87b09bf50f4ae187126d018eeda1eedaa77eea1bb0b805 +LLVM_assert.v13.0.1+2.x86_64-linux-musl-cxx11.tar.gz/md5/97f7b2df4ebe26168bf8aba8d7a433e7 +LLVM_assert.v13.0.1+2.x86_64-linux-musl-cxx11.tar.gz/sha512/5f3b1930593d28b8445c77b20f9e064ea5fee0e1cd9c327a2d59ced38349a0425c9f4e07ed745789270a5906a4e64631b801a0088886784e34e8db501ec52b17 +LLVM_assert.v13.0.1+2.x86_64-unknown-freebsd.tar.gz/md5/8cdb3adcbb93769ee87c52d81f68a25c +LLVM_assert.v13.0.1+2.x86_64-unknown-freebsd.tar.gz/sha512/fb39e79f39af14cecd4cda84ffdeadc9b2a80aab1f755d484571336e8a55dc69e6eb07774de614ed715767e1ed127ad9d6ffd63a011d4f72ff0ece212ca703ad +LLVM_assert.v13.0.1+2.x86_64-w64-mingw32-cxx03.tar.gz/md5/00101e6a75b72d7facb88204c42c43a0 +LLVM_assert.v13.0.1+2.x86_64-w64-mingw32-cxx03.tar.gz/sha512/9d6da10934a375c5ae58688c6133d99683a2b04c64d4ecfcc515146344f163b99e054f33afaccefe051ca403b63d7a65e05c56b2c695cf2a5fc32f41fe59efaf +LLVM_assert.v13.0.1+2.x86_64-w64-mingw32-cxx11.tar.gz/md5/a5608dff32644cde660d453f051999a9 +LLVM_assert.v13.0.1+2.x86_64-w64-mingw32-cxx11.tar.gz/sha512/18ed54aeec018219975baa610b3851dfdb4504e0e4a42ae403d90c936bc27ef233a6d86a9e3f7e2018010056a494ae686d2c05db276a047368cfd5932ba32265 +libLLVM.v13.0.1+2.aarch64-apple-darwin.tar.gz/md5/db865124e4808e1d9d3bf673fd413fe7 +libLLVM.v13.0.1+2.aarch64-apple-darwin.tar.gz/sha512/63d9b2bd2274949e8b3184e788790fd2c7976eb41bda63a765cd5090bdad78dd2554108a040f55da7914737f82d6f62037cfc033c121a52a09b414d4386f01bd +libLLVM.v13.0.1+2.aarch64-linux-gnu-cxx03.tar.gz/md5/12896808215cd92bcccf1862d21bdf3a +libLLVM.v13.0.1+2.aarch64-linux-gnu-cxx03.tar.gz/sha512/4e776f1e2f8010f90602b5f2939e6d5f5cff6d2fbdd4ec4278170387cef4734b95f4d63e83849b6a7136978db1e8af37139321350d13cc4c62186641d7e94217 +libLLVM.v13.0.1+2.aarch64-linux-gnu-cxx11.tar.gz/md5/0899638d95c01e5694134095c37cf7b6 +libLLVM.v13.0.1+2.aarch64-linux-gnu-cxx11.tar.gz/sha512/17c7d7303a29e6d9eeadde8293b5c0e32bf7cb11f40ad99853ab97499598bb153dd9ed99e0c3f974f578f21075d3608a4479b359c8e1a870f43a0b4e96a85233 +libLLVM.v13.0.1+2.aarch64-linux-musl-cxx03.tar.gz/md5/28a87ce1a49b04162ffcb9a1c69f3d08 +libLLVM.v13.0.1+2.aarch64-linux-musl-cxx03.tar.gz/sha512/1bfeea1dd10b1d3c743544ecefa4e3b5e7eea36d9f053fa68e3d12067b39648cb2bfa224ce2adb674250015b26724b5bb1e363e43332e0b1a62699fb2acb0b33 +libLLVM.v13.0.1+2.aarch64-linux-musl-cxx11.tar.gz/md5/179933143843b8d02800afa6247224a2 +libLLVM.v13.0.1+2.aarch64-linux-musl-cxx11.tar.gz/sha512/4f590f21355374ccfa4d83e15f50e05dec44187ef47c4cc3b8ef18189763df2a29f0f314dfb2486d03b15e4dbb1f75707d83656b7c711ea7923fc8dbf2ab8530 +libLLVM.v13.0.1+2.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/74743252af0303c21d45be20564b301d +libLLVM.v13.0.1+2.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/e93922b32a8558f3dc5261d8e8f226f02106c3d6c1d54251318b70a91f1192c78de589dabd50778af40e8c38825b5d772d6ec0cbf64374ac23e7e6175a87bb1f +libLLVM.v13.0.1+2.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/6da3d1ad82396c57b670316199a849cc +libLLVM.v13.0.1+2.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/699c710160e0c5914669f842c055bc98e9ed96bc0f4825258ecc9649cbbfdb65a32edd6bf53f8a087183adbca486460a9ebdfc4987d8a8333980327402323707 +libLLVM.v13.0.1+2.armv6l-linux-musleabihf-cxx03.tar.gz/md5/9f6eb18ac80047e7ac8970196355aa10 +libLLVM.v13.0.1+2.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/8f7b78c4faca36cdedcbf8f9f35175092571ac1782cfe22e2f35c72f20d2737d573acf2c964c97a809d646550262567f8579f61b247b5d4eb041c02342795b51 +libLLVM.v13.0.1+2.armv6l-linux-musleabihf-cxx11.tar.gz/md5/b7e2234f55b932a11f8d1d79e045fa90 +libLLVM.v13.0.1+2.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/f513840d7abbf85dd1f2506d7d51c0d203bddda152750fde88fa2328d7a1b9efa872f11bdd828b4a04f14d630a3f009d7230cb7b9ada49e6a16682049a893233 +libLLVM.v13.0.1+2.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/2b9aa510d139a231e10eb6c5620c35d1 +libLLVM.v13.0.1+2.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/37a0230ea751d198a2996832ff9bbf751e7d1906648de982f796393cc25a8ffbda081484075ab8d7c16e9ce26dd9325f3f448f16108a3c4968b15c0a80366b70 +libLLVM.v13.0.1+2.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/d2e7262c367908e43e25579a7f0893a7 +libLLVM.v13.0.1+2.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/8f3f24e7e653bec2d5269d4875deadad4592e1c76ed491b17c528f853a2d233d7bdb2d3182a2aea9a2d1aa24c02d967c17a38b160b97f2ffd3d46eaae7a749e0 +libLLVM.v13.0.1+2.armv7l-linux-musleabihf-cxx03.tar.gz/md5/9c1d38c2c54fae44143caa2dba78bb64 +libLLVM.v13.0.1+2.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/0e50dae8e3bd4372b16fd96418241c99e46278f8f2fb8191d1cacf136cd0d429bd74a6472ad0edaab6a17bb03ee576e11778d3569ad4b20184ebf82b6359de62 +libLLVM.v13.0.1+2.armv7l-linux-musleabihf-cxx11.tar.gz/md5/cc58770ca889bd4c4a68236ee7aca8ce +libLLVM.v13.0.1+2.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/c1211ea7e8317b96dff0276c69301029658d3c3c2d88f69b56527205a72f75eac5941eca6f518a184b5ffbab6865656b9fc27a88433c88f2a701eff6de170d03 +libLLVM.v13.0.1+2.i686-linux-gnu-cxx03.tar.gz/md5/c4af3f5036fff0a110dc16b6226fce3c +libLLVM.v13.0.1+2.i686-linux-gnu-cxx03.tar.gz/sha512/e5a9e017efada516e4f902a2ad98a63a99b52052d66dea9b4c20f2a8f8f6ecebf765022d9761b89b759571364065ba712686f3b417c34e46447ff4f7119b7ed3 +libLLVM.v13.0.1+2.i686-linux-gnu-cxx11.tar.gz/md5/91f397cc9dd9594977a46da558e8d310 +libLLVM.v13.0.1+2.i686-linux-gnu-cxx11.tar.gz/sha512/32e570b4845a65c2cb5526164ceb377845d73698a542a324dce343200b4f8509df37cac805890de45bf9475cb0007dc9d7daac029e736a623ccab05133e8eb52 +libLLVM.v13.0.1+2.i686-linux-musl-cxx03.tar.gz/md5/5eb6f2aac0a48a799cee5c0b42213689 +libLLVM.v13.0.1+2.i686-linux-musl-cxx03.tar.gz/sha512/6a0e6574931c68703fe5b638799e238f0bc105683d4c7ced0d7e8c25b4eb9617770a4dbb5b9c5f65f8d8e2b63a4fcc594b386afee8ed723e937bbc49b153ad2f +libLLVM.v13.0.1+2.i686-linux-musl-cxx11.tar.gz/md5/f650178dc0dc04babd2fcabaa3ffc35a +libLLVM.v13.0.1+2.i686-linux-musl-cxx11.tar.gz/sha512/32d48203c6d4c2b2ca2a8bf3927b2dff84cf264d3607f3215456baac2109e7710d53685c8572718d74f614e867f5a911ac62466815c28c5ad0ddc8761bec8437 +libLLVM.v13.0.1+2.i686-w64-mingw32-cxx03.tar.gz/md5/edb299dfe330144360ae0348ff241682 +libLLVM.v13.0.1+2.i686-w64-mingw32-cxx03.tar.gz/sha512/613af75a89930091bd2e6938463a97aafcef7a9bac4d38618979d98dedb8e95180b065e079214e88709700dd28f6a18cd465eda9440e77cac5a232d9a733febf +libLLVM.v13.0.1+2.i686-w64-mingw32-cxx11.tar.gz/md5/32372fe46245d0e93dcbd73e48303692 +libLLVM.v13.0.1+2.i686-w64-mingw32-cxx11.tar.gz/sha512/53da82205f30e2d7e5f1053ac8f254b7cf84f33e1952c6b96e0f4562b164827818ce507ac4c36364c6b34499c08d4f7392866f4075f031e1de91b464b282ba61 +libLLVM.v13.0.1+2.powerpc64le-linux-gnu-cxx03.tar.gz/md5/cd4323bbcfc6af0047d43561d395cc7a +libLLVM.v13.0.1+2.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/e6d6ce334515d46f9400f999de4a3af28791c362e48fd17ee7a1135d88dff87caaf86292c4ef2f05d78c6bfa8b0248bc9a50687b4c3094a1e83bf7da9d44f80d +libLLVM.v13.0.1+2.powerpc64le-linux-gnu-cxx11.tar.gz/md5/ec85afc77c883a45d342e11c0a3fe5c4 +libLLVM.v13.0.1+2.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/fa0e44b8e5efcb770b1ed7c0fa47b03c2fef0b6c1a0c992d35119aa5860f6f1fa039296fc477e6f78c8b9a904ab78394ea962bbd34548a697c7e06891ff37b05 +libLLVM.v13.0.1+2.x86_64-apple-darwin.tar.gz/md5/d8fb6e02698b7be3383df9bf979a7b5f +libLLVM.v13.0.1+2.x86_64-apple-darwin.tar.gz/sha512/a248f58e3e692f8fe2c3a10a513dc0ec25d8e771d0433d80845eff2ecddc46a7cee54c34235603de07daa5345eab279c3ba492df336f23e408d094f0669de7ac +libLLVM.v13.0.1+2.x86_64-linux-gnu-cxx03.tar.gz/md5/e0870d923fac327918a634b327b9761c +libLLVM.v13.0.1+2.x86_64-linux-gnu-cxx03.tar.gz/sha512/60185760fdf65066bec0c9065f2e3553d3ffd9baf2cdf40674b966d04c3b1eadc98670ffc858c49506427999c5527d85fba335d5e82fa879e0a9bd15b1f79780 +libLLVM.v13.0.1+2.x86_64-linux-gnu-cxx11.tar.gz/md5/53a958655d9e0f44babd05ce1e74c8a2 +libLLVM.v13.0.1+2.x86_64-linux-gnu-cxx11.tar.gz/sha512/afd4a7f78b17cf9aad9021613bf2c1fa904835e0d8f473e9abec1d6ebd40b75d1d529fac579cc4f5dc8fff68d2bab8a141f0558dd149294e7fe30b21f4093e8d +libLLVM.v13.0.1+2.x86_64-linux-musl-cxx03.tar.gz/md5/94e731b4f67e99be5c35b1a389e80bb8 +libLLVM.v13.0.1+2.x86_64-linux-musl-cxx03.tar.gz/sha512/f46ffe8ea2b71c4a46976403bcf7fcf97c127d5e69100cc0e52d7ae21a7cf2ba88fc5988ae022c3e42f856d08b3b53a7f6c0e5feed1bed832c74b9363b8b49c9 +libLLVM.v13.0.1+2.x86_64-linux-musl-cxx11.tar.gz/md5/52076835b1d0e41353090923f56651c3 +libLLVM.v13.0.1+2.x86_64-linux-musl-cxx11.tar.gz/sha512/accac4f426f3831b846a1fd4a97344854f5d07e891f1c8d7e458108c7155dc835457225830aa43cc30784fa310729f06c50928816a095e2122280ae2f4fa9512 +libLLVM.v13.0.1+2.x86_64-unknown-freebsd.tar.gz/md5/b19dd47acb743dcf2d42e126d42bd3a8 +libLLVM.v13.0.1+2.x86_64-unknown-freebsd.tar.gz/sha512/38d846acdd788926f6f7cec7ccd2cde13dc55155cb2817ba6eab92f52b4a8583ea753ff879441241949eb3d4c06dfed2dc17703cc37ca77044cb40080520fd3d +libLLVM.v13.0.1+2.x86_64-w64-mingw32-cxx03.tar.gz/md5/7c63d16ebddd4b64f925badc70e81342 +libLLVM.v13.0.1+2.x86_64-w64-mingw32-cxx03.tar.gz/sha512/356ab0a607d034abdf36c955cd704bd6a130bb6f68cc9bf675b9cd1920034fa221103038855ef0735e0a8663965017a2e6138bb379288f31f6c6a4a5bad5ef43 +libLLVM.v13.0.1+2.x86_64-w64-mingw32-cxx11.tar.gz/md5/003ac94ddc23551ed3ecd633825b2c1b +libLLVM.v13.0.1+2.x86_64-w64-mingw32-cxx11.tar.gz/sha512/6c6d8e76c0ac4ac8a37324de60b1ed4a3965556e31f5a14138b880c4f1ad66a4d9621aacd1e35fbd312e720eeee48de1ac30ad66ad70814180cdeff550600710 +libLLVM_assert.v13.0.1+2.aarch64-apple-darwin.tar.gz/md5/6db0cfb11b96d461ead66743f0a49e29 +libLLVM_assert.v13.0.1+2.aarch64-apple-darwin.tar.gz/sha512/10fa8e2725d297d6bd29e98e0c6547e2f870c99f6db5eb31636a7d13d2894b513db0379dbd94979c1adfae5d947d873d2c7debede791c7a7a6baf9428277fda6 +libLLVM_assert.v13.0.1+2.aarch64-linux-gnu-cxx03.tar.gz/md5/d8265030dbcc311ca51b2f7c193d4a89 +libLLVM_assert.v13.0.1+2.aarch64-linux-gnu-cxx03.tar.gz/sha512/7d1096d83cef13590af442383f70e5e5684b7fc1425bfa61855b4a4185b4540f5a3ceb7411e71234b072318b146bf308c38da88d4df29008fdcb409da9d86d04 +libLLVM_assert.v13.0.1+2.aarch64-linux-gnu-cxx11.tar.gz/md5/a96add0e10401d642b56257b9fce2b62 +libLLVM_assert.v13.0.1+2.aarch64-linux-gnu-cxx11.tar.gz/sha512/b8e96c03ddbff403a2576a5429d9798207ded44322d78cda2087ede37615fce8c11cbcbe0d39923878a963a7f7b8c99d891b6531faf4f201ec8bb12684ce462b +libLLVM_assert.v13.0.1+2.aarch64-linux-musl-cxx03.tar.gz/md5/db846ddc21e550abaf84d9298f8a126e +libLLVM_assert.v13.0.1+2.aarch64-linux-musl-cxx03.tar.gz/sha512/3e81700354800d714a87fc280f07098f95638e561f97efdab6287ac78e056771cfca61372c72f010ff7c60ccf90221c2aecfdfa4dfcb068fff9eec9bbec99580 +libLLVM_assert.v13.0.1+2.aarch64-linux-musl-cxx11.tar.gz/md5/b96153a15db02d2068a42cb49c181a6d +libLLVM_assert.v13.0.1+2.aarch64-linux-musl-cxx11.tar.gz/sha512/4250e16b1efafc2466261faab9b1db6426caaea37d169ebe2c14066df0f270550825996355315bacb0d29fd65add71873cbbe05db7462f14939baa0b94348000 +libLLVM_assert.v13.0.1+2.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/f26da04aaaae16d09f9934b5135cc4ae +libLLVM_assert.v13.0.1+2.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/87d5f4b6a6e9b4930b8247a2230e68d177c9ff0c2e148cc523f0c9a585882970a30c0383f3a22730fa363d3b8eb467a00dd678908e30eea9b876f3f296ca7ee0 +libLLVM_assert.v13.0.1+2.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/0dc7603dc37f55f06bd685ab1e76151c +libLLVM_assert.v13.0.1+2.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/89ef75f0ccb845836afd530dd5976ff7ac3a68f6abec830c5baddfe0116a1e9321cd2c899c663ac5e3b816346d26f9f3831d7185d5958e1c66560a4bc972d587 +libLLVM_assert.v13.0.1+2.armv6l-linux-musleabihf-cxx03.tar.gz/md5/048b75ef0762ee79902ba0601e6e6054 +libLLVM_assert.v13.0.1+2.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/921cb24d6035afc48a8f6f59c034850448b89f8e38bcbd1e238470a1901e1b917f0a479895a44dfd17e1ceeefb5d2b17c038a18f4051bd42ec811d1c8a8f21b4 +libLLVM_assert.v13.0.1+2.armv6l-linux-musleabihf-cxx11.tar.gz/md5/4f7da2eb48a580a56e7a888a8553c7de +libLLVM_assert.v13.0.1+2.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/d7ced8375c4a931294f3f103b9139ca44777744926c8e259bba7d5dd199284888752fecc6dda376eaf5cd4ff4933e1982933468024cefbe1a0469f7c03c54fde +libLLVM_assert.v13.0.1+2.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/e0b0e376d56c0d59691b8514522abce7 +libLLVM_assert.v13.0.1+2.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/f48652ed9a186729b2de70d6cfe782a2778c50520dcde234e31d67bd9043aeeefb2f2f5497400d25507a44fa2a8be50f6f0a65c54ba89b34b3b341132fea3e0f +libLLVM_assert.v13.0.1+2.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/a8e910783f176a4e74845bcf792895b1 +libLLVM_assert.v13.0.1+2.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/c2bd2b2d4bb38f248ed69eee64269ad17505a3ac7ba64320aab5b10069e120dcc3d06beee8355514e6140e43fd8614d61f9d5c484195a2d0e3c25145ca391968 +libLLVM_assert.v13.0.1+2.armv7l-linux-musleabihf-cxx03.tar.gz/md5/c49214e76b086459357d90f242834245 +libLLVM_assert.v13.0.1+2.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/4c70bfed6c12e7ea53749ebbba434870637271211ffbbeeaa3f136337cbb9c65f02fbd6d7a1fc6f441de68df3099b2c30790494b9e2dd3bc4dbc45d687c41a5b +libLLVM_assert.v13.0.1+2.armv7l-linux-musleabihf-cxx11.tar.gz/md5/7dfa45c315adf488855cd501c565c99e +libLLVM_assert.v13.0.1+2.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/56b6743a756cffea541f64e38444d3e1788e2a59404840d3852f26f175d2564973a8faa278446819a4e63fc8b789506f8c356132dacbe5045a9b1e13f34e86bb +libLLVM_assert.v13.0.1+2.i686-linux-gnu-cxx03.tar.gz/md5/e0a91a1099a93f332d8af332f3162d33 +libLLVM_assert.v13.0.1+2.i686-linux-gnu-cxx03.tar.gz/sha512/a36c73fad0968a0702f4bc946d4bbc2d221d61e5ada21a6fef6c1ec93bfc4737995b059a8769c8f728c434459fd311506b27459419fc068e472fe2f7387d97bb +libLLVM_assert.v13.0.1+2.i686-linux-gnu-cxx11.tar.gz/md5/bf896902f6ec4fb758ae57e0eb76f163 +libLLVM_assert.v13.0.1+2.i686-linux-gnu-cxx11.tar.gz/sha512/d653cc299ba864ee247648c3cdf67b9946c14b9a557e2c57b71c356d25d5b2ec8de93d406dbd783bcf19f245e08152bc54bca84eac26f51be100bf09bbec8776 +libLLVM_assert.v13.0.1+2.i686-linux-musl-cxx03.tar.gz/md5/74b85af091b0adad05393c0e791321d3 +libLLVM_assert.v13.0.1+2.i686-linux-musl-cxx03.tar.gz/sha512/c48f8c181e3c8a36fab4ce2075f1ecdaaca5c6e73c09cca49f7d7bf7f60752478020eb9de1fc74c0a4746200ff59ad4828558023ec43047e9719b705e153de30 +libLLVM_assert.v13.0.1+2.i686-linux-musl-cxx11.tar.gz/md5/77425352387848e8ac76018e0d74edb4 +libLLVM_assert.v13.0.1+2.i686-linux-musl-cxx11.tar.gz/sha512/1cea3a6fe8c49b732677d7e313691cda2165a0a6d4dca44f01c8d7ab048329433e77758ba5291e580791f8b3b84ed8125575a4fec37bf5b6cff817b87f8528f4 +libLLVM_assert.v13.0.1+2.i686-w64-mingw32-cxx03.tar.gz/md5/9d388d44c619d2cb0a9824778f1bd164 +libLLVM_assert.v13.0.1+2.i686-w64-mingw32-cxx03.tar.gz/sha512/a8629e54c166b4748a891592d9f2b8e015d008570f49eca09c70489c1e0b50a19556e60f34717f868b9767f2a10578e48010c0686c50f0771cfbd06e3446e219 +libLLVM_assert.v13.0.1+2.i686-w64-mingw32-cxx11.tar.gz/md5/f7f59e413e7dc94135920df1b234eab5 +libLLVM_assert.v13.0.1+2.i686-w64-mingw32-cxx11.tar.gz/sha512/85c1d61c0546c1c679e0b2edf56230c63aa60a4ef31df73e6e797ac873dc8d4b0eaa084e1610435903e5e279186c54e679da7b635750e9ecd61695170fe4d5d3 +libLLVM_assert.v13.0.1+2.powerpc64le-linux-gnu-cxx03.tar.gz/md5/9e22f7f6b2a22b1926a0f68a84f20b00 +libLLVM_assert.v13.0.1+2.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/49ac6e7fe4dd9e61b848ba953082a6149945ad3c733b7d42a89a0b7cc05d0af4a37610cd6dc729c10540d9a7134abf6e5a65d69d072df7056ca17fc48251d951 +libLLVM_assert.v13.0.1+2.powerpc64le-linux-gnu-cxx11.tar.gz/md5/f80e5e501f879e214feeed6cc971a5e9 +libLLVM_assert.v13.0.1+2.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/e75e26dfb6fd42ce1305acd65701468eee6da7721dfa37c959f2aab0921eaf95fa0d94b1f4c97c59df5858539c7b1cc2949a732be98d36b44845beecc7c1bf0c +libLLVM_assert.v13.0.1+2.x86_64-apple-darwin.tar.gz/md5/a53b7fcbd8149fd5211b7c887711607b +libLLVM_assert.v13.0.1+2.x86_64-apple-darwin.tar.gz/sha512/1b0ad43d312420c5da5cd6bc88138f0e38b65f9e5d36d1dbeb7d4aeac7e472e66b326261c4065565e4dbb81d720f8d6370178bd97ce85ef8502abb462ec2fb57 +libLLVM_assert.v13.0.1+2.x86_64-linux-gnu-cxx03.tar.gz/md5/c1c290bcb3b5fc2268a29ceed211245f +libLLVM_assert.v13.0.1+2.x86_64-linux-gnu-cxx03.tar.gz/sha512/1ac3c8b5ea9e1232c8820481364be61184e9fa8c9da7fc66707c965b283f56b8e1a590b40aaad518f152a3bb14903967392d0c77673c324664292263815a1ba2 +libLLVM_assert.v13.0.1+2.x86_64-linux-gnu-cxx11.tar.gz/md5/9bcb827c673cb07f316a752707c3144e +libLLVM_assert.v13.0.1+2.x86_64-linux-gnu-cxx11.tar.gz/sha512/cb4559d5b6f68c4754ee4aa1238f9c2e5f91131d2e93f34ef0037512886ef4ca9795243f4556838511024c3c7c9f511c07e64cd773bb98f9e7b653c76f194e57 +libLLVM_assert.v13.0.1+2.x86_64-linux-musl-cxx03.tar.gz/md5/6b400208db2fc0cce2871ec881d3ec2c +libLLVM_assert.v13.0.1+2.x86_64-linux-musl-cxx03.tar.gz/sha512/2e7405516e973610d090d6966a25293bc252c883e5886fcff59de60d2d1324db9507ba27ebcdcc4565f7f2d6066149b4190513cf26d634fc4260c02b6bf1fb9f +libLLVM_assert.v13.0.1+2.x86_64-linux-musl-cxx11.tar.gz/md5/e1f9fe84eab47bb2670a1ac4424a71df +libLLVM_assert.v13.0.1+2.x86_64-linux-musl-cxx11.tar.gz/sha512/80487d4e1cd60cf117e735e78631b3c2095cb4bc98f193077f499d22db9000715738ff1b929dd4bce4f1bbbfa6fb417bd704a034cf0d8996e6a8872eb4a3d84b +libLLVM_assert.v13.0.1+2.x86_64-unknown-freebsd.tar.gz/md5/3c1d3bce109eb88d8a1a20ae655a384b +libLLVM_assert.v13.0.1+2.x86_64-unknown-freebsd.tar.gz/sha512/f1ca50d1f135d7b82da71145ad6d4c11d781044c74f705c362885d2becfb17f585ff7e167dd279f4898d92496ded9af9082afc1a5e3b7c271f262647383edf08 +libLLVM_assert.v13.0.1+2.x86_64-w64-mingw32-cxx03.tar.gz/md5/83399cb1b8201cc5991c895e54fdbc2c +libLLVM_assert.v13.0.1+2.x86_64-w64-mingw32-cxx03.tar.gz/sha512/449ba8cf0d3ace07f426c27dafdb24f1dfa9b56fdd4bc31d118aef6dba357fb5788a3bc7a62d860f41287a4bdee82851c1da7d6a6817104af5225bd3c6ec4e2b +libLLVM_assert.v13.0.1+2.x86_64-w64-mingw32-cxx11.tar.gz/md5/3493be4fc51854d5c3a6e848a99be415 +libLLVM_assert.v13.0.1+2.x86_64-w64-mingw32-cxx11.tar.gz/sha512/262c0f26b542ae9e97846f83257084a1344fad4ad81ce8ef1f20b6ea2741a737674dc018b3b8e1493685ff10eecb35f137cf82c4603e0d28f32f62101621201e +llvm-julia-13.0.1-2.tar.gz/md5/ecf89f679a0114cdd52eea79dd3c28ae +llvm-julia-13.0.1-2.tar.gz/sha512/3e93cbb4878d2e0890d6c91a6101ab76d89d8d11110a95731fc041d5300ecee5b03e8f8c26bddb58cbf177799c4656c7d54e23ed6d90fc402a5941e39c4ae508 llvmunwind-12.0.1.tar.xz/md5/4ec327cee517fdb1f6a20e83748e2c7b llvmunwind-12.0.1.tar.xz/sha512/847b6ba03010a43f4fdbfdc49bf16d18fd18474d01584712e651b11191814bf7c1cf53475021d9ee447ed78413202b4ed97973d7bdd851d3e49f8d06f55a7af4 diff --git a/deps/checksums/llvmunwind b/deps/checksums/llvmunwind deleted file mode 100644 index 678ae7b0c3fc4..0000000000000 --- a/deps/checksums/llvmunwind +++ /dev/null @@ -1,34 +0,0 @@ -LLVMLibUnwind.v12.0.1+0.aarch64-apple-darwin.tar.gz/md5/b95ad4844e649bf46db43683b55b9f4f -LLVMLibUnwind.v12.0.1+0.aarch64-apple-darwin.tar.gz/sha512/15e0996aebe6db91fe58121001aa7ea4b23685ead3c26b5d89afae34b535e34b4e801a971f4854d8e1a1fbc805cece06272470622eef863e225358113a127913 -LLVMLibUnwind.v12.0.1+0.aarch64-linux-gnu.tar.gz/md5/6d8783dc9b86c9884e0877f0d8ac4167 -LLVMLibUnwind.v12.0.1+0.aarch64-linux-gnu.tar.gz/sha512/d3b0c81498220d77e4f3cc684fb2cc0653792c381207390e695ac30bc74249f96a333a406b2cebdaca14e0b0a27b188cba6209bb5c1cbbb5c184d5626dbdc7a0 -LLVMLibUnwind.v12.0.1+0.aarch64-linux-musl.tar.gz/md5/052a35e879d52244e4b0804be875a38f -LLVMLibUnwind.v12.0.1+0.aarch64-linux-musl.tar.gz/sha512/d1b34fb97f9928e046d3131a050454710a93d38e60287b7e3c92f179f436586d3230cf90b0ca0eb8a3f9ef89fef7b1ffd7d52871645dfa233a8b07ca87ea2ee4 -LLVMLibUnwind.v12.0.1+0.armv6l-linux-gnueabihf.tar.gz/md5/1ad96a03a5dde506b5c05773b1849ec4 -LLVMLibUnwind.v12.0.1+0.armv6l-linux-gnueabihf.tar.gz/sha512/82306fb7b920fa7c71bd53b23d6915e7f256e8da9679cc926a53bb0d879f1f4469f43efe556ca32c9ef59e27b435572c7b39859090652635db4eeefdec0d1685 -LLVMLibUnwind.v12.0.1+0.armv6l-linux-musleabihf.tar.gz/md5/6a24fcd3a4dc3b1a98bb7963b1bb4930 -LLVMLibUnwind.v12.0.1+0.armv6l-linux-musleabihf.tar.gz/sha512/9ba6b83ccec061a1e5260c807dc8afd6e18799431b25a7e65b97662cc4db02509d02ea07fe12025d80914cec7383624b1c8fc9add46511c668e184ede263ac52 -LLVMLibUnwind.v12.0.1+0.armv7l-linux-gnueabihf.tar.gz/md5/09f1bfcf58a4124561553ab5005f9538 -LLVMLibUnwind.v12.0.1+0.armv7l-linux-gnueabihf.tar.gz/sha512/b0907cb857131183ffc338780c6c6dd1d48bf0ba61c3da1b8f20cf9a943373173b621cf9b2e8f1fbc657059a896b84aa025e6d4f0f1d1e8b623fac3e96541765 -LLVMLibUnwind.v12.0.1+0.armv7l-linux-musleabihf.tar.gz/md5/19158bcfae716b26f924d67c4e719342 -LLVMLibUnwind.v12.0.1+0.armv7l-linux-musleabihf.tar.gz/sha512/a90be57990b6699cb737ba96904e94e1f082601ca9d01e670f025b5500f526980741921c9cf672accab78cb5327714ab6ecdbb875174088f0773ebb627a98819 -LLVMLibUnwind.v12.0.1+0.i686-linux-gnu.tar.gz/md5/ba75556eb96b2bcdaf73ff68386d3bc3 -LLVMLibUnwind.v12.0.1+0.i686-linux-gnu.tar.gz/sha512/612fb765695b7aae11ef29608eedf8b959f60c021287a67b03a2a0f57a5814001ffa9b261c9d60d5f3d0582c06c2b41f75fd3afb66a045a248bd43d29e304c97 -LLVMLibUnwind.v12.0.1+0.i686-linux-musl.tar.gz/md5/2fcbceeb1bfde29be0cbca8bb6718bfe -LLVMLibUnwind.v12.0.1+0.i686-linux-musl.tar.gz/sha512/58f281cfc70b3f8a59cf4faa7732824637c811ddc5ea6a058f294f4c3ed4fa6c8ddab5c007567b439f2854635cf4fd146284059bfbc73e7006000ced9383f705 -LLVMLibUnwind.v12.0.1+0.i686-w64-mingw32.tar.gz/md5/153c028d97dceb6924414a7a9a137e1e -LLVMLibUnwind.v12.0.1+0.i686-w64-mingw32.tar.gz/sha512/7ae1f197600eabde9036ae58623de34a6d25636d7861777e324eb97902f65e26c6f3775e757178f8914b0cb6c2e925413f5ffc6abc9b6138470dc9e67a17f212 -LLVMLibUnwind.v12.0.1+0.powerpc64le-linux-gnu.tar.gz/md5/c08a6cf3e1baf156eb05003ed4e9ebe9 -LLVMLibUnwind.v12.0.1+0.powerpc64le-linux-gnu.tar.gz/sha512/f74e44986622329990842cb3ff549ff9254c81863d8bee468b0e58b7621067e7e7f7f18e4cbeafad6a05e0c107323de6828a78dc7afbcd7cd1892383ff417968 -LLVMLibUnwind.v12.0.1+0.x86_64-apple-darwin.tar.gz/md5/caf151150e56827be09acca6964d2b18 -LLVMLibUnwind.v12.0.1+0.x86_64-apple-darwin.tar.gz/sha512/cb3e7aa71367ec4a115bccc2e8ac6bd5d9f22b3935b3889eee1fbf7303c5f553d7d3108977bc1f6c9b6917a6ed9e10bff211fd56b8169233ceae287b112894c2 -LLVMLibUnwind.v12.0.1+0.x86_64-linux-gnu.tar.gz/md5/d95874cbf6f8b55bc314c3968a6a4563 -LLVMLibUnwind.v12.0.1+0.x86_64-linux-gnu.tar.gz/sha512/4986a8d9cc9d8761a99a4f02d017b424484233d4cbe2d4f49ccd371591384b1b8d1c4d31cb908505b86b00f2b164568e57751dd949d91af203ee4a582971798a -LLVMLibUnwind.v12.0.1+0.x86_64-linux-musl.tar.gz/md5/89077d871e15425b1f4c2451fb19a1b2 -LLVMLibUnwind.v12.0.1+0.x86_64-linux-musl.tar.gz/sha512/b65a218b05ade2e2d1582188897b036a4596d09cf65558f178c49c1a1a62b7d992b1d99fbe86a027dc83b614f178e6061f3dfb695b18a8e2b6bf76779b741d96 -LLVMLibUnwind.v12.0.1+0.x86_64-unknown-freebsd.tar.gz/md5/54ac594b4c8e7f261034a8829dad5e34 -LLVMLibUnwind.v12.0.1+0.x86_64-unknown-freebsd.tar.gz/sha512/a43756afd92081e6dd7244d162862fc318b41ca110a5e8be6e4ee2d8fdfd8fb0f79961ae55e48913e055779791bd1c0ecd34fd59281fb66b3c4f24a1f44128f0 -LLVMLibUnwind.v12.0.1+0.x86_64-w64-mingw32.tar.gz/md5/83cf8fc2a085a73b8af4245a82b7d32f -LLVMLibUnwind.v12.0.1+0.x86_64-w64-mingw32.tar.gz/sha512/297a5c7b33bd3f57878871eccb3b9879ea5549639523a1b9db356b710cafb232906a74d668315340d60ba0c5087d3400f14ab92c3704e32e062e6b546abf7df6 -llvmunwind-12.0.1.tar.xz/md5/4ec327cee517fdb1f6a20e83748e2c7b -llvmunwind-12.0.1.tar.xz/sha512/847b6ba03010a43f4fdbfdc49bf16d18fd18474d01584712e651b11191814bf7c1cf53475021d9ee447ed78413202b4ed97973d7bdd851d3e49f8d06f55a7af4 diff --git a/deps/llvm.version b/deps/llvm.version index 95f9796624933..68b68b56a4926 100644 --- a/deps/llvm.version +++ b/deps/llvm.version @@ -1,2 +1,2 @@ -LLVM_BRANCH=julia-13.0.1-1 -LLVM_SHA1=julia-13.0.1-1 +LLVM_BRANCH=julia-13.0.1-2 +LLVM_SHA1=julia-13.0.1-2 diff --git a/stdlib/libLLVM_jll/Project.toml b/stdlib/libLLVM_jll/Project.toml index 38fb77588fb66..cda68e4352d06 100644 --- a/stdlib/libLLVM_jll/Project.toml +++ b/stdlib/libLLVM_jll/Project.toml @@ -1,6 +1,6 @@ name = "libLLVM_jll" uuid = "8f36deef-c2a5-5394-99ed-8e07531fb29a" -version = "13.0.1+1" +version = "13.0.1+2" [deps] Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" From b97d34ad429b1eb5ae0e8d6610fc36f35e064b48 Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Wed, 20 Apr 2022 09:01:53 -0400 Subject: [PATCH 200/369] Report any recompilation in time macro (#45015) `@time` now shows if any of the compilation time was spent recompiling invalidated methods. The new percentage is % of the compilation time, not the total execution time. (cherry picked from commit 7074f04228d6149c2cefaa16064f30739f31da13) --- NEWS.md | 2 ++ base/timing.jl | 50 +++++++++++++++++++++++++++++++------------- src/jitlayers.cpp | 13 ++++++++++-- src/jlapi.c | 14 ++++++++++--- src/julia_internal.h | 1 + src/threading.c | 1 + test/misc.jl | 27 ++++++++++++------------ 7 files changed, 75 insertions(+), 33 deletions(-) diff --git a/NEWS.md b/NEWS.md index a3ae8fe37e40b..63172f026cac5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -110,6 +110,8 @@ New library features * TCP socket objects now expose `closewrite` functionality and support half-open mode usage ([#40783]). * `extrema` now accepts an `init` keyword argument ([#36265], [#43604]). * `Iterators.countfrom` now accepts any type that defines `+` ([#37747]). +* `@time` now separates out % time spent recompiling invalidated methods ([#45015]). +* `@time_imports` now shows any compilation and recompilation time percentages per import ([#45064]). Standard library changes ------------------------ diff --git a/base/timing.jl b/base/timing.jl index c7870ac491169..1579cd5673bc9 100644 --- a/base/timing.jl +++ b/base/timing.jl @@ -55,9 +55,21 @@ function gc_alloc_count(diff::GC_Diff) diff.malloc + diff.realloc + diff.poolalloc + diff.bigalloc end -# cumulative total time spent on compilation, in nanoseconds -cumulative_compile_time_ns_before() = ccall(:jl_cumulative_compile_time_ns_before, UInt64, ()) -cumulative_compile_time_ns_after() = ccall(:jl_cumulative_compile_time_ns_after, UInt64, ()) +# cumulative total time spent on compilation and recompilation, in nanoseconds +function cumulative_compile_time_ns() + comp = ccall(:jl_cumulative_compile_time_ns, UInt64, ()) + recomp = ccall(:jl_cumulative_recompile_time_ns, UInt64, ()) + return comp, recomp +end + +function cumulative_compile_timing(b::Bool) + if b + ccall(:jl_cumulative_compile_timing_enable, Cvoid, ()) + else + ccall(:jl_cumulative_compile_timing_disable, Cvoid, ()) + end + return +end # total time spend in garbage collection, in nanoseconds gc_time_ns() = ccall(:jl_gc_total_hrtime, UInt64, ()) @@ -114,7 +126,7 @@ function format_bytes(bytes) # also used by InteractiveUtils end end -function time_print(elapsedtime, bytes=0, gctime=0, allocs=0, compile_time=0, newline=false, _lpad=true) +function time_print(elapsedtime, bytes=0, gctime=0, allocs=0, compile_time=0, recompile_time=0, newline=false, _lpad=true) timestr = Ryu.writefixed(Float64(elapsedtime/1e9), 6) str = sprint() do io _lpad && print(io, length(timestr) < 10 ? (" "^(10 - length(timestr))) : "") @@ -142,15 +154,20 @@ function time_print(elapsedtime, bytes=0, gctime=0, allocs=0, compile_time=0, ne end print(io, Ryu.writefixed(Float64(100*compile_time/elapsedtime), 2), "% compilation time") end + if recompile_time > 0 + print(io, ": ", Ryu.writefixed(Float64(100*recompile_time/compile_time), 0), "% of which was recompilation") + end parens && print(io, ")") end newline ? println(str) : print(str) nothing end -function timev_print(elapsedtime, diff::GC_Diff, compile_time, _lpad) +function timev_print(elapsedtime, diff::GC_Diff, compile_times, _lpad) allocs = gc_alloc_count(diff) - time_print(elapsedtime, diff.allocd, diff.total_time, allocs, compile_time, true, _lpad) + compile_time = first(compile_times) + recompile_time = last(compile_times) + time_print(elapsedtime, diff.allocd, diff.total_time, allocs, compile_time, recompile_time, true, _lpad) padded_nonzero_print(elapsedtime, "elapsed time (ns)") padded_nonzero_print(diff.total_time, "gc time (ns)") padded_nonzero_print(diff.allocd, "bytes allocated") @@ -181,8 +198,8 @@ end A macro to execute an expression, printing the time it took to execute, the number of allocations, and the total number of bytes its execution caused to be allocated, before -returning the value of the expression. Any time spent garbage collecting (gc) or -compiling is shown as a percentage. +returning the value of the expression. Any time spent garbage collecting (gc), compiling +new code, or recompiling invalidated code is shown as a percentage. Optionally provide a description string to print before the time report. @@ -201,6 +218,9 @@ See also [`@showtime`](@ref), [`@timev`](@ref), [`@timed`](@ref), [`@elapsed`](@ !!! compat "Julia 1.8" The option to add a description was introduced in Julia 1.8. +!!! compat "Julia 1.9" + Recompilation time being shown separately from compilation time was introduced in Julia 1.9 + ```julia-repl julia> x = rand(10,10); @@ -238,16 +258,18 @@ macro time(msg, ex) Experimental.@force_compile local stats = gc_num() local elapsedtime = time_ns() - local compile_elapsedtime = cumulative_compile_time_ns_before() + cumulative_compile_timing(true) + local compile_elapsedtimes = cumulative_compile_time_ns() local val = @__tryfinally($(esc(ex)), (elapsedtime = time_ns() - elapsedtime; - compile_elapsedtime = cumulative_compile_time_ns_after() - compile_elapsedtime) + cumulative_compile_timing(false); + compile_elapsedtimes = cumulative_compile_time_ns() .- compile_elapsedtimes) ) local diff = GC_Diff(gc_num(), stats) local _msg = $(esc(msg)) local has_msg = !isnothing(_msg) has_msg && print(_msg, ": ") - time_print(elapsedtime, diff.allocd, diff.total_time, gc_alloc_count(diff), compile_elapsedtime, true, !has_msg) + time_print(elapsedtime, diff.allocd, diff.total_time, gc_alloc_count(diff), first(compile_elapsedtimes), last(compile_elapsedtimes), true, !has_msg) val end end @@ -320,16 +342,16 @@ macro timev(msg, ex) Experimental.@force_compile local stats = gc_num() local elapsedtime = time_ns() - local compile_elapsedtime = cumulative_compile_time_ns_before() + local compile_elapsedtimes = cumulative_compile_time_ns() local val = @__tryfinally($(esc(ex)), (elapsedtime = time_ns() - elapsedtime; - compile_elapsedtime = cumulative_compile_time_ns_after() - compile_elapsedtime) + compile_elapsedtimes = cumulative_compile_time_ns() .- compile_elapsedtimes) ) local diff = GC_Diff(gc_num(), stats) local _msg = $(esc(msg)) local has_msg = !isnothing(_msg) has_msg && print(_msg, ": ") - timev_print(elapsedtime, diff, compile_elapsedtime, !has_msg) + timev_print(elapsedtime, diff, compile_elapsedtimes, !has_msg) val end end diff --git a/src/jitlayers.cpp b/src/jitlayers.cpp index 7c68c8eb561d9..93ae9b16d7f16 100644 --- a/src/jitlayers.cpp +++ b/src/jitlayers.cpp @@ -291,6 +291,7 @@ jl_code_instance_t *jl_generate_fptr_impl(jl_method_instance_t *mi JL_PROPAGATES JL_LOCK(&jl_codegen_lock); // also disables finalizers, to prevent any unexpected recursion uint64_t compiler_start_time = 0; uint8_t measure_compile_time_enabled = jl_atomic_load_relaxed(&jl_measure_compile_time_enabled); + bool is_recompile = false; if (measure_compile_time_enabled) compiler_start_time = jl_hrtime(); // if we don't have any decls already, try to generate it now @@ -305,6 +306,10 @@ jl_code_instance_t *jl_generate_fptr_impl(jl_method_instance_t *mi JL_PROPAGATES else if (jl_is_method(mi->def.method)) src = jl_uncompress_ir(mi->def.method, codeinst, (jl_array_t*)src); } + else { + // identify whether this is an invalidated method that is being recompiled + is_recompile = jl_atomic_load_relaxed(&mi->cache) != NULL; + } if (src == NULL && jl_is_method(mi->def.method) && jl_symbol_name(mi->def.method->name)[0] != '@') { if (mi->def.method->source != jl_nothing) { @@ -331,8 +336,12 @@ jl_code_instance_t *jl_generate_fptr_impl(jl_method_instance_t *mi JL_PROPAGATES else { codeinst = NULL; } - if (jl_codegen_lock.count == 1 && measure_compile_time_enabled) - jl_atomic_fetch_add_relaxed(&jl_cumulative_compile_time, (jl_hrtime() - compiler_start_time)); + if (jl_codegen_lock.count == 1 && measure_compile_time_enabled) { + uint64_t t_comp = jl_hrtime() - compiler_start_time; + if (is_recompile) + jl_atomic_fetch_add_relaxed(&jl_cumulative_recompile_time, t_comp); + jl_atomic_fetch_add_relaxed(&jl_cumulative_compile_time, t_comp); + } JL_UNLOCK(&jl_codegen_lock); JL_GC_POP(); return codeinst; diff --git a/src/jlapi.c b/src/jlapi.c index 18a98d943187b..e2691db51b709 100644 --- a/src/jlapi.c +++ b/src/jlapi.c @@ -480,20 +480,28 @@ JL_DLLEXPORT void (jl_cpu_wake)(void) jl_cpu_wake(); } -JL_DLLEXPORT uint64_t jl_cumulative_compile_time_ns_before(void) +JL_DLLEXPORT void jl_cumulative_compile_timing_enable(void) { // Increment the flag to allow reentrant callers to `@time`. jl_atomic_fetch_add(&jl_measure_compile_time_enabled, 1); - return jl_atomic_load_relaxed(&jl_cumulative_compile_time); } -JL_DLLEXPORT uint64_t jl_cumulative_compile_time_ns_after(void) +JL_DLLEXPORT void jl_cumulative_compile_timing_disable(void) { // Decrement the flag when done measuring, allowing other callers to continue measuring. jl_atomic_fetch_add(&jl_measure_compile_time_enabled, -1); +} + +JL_DLLEXPORT uint64_t jl_cumulative_compile_time_ns(void) +{ return jl_atomic_load_relaxed(&jl_cumulative_compile_time); } +JL_DLLEXPORT uint64_t jl_cumulative_recompile_time_ns(void) +{ + return jl_atomic_load_relaxed(&jl_cumulative_recompile_time); +} + JL_DLLEXPORT void jl_get_fenv_consts(int *ret) { ret[0] = FE_INEXACT; diff --git a/src/julia_internal.h b/src/julia_internal.h index 4f75cfa6ee299..873ef2541d6f6 100644 --- a/src/julia_internal.h +++ b/src/julia_internal.h @@ -169,6 +169,7 @@ static inline uint64_t cycleclock(void) JL_NOTSAFEPOINT // Global *atomic* integers controlling *process-wide* measurement of compilation time. extern JL_DLLEXPORT _Atomic(uint8_t) jl_measure_compile_time_enabled; extern JL_DLLEXPORT _Atomic(uint64_t) jl_cumulative_compile_time; +extern JL_DLLEXPORT _Atomic(uint64_t) jl_cumulative_recompile_time; #define jl_return_address() ((uintptr_t)__builtin_return_address(0)) diff --git a/src/threading.c b/src/threading.c index 2f50783dafaf0..f6e053df410c5 100644 --- a/src/threading.c +++ b/src/threading.c @@ -289,6 +289,7 @@ void jl_pgcstack_getkey(jl_get_pgcstack_func **f, jl_pgcstack_key_t *k) jl_ptls_t *jl_all_tls_states JL_GLOBALLY_ROOTED; JL_DLLEXPORT _Atomic(uint8_t) jl_measure_compile_time_enabled = 0; JL_DLLEXPORT _Atomic(uint64_t) jl_cumulative_compile_time = 0; +JL_DLLEXPORT _Atomic(uint64_t) jl_cumulative_recompile_time = 0; // return calling thread's ID // Also update the suspended_threads list in signals-mach when changing the diff --git a/test/misc.jl b/test/misc.jl index efc647667f4b6..acefe3981674c 100644 --- a/test/misc.jl +++ b/test/misc.jl @@ -334,24 +334,23 @@ function timev_macro_scope() end @test timev_macro_scope() == 1 -before = Base.cumulative_compile_time_ns_before(); +before_comp, before_recomp = Base.cumulative_compile_time_ns() # no need to turn timing on, @time will do that # exercise concurrent calls to `@time` for reentrant compilation time measurement. -t1 = @async @time begin - sleep(2) - @eval module M ; f(x,y) = x+y ; end - @eval M.f(2,3) -end -t2 = @async begin - sleep(1) - @time 2 + 2 +@sync begin + t1 = @async @time begin + sleep(2) + @eval module M ; f(x,y) = x+y ; end + @eval M.f(2,3) + end + t2 = @async begin + sleep(1) + @time 2 + 2 + end end -after = Base.cumulative_compile_time_ns_after(); -@test after >= before; - -# wait for completion of these tasks before restoring stdout, to suppress their @time prints. -wait(t1); wait(t2) +after_comp, after_recomp = Base.cumulative_compile_time_ns() # no need to turn timing off, @time will do that +@test after_comp >= before_comp; end # redirect_stdout From ad61d037ddc492621a8535381b67ce9bac0f14df Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Thu, 28 Apr 2022 09:48:42 -0400 Subject: [PATCH 201/369] Add compilation & recompilation time to time_imports macro (#45064) (cherry picked from commit 9320fba641e1b78c5b596f4a4a8ad20deb2dfdaa) --- base/loading.jl | 24 +++++++++++++++--- stdlib/InteractiveUtils/src/macros.jl | 32 ++++++++++++++++-------- stdlib/InteractiveUtils/test/runtests.jl | 2 +- 3 files changed, 43 insertions(+), 15 deletions(-) diff --git a/base/loading.jl b/base/loading.jl index 2e83a4296c238..5011cb837df3f 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -895,7 +895,13 @@ const TIMING_IMPORTS = Threads.Atomic{Int}(0) # returns `false` if the module isn't known to be precompilable # returns the set of modules restored if the cache load succeeded @constprop :none function _require_search_from_serialized(pkg::PkgId, sourcepath::String, depth::Int = 0) - t_before = time_ns() + timing_imports = TIMING_IMPORTS[] > 0 + try + if timing_imports + t_before = time_ns() + cumulative_compile_timing(true) + t_comp_before = cumulative_compile_time_ns() + end paths = find_all_in_cache_path(pkg) for path_to_try in paths::Vector{String} staledeps = stale_cachefile(sourcepath, path_to_try) @@ -927,17 +933,29 @@ const TIMING_IMPORTS = Threads.Atomic{Int}(0) if isa(restored, Exception) @debug "Deserialization checks failed while attempting to load cache from $path_to_try" exception=restored else - if TIMING_IMPORTS[] > 0 + if timing_imports elapsed = round((time_ns() - t_before) / 1e6, digits = 1) + comp_time, recomp_time = cumulative_compile_time_ns() .- t_comp_before tree_prefix = depth == 0 ? "" : " "^(depth-1)*"┌ " print(lpad(elapsed, 9), " ms ") printstyled(tree_prefix, color = :light_black) - println(pkg.name) + print(pkg.name) + if comp_time > 0 + printstyled(" ", Ryu.writefixed(Float64(100 * comp_time / (elapsed * 1e6)), 2), "% compilation time", color = Base.info_color()) + end + if recomp_time > 0 + perc = Float64(100 * recomp_time / comp_time) + printstyled(" (", perc < 1 ? "<1" : Ryu.writefixed(perc, 0), "% recompilation)", color = Base.warn_color()) + end + println() end return restored end end return !isempty(paths) + finally + timing_imports && cumulative_compile_timing(false) + end end # to synchronize multiple tasks trying to import/using something diff --git a/stdlib/InteractiveUtils/src/macros.jl b/stdlib/InteractiveUtils/src/macros.jl index 623873a3484b5..b0005e6d7d783 100644 --- a/stdlib/InteractiveUtils/src/macros.jl +++ b/stdlib/InteractiveUtils/src/macros.jl @@ -354,24 +354,34 @@ See also: [`code_native`](@ref), [`@code_llvm`](@ref), [`@code_typed`](@ref) and @time_imports A macro to execute an expression and produce a report of any time spent importing packages and their -dependencies. +dependencies. Any compilation time will be reported as a percentage, and how much of which was recompilation, if any. If a package's dependencies have already been imported either globally or by another dependency they will not appear under that package and the package will accurately report a faster load time than if it were to be loaded in isolation. +!!! compat "Julia 1.9" + Reporting of any compilation and recompilation time was added in Julia 1.9 + ```julia-repl julia> @time_imports using CSV - 3.5 ms ┌ IteratorInterfaceExtensions - 27.4 ms ┌ TableTraits - 614.0 ms ┌ SentinelArrays - 138.6 ms ┌ Parsers - 2.7 ms ┌ DataValueInterfaces - 3.4 ms ┌ DataAPI - 59.0 ms ┌ WeakRefStrings - 35.4 ms ┌ Tables - 49.5 ms ┌ PooledArrays - 972.1 ms CSV + 0.4 ms ┌ IteratorInterfaceExtensions + 11.1 ms ┌ TableTraits 84.88% compilation time + 145.4 ms ┌ SentinelArrays 66.73% compilation time + 42.3 ms ┌ Parsers 19.66% compilation time + 4.1 ms ┌ Compat + 8.2 ms ┌ OrderedCollections + 1.4 ms ┌ Zlib_jll + 2.3 ms ┌ TranscodingStreams + 6.1 ms ┌ CodecZlib + 0.3 ms ┌ DataValueInterfaces + 15.2 ms ┌ FilePathsBase 30.06% compilation time + 9.3 ms ┌ InlineStrings + 1.5 ms ┌ DataAPI + 31.4 ms ┌ WeakRefStrings + 14.8 ms ┌ Tables + 24.2 ms ┌ PooledArrays + 2002.4 ms CSV 83.49% compilation time ``` !!! note diff --git a/stdlib/InteractiveUtils/test/runtests.jl b/stdlib/InteractiveUtils/test/runtests.jl index 05e3a744644e1..4013eee1b54bc 100644 --- a/stdlib/InteractiveUtils/test/runtests.jl +++ b/stdlib/InteractiveUtils/test/runtests.jl @@ -641,7 +641,7 @@ end buf = read(fname) rm(fname) - @test occursin("ms Foo3242\n", String(buf)) + @test occursin("ms Foo3242", String(buf)) finally filter!((≠)(dir), LOAD_PATH) From 0646ce78e090175194daede771a332e09799875b Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Thu, 30 Jun 2022 12:01:59 -0400 Subject: [PATCH 202/369] loading: prevent module replacement during precompile This is theoretically okay, but unlikely to be intended ever. (cherry picked from commit d81724aa7be61098ceeb11da64ecdc8921f4f8d5) --- base/loading.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/base/loading.jl b/base/loading.jl index 5011cb837df3f..97cf10db766d5 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -1135,7 +1135,11 @@ root_module_key(m::Module) = @lock require_lock module_keys[m] if haskey(loaded_modules, key) oldm = loaded_modules[key] if oldm !== m - @warn "Replacing module `$(key.name)`" + if (0 != ccall(:jl_generating_output, Cint, ())) && (JLOptions().incremental != 0) + error("Replacing module `$(key.name)`") + else + @warn "Replacing module `$(key.name)`" + end end end loaded_modules[key] = m From 89cb6dfda1468b80fcb9652ecbb43119e48c3609 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Wed, 29 Jun 2022 00:48:17 -0400 Subject: [PATCH 203/369] loading: add missing deadlock causing #45704 Does not explicitly close issue #45704, as perhaps the deserialized module should still be valid after the replacement warning. (cherry picked from commit ad8893be72591562e82e704989b6b20a0f3a35da) --- base/loading.jl | 103 ++++++++++++++++++++++++++++++------------------ 1 file changed, 64 insertions(+), 39 deletions(-) diff --git a/base/loading.jl b/base/loading.jl index 97cf10db766d5..939c0153ac0e3 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -167,7 +167,8 @@ function dummy_uuid(project_file::String) end project_path = try realpath(project_file) - catch + catch ex + ex isa IOError || rethrow() project_file end uuid = uuid5(ns_dummy_uuid, project_path) @@ -335,15 +336,15 @@ function locate_package(pkg::PkgId)::Union{Nothing,String} for env in load_path() # look for the toplevel pkg `pkg.name` in this entry found = project_deps_get(env, pkg.name) - found === nothing && continue - if pkg == found - # pkg.name is present in this directory or project file, - # return the path the entry point for the code, if it could be found - # otherwise, signal failure - return implicit_manifest_uuid_path(env, pkg) + if found !== nothing + @assert found.name == pkg.name + if found.uuid === nothing + # pkg.name is present in this directory or project file, + # return the path the entry point for the code, if it could be found + # otherwise, signal failure + return implicit_manifest_uuid_path(env, pkg) + end end - @assert found.uuid !== nothing - return locate_package(found) # restart search now that we know the uuid for pkg end else for env in load_path() @@ -790,6 +791,7 @@ end # or an Exception that describes why it couldn't be loaded # and it reconnects the Base.Docs.META function _include_from_serialized(pkg::PkgId, path::String, depmods::Vector{Any}) + assert_havelock(require_lock) sv = ccall(:jl_restore_incremental, Any, (Cstring, Any), path, depmods) if isa(sv, Exception) return sv @@ -823,6 +825,7 @@ function _include_from_serialized(pkg::PkgId, path::String, depmods::Vector{Any} end function run_package_callbacks(modkey::PkgId) + assert_havelock(require_lock) unlock(require_lock) try for callback in package_callbacks @@ -839,34 +842,51 @@ function run_package_callbacks(modkey::PkgId) end function _tryrequire_from_serialized(modkey::PkgId, build_id::UInt64, modpath::Union{Nothing, String}, depth::Int = 0) + assert_havelock(require_lock) + local loaded = nothing if root_module_exists(modkey) M = root_module(modkey) if PkgId(M) == modkey && module_build_id(M) === build_id - return M + loaded = M end else - if modpath === nothing - modpath = locate_package(modkey) - modpath === nothing && return nothing + loading = get(package_locks, modkey, false) + if loading !== false + # load already in progress for this module + return wait(loading) end - mod = _require_search_from_serialized(modkey, String(modpath), depth) - get!(PkgOrigin, pkgorigins, modkey).path = modpath - if !isa(mod, Bool) - run_package_callbacks(modkey) - for M in mod::Vector{Any} - M = M::Module - if PkgId(M) == modkey && module_build_id(M) === build_id - return M + package_locks[modkey] = Threads.Condition(require_lock) + try + if modpath === nothing + modpath = locate_package(modkey) + modpath === nothing && return nothing + end + mod = _require_search_from_serialized(modkey, String(modpath), depth) + get!(PkgOrigin, pkgorigins, modkey).path = modpath + if !isa(mod, Bool) + for M in mod::Vector{Any} + M = M::Module + if PkgId(M) == modkey && module_build_id(M) === build_id + loaded = M + break + end end end + finally + loading = pop!(package_locks, modkey) + notify(loading, loaded, all=true) + end + if loaded !== nothing + run_package_callbacks(modkey) end end - return nothing + return loaded end function _require_from_serialized(pkg::PkgId, path::String) # loads a precompile cache file, ignoring stale_cachfile tests # load all of the dependent modules first + assert_havelock(require_lock) local depmodnames io = open(path, "r") try @@ -895,6 +915,7 @@ const TIMING_IMPORTS = Threads.Atomic{Int}(0) # returns `false` if the module isn't known to be precompilable # returns the set of modules restored if the cache load succeeded @constprop :none function _require_search_from_serialized(pkg::PkgId, sourcepath::String, depth::Int = 0) + assert_havelock(require_lock) timing_imports = TIMING_IMPORTS[] > 0 try if timing_imports @@ -911,7 +932,8 @@ const TIMING_IMPORTS = Threads.Atomic{Int}(0) staledeps = staledeps::Vector{Any} try touch(path_to_try) # update timestamp of precompilation file - catch # file might be read-only and then we fail to update timestamp, which is fine + catch ex # file might be read-only and then we fail to update timestamp, which is fine + ex isa IOError || rethrow() end # finish loading module graph into staledeps for i in 1:length(staledeps) @@ -929,6 +951,7 @@ const TIMING_IMPORTS = Threads.Atomic{Int}(0) if staledeps === true continue end + #@debug "Loading cache file $path for $pkg at $sourcepath" restored = _include_from_serialized(pkg, path_to_try, staledeps) if isa(restored, Exception) @debug "Deserialization checks failed while attempting to load cache from $path_to_try" exception=restored @@ -1107,18 +1130,19 @@ const pkgorigins = Dict{PkgId,PkgOrigin}() require(uuidkey::PkgId) = @lock require_lock _require_prelocked(uuidkey) function _require_prelocked(uuidkey::PkgId) - just_loaded_pkg = false + assert_havelock(require_lock) if !root_module_exists(uuidkey) - _require(uuidkey) + newm = _require(uuidkey) + if newm === nothing + error("package `$(uuidkey.name)` did not define the expected \ + module `$(uuidkey.name)`, check for typos in package module name") + end # After successfully loading, notify downstream consumers run_package_callbacks(uuidkey) - just_loaded_pkg = true - end - if just_loaded_pkg && !root_module_exists(uuidkey) - error("package `$(uuidkey.name)` did not define the expected \ - module `$(uuidkey.name)`, check for typos in package module name") + else + newm = root_module(uuidkey) end - return root_module(uuidkey) + return newm end const loaded_modules = Dict{PkgId,Module}() @@ -1191,18 +1215,19 @@ function set_pkgorigin_version_path(pkg, path) pkgorigin.path = path end -# Returns `nothing` or the name of the newly-created cachefile +# Returns `nothing` or the new(ish) module function _require(pkg::PkgId) + assert_havelock(require_lock) # handle recursive calls to require loading = get(package_locks, pkg, false) if loading !== false # load already in progress for this module - wait(loading) - return + return wait(loading) end package_locks[pkg] = Threads.Condition(require_lock) last = toplevel_load[] + loaded = nothing try toplevel_load[] = false # perform the search operation to select the module file require intends to load @@ -1219,7 +1244,7 @@ function _require(pkg::PkgId) if JLOptions().use_compiled_modules != 0 m = _require_search_from_serialized(pkg, path) if !isa(m, Bool) - return + return m end end @@ -1254,7 +1279,7 @@ function _require(pkg::PkgId) if isa(m, Exception) @warn "The call to compilecache failed to create a usable precompiled cache file for $pkg" exception=m else - return + return m end end end @@ -1271,7 +1296,7 @@ function _require(pkg::PkgId) unlock(require_lock) try include(__toplevel__, path) - return + loaded = get(loaded_modules, key, nothing) finally lock(require_lock) if uuid !== old_uuid @@ -1281,9 +1306,9 @@ function _require(pkg::PkgId) finally toplevel_load[] = last loading = pop!(package_locks, pkg) - notify(loading, all=true) + notify(loading, loaded, all=true) end - nothing + return loaded end # relative-path load From 73b37b2ffc689d65460ee166dd0ac528fd28bd68 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Wed, 29 Jun 2022 02:34:46 -0400 Subject: [PATCH 204/369] loading: validate all cache files before loading any Ensures we do not get easily wedged into bad states. (cherry picked from commit d0e28affa7f69556aa60c968ae013726399e7e49) --- base/loading.jl | 278 ++++++++++++++++++++++++++++++--------------- test/precompile.jl | 4 +- 2 files changed, 186 insertions(+), 96 deletions(-) diff --git a/base/loading.jl b/base/loading.jl index 939c0153ac0e3..21772bfbf3c8b 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -787,11 +787,23 @@ function find_all_in_cache_path(pkg::PkgId) end end +# use an Int counter so that nested @time_imports calls all remain open +const TIMING_IMPORTS = Threads.Atomic{Int}(0) + # these return either the array of modules loaded from the path / content given # or an Exception that describes why it couldn't be loaded # and it reconnects the Base.Docs.META function _include_from_serialized(pkg::PkgId, path::String, depmods::Vector{Any}) assert_havelock(require_lock) + timing_imports = TIMING_IMPORTS[] > 0 + try + if timing_imports + t_before = time_ns() + cumulative_compile_timing(true) + t_comp_before = cumulative_compile_time_ns() + end + + @debug "Loading cache file $path for $pkg" sv = ccall(:jl_restore_incremental, Any, (Cstring, Any), path, depmods) if isa(sv, Exception) return sv @@ -821,7 +833,32 @@ function _include_from_serialized(pkg::PkgId, path::String, depmods::Vector{Any} lock(require_lock) end end - return restored + + for M in restored + M = M::Module + if parentmodule(M) === M && PkgId(M) == pkg + if timing_imports + elapsed = round((time_ns() - t_before) / 1e6, digits = 1) + comp_time, recomp_time = cumulative_compile_time_ns() .- t_comp_before + print(lpad(elapsed, 9), " ms ") + print(pkg.name) + if comp_time > 0 + printstyled(" ", Ryu.writefixed(Float64(100 * comp_time / (elapsed * 1e6)), 2), "% compilation time", color = Base.info_color()) + end + if recomp_time > 0 + perc = Float64(100 * recomp_time / comp_time) + printstyled(" (", perc < 1 ? "<1" : Ryu.writefixed(perc, 0), "% recompilation)", color = Base.warn_color()) + end + println() + end + return M + end + end + return ErrorException("Required dependency $pkg failed to load from a cache file.") + + finally + timing_imports && cumulative_compile_timing(false) + end end function run_package_callbacks(modkey::PkgId) @@ -841,51 +878,81 @@ function run_package_callbacks(modkey::PkgId) nothing end -function _tryrequire_from_serialized(modkey::PkgId, build_id::UInt64, modpath::Union{Nothing, String}, depth::Int = 0) +# loads a precompile cache file, after checking stale_cachefile tests +function _tryrequire_from_serialized(modkey::PkgId, build_id::UInt64) assert_havelock(require_lock) - local loaded = nothing + loaded = nothing if root_module_exists(modkey) - M = root_module(modkey) - if PkgId(M) == modkey && module_build_id(M) === build_id - loaded = M - end + loaded = root_module(modkey) else loading = get(package_locks, modkey, false) if loading !== false # load already in progress for this module - return wait(loading) - end - package_locks[modkey] = Threads.Condition(require_lock) - try - if modpath === nothing + loaded = wait(loading) + else + package_locks[modkey] = Threads.Condition(require_lock) + try modpath = locate_package(modkey) modpath === nothing && return nothing + loaded = _require_search_from_serialized(modkey, String(modpath), build_id) + get!(PkgOrigin, pkgorigins, modkey).path = modpath + finally + loading = pop!(package_locks, modkey) + notify(loading, loaded, all=true) end - mod = _require_search_from_serialized(modkey, String(modpath), depth) - get!(PkgOrigin, pkgorigins, modkey).path = modpath - if !isa(mod, Bool) - for M in mod::Vector{Any} - M = M::Module - if PkgId(M) == modkey && module_build_id(M) === build_id - loaded = M - break - end - end + if loaded isa Module + run_package_callbacks(modkey) end - finally - loading = pop!(package_locks, modkey) - notify(loading, loaded, all=true) end - if loaded !== nothing - run_package_callbacks(modkey) + end + if !(loaded isa Module) || PkgId(loaded) != modkey + return ErrorException("Required dependency $modkey failed to load from a cache file.") + end + return loaded +end + +# loads a precompile cache file, ignoring stale_cachefile tests +# assuming all depmods are already loaded and everything is valid +function _tryrequire_from_serialized(modkey::PkgId, path::String, depmods::Vector{Any}) + assert_havelock(require_lock) + loaded = nothing + if root_module_exists(modkey) + loaded = root_module(modkey) + else + loading = get(package_locks, modkey, false) + if loading !== false + # load already in progress for this module + loaded = wait(loading) + else + for i in 1:length(depmods) + dep = depmods[i] + dep isa Module && continue + _, depkey, depbuild_id = dep::Tuple{String, PkgId, UInt64} + @assert root_module_exists(depkey) + dep = root_module(depkey) + depmods[i] = dep + end + package_locks[modkey] = Threads.Condition(require_lock) + try + loaded = _include_from_serialized(modkey, path, depmods) + finally + loading = pop!(package_locks, modkey) + notify(loading, loaded, all=true) + end + if loaded isa Module + run_package_callbacks(modkey) + end end end + if !(loaded isa Module) || PkgId(loaded) != modkey + return ErrorException("Required dependency $modkey failed to load from a cache file.") + end return loaded end -function _require_from_serialized(pkg::PkgId, path::String) - # loads a precompile cache file, ignoring stale_cachfile tests - # load all of the dependent modules first +# loads a precompile cache file, ignoring stale_cachefile tests +# load the best available (non-stale) version of all dependent modules first +function _tryrequire_from_serialized(pkg::PkgId, path::String) assert_havelock(require_lock) local depmodnames io = open(path, "r") @@ -900,36 +967,53 @@ function _require_from_serialized(pkg::PkgId, path::String) depmods = Vector{Any}(undef, ndeps) for i in 1:ndeps modkey, build_id = depmodnames[i] - dep = _tryrequire_from_serialized(modkey, build_id, nothing) - dep === nothing && return ErrorException("Required dependency $modkey failed to load from a cache file.") - depmods[i] = dep::Module + dep = _tryrequire_from_serialized(modkey, build_id) + if !isa(dep, Module) + return dep + end + depmods[i] = dep end # then load the file return _include_from_serialized(pkg, path, depmods) end -# use an Int counter so that nested @time_imports calls all remain open -const TIMING_IMPORTS = Threads.Atomic{Int}(0) - -# returns `true` if require found a precompile cache for this sourcepath, but couldn't load it -# returns `false` if the module isn't known to be precompilable +# returns `nothing` if require found a precompile cache for this sourcepath, but couldn't load it # returns the set of modules restored if the cache load succeeded -@constprop :none function _require_search_from_serialized(pkg::PkgId, sourcepath::String, depth::Int = 0) +@constprop :none function _require_search_from_serialized(pkg::PkgId, sourcepath::String, build_id::UInt64) assert_havelock(require_lock) - timing_imports = TIMING_IMPORTS[] > 0 - try - if timing_imports - t_before = time_ns() - cumulative_compile_timing(true) - t_comp_before = cumulative_compile_time_ns() - end paths = find_all_in_cache_path(pkg) for path_to_try in paths::Vector{String} - staledeps = stale_cachefile(sourcepath, path_to_try) + staledeps = stale_cachefile(pkg, build_id, sourcepath, path_to_try) if staledeps === true continue end staledeps = staledeps::Vector{Any} + # finish checking staledeps module graph + for i in 1:length(staledeps) + dep = staledeps[i] + dep isa Module && continue + modpath, modkey, modbuild_id = dep::Tuple{String, PkgId, UInt64} + modpaths = find_all_in_cache_path(modkey) + modfound = false + for modpath_to_try in modpaths::Vector{String} + modstaledeps = stale_cachefile(modkey, modbuild_id, modpath, modpath_to_try) + if modstaledeps === true + continue + end + modstaledeps = modstaledeps::Vector{Any} + staledeps[i] = (modkey, modpath_to_try, modstaledeps) + modfound = true + break + end + if !modfound + @debug "Rejecting cache file $path_to_try because required dependency $modkey with build ID $modbuild_id is missing from the cache." + staledeps = true + break + end + end + if staledeps === true + continue + end try touch(path_to_try) # update timestamp of precompilation file catch ex # file might be read-only and then we fail to update timestamp, which is fine @@ -939,46 +1023,26 @@ const TIMING_IMPORTS = Threads.Atomic{Int}(0) for i in 1:length(staledeps) dep = staledeps[i] dep isa Module && continue - modpath, modkey, build_id = dep::Tuple{String, PkgId, UInt64} - dep = _tryrequire_from_serialized(modkey, build_id, modpath, depth + 1) - if dep === nothing - @debug "Required dependency $modkey failed to load from cache file for $modpath." + modkey, modpath_to_try, modstaledeps = dep::Tuple{PkgId, String, Vector{Any}} + dep = _tryrequire_from_serialized(modkey, modpath_to_try, modstaledeps) + if !isa(dep, Module) + @debug "Rejecting cache file $path_to_try because required dependency $modkey failed to load from cache file for $modpath." exception=dep staledeps = true break end - staledeps[i] = dep::Module + staledeps[i] = dep end if staledeps === true continue end - #@debug "Loading cache file $path for $pkg at $sourcepath" restored = _include_from_serialized(pkg, path_to_try, staledeps) - if isa(restored, Exception) + if !isa(restored, Module) @debug "Deserialization checks failed while attempting to load cache from $path_to_try" exception=restored else - if timing_imports - elapsed = round((time_ns() - t_before) / 1e6, digits = 1) - comp_time, recomp_time = cumulative_compile_time_ns() .- t_comp_before - tree_prefix = depth == 0 ? "" : " "^(depth-1)*"┌ " - print(lpad(elapsed, 9), " ms ") - printstyled(tree_prefix, color = :light_black) - print(pkg.name) - if comp_time > 0 - printstyled(" ", Ryu.writefixed(Float64(100 * comp_time / (elapsed * 1e6)), 2), "% compilation time", color = Base.info_color()) - end - if recomp_time > 0 - perc = Float64(100 * recomp_time / comp_time) - printstyled(" (", perc < 1 ? "<1" : Ryu.writefixed(perc, 0), "% recompilation)", color = Base.warn_color()) - end - println() - end return restored end end - return !isempty(paths) - finally - timing_imports && cumulative_compile_timing(false) - end + return end # to synchronize multiple tasks trying to import/using something @@ -1146,6 +1210,7 @@ function _require_prelocked(uuidkey::PkgId) end const loaded_modules = Dict{PkgId,Module}() +const loaded_modules_order = Vector{Module}() const module_keys = IdDict{Module,PkgId}() # the reverse is_root_module(m::Module) = @lock require_lock haskey(module_keys, m) @@ -1166,6 +1231,7 @@ root_module_key(m::Module) = @lock require_lock module_keys[m] end end end + push!(loaded_modules_order, m) loaded_modules[key] = m module_keys[m] = key end @@ -1190,7 +1256,7 @@ root_module(where::Module, name::Symbol) = maybe_root_module(key::PkgId) = @lock require_lock get(loaded_modules, key, nothing) root_module_exists(key::PkgId) = @lock require_lock haskey(loaded_modules, key) -loaded_modules_array() = @lock require_lock collect(values(loaded_modules)) +loaded_modules_array() = @lock require_lock copy(loaded_modules_order) function unreference_module(key::PkgId) if haskey(loaded_modules, key) @@ -1242,8 +1308,8 @@ function _require(pkg::PkgId) # attempt to load the module file via the precompile cache locations if JLOptions().use_compiled_modules != 0 - m = _require_search_from_serialized(pkg, path) - if !isa(m, Bool) + m = _require_search_from_serialized(pkg, path, UInt64(0)) + if m isa Module return m end end @@ -1264,7 +1330,6 @@ function _require(pkg::PkgId) if JLOptions().use_compiled_modules != 0 if (0 == ccall(:jl_generating_output, Cint, ())) || (JLOptions().incremental != 0) # spawn off a new incremental pre-compile task for recursive `require` calls - # or if the require search declared it was pre-compiled before (and therefore is expected to still be pre-compilable) cachefile = compilecache(pkg, path) if isa(cachefile, Exception) if precompilableerror(cachefile) @@ -1275,8 +1340,8 @@ function _require(pkg::PkgId) end # fall-through to loading the file locally else - m = _require_from_serialized(pkg, cachefile) - if isa(m, Exception) + m = _tryrequire_from_serialized(pkg, cachefile) + if !isa(m, Module) @warn "The call to compilecache failed to create a usable precompiled cache file for $pkg" exception=m else return m @@ -1296,7 +1361,7 @@ function _require(pkg::PkgId) unlock(require_lock) try include(__toplevel__, path) - loaded = get(loaded_modules, key, nothing) + loaded = get(loaded_modules, pkg, nothing) finally lock(require_lock) if uuid !== old_uuid @@ -1311,6 +1376,18 @@ function _require(pkg::PkgId) return loaded end +function _require_from_serialized(uuidkey::PkgId, path::String) + @lock require_lock begin + newm = _tryrequire_from_serialized(uuidkey, path) + newm isa Module || throw(newm) + # After successfully loading, notify downstream consumers + run_package_callbacks(uuidkey) + return newm + end +end + + + # relative-path load """ @@ -1560,7 +1637,7 @@ end const MAX_NUM_PRECOMPILE_FILES = Ref(10) function compilecache(pkg::PkgId, path::String, internal_stderr::IO = stderr, internal_stdout::IO = stdout, - ignore_loaded_modules::Bool = true) + keep_loaded_modules::Bool = true) @nospecialize internal_stderr internal_stdout # decide where to put the resulting cache file @@ -1568,10 +1645,10 @@ function compilecache(pkg::PkgId, path::String, internal_stderr::IO = stderr, in # build up the list of modules that we want the precompile process to preserve concrete_deps = copy(_concrete_dependencies) - if ignore_loaded_modules - for (key, mod) in loaded_modules + if keep_loaded_modules + for mod in loaded_modules_array() if !(mod === Main || mod === Core || mod === Base) - push!(concrete_deps, key => module_build_id(mod)) + push!(concrete_deps, PkgId(mod) => module_build_id(mod)) end end end @@ -1973,9 +2050,12 @@ get_compiletime_preferences(uuid::UUID) = collect(get(Vector{String}, COMPILETIM get_compiletime_preferences(m::Module) = get_compiletime_preferences(PkgId(m).uuid) get_compiletime_preferences(::Nothing) = String[] -# returns true if it "cachefile.ji" is stale relative to "modpath.jl" +# returns true if it "cachefile.ji" is stale relative to "modpath.jl" and build_id for modkey # otherwise returns the list of dependencies to also check @constprop :none function stale_cachefile(modpath::String, cachefile::String; ignore_loaded::Bool = false) + return stale_cachefile(PkgId(""), UInt64(0), modpath, cachefile; ignore_loaded) +end +@constprop :none function stale_cachefile(modkey::PkgId, build_id::UInt64, modpath::String, cachefile::String; ignore_loaded::Bool = false) io = open(cachefile, "r") try if !isvalid_cache_header(io) @@ -1983,7 +2063,19 @@ get_compiletime_preferences(::Nothing) = String[] return true # invalid cache file end modules, (includes, requires), required_modules, srctextpos, prefs, prefs_hash = parse_cache_header(io) - id = isempty(modules) ? nothing : first(modules).first + if isempty(modules) + return true # ignore empty file + end + id = first(modules) + if id.first != modkey && modkey != PkgId("") + @debug "Rejecting cache file $cachefile for $modkey since it is for $id instead" + return true + end + if build_id != UInt64(0) && id.second != build_id + @debug "Ignoring cache file $cachefile for $modkey since it is does not provide desired build_id" + return true + end + id = id.first modules = Dict{PkgId, UInt64}(modules) # Check if transitive dependencies can be fulfilled @@ -2026,7 +2118,7 @@ get_compiletime_preferences(::Nothing) = String[] skip_timecheck = true break end - @debug "Rejecting cache file $cachefile because it provides the wrong uuid (got $build_id) for $req_key (want $req_build_id)" + @debug "Rejecting cache file $cachefile because it provides the wrong build_id (got $build_id) for $req_key (want $req_build_id)" return true # cachefile doesn't provide the required version of the dependency end end @@ -2062,12 +2154,10 @@ get_compiletime_preferences(::Nothing) = String[] return true end - if isa(id, PkgId) - curr_prefs_hash = get_preferences_hash(id.uuid, prefs) - if prefs_hash != curr_prefs_hash - @debug "Rejecting cache file $cachefile because preferences hash does not match 0x$(string(prefs_hash, base=16)) != 0x$(string(curr_prefs_hash, base=16))" - return true - end + curr_prefs_hash = get_preferences_hash(id.uuid, prefs) + if prefs_hash != curr_prefs_hash + @debug "Rejecting cache file $cachefile because preferences hash does not match 0x$(string(prefs_hash, base=16)) != 0x$(string(curr_prefs_hash, base=16))" + return true end return depmods # fresh cachefile diff --git a/test/precompile.jl b/test/precompile.jl index 5162d026628b7..a8937581cb5d0 100644 --- a/test/precompile.jl +++ b/test/precompile.jl @@ -313,8 +313,8 @@ precompile_test_harness(false) do dir # the module doesn't reload from the image: @test_warn "@ccallable was already defined for this method name" begin @test_logs (:warn, "Replacing module `$Foo_module`") begin - ms = Base._require_from_serialized(Base.PkgId(Foo), cachefile) - @test isa(ms, Array{Any,1}) + m = Base._require_from_serialized(Base.PkgId(Foo), cachefile) + @test isa(m, Module) end end From 0ce21a6fe640826e44eee72ee269504d01b4ef2b Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Wed, 29 Jun 2022 03:29:33 -0400 Subject: [PATCH 205/369] loading: stop corrupting memory all over the place Regressions introduced by #45607 (cherry picked from commit 239a1f261e140f7a74fe20b61045aff5ad9ad15e) --- base/loading.jl | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/base/loading.jl b/base/loading.jl index 21772bfbf3c8b..71e464f49eda5 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -894,8 +894,8 @@ function _tryrequire_from_serialized(modkey::PkgId, build_id::UInt64) try modpath = locate_package(modkey) modpath === nothing && return nothing + set_pkgorigin_version_path(modkey, String(modpath)) loaded = _require_search_from_serialized(modkey, String(modpath), build_id) - get!(PkgOrigin, pkgorigins, modkey).path = modpath finally loading = pop!(package_locks, modkey) notify(loading, loaded, all=true) @@ -913,7 +913,7 @@ end # loads a precompile cache file, ignoring stale_cachefile tests # assuming all depmods are already loaded and everything is valid -function _tryrequire_from_serialized(modkey::PkgId, path::String, depmods::Vector{Any}) +function _tryrequire_from_serialized(modkey::PkgId, path::String, sourcepath::String, depmods::Vector{Any}) assert_havelock(require_lock) loaded = nothing if root_module_exists(modkey) @@ -934,6 +934,7 @@ function _tryrequire_from_serialized(modkey::PkgId, path::String, depmods::Vecto end package_locks[modkey] = Threads.Condition(require_lock) try + set_pkgorigin_version_path(modkey, sourcepath) loaded = _include_from_serialized(modkey, path, depmods) finally loading = pop!(package_locks, modkey) @@ -1001,7 +1002,7 @@ end continue end modstaledeps = modstaledeps::Vector{Any} - staledeps[i] = (modkey, modpath_to_try, modstaledeps) + staledeps[i] = (modpath, modkey, modpath_to_try, modstaledeps) modfound = true break end @@ -1023,8 +1024,8 @@ end for i in 1:length(staledeps) dep = staledeps[i] dep isa Module && continue - modkey, modpath_to_try, modstaledeps = dep::Tuple{PkgId, String, Vector{Any}} - dep = _tryrequire_from_serialized(modkey, modpath_to_try, modstaledeps) + modpath, modkey, modpath_to_try, modstaledeps = dep::Tuple{String, PkgId, String, Vector{Any}} + dep = _tryrequire_from_serialized(modkey, modpath_to_try, modpath, modstaledeps) if !isa(dep, Module) @debug "Rejecting cache file $path_to_try because required dependency $modkey failed to load from cache file for $modpath." exception=dep staledeps = true @@ -1266,7 +1267,9 @@ function unreference_module(key::PkgId) end end -function set_pkgorigin_version_path(pkg, path) +# whoever takes the package_locks[pkg] must call this function immediately +function set_pkgorigin_version_path(pkg::PkgId, path::Union{String,Nothing}) + assert_havelock(require_lock) pkgorigin = get!(PkgOrigin, pkgorigins, pkg) if path !== nothing project_file = locate_project_file(joinpath(dirname(path), "..")) @@ -1279,6 +1282,7 @@ function set_pkgorigin_version_path(pkg, path) end end pkgorigin.path = path + nothing end # Returns `nothing` or the new(ish) module @@ -1298,13 +1302,13 @@ function _require(pkg::PkgId) toplevel_load[] = false # perform the search operation to select the module file require intends to load path = locate_package(pkg) - set_pkgorigin_version_path(pkg, path) if path === nothing throw(ArgumentError(""" Package $pkg is required but does not seem to be installed: - Run `Pkg.instantiate()` to install all recorded dependencies. """)) end + set_pkgorigin_version_path(pkg, path) # attempt to load the module file via the precompile cache locations if JLOptions().use_compiled_modules != 0 @@ -1378,6 +1382,7 @@ end function _require_from_serialized(uuidkey::PkgId, path::String) @lock require_lock begin + set_pkgorigin_version_path(uuidkey, nothing) newm = _tryrequire_from_serialized(uuidkey, path) newm isa Module || throw(newm) # After successfully loading, notify downstream consumers @@ -2102,7 +2107,6 @@ end @debug "Rejecting cache file $cachefile because dependency $req_key not found." return true # Won't be able to fulfill dependency end - set_pkgorigin_version_path(req_key, path) depmods[i] = (path, req_key, req_build_id) end end From 11cfa4e55d3af17e304a26e8bf1c7285b2be4ad5 Mon Sep 17 00:00:00 2001 From: pchintalapudi <34727397+pchintalapudi@users.noreply.github.com> Date: Sat, 12 Mar 2022 14:35:38 -0500 Subject: [PATCH 206/369] Fix llvm powi intrinsic calls in fastmath.jl (#44580) (cherry picked from commit b49a1b47985edc76526a5a006ddbe0c385a39f9f) --- base/fastmath.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/fastmath.jl b/base/fastmath.jl index c01a8a5b225f7..05a5ce0503e68 100644 --- a/base/fastmath.jl +++ b/base/fastmath.jl @@ -279,8 +279,8 @@ exp10_fast(x::Union{Float32,Float64}) = Base.Math.exp10_fast(x) # builtins -pow_fast(x::Float32, y::Integer) = ccall("llvm.powi.f32", llvmcall, Float32, (Float32, Int32), x, y) -pow_fast(x::Float64, y::Integer) = ccall("llvm.powi.f64", llvmcall, Float64, (Float64, Int32), x, y) +pow_fast(x::Float32, y::Integer) = ccall("llvm.powi.f32.i32", llvmcall, Float32, (Float32, Int32), x, y) +pow_fast(x::Float64, y::Integer) = ccall("llvm.powi.f64.i32", llvmcall, Float64, (Float64, Int32), x, y) pow_fast(x::FloatTypes, ::Val{p}) where {p} = pow_fast(x, p) # inlines already via llvm.powi @inline pow_fast(x, v::Val) = Base.literal_pow(^, x, v) From 8fcc2dd15cdcf1ced03a409363d7401e68e943a6 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Wed, 30 Mar 2022 09:27:41 +0900 Subject: [PATCH 207/369] fix `tuple_tfunc` on `Union` containing `Type{...}` (#44725) fix #44705 (cherry picked from commit 41156867d06ed2cbfbf624b727f54a94db00eb32) --- base/compiler/tfuncs.jl | 6 ++++++ test/compiler/inference.jl | 11 ++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/base/compiler/tfuncs.jl b/base/compiler/tfuncs.jl index 23a18ae8d8aeb..c07f0a5c2f0b3 100644 --- a/base/compiler/tfuncs.jl +++ b/base/compiler/tfuncs.jl @@ -1515,6 +1515,10 @@ function tuple_tfunc(argtypes::Vector{Any}) params[i] = typeof(x.val) else x = isvarargtype(x) ? x : widenconst(x) + # since there don't exist any values whose runtime type are `Tuple{Type{...}}`, + # here we should turn such `Type{...}`-parameters to valid parameters, e.g. + # (::Type{Int},) -> Tuple{DataType} (or PartialStruct for more accuracy) + # (::Union{Type{Int32},Type{Int64}}) -> Tuple{Type} if isType(x) anyinfo = true xparam = x.parameters[1] @@ -1523,6 +1527,8 @@ function tuple_tfunc(argtypes::Vector{Any}) else params[i] = Type end + elseif !isvarargtype(x) && hasintersect(x, Type) + params[i] = Union{x, Type} else params[i] = x end diff --git a/test/compiler/inference.jl b/test/compiler/inference.jl index 7f7b14b1705c1..38eecece6f504 100644 --- a/test/compiler/inference.jl +++ b/test/compiler/inference.jl @@ -1564,6 +1564,15 @@ end @test arraysize_tfunc(Vector, Float64) === Union{} @test arraysize_tfunc(String, Int) === Union{} +let tuple_tfunc + function tuple_tfunc(@nospecialize xs...) + return Core.Compiler.tuple_tfunc(Any[xs...]) + end + @test Core.Compiler.widenconst(tuple_tfunc(Type{Int})) === Tuple{DataType} + # https://github.com/JuliaLang/julia/issues/44705 + @test tuple_tfunc(Union{Type{Int32},Type{Int64}}) === Tuple{Type} +end + function f23024(::Type{T}, ::Int) where T 1 + 1 end @@ -2084,7 +2093,7 @@ let M = Module() obj = $(Expr(:new, M.BePartialStruct, 42, :cond)) r1 = getfield(obj, :cond) ? 0 : a # r1::Union{Nothing,Int}, not r1::Int (because PartialStruct doesn't wrap Conditional) a = $(gensym(:anyvar))::Any - r2 = getfield(obj, :cond) ? a : nothing # r2::Any, not r2::Const(nothing) (we don't need to worry about constrait invalidation here) + r2 = getfield(obj, :cond) ? a : nothing # r2::Any, not r2::Const(nothing) (we don't need to worry about constraint invalidation here) return r1, r2 # ::Tuple{Union{Nothing,Int},Any} end |> only end From 97c17e029e632f74caa70d8681267f7f92b92e57 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Mon, 11 Apr 2022 11:41:35 +0900 Subject: [PATCH 208/369] inference: don't widen `DataType`/`UninAll` to `Type` within `tuple_tfunc` (#44896) Follows up #44725. (cherry picked from commit 0deb3265eea2081cf19754f539985405cd0ddf05) --- base/compiler/tfuncs.jl | 2 ++ test/compiler/inference.jl | 2 ++ 2 files changed, 4 insertions(+) diff --git a/base/compiler/tfuncs.jl b/base/compiler/tfuncs.jl index c07f0a5c2f0b3..c188d3e24e143 100644 --- a/base/compiler/tfuncs.jl +++ b/base/compiler/tfuncs.jl @@ -1527,6 +1527,8 @@ function tuple_tfunc(argtypes::Vector{Any}) else params[i] = Type end + elseif iskindtype(x) + params[i] = x elseif !isvarargtype(x) && hasintersect(x, Type) params[i] = Union{x, Type} else diff --git a/test/compiler/inference.jl b/test/compiler/inference.jl index 38eecece6f504..7e1ea8f84b271 100644 --- a/test/compiler/inference.jl +++ b/test/compiler/inference.jl @@ -1571,6 +1571,8 @@ let tuple_tfunc @test Core.Compiler.widenconst(tuple_tfunc(Type{Int})) === Tuple{DataType} # https://github.com/JuliaLang/julia/issues/44705 @test tuple_tfunc(Union{Type{Int32},Type{Int64}}) === Tuple{Type} + @test tuple_tfunc(DataType) === Tuple{DataType} + @test tuple_tfunc(UnionAll) === Tuple{UnionAll} end function f23024(::Type{T}, ::Int) where T From fbae62d2dfee7219e92375fe3b95b5adf1b8e309 Mon Sep 17 00:00:00 2001 From: Jacob Quinn Date: Sun, 19 Jun 2022 04:36:22 -0600 Subject: [PATCH 209/369] Pass along backlog keyword argument in Sockets.listen (#45737) (cherry picked from commit 4f1c68e071a5ad54d9d8a1aeb1f3622bb4498d5f) --- stdlib/Sockets/src/Sockets.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/Sockets/src/Sockets.jl b/stdlib/Sockets/src/Sockets.jl index 4b5518a1fde61..84fe351de99e1 100644 --- a/stdlib/Sockets/src/Sockets.jl +++ b/stdlib/Sockets/src/Sockets.jl @@ -626,7 +626,7 @@ listen(port::Integer; backlog::Integer=BACKLOG_DEFAULT) = listen(localhost, port listen(host::IPAddr, port::Integer; backlog::Integer=BACKLOG_DEFAULT) = listen(InetAddr(host, port); backlog=backlog) function listen(sock::LibuvServer; backlog::Integer=BACKLOG_DEFAULT) - uv_error("listen", trylisten(sock)) + uv_error("listen", trylisten(sock; backlog=backlog)) return sock end From 0559fa6ab96d8eb044b77eef1f0a39f0d8586111 Mon Sep 17 00:00:00 2001 From: "Viral B. Shah" Date: Sun, 19 Jun 2022 15:31:01 -0400 Subject: [PATCH 210/369] Use https for downloading of unicode data from unicode.org (#45750) (cherry picked from commit 9b83dd8920734c1d869ced888b6d8a734fff365d) --- doc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Makefile b/doc/Makefile index 2f8b3f18495d8..51c4f3f51405c 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -28,7 +28,7 @@ DOCUMENTER_OPTIONS := linkcheck=$(linkcheck) doctest=$(doctest) buildroot=$(call UNICODE_DATA_VERSION=13.0.0 $(SRCCACHE)/UnicodeData-$(UNICODE_DATA_VERSION).txt: @mkdir -p "$(SRCCACHE)" - $(JLDOWNLOAD) "$@" http://www.unicode.org/Public/$(UNICODE_DATA_VERSION)/ucd/UnicodeData.txt + $(JLDOWNLOAD) "$@" https://www.unicode.org/Public/$(UNICODE_DATA_VERSION)/ucd/UnicodeData.txt deps: $(SRCCACHE)/UnicodeData-$(UNICODE_DATA_VERSION).txt $(JLCHECKSUM) "$<" From 929c48ab8a850425f7348b029ef156fb0c6ab5e4 Mon Sep 17 00:00:00 2001 From: "Viral B. Shah" Date: Sun, 19 Jun 2022 17:24:46 -0400 Subject: [PATCH 211/369] Fix libblastrampoline full source build to install into the right location (#45746) * Bump LBT to 5.1.1 * Use DESTDIR to install into * Update LBT checksums (cherry picked from commit 1d782658eeaaed4b52e9139a1956557e40ce8f8c) --- deps/Versions.make | 2 +- deps/blastrampoline.mk | 2 +- deps/blastrampoline.version | 4 +- deps/checksums/blastrampoline | 68 +++++++++++------------ deps/libsuitesparse.mk | 15 +++-- stdlib/libblastrampoline_jll/Project.toml | 2 +- 6 files changed, 49 insertions(+), 44 deletions(-) diff --git a/deps/Versions.make b/deps/Versions.make index 529bf25d4c634..0405de70e5bd8 100644 --- a/deps/Versions.make +++ b/deps/Versions.make @@ -75,7 +75,7 @@ OBJCONV_JLL_NAME := Objconv OBJCONV_JLL_VER := 2.49.1+0 # blastrampoline -BLASTRAMPOLINE_VER := 5.1.0 +BLASTRAMPOLINE_VER := 5.1.1 BLASTRAMPOLINE_JLL_NAME := libblastrampoline # OpenBLAS diff --git a/deps/blastrampoline.mk b/deps/blastrampoline.mk index a29b9b19e0eaa..bde21174a12a6 100644 --- a/deps/blastrampoline.mk +++ b/deps/blastrampoline.mk @@ -15,7 +15,7 @@ $(BUILDDIR)/$(BLASTRAMPOLINE_SRC_DIR)/build-compiled: $(BUILDDIR)/$(BLASTRAMPOLI echo 1 > $@ define BLASTRAMPOLINE_INSTALL - $(MAKE) -C $(BUILDDIR)/$(BLASTRAMPOLINE_SRC_DIR)/src $(MAKE_COMMON) install + $(MAKE) -C $(BUILDDIR)/$(BLASTRAMPOLINE_SRC_DIR)/src $(MAKE_COMMON) install DESTDIR="$2" endef $(eval $(call staged-install, \ blastrampoline,$(BLASTRAMPOLINE_SRC_DIR), \ diff --git a/deps/blastrampoline.version b/deps/blastrampoline.version index 23074f70854dc..b034fe1402f36 100644 --- a/deps/blastrampoline.version +++ b/deps/blastrampoline.version @@ -1,2 +1,2 @@ -BLASTRAMPOLINE_BRANCH=v5.0.1 -BLASTRAMPOLINE_SHA1=d32042273719672c6669f6442a0be5605d434b70 +BLASTRAMPOLINE_BRANCH=v5.1.1 +BLASTRAMPOLINE_SHA1=bac2f810d523003fbb431ecc6e9ea81c8b86e2d6 diff --git a/deps/checksums/blastrampoline b/deps/checksums/blastrampoline index 3b5e4359e43ec..0276f885e5768 100644 --- a/deps/checksums/blastrampoline +++ b/deps/checksums/blastrampoline @@ -1,34 +1,34 @@ -blastrampoline-d32042273719672c6669f6442a0be5605d434b70.tar.gz/md5/f380e4238a2dec186ecfe9598f75b824 -blastrampoline-d32042273719672c6669f6442a0be5605d434b70.tar.gz/sha512/00437a96b57d99cef946257480e38e1dfdf325c46bc4a1619f5067565dfb7d9f668b0c8415badb0879b933cb1972f3c4e6be4c9e63a8a85728033e2183373819 -libblastrampoline.v5.1.0+0.aarch64-apple-darwin.tar.gz/md5/edf090a17d862c33d611875058438757 -libblastrampoline.v5.1.0+0.aarch64-apple-darwin.tar.gz/sha512/a3413c7d46c04318a5bebf10d6f930d04b5997d4be6be4e2748a7b60f968d2f2be7de140eee6c699962a12e8439f68f144e5323dea17d91587e82f97aaaaaa24 -libblastrampoline.v5.1.0+0.aarch64-linux-gnu.tar.gz/md5/fe88a410d795f805756488915679edbd -libblastrampoline.v5.1.0+0.aarch64-linux-gnu.tar.gz/sha512/cbd31304278ea67ddc0f766c4647275c87829cf5377c3851153b7568015f4f016fd0f3e095f479c33d23a50f4af8c38bae4555b02dcbf45a04b6e5a0dd3504a8 -libblastrampoline.v5.1.0+0.aarch64-linux-musl.tar.gz/md5/d4d8c393eb28953297b37a7bae79ed2e -libblastrampoline.v5.1.0+0.aarch64-linux-musl.tar.gz/sha512/3b5dca87e089ac10486f75663b4cf7d404c71b040231b04e1ec5110d13f30ac620b4cb880040106273866d465da9bdda5643887534de8e35668a7ab545422216 -libblastrampoline.v5.1.0+0.armv6l-linux-gnueabihf.tar.gz/md5/8b5f2fbd5442bf31bd10836ffd177968 -libblastrampoline.v5.1.0+0.armv6l-linux-gnueabihf.tar.gz/sha512/f1d6314c785afc0aaa3ebcf8a532312e676ca41d427b9c2abdea88c700df4d6a7cb5cfa54d65493e5c3d711a64062a20a5de7e3b75feee0653115cee7de05446 -libblastrampoline.v5.1.0+0.armv6l-linux-musleabihf.tar.gz/md5/8ed3013c644ab3be5dce013fb23fd413 -libblastrampoline.v5.1.0+0.armv6l-linux-musleabihf.tar.gz/sha512/da40cbb0114d46a66ae41284d36dc855aa52dcd3993643858308f18c5d8eedbf92fc8ee57d3e3cc2153f29670b40bc03a8dd01d5b49dde210c8a7a2d471a59b7 -libblastrampoline.v5.1.0+0.armv7l-linux-gnueabihf.tar.gz/md5/23b8ef9ea92a8d474646d814c0c91577 -libblastrampoline.v5.1.0+0.armv7l-linux-gnueabihf.tar.gz/sha512/97789adc18a54b953ce8696b484a4314e734a8092a27f81f43c1ae269b592b18ba7c67082396220a1906ffb075895c34462be976e0059aded9f6a6948abb1672 -libblastrampoline.v5.1.0+0.armv7l-linux-musleabihf.tar.gz/md5/d5a47ebe37a4a234ee6a4f3cf830e8c5 -libblastrampoline.v5.1.0+0.armv7l-linux-musleabihf.tar.gz/sha512/65366692c074576733e3b3f15d011e326d6a1e2357055a1a0159db31cdd7d5ff0e9aba9a33c1f2a949e128ac10b72776a3f76907df4cadcf7e67ace934cf4ef0 -libblastrampoline.v5.1.0+0.i686-linux-gnu.tar.gz/md5/14a342ab1bd16ef61d747e99acc97e6a -libblastrampoline.v5.1.0+0.i686-linux-gnu.tar.gz/sha512/8eca984912e69af769f06cd2b38d1df9d724e4e42d6d5b2fcb77a8e74b2aa9f9c31beb36d634e5da28d4d2f0838957f5c5cd336db616768d8ffb60217fe92edc -libblastrampoline.v5.1.0+0.i686-linux-musl.tar.gz/md5/201e6c737df0c0e2f4327c395133969f -libblastrampoline.v5.1.0+0.i686-linux-musl.tar.gz/sha512/778daa7a0d3a6fb8d6480a14123e874009f0fdc5f1d3411518f8d9975c45ca418e88d71db72af8465d4064f4c177d0abb70bc568df3a4c765eed7c5aeddca428 -libblastrampoline.v5.1.0+0.i686-w64-mingw32.tar.gz/md5/8ddf4dec49fac4888f94f90143126e5f -libblastrampoline.v5.1.0+0.i686-w64-mingw32.tar.gz/sha512/388b797f4c86f0ea090058acaff0eed34c42d45092c001410d11a4a4da93668c1729453290872cd44615ee517d62546f4dc42005240a6c36e40e7152f5c9cf5c -libblastrampoline.v5.1.0+0.powerpc64le-linux-gnu.tar.gz/md5/db626123ab94b489ac8b4d395b2f5cf4 -libblastrampoline.v5.1.0+0.powerpc64le-linux-gnu.tar.gz/sha512/8c96f518dea82057fe85bdb2ee867cc7abc33e9c53fe94dd84d097a16268630c22082db7fc003dadfc4749400f3465564088e05cabd6844c31b870319432c433 -libblastrampoline.v5.1.0+0.x86_64-apple-darwin.tar.gz/md5/65b9aae2f749ec608b61412aa1921d65 -libblastrampoline.v5.1.0+0.x86_64-apple-darwin.tar.gz/sha512/38e974c9260614d855b0b13f78e72bbd65aa889e88101d25441dd4e78ce37baf81bab7de1950d71d8e35b32d62fb88ac9c3f39ab5a4aff11d00619441bc003f8 -libblastrampoline.v5.1.0+0.x86_64-linux-gnu.tar.gz/md5/0ab01f256277b4ea96f6d83c50891b99 -libblastrampoline.v5.1.0+0.x86_64-linux-gnu.tar.gz/sha512/2b2178d74beb1c12e348f6469777d31116f26229c243d5e08a6ac36a74c3eb38854c1d82429d0e7cabee259d0d5220c47c334a561ea5caac6f61d91aa6b34f52 -libblastrampoline.v5.1.0+0.x86_64-linux-musl.tar.gz/md5/52a9da4586daa6572b8fe2c13db6268a -libblastrampoline.v5.1.0+0.x86_64-linux-musl.tar.gz/sha512/04abc5a0b6f80f10d1fccceee8a0e1c58aba76a45e3f6662ce4115d9d39d20dd05b3859434037d21bf6c5088a5a428565cd86e1cf6d1676666ce7e3eb1921b80 -libblastrampoline.v5.1.0+0.x86_64-unknown-freebsd.tar.gz/md5/f2b66517937a7647086ba96acc81c6a6 -libblastrampoline.v5.1.0+0.x86_64-unknown-freebsd.tar.gz/sha512/c19654b97928bdba36ccf3dbecf8ca994a46929c29c5c120d2d17062128a3df8927230fe7c418d6f780557abb8ce94b6a6a023bddcd3aeb91c8302cdbfe2b39e -libblastrampoline.v5.1.0+0.x86_64-w64-mingw32.tar.gz/md5/4b50ad8399c733ee5d60ce1ad00e1e5e -libblastrampoline.v5.1.0+0.x86_64-w64-mingw32.tar.gz/sha512/6a0f1d061350d53dd2a030ba11a0ac02c5ae598cd2c21dda39f95d81a2b0f43a454d60cf32c2fc0546df074181100e2d247d229d62c4a6b94bc7b697b02f0e0e +blastrampoline-bac2f810d523003fbb431ecc6e9ea81c8b86e2d6.tar.gz/md5/070218f52aee906ebebb035e6c504aef +blastrampoline-bac2f810d523003fbb431ecc6e9ea81c8b86e2d6.tar.gz/sha512/eff4c34f19fd444cf3379c81836db82848287aca6106d952127565a0ee2d36797fa36b9f48b77db6a9a0c27dd307400385236ed335d7e58ecc7ec92de32af2c6 +libblastrampoline.v5.1.1+0.aarch64-apple-darwin.tar.gz/md5/a6475f23420c26d97b1baf1e37cc13b5 +libblastrampoline.v5.1.1+0.aarch64-apple-darwin.tar.gz/sha512/96386a4e0b57bc50cbefbb0eb75b037571e3d9ae3900122bb8d4f7f14db017b9e8a6dd2eceff07c9880dda2e072b89df7d21432fd5a08bef87a282cfc3bfbb82 +libblastrampoline.v5.1.1+0.aarch64-linux-gnu.tar.gz/md5/c28450dc1999d9304414288b267d72f2 +libblastrampoline.v5.1.1+0.aarch64-linux-gnu.tar.gz/sha512/19303d32b316cbce29f93dfb713987d6567946262158f1aa5f447a86197843d2875915fc6282264f49747237844f8cf32f9e5b2a0d6f67d514474823e7929de5 +libblastrampoline.v5.1.1+0.aarch64-linux-musl.tar.gz/md5/a40854c55588b88c57994fc8e3d3247a +libblastrampoline.v5.1.1+0.aarch64-linux-musl.tar.gz/sha512/c2fbc67fd8ab61bc854722949ac87d19fb7ae3e732f01e9ed855204605ef1b2756db4272688807a9928eba3cfe949099a3e74ea68c432219c023216d82e44b1b +libblastrampoline.v5.1.1+0.armv6l-linux-gnueabihf.tar.gz/md5/2d564a40dafc6e3001bcb13f2460306a +libblastrampoline.v5.1.1+0.armv6l-linux-gnueabihf.tar.gz/sha512/2ba59a5ea48bb4e9fafc5a34b8bc09fda9f4aa15917e41a87410d888ff69832fbd54a6ed6a401e0686dd2fd46e90603969ee42497691270921cf5688c8a1d2f7 +libblastrampoline.v5.1.1+0.armv6l-linux-musleabihf.tar.gz/md5/41cd8967ea13f76301e2760ce20b16b9 +libblastrampoline.v5.1.1+0.armv6l-linux-musleabihf.tar.gz/sha512/40f69ae9e352215e8faa65ca8451d5850090cafc3b71207df2f588ebd06d247fab4af02a544e5389a9e5a89a38d5a89f71ad8d1bf7bc695d9cf8903e9654ac87 +libblastrampoline.v5.1.1+0.armv7l-linux-gnueabihf.tar.gz/md5/a689ed70eba7f191a32508c5e266952a +libblastrampoline.v5.1.1+0.armv7l-linux-gnueabihf.tar.gz/sha512/47e5e1f1ef3f7dbf22c48bc9a09c0abb5abb967885c288c74b51249a22aab0cf475887e612f219e5abb905eab3018d5b5225682bfcc908debd6ff8d509e1a23c +libblastrampoline.v5.1.1+0.armv7l-linux-musleabihf.tar.gz/md5/ed08534ca3f065d391c2484c5fe6fd6b +libblastrampoline.v5.1.1+0.armv7l-linux-musleabihf.tar.gz/sha512/014d10a154ce3d35dd428dae52d4d52445d1cc1d501aed5f490332b663438a000b02992946b0ce18bf2e829339a35e163f684568f3484c83ca4f8584da4cc405 +libblastrampoline.v5.1.1+0.i686-linux-gnu.tar.gz/md5/b5f315c6e3b719991f4750d0451ac13b +libblastrampoline.v5.1.1+0.i686-linux-gnu.tar.gz/sha512/b67a478b532b664c1729a151d62f070308806476a2ca38bde3d20648676f1ed7f41ada42650641f98eb165beba984d40ddbe667b49b99213321c54d72c2f0f81 +libblastrampoline.v5.1.1+0.i686-linux-musl.tar.gz/md5/69b0b2128c7b482bc6f7b769d30322cc +libblastrampoline.v5.1.1+0.i686-linux-musl.tar.gz/sha512/97621e6f17deb137ba63af5a413efa67bc60ccd6a6776ff6fad8b1393e8a4b9a4586b5a4015471a64314b85e81e8421d5fa85b55f7bc48f4affd30d89a5d4082 +libblastrampoline.v5.1.1+0.i686-w64-mingw32.tar.gz/md5/b16bdd51b0d3336bca03374cd23884da +libblastrampoline.v5.1.1+0.i686-w64-mingw32.tar.gz/sha512/f323fae462a4d1210fbab1f6b253224b385c5a3c5e259cd4ce57fc4f77ba53293b8f14a3cd9db1f7c8ee2dab461aa36d62a8ec8e9693f3c257b8401de6550cc1 +libblastrampoline.v5.1.1+0.powerpc64le-linux-gnu.tar.gz/md5/d8f0d6980b97ae48a9d97dbfa28e6d1c +libblastrampoline.v5.1.1+0.powerpc64le-linux-gnu.tar.gz/sha512/f1137c5357153c0c309277d39398c2338297be73de995ae083397da5c170c4b1bec6939b6e160601b98ea40c42f9b563ac5ac1625341cde1ece6b1b5f5ec01f5 +libblastrampoline.v5.1.1+0.x86_64-apple-darwin.tar.gz/md5/088b8d27b76be56fcd7ed4383e5912d3 +libblastrampoline.v5.1.1+0.x86_64-apple-darwin.tar.gz/sha512/52741282b55f1ee0ded1aa63e4313a84be0862209f8a4439ef2076a03010c0d91083ca35cacbf187de77817ad864625a3dfd2769881764e3d9434ae387405778 +libblastrampoline.v5.1.1+0.x86_64-linux-gnu.tar.gz/md5/562215ad47d93c83c6587051ef201f0c +libblastrampoline.v5.1.1+0.x86_64-linux-gnu.tar.gz/sha512/9217f6afa0f3ef534c361fc09d14bfdf8322a8942c5e2ca0fc9234839e48d56339f03126aa9706b2ef067f88433d79f7d6f8824bb5763b99f64ef42919c3ab0b +libblastrampoline.v5.1.1+0.x86_64-linux-musl.tar.gz/md5/bd9b17ebc05ae50fc125c3cf1df8f990 +libblastrampoline.v5.1.1+0.x86_64-linux-musl.tar.gz/sha512/68b0ea95d404508038ca84b426c3ec02ae98b129e92a0f661766ab08bf38750f92a8aa41c53327bc2f6787b42504025011eaf79bb98febace4c41e628caf2094 +libblastrampoline.v5.1.1+0.x86_64-unknown-freebsd.tar.gz/md5/0308d4a7312bacc62446438f4d4b6894 +libblastrampoline.v5.1.1+0.x86_64-unknown-freebsd.tar.gz/sha512/d4085d81e85b9c1ffefd5a6147deea9f04436e1145eca73e5b63dba048aeaab9c497df725dc3104a77c834597363b7205ef7270f96ae94f06c950f7574e25d07 +libblastrampoline.v5.1.1+0.x86_64-w64-mingw32.tar.gz/md5/2a883d986c884be08ef332bcdc3ab52e +libblastrampoline.v5.1.1+0.x86_64-w64-mingw32.tar.gz/sha512/dacbcbe09910b7965448b22f3dbd55945bbe22d06c60a92d2c97da83f0b08d00278ff870eada470213fe22fa3c8acfcc0be8b753a885d98898d048e896c909ad diff --git a/deps/libsuitesparse.mk b/deps/libsuitesparse.mk index 42ae7807bb4ec..7d505cc6837ea 100644 --- a/deps/libsuitesparse.mk +++ b/deps/libsuitesparse.mk @@ -17,13 +17,18 @@ ifneq ($(USE_BINARYBUILDER_LIBSUITESPARSE), 1) LIBSUITESPARSE_PROJECTS := AMD BTF CAMD CCOLAMD COLAMD CHOLMOD LDL KLU UMFPACK RBio SPQR LIBSUITESPARSE_LIBS := $(addsuffix .*$(SHLIB_EXT)*,suitesparseconfig amd btf camd ccolamd colamd cholmod klu ldl umfpack rbio spqr) -SUITE_SPARSE_LIB := $(LDFLAGS) -L"$(abspath $(BUILDDIR))/SuiteSparse-$(LIBSUITESPARSE_VER)/lib" +SUITESPARSE_LIB := $(LDFLAGS) -L"$(abspath $(BUILDDIR))/SuiteSparse-$(LIBSUITESPARSE_VER)/lib" ifeq ($(OS), Darwin) -SUITE_SPARSE_LIB += $(RPATH_ESCAPED_ORIGIN) +SUITESPARSE_LIB += $(RPATH_ESCAPED_ORIGIN) endif -LIBSUITESPARSE_MFLAGS := CC="$(CC)" CXX="$(CXX)" F77="$(FC)" AR="$(AR)" RANLIB="$(RANLIB)" BLAS="-L$(build_shlibdir) -lblastrampoline" LAPACK="-L$(build_shlibdir) -lblastrampoline" \ - LDFLAGS="$(SUITE_SPARSE_LIB)" CFOPENMP="" CUDA=no CUDA_PATH="" \ - UMFPACK_CONFIG="$(UMFPACK_CONFIG)" CHOLMOD_CONFIG="$(CHOLMOD_CONFIG)" SPQR_CONFIG="$(SPQR_CONFIG)" +LIBSUITESPARSE_MFLAGS := CC="$(CC)" CXX="$(CXX)" F77="$(FC)" \ + AR="$(AR)" RANLIB="$(RANLIB)" \ + BLAS="-L$(build_shlibdir) -lblastrampoline" \ + LAPACK="-L$(build_shlibdir) -lblastrampoline" \ + LDFLAGS="$(SUITESPARSE_LIB)" CFOPENMP="" CUDA=no CUDA_PATH="" \ + UMFPACK_CONFIG="$(UMFPACK_CONFIG)" \ + CHOLMOD_CONFIG="$(CHOLMOD_CONFIG)" \ + SPQR_CONFIG="$(SPQR_CONFIG)" ifeq ($(OS),WINNT) LIBSUITESPARSE_MFLAGS += UNAME=Windows else diff --git a/stdlib/libblastrampoline_jll/Project.toml b/stdlib/libblastrampoline_jll/Project.toml index 8b93e368f8f59..f4e1a12f93a1b 100644 --- a/stdlib/libblastrampoline_jll/Project.toml +++ b/stdlib/libblastrampoline_jll/Project.toml @@ -1,6 +1,6 @@ name = "libblastrampoline_jll" uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" -version = "5.1.0+0" +version = "5.1.1+0" [deps] Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" From 14be13783c00122f6ef3dc14d6725b8b3525b9eb Mon Sep 17 00:00:00 2001 From: Oscar Smith Date: Tue, 21 Jun 2022 11:45:38 -0400 Subject: [PATCH 212/369] Document file descriptors in `run` (#45710) (cherry picked from commit 1f99ee9783f11a474fccaf333ec90f4af05573cc) --- base/process.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/base/process.jl b/base/process.jl index 57c4e0ebd874a..016c495a76a8b 100644 --- a/base/process.jl +++ b/base/process.jl @@ -464,6 +464,9 @@ Run a command object, constructed with backticks (see the [Running External Prog section in the manual). Throws an error if anything goes wrong, including the process exiting with a non-zero status (when `wait` is true). +The `args...` allow you to pass through file descriptors to the command, and are ordered +like regular unix file descriptors (eg `stdin, stdout, stderr, FD(3), FD(4)...`). + If `wait` is false, the process runs asynchronously. You can later wait for it and check its exit status by calling `success` on the returned process object. From 5894899dc718804a40ebc42bf28f41d1f56e5bfc Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Mon, 27 Jun 2022 13:06:20 -0400 Subject: [PATCH 213/369] fix obvious_subtype bug with egal objects (#45771) When egal objects contain identical typevars with different environments, the resulting subtyping might not be so obvious. Fix #45703 (cherry picked from commit 8ccf2d6b1fb0acc2c8e9766d320c34cb8445cae9) --- src/subtype.c | 11 +++++++++-- test/subtype.jl | 9 +++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/subtype.c b/src/subtype.c index c43d307e6d421..aea5b80a5cadf 100644 --- a/src/subtype.c +++ b/src/subtype.c @@ -1542,8 +1542,15 @@ static int obvious_subtype(jl_value_t *x, jl_value_t *y, jl_value_t *y0, int *su *subtype = 1; return 1; } - if (jl_is_unionall(x)) - x = jl_unwrap_unionall(x); + while (jl_is_unionall(x)) { + if (!jl_is_unionall(y)) { + if (obvious_subtype(jl_unwrap_unionall(x), y, y0, subtype) && !*subtype) + return 1; + return 0; + } + x = ((jl_unionall_t*)x)->body; + y = ((jl_unionall_t*)y)->body; + } if (jl_is_unionall(y)) y = jl_unwrap_unionall(y); if (x == (jl_value_t*)jl_typeofbottom_type->super) diff --git a/test/subtype.jl b/test/subtype.jl index a0a6c96c300d7..b17f502bc2e00 100644 --- a/test/subtype.jl +++ b/test/subtype.jl @@ -1987,3 +1987,12 @@ let A = Tuple{typeof(identity), Type{Union{}}}, B = Tuple{typeof(identity), typeof(Union{})} @test A == B && (Base.isdispatchtuple(A) == Base.isdispatchtuple(B)) end + +# issue #45703 +# requires assertions enabled (to catch discrepancy in obvious_subtype) +let T = TypeVar(:T, Real), + V = TypeVar(:V, AbstractVector{T}), + S = Type{Pair{T, V}} + @test !(UnionAll(T, UnionAll(V, UnionAll(T, Type{Pair{T, V}}))) <: UnionAll(T, UnionAll(V, Type{Pair{T, V}}))) + @test !(UnionAll(T, UnionAll(V, UnionAll(T, S))) <: UnionAll(T, UnionAll(V, S))) +end From 2b6c746c57bc43b635b6920827b9b36d81e782bf Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 2 Jul 2022 00:42:57 +0200 Subject: [PATCH 214/369] Remove duplicate definition of jl_gc_safepoint (#45120) This prevents a compiler warning on some systems (cherry picked from commit 05eb1530bbfe2db0dd6c9a13ea065f17cb9730cf) --- src/julia_threads.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/julia_threads.h b/src/julia_threads.h index 22acf3aec8587..9ad6ae089dad4 100644 --- a/src/julia_threads.h +++ b/src/julia_threads.h @@ -356,7 +356,6 @@ int8_t jl_gc_safe_leave(jl_ptls_t ptls, int8_t state); // Can be a safepoint #define jl_gc_safe_enter(ptls) jl_gc_state_save_and_set(ptls, JL_GC_STATE_SAFE) #define jl_gc_safe_leave(ptls, state) ((void)jl_gc_state_set(ptls, (state), JL_GC_STATE_SAFE)) #endif -JL_DLLEXPORT void (jl_gc_safepoint)(void); JL_DLLEXPORT void jl_gc_enable_finalizers(struct _jl_task_t *ct, int on); JL_DLLEXPORT void jl_gc_disable_finalizers_internal(void); From 7a238718bda72049f86563907837ab68a0e76d6d Mon Sep 17 00:00:00 2001 From: kpamnany Date: Tue, 5 Jul 2022 16:03:25 -0400 Subject: [PATCH 215/369] Backport #45727 and a patch to make it work (#45938) * Bug fix for `max_collect_interval` computation (#45727) Currently constrained to `totalmem / ncores / 2` for `_P64` which results in a very short collect interval when you're running with a smaller number of threads on a machine with many cores. Changes this to `totalmem / nthreads / 2` which, for two of our tests, resulted in 40% and 60% runtime reduction (!!) as well as GC time reduction from 46% to 10% and 64% to 11%. * Move GC init after threading init To allow use of `jl_n_threads` in GC initialization. --- src/gc.c | 4 ++-- src/init.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gc.c b/src/gc.c index 6942d153616b9..97669e0acfe61 100644 --- a/src/gc.c +++ b/src/gc.c @@ -3410,12 +3410,12 @@ void jl_gc_init(void) gc_num.allocd = 0; #ifdef _P64 - // on a big memory machine, set max_collect_interval to totalmem / ncores / 2 + // on a big memory machine, set max_collect_interval to totalmem / nthreads / 2 uint64_t total_mem = uv_get_total_memory(); uint64_t constrained_mem = uv_get_constrained_memory(); if (constrained_mem > 0 && constrained_mem < total_mem) total_mem = constrained_mem; - size_t maxmem = total_mem / jl_cpu_threads() / 2; + size_t maxmem = total_mem / jl_n_threads / 2; if (maxmem > max_collect_interval) max_collect_interval = maxmem; #endif diff --git a/src/init.c b/src/init.c index 98d5081c1daaf..d2c76bac404e7 100644 --- a/src/init.c +++ b/src/init.c @@ -686,10 +686,10 @@ JL_DLLEXPORT void julia_init(JL_IMAGE_SEARCH rel) } jl_init_runtime_ccall(); - jl_gc_init(); jl_init_tasks(); jl_init_threading(); + jl_gc_init(); jl_ptls_t ptls = jl_init_threadtls(0); // warning: this changes `jl_current_task`, so be careful not to call that from this function jl_task_t *ct = jl_init_root_task(ptls, stack_lo, stack_hi); From f76e364a960ec3a06dcdd88854a756fc378089b1 Mon Sep 17 00:00:00 2001 From: N5N3 <2642243996@qq.com> Date: Tue, 5 Jul 2022 23:23:22 +0800 Subject: [PATCH 216/369] Extend `strides` for `ReshapedArray` with strided parent. (#44507) * Extend `strides(::ReshapedArray)` with non-contiguous strided parent * Make sure `strides(::StridedReinterpretArray)` calls `size_to_strides` Co-authored-by: Tim Holy (cherry picked from commit 0d3aca404b28ba12acb11fa0fa7d66763ec4b6d0) --- base/reinterpretarray.jl | 24 +++++---------- base/reshapedarray.jl | 49 +++++++++++++++++++++++++++---- stdlib/LinearAlgebra/src/blas.jl | 19 ++++++------ stdlib/LinearAlgebra/test/blas.jl | 9 ++++-- test/abstractarray.jl | 44 +++++++++++++++++++++++---- 5 files changed, 106 insertions(+), 39 deletions(-) diff --git a/base/reinterpretarray.jl b/base/reinterpretarray.jl index 9211a66a99cbe..7ca50f9e2859e 100644 --- a/base/reinterpretarray.jl +++ b/base/reinterpretarray.jl @@ -152,23 +152,15 @@ strides(a::Union{DenseArray,StridedReshapedArray,StridedReinterpretArray}) = siz stride(A::Union{DenseArray,StridedReshapedArray,StridedReinterpretArray}, k::Integer) = k ≤ ndims(A) ? strides(A)[k] : length(A) -function strides(a::ReshapedReinterpretArray) - ap = parent(a) - els, elp = elsize(a), elsize(ap) - stp = strides(ap) - els == elp && return stp - els < elp && return (1, _checked_strides(stp, els, elp)...) +function strides(a::ReinterpretArray{T,<:Any,S,<:AbstractArray{S},IsReshaped}) where {T,S,IsReshaped} + _checkcontiguous(Bool, a) && return size_to_strides(1, size(a)) + stp = strides(parent(a)) + els, elp = sizeof(T), sizeof(S) + els == elp && return stp # 0dim parent is also handled here. + IsReshaped && els < elp && return (1, _checked_strides(stp, els, elp)...) stp[1] == 1 || throw(ArgumentError("Parent must be contiguous in the 1st dimension!")) - return _checked_strides(tail(stp), els, elp) -end - -function strides(a::NonReshapedReinterpretArray) - ap = parent(a) - els, elp = elsize(a), elsize(ap) - stp = strides(ap) - els == elp && return stp - stp[1] == 1 || throw(ArgumentError("Parent must be contiguous in the 1st dimension!")) - return (1, _checked_strides(tail(stp), els, elp)...) + st′ = _checked_strides(tail(stp), els, elp) + return IsReshaped ? st′ : (1, st′...) end @inline function _checked_strides(stp::Tuple, els::Integer, elp::Integer) diff --git a/base/reshapedarray.jl b/base/reshapedarray.jl index 82d293249afc6..367beaff7cc0e 100644 --- a/base/reshapedarray.jl +++ b/base/reshapedarray.jl @@ -294,14 +294,51 @@ unsafe_convert(::Type{Ptr{T}}, V::SubArray{T,N,P,<:Tuple{Vararg{Union{RangeIndex unsafe_convert(Ptr{T}, V.parent) + (first_index(V)-1)*sizeof(T) -_checkcontiguous(::Type{Bool}, A::AbstractArray) = size_to_strides(1, size(A)...) == strides(A) -_checkcontiguous(::Type{Bool}, A::Array) = true +_checkcontiguous(::Type{Bool}, A::AbstractArray) = false +# `strides(A::DenseArray)` calls `size_to_strides` by default. +# Thus it's OK to assume all `DenseArray`s are contiguously stored. +_checkcontiguous(::Type{Bool}, A::DenseArray) = true _checkcontiguous(::Type{Bool}, A::ReshapedArray) = _checkcontiguous(Bool, parent(A)) _checkcontiguous(::Type{Bool}, A::FastContiguousSubArray) = _checkcontiguous(Bool, parent(A)) function strides(a::ReshapedArray) - # We can handle non-contiguous parent if it's a StridedVector - ndims(parent(a)) == 1 && return size_to_strides(only(strides(parent(a))), size(a)...) - _checkcontiguous(Bool, a) || throw(ArgumentError("Parent must be contiguous.")) - size_to_strides(1, size(a)...) + _checkcontiguous(Bool, a) && return size_to_strides(1, size(a)...) + apsz::Dims = size(a.parent) + apst::Dims = strides(a.parent) + msz, mst, n = merge_adjacent_dim(apsz, apst) # Try to perform "lazy" reshape + n == ndims(a.parent) && return size_to_strides(mst, size(a)...) # Parent is stridevector like + return _reshaped_strides(size(a), 1, msz, mst, n, apsz, apst) +end + +function _reshaped_strides(::Dims{0}, reshaped::Int, msz::Int, ::Int, ::Int, ::Dims, ::Dims) + reshaped == msz && return () + throw(ArgumentError("Input is not strided.")) +end +function _reshaped_strides(sz::Dims, reshaped::Int, msz::Int, mst::Int, n::Int, apsz::Dims, apst::Dims) + st = reshaped * mst + reshaped = reshaped * sz[1] + if length(sz) > 1 && reshaped == msz && sz[2] != 1 + msz, mst, n = merge_adjacent_dim(apsz, apst, n + 1) + reshaped = 1 + end + sts = _reshaped_strides(tail(sz), reshaped, msz, mst, n, apsz, apst) + return (st, sts...) +end + +merge_adjacent_dim(::Dims{0}, ::Dims{0}) = 1, 1, 0 +merge_adjacent_dim(apsz::Dims{1}, apst::Dims{1}) = apsz[1], apst[1], 1 +function merge_adjacent_dim(apsz::Dims{N}, apst::Dims{N}, n::Int = 1) where {N} + sz, st = apsz[n], apst[n] + while n < N + szₙ, stₙ = apsz[n+1], apst[n+1] + if sz == 1 + sz, st = szₙ, stₙ + elseif stₙ == st * sz || szₙ == 1 + sz *= szₙ + else + break + end + n += 1 + end + return sz, st, n end diff --git a/stdlib/LinearAlgebra/src/blas.jl b/stdlib/LinearAlgebra/src/blas.jl index caa61cf94a52d..95eed9ceaafff 100644 --- a/stdlib/LinearAlgebra/src/blas.jl +++ b/stdlib/LinearAlgebra/src/blas.jl @@ -169,18 +169,19 @@ end # Level 1 # A help function to pick the pointer and inc for 1d like inputs. @inline function vec_pointer_stride(x::AbstractArray, stride0check = nothing) - isdense(x) && return pointer(x), 1 # simpify runtime check when possibe - ndims(x) == 1 || strides(x) == Base.size_to_strides(stride(x, 1), size(x)...) || - throw(ArgumentError("only support vector like inputs")) - st = stride(x, 1) + Base._checkcontiguous(Bool, x) && return pointer(x), 1 # simpify runtime check when possibe + st, ptr = checkedstride(x), pointer(x) isnothing(stride0check) || (st == 0 && throw(stride0check)) - ptr = st > 0 ? pointer(x) : pointer(x, lastindex(x)) + ptr += min(st, 0) * sizeof(eltype(x)) * (length(x) - 1) ptr, st end -isdense(x) = x isa DenseArray -isdense(x::Base.FastContiguousSubArray) = isdense(parent(x)) -isdense(x::Base.ReshapedArray) = isdense(parent(x)) -isdense(x::Base.ReinterpretArray) = isdense(parent(x)) +function checkedstride(x::AbstractArray) + szs::Dims = size(x) + sts::Dims = strides(x) + _, st, n = Base.merge_adjacent_dim(szs, sts) + n === ndims(x) && return st + throw(ArgumentError("only support vector like inputs")) +end ## copy """ diff --git a/stdlib/LinearAlgebra/test/blas.jl b/stdlib/LinearAlgebra/test/blas.jl index d39f7c45ba205..4967d6f18a067 100644 --- a/stdlib/LinearAlgebra/test/blas.jl +++ b/stdlib/LinearAlgebra/test/blas.jl @@ -18,9 +18,14 @@ function pack(A, uplo) end @testset "vec_pointer_stride" begin - a = zeros(4,4,4) - @test BLAS.asum(view(a,1:2:4,:,:)) == 0 # vector like + a = float(rand(1:20,4,4,4)) + @test BLAS.asum(a) == sum(a) # dense case + @test BLAS.asum(view(a,1:2:4,:,:)) == sum(view(a,1:2:4,:,:)) # vector like + @test BLAS.asum(view(a,1:3,2:2,3:3)) == sum(view(a,1:3,2:2,3:3)) + @test BLAS.asum(view(a,1:1,1:3,1:1)) == sum(view(a,1:1,1:3,1:1)) + @test BLAS.asum(view(a,1:1,1:1,1:3)) == sum(view(a,1:1,1:1,1:3)) @test_throws ArgumentError BLAS.asum(view(a,1:3:4,:,:)) # non-vector like + @test_throws ArgumentError BLAS.asum(view(a,1:2,1:1,1:3)) end Random.seed!(100) ## BLAS tests - testing the interface code to BLAS routines diff --git a/test/abstractarray.jl b/test/abstractarray.jl index a2894c139eeee..43f4223affe62 100644 --- a/test/abstractarray.jl +++ b/test/abstractarray.jl @@ -1567,22 +1567,54 @@ end @test reshape(r, :) === reshape(r, (:,)) === r end +struct FakeZeroDimArray <: AbstractArray{Int, 0} end +Base.strides(::FakeZeroDimArray) = () +Base.size(::FakeZeroDimArray) = () @testset "strides for ReshapedArray" begin # Type-based contiguous check is tested in test/compiler/inline.jl + function check_strides(A::AbstractArray) + # Make sure stride(A, i) is equivalent with strides(A)[i] (if 1 <= i <= ndims(A)) + dims = ntuple(identity, ndims(A)) + map(i -> stride(A, i), dims) == @inferred(strides(A)) || return false + # Test strides via value check. + for i in eachindex(IndexLinear(), A) + A[i] === Base.unsafe_load(pointer(A, i)) || return false + end + return true + end # General contiguous check a = view(rand(10,10), 1:10, 1:10) - @test strides(vec(a)) == (1,) + @test check_strides(vec(a)) b = view(parent(a), 1:9, 1:10) - @test_throws "Parent must be contiguous." strides(vec(b)) + @test_throws "Input is not strided." strides(vec(b)) # StridedVector parent for n in 1:3 a = view(collect(1:60n), 1:n:60n) - @test strides(reshape(a, 3, 4, 5)) == (n, 3n, 12n) - @test strides(reshape(a, 5, 6, 2)) == (n, 5n, 30n) + @test check_strides(reshape(a, 3, 4, 5)) + @test check_strides(reshape(a, 5, 6, 2)) b = view(parent(a), 60n:-n:1) - @test strides(reshape(b, 3, 4, 5)) == (-n, -3n, -12n) - @test strides(reshape(b, 5, 6, 2)) == (-n, -5n, -30n) + @test check_strides(reshape(b, 3, 4, 5)) + @test check_strides(reshape(b, 5, 6, 2)) end + # StridedVector like parent + a = randn(10, 10, 10) + b = view(a, 1:10, 1:1, 5:5) + @test check_strides(reshape(b, 2, 5)) + # Other StridedArray parent + a = view(randn(10,10), 1:9, 1:10) + @test check_strides(reshape(a,3,3,2,5)) + @test check_strides(reshape(a,3,3,5,2)) + @test check_strides(reshape(a,9,5,2)) + @test check_strides(reshape(a,3,3,10)) + @test check_strides(reshape(a,1,3,1,3,1,5,1,2)) + @test check_strides(reshape(a,3,3,5,1,1,2,1,1)) + @test_throws "Input is not strided." strides(reshape(a,3,6,5)) + @test_throws "Input is not strided." strides(reshape(a,3,2,3,5)) + @test_throws "Input is not strided." strides(reshape(a,3,5,3,2)) + @test_throws "Input is not strided." strides(reshape(a,5,3,3,2)) + # Zero dimensional parent + a = reshape(FakeZeroDimArray(),1,1,1) + @test @inferred(strides(a)) == (1, 1, 1) end @testset "stride for 0 dims array #44087" begin From 6768a5290226aaf14848322dc31b2857dce2bfba Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Tue, 5 Jul 2022 20:42:33 +0200 Subject: [PATCH 217/369] Don't inadvertently export factorization internals via at-deprecate (#45935) Accidentally introduced by #42594. (cherry picked from commit 8a776bda4c8dae8baf515cd911a0a5ff914f1516) --- stdlib/LinearAlgebra/src/bunchkaufman.jl | 2 +- stdlib/LinearAlgebra/src/cholesky.jl | 2 +- stdlib/LinearAlgebra/src/lq.jl | 2 +- stdlib/LinearAlgebra/src/lu.jl | 2 +- stdlib/LinearAlgebra/src/qr.jl | 10 +++++----- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/stdlib/LinearAlgebra/src/bunchkaufman.jl b/stdlib/LinearAlgebra/src/bunchkaufman.jl index 33da0af79793c..8de71109082d0 100644 --- a/stdlib/LinearAlgebra/src/bunchkaufman.jl +++ b/stdlib/LinearAlgebra/src/bunchkaufman.jl @@ -81,7 +81,7 @@ BunchKaufman(A::AbstractMatrix{T}, ipiv::AbstractVector{<:Integer}, uplo::Abstra BunchKaufman{T,typeof(A),typeof(ipiv)}(A, ipiv, uplo, symmetric, rook, info) # backwards-compatible constructors (remove with Julia 2.0) @deprecate(BunchKaufman(LD, ipiv, uplo, symmetric, rook, info) where {T,S}, - BunchKaufman{T,S,typeof(ipiv)}(LD, ipiv, uplo, symmetric, rook, info)) + BunchKaufman{T,S,typeof(ipiv)}(LD, ipiv, uplo, symmetric, rook, info), false) # iteration for destructuring into components Base.iterate(S::BunchKaufman) = (S.D, Val(:UL)) diff --git a/stdlib/LinearAlgebra/src/cholesky.jl b/stdlib/LinearAlgebra/src/cholesky.jl index bb831f8dca164..3e3e05757e962 100644 --- a/stdlib/LinearAlgebra/src/cholesky.jl +++ b/stdlib/LinearAlgebra/src/cholesky.jl @@ -168,7 +168,7 @@ CholeskyPivoted(A::AbstractMatrix{T}, uplo::AbstractChar, piv::AbstractVector{<: CholeskyPivoted{T,typeof(A),typeof(piv)}(A, uplo, piv, rank, tol, info) # backwards-compatible constructors (remove with Julia 2.0) @deprecate(CholeskyPivoted{T,S}(factors, uplo, piv, rank, tol, info) where {T,S<:AbstractMatrix}, - CholeskyPivoted{T,S,typeof(piv)}(factors, uplo, piv, rank, tol, info)) + CholeskyPivoted{T,S,typeof(piv)}(factors, uplo, piv, rank, tol, info), false) # iteration for destructuring into components diff --git a/stdlib/LinearAlgebra/src/lq.jl b/stdlib/LinearAlgebra/src/lq.jl index f19df799bb4a7..9a3d77800f483 100644 --- a/stdlib/LinearAlgebra/src/lq.jl +++ b/stdlib/LinearAlgebra/src/lq.jl @@ -58,7 +58,7 @@ LQ{T}(factors::AbstractMatrix, τ::AbstractVector) where {T} = LQ(convert(AbstractMatrix{T}, factors), convert(AbstractVector{T}, τ)) # backwards-compatible constructors (remove with Julia 2.0) @deprecate(LQ{T,S}(factors::AbstractMatrix{T}, τ::AbstractVector{T}) where {T,S}, - LQ{T,S,typeof(τ)}(factors, τ)) + LQ{T,S,typeof(τ)}(factors, τ), false) # iteration for destructuring into components Base.iterate(S::LQ) = (S.L, Val(:Q)) diff --git a/stdlib/LinearAlgebra/src/lu.jl b/stdlib/LinearAlgebra/src/lu.jl index eed82093af876..7a9fd97a76f5a 100644 --- a/stdlib/LinearAlgebra/src/lu.jl +++ b/stdlib/LinearAlgebra/src/lu.jl @@ -64,7 +64,7 @@ LU{T}(factors::AbstractMatrix, ipiv::AbstractVector{<:Integer}, info::Integer) w # backwards-compatible constructors (remove with Julia 2.0) @deprecate(LU{T,S}(factors::AbstractMatrix{T}, ipiv::AbstractVector{<:Integer}, info::BlasInt) where {T,S}, - LU{T,S,typeof(ipiv)}(factors, ipiv, info)) + LU{T,S,typeof(ipiv)}(factors, ipiv, info), false) # iteration for destructuring into components Base.iterate(S::LU) = (S.L, Val(:U)) diff --git a/stdlib/LinearAlgebra/src/qr.jl b/stdlib/LinearAlgebra/src/qr.jl index 4e1cc83b468f5..697e0d26e7379 100644 --- a/stdlib/LinearAlgebra/src/qr.jl +++ b/stdlib/LinearAlgebra/src/qr.jl @@ -49,7 +49,7 @@ QR{T}(factors::AbstractMatrix, τ::AbstractVector) where {T} = QR(convert(AbstractMatrix{T}, factors), convert(AbstractVector{T}, τ)) # backwards-compatible constructors (remove with Julia 2.0) @deprecate(QR{T,S}(factors::AbstractMatrix{T}, τ::AbstractVector{T}) where {T,S}, - QR{T,S,typeof(τ)}(factors, τ)) + QR{T,S,typeof(τ)}(factors, τ), false) # iteration for destructuring into components Base.iterate(S::QR) = (S.Q, Val(:R)) @@ -126,7 +126,7 @@ QRCompactWY{S}(factors::AbstractMatrix, T::AbstractMatrix) where {S} = QRCompactWY(convert(AbstractMatrix{S}, factors), convert(AbstractMatrix{S}, T)) # backwards-compatible constructors (remove with Julia 2.0) @deprecate(QRCompactWY{S,M}(factors::AbstractMatrix{S}, T::AbstractMatrix{S}) where {S,M}, - QRCompactWY{S,M,typeof(T)}(factors, T)) + QRCompactWY{S,M,typeof(T)}(factors, T), false) # iteration for destructuring into components Base.iterate(S::QRCompactWY) = (S.Q, Val(:R)) @@ -219,7 +219,7 @@ QRPivoted{T}(factors::AbstractMatrix, τ::AbstractVector, # backwards-compatible constructors (remove with Julia 2.0) @deprecate(QRPivoted{T,S}(factors::AbstractMatrix{T}, τ::AbstractVector{T}, jpvt::AbstractVector{<:Integer}) where {T,S}, - QRPivoted{T,S,typeof(τ),typeof(jpvt)}(factors, τ, jpvt)) + QRPivoted{T,S,typeof(τ),typeof(jpvt)}(factors, τ, jpvt), false) # iteration for destructuring into components Base.iterate(S::QRPivoted) = (S.Q, Val(:R)) @@ -541,7 +541,7 @@ QRPackedQ{T}(factors::AbstractMatrix, τ::AbstractVector) where {T} = QRPackedQ(convert(AbstractMatrix{T}, factors), convert(AbstractVector{T}, τ)) # backwards-compatible constructors (remove with Julia 2.0) @deprecate(QRPackedQ{T,S}(factors::AbstractMatrix{T}, τ::AbstractVector{T}) where {T,S}, - QRPackedQ{T,S,typeof(τ)}(factors, τ)) + QRPackedQ{T,S,typeof(τ)}(factors, τ), false) """ QRCompactWYQ <: AbstractMatrix @@ -564,7 +564,7 @@ QRCompactWYQ{S}(factors::AbstractMatrix, T::AbstractMatrix) where {S} = QRCompactWYQ(convert(AbstractMatrix{S}, factors), convert(AbstractMatrix{S}, T)) # backwards-compatible constructors (remove with Julia 2.0) @deprecate(QRCompactWYQ{S,M}(factors::AbstractMatrix{S}, T::AbstractMatrix{S}) where {S,M}, - QRCompactWYQ{S,M,typeof(T)}(factors, T)) + QRCompactWYQ{S,M,typeof(T)}(factors, T), false) QRPackedQ{T}(Q::QRPackedQ) where {T} = QRPackedQ(convert(AbstractMatrix{T}, Q.factors), convert(Vector{T}, Q.τ)) AbstractMatrix{T}(Q::QRPackedQ{T}) where {T} = Q From 3de26def2024e6420094ba73956fe74e8271cb68 Mon Sep 17 00:00:00 2001 From: Matt Bauman Date: Tue, 5 Jul 2022 09:27:03 -0400 Subject: [PATCH 218/369] fix #45903, in place broadcast into a bit-masked bitmatrix (#45904) as reported in https://discourse.julialang.org/t/indexed-assignment-with-logical-indices-subarray-jl-error/83646 (cherry picked from commit 89bdcce76b01ae0327a7e575290a0cbd035c1950) --- base/broadcast.jl | 2 +- test/broadcast.jl | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/base/broadcast.jl b/base/broadcast.jl index c9694d6645099..e381a225f66c5 100644 --- a/base/broadcast.jl +++ b/base/broadcast.jl @@ -1172,7 +1172,7 @@ Base.@propagate_inbounds dotview(B::BitArray, i::BitArray) = BitMaskedBitArray(B Base.show(io::IO, B::BitMaskedBitArray) = foreach(arg->show(io, arg), (typeof(B), (B.parent, B.mask))) # Override materialize! to prevent the BitMaskedBitArray from escaping to an overrideable method @inline materialize!(B::BitMaskedBitArray, bc::Broadcasted{<:Any,<:Any,typeof(identity),Tuple{Bool}}) = fill!(B, bc.args[1]) -@inline materialize!(B::BitMaskedBitArray, bc::Broadcasted{<:Any}) = materialize!(SubArray(B.parent, to_indices(B.parent, (B.mask,))), bc) +@inline materialize!(B::BitMaskedBitArray, bc::Broadcasted{<:Any}) = materialize!(@inbounds(view(B.parent, B.mask)), bc) function Base.fill!(B::BitMaskedBitArray, b::Bool) Bc = B.parent.chunks Ic = B.mask.chunks diff --git a/test/broadcast.jl b/test/broadcast.jl index 5cddd0cb174f8..53f300e40292e 100644 --- a/test/broadcast.jl +++ b/test/broadcast.jl @@ -1079,3 +1079,11 @@ end y = randn(2) @inferred(test(x, y)) == [0, 0] end + +@testset "issue #45903, in place broadcast into a bit-masked bitmatrix" begin + A = BitArray(ones(3,3)) + pos = randn(3,3) + A[pos .< 0] .= false + @test all(>=(0), pos[A]) + @test count(A) == count(>=(0), pos) +end From b42dd12218c518502b68665f5b968bdf672422ea Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Tue, 24 May 2022 14:03:48 +0200 Subject: [PATCH 219/369] llvm: add NDEBUG when assertion mode is off `llvm-config --cxxflags` unfortunately does not set `-DNDEBUG`, which Julia needs to set correctly when including LLVM header files. (cherry picked from commit c9c2082a162e916d0f86241453b30473dcd63044) --- src/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Makefile b/src/Makefile index e0ab9568fd242..57dd4482a1a34 100644 --- a/src/Makefile +++ b/src/Makefile @@ -115,6 +115,11 @@ PUBLIC_HEADER_TARGETS := $(addprefix $(build_includedir)/julia/,$(notdir $(PUBLI LLVM_LDFLAGS := $(shell $(LLVM_CONFIG_HOST) --ldflags) LLVM_CXXFLAGS := $(shell $(LLVM_CONFIG_HOST) --cxxflags) +# llvm-config --cxxflags does not return -DNDEBUG +ifeq ($(shell $(LLVM_CONFIG_HOST) --assertion-mode),OFF) +LLVM_CXXFLAGS += -DNDEBUG +endif + ifeq ($(JULIACODEGEN),LLVM) ifneq ($(USE_SYSTEM_LLVM),0) CG_LLVMLINK += $(LLVM_LDFLAGS) $(shell $(LLVM_CONFIG_HOST) --libs --system-libs) From 0e51af9198b7843438b25c651a95905f184e57a0 Mon Sep 17 00:00:00 2001 From: Jishnu Bhattacharya Date: Fri, 1 Jul 2022 01:03:03 +0530 Subject: [PATCH 220/369] Fix integer overflow in `reverse!` (#45871) (cherry picked from commit 3c049196070150bdb1135149ea6f52b61ba4f0c6) --- base/array.jl | 28 +++++++++++++++++----------- base/sort.jl | 7 +------ test/offsetarray.jl | 17 +++++++++++++++++ 3 files changed, 35 insertions(+), 17 deletions(-) diff --git a/base/array.jl b/base/array.jl index b8ad7e137f25e..baef032f96b3f 100644 --- a/base/array.jl +++ b/base/array.jl @@ -1833,6 +1833,11 @@ function reverseind(a::AbstractVector, i::Integer) first(li) + last(li) - i end +# This implementation of `midpoint` is performance-optimized but safe +# only if `lo <= hi`. +midpoint(lo::T, hi::T) where T<:Integer = lo + ((hi - lo) >>> 0x01) +midpoint(lo::Integer, hi::Integer) = midpoint(promote(lo, hi)...) + """ reverse!(v [, start=1 [, stop=length(v) ]]) -> v @@ -1861,17 +1866,18 @@ julia> A """ function reverse!(v::AbstractVector, start::Integer, stop::Integer=lastindex(v)) s, n = Int(start), Int(stop) - liv = LinearIndices(v) - if n <= s # empty case; ok - elseif !(first(liv) ≤ s ≤ last(liv)) - throw(BoundsError(v, s)) - elseif !(first(liv) ≤ n ≤ last(liv)) - throw(BoundsError(v, n)) - end - r = n - @inbounds for i in s:div(s+n-1, 2) - v[i], v[r] = v[r], v[i] - r -= 1 + if n > s # non-empty and non-trivial + liv = LinearIndices(v) + if !(first(liv) ≤ s ≤ last(liv)) + throw(BoundsError(v, s)) + elseif !(first(liv) ≤ n ≤ last(liv)) + throw(BoundsError(v, n)) + end + r = n + @inbounds for i in s:midpoint(s, n-1) + v[i], v[r] = v[r], v[i] + r -= 1 + end end return v end diff --git a/base/sort.jl b/base/sort.jl index d26e9a4b09332..53ebefd1840ab 100644 --- a/base/sort.jl +++ b/base/sort.jl @@ -11,7 +11,7 @@ using .Base: copymutable, LinearIndices, length, (:), AbstractMatrix, AbstractUnitRange, isless, identity, eltype, >, <, <=, >=, |, +, -, *, !, extrema, sub_with_overflow, add_with_overflow, oneunit, div, getindex, setindex!, length, resize!, fill, Missing, require_one_based_indexing, keytype, - UnitRange, max, min + UnitRange, max, min, midpoint using .Base: >>>, !== @@ -166,11 +166,6 @@ same thing as `partialsort!` but leaving `v` unmodified. partialsort(v::AbstractVector, k::Union{Integer,OrdinalRange}; kws...) = partialsort!(copymutable(v), k; kws...) -# This implementation of `midpoint` is performance-optimized but safe -# only if `lo <= hi`. -midpoint(lo::T, hi::T) where T<:Integer = lo + ((hi - lo) >>> 0x01) -midpoint(lo::Integer, hi::Integer) = midpoint(promote(lo, hi)...) - # reference on sorted binary search: # http://www.tbray.org/ongoing/When/200x/2003/03/22/Binary diff --git a/test/offsetarray.jl b/test/offsetarray.jl index 7621e14013627..b6aab384f2cd4 100644 --- a/test/offsetarray.jl +++ b/test/offsetarray.jl @@ -415,6 +415,23 @@ rv = reverse(v) cv = copy(v) @test reverse!(cv) == rv +@testset "reverse! (issue #45870)" begin + @testset for n in [4,5] + offset = typemax(Int)-n + vo = OffsetArray([1:n;], offset) + vo2 = OffsetArray([1:n;], offset) + @test reverse!(vo) == OffsetArray(n:-1:1, offset) + @test reverse!(vo) == vo2 + @test_throws BoundsError reverse!(vo, firstindex(vo)-1, firstindex(vo)) + @test reverse!(vo, firstindex(vo), firstindex(vo)-1) == vo2 + @test reverse!(vo, firstindex(vo), firstindex(vo)) == vo2 + @test reverse!(vo, lastindex(vo), lastindex(vo)) == vo2 + @test reverse!(vo, lastindex(vo), lastindex(vo)+1) == vo2 # overflow in stop + @test reverse!(vo, firstindex(vo)+1) == OffsetArray([1;n:-1:2], offset) + @test reverse!(vo2, firstindex(vo)+1, lastindex(vo)-1) == OffsetArray([1;n-1:-1:2;n], offset) + end +end + A = OffsetArray(rand(4,4), (-3,5)) @test lastindex(A) == 16 @test lastindex(A, 1) == 1 From e3c2c250eb4172f443d8798d064fc99c257755e9 Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Wed, 6 Jul 2022 08:55:23 +0200 Subject: [PATCH 221/369] Fix doctests after factorization internals unexport. (#45943) (cherry picked from commit c5aa255280cba6ae389296c9efd4e80b908c4518) --- stdlib/LinearAlgebra/src/qr.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stdlib/LinearAlgebra/src/qr.jl b/stdlib/LinearAlgebra/src/qr.jl index 697e0d26e7379..1d6fb0ecda0bc 100644 --- a/stdlib/LinearAlgebra/src/qr.jl +++ b/stdlib/LinearAlgebra/src/qr.jl @@ -314,9 +314,9 @@ julia> a = [1. 2.; 3. 4.] 3.0 4.0 julia> qr!(a) -QRCompactWY{Float64, Matrix{Float64}, Matrix{Float64}} +LinearAlgebra.QRCompactWY{Float64, Matrix{Float64}, Matrix{Float64}} Q factor: -2×2 QRCompactWYQ{Float64, Matrix{Float64}, Matrix{Float64}}: +2×2 LinearAlgebra.QRCompactWYQ{Float64, Matrix{Float64}, Matrix{Float64}}: -0.316228 -0.948683 -0.948683 0.316228 R factor: @@ -401,9 +401,9 @@ julia> A = [3.0 -6.0; 4.0 -8.0; 0.0 1.0] 0.0 1.0 julia> F = qr(A) -QRCompactWY{Float64, Matrix{Float64}, Matrix{Float64}} +LinearAlgebra.QRCompactWY{Float64, Matrix{Float64}, Matrix{Float64}} Q factor: -3×3 QRCompactWYQ{Float64, Matrix{Float64}, Matrix{Float64}}: +3×3 LinearAlgebra.QRCompactWYQ{Float64, Matrix{Float64}, Matrix{Float64}}: -0.6 0.0 0.8 -0.8 0.0 -0.6 0.0 -1.0 0.0 From c1181032c2262b631e9e99d929b0bc46b65ee77e Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Thu, 7 Jul 2022 06:29:09 -0400 Subject: [PATCH 222/369] fix freeze on `@threads` loop exit (#45899) Closes #45626, hopefully. (cherry picked from commit f7e0c7eeff59a920d4b836c2af832e6622c84157) --- src/jl_uv.c | 1 + src/partr.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/jl_uv.c b/src/jl_uv.c index d2a78c26bbc72..726290605ee32 100644 --- a/src/jl_uv.c +++ b/src/jl_uv.c @@ -60,6 +60,7 @@ void JL_UV_LOCK(void) } else { jl_atomic_fetch_add_relaxed(&jl_uv_n_waiters, 1); + jl_fence(); // [^store_buffering_2] jl_wake_libuv(); JL_LOCK(&jl_uv_mutex); jl_atomic_fetch_add_relaxed(&jl_uv_n_waiters, -1); diff --git a/src/partr.c b/src/partr.c index c8cc3245ebb4c..ddba203b92b1d 100644 --- a/src/partr.c +++ b/src/partr.c @@ -40,7 +40,14 @@ static const int16_t sleeping = 1; // * 2a: `multiq_insert` // * 2b: `jl_atomic_load_relaxed(&ptls->sleep_check_state)` in `jl_wakeup_thread` returns `not_sleeping` // i.e., the dequeuer misses the enqueue and enqueuer misses the sleep state transition. - +// [^store_buffering_2]: and also +// * Enqueuer: +// * 1a: `jl_atomic_store_relaxed(jl_uv_n_waiters, 1)` in `JL_UV_LOCK` +// * 1b: "cheap read" of `handle->pending` in `uv_async_send` (via `JL_UV_LOCK`) loads `0` +// * Dequeuer: +// * 2a: store `2` to `handle->pending` in `uv_async_send` (via `JL_UV_LOCK` in `jl_task_get_next`) +// * 2b: `jl_atomic_load_relaxed(jl_uv_n_waiters)` in `jl_task_get_next` returns `0` +// i.e., the dequeuer misses the `n_waiters` is set and enqueuer misses the `uv_stop` flag (in `signal_async`) transition to cleared JULIA_DEBUG_SLEEPWAKE( uint64_t wakeup_enter; @@ -462,7 +469,7 @@ static int may_sleep(jl_ptls_t ptls) JL_NOTSAFEPOINT // by the thread itself. As a result, if this returns false, it will // continue returning false. If it returns true, we know the total // modification order of the fences. - jl_fence(); // [^store_buffering_1] + jl_fence(); // [^store_buffering_1] [^store_buffering_2] return jl_atomic_load_relaxed(&ptls->sleep_check_state) == sleeping; } From ab36468f5bacf52d4a82bcac13146946a753cc47 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Wed, 6 Jul 2022 08:34:07 -0400 Subject: [PATCH 223/369] union-types: use insertion (stable) sort instead of qsort (#45896) Different platforms implement qsort differently, leading to platform-specific errors. This is a quick port of the ml_matches algorithm for use instead. For small unions (almost always), this should also be slightly faster, though insignificant. Refs #45874 (cherry picked from commit 8cc544543d7bb978451f9076242bbad41d5184cb) --- base/sort.jl | 10 +++++----- src/jltypes.c | 35 +++++++++++++++++++++++++---------- 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/base/sort.jl b/base/sort.jl index 53ebefd1840ab..307a515dad050 100644 --- a/base/sort.jl +++ b/base/sort.jl @@ -500,12 +500,12 @@ function sort!(v::AbstractVector, lo::Integer, hi::Integer, ::InsertionSortAlg, j = i x = v[i] while j > lo - if lt(o, x, v[j-1]) - v[j] = v[j-1] - j -= 1 - continue + y = v[j-1] + if !lt(o, x, y) + break end - break + v[j] = y + j -= 1 end v[j] = x end diff --git a/src/jltypes.c b/src/jltypes.c index 72a9d257f140b..ef09f6f457fd1 100644 --- a/src/jltypes.c +++ b/src/jltypes.c @@ -420,10 +420,8 @@ static int datatype_name_cmp(jl_value_t *a, jl_value_t *b) JL_NOTSAFEPOINT // sort singletons first, then DataTypes, then UnionAlls, // ties broken alphabetically including module name & type parameters -static int union_sort_cmp(const void *ap, const void *bp) JL_NOTSAFEPOINT +static int union_sort_cmp(jl_value_t *a, jl_value_t *b) JL_NOTSAFEPOINT { - jl_value_t *a = *(jl_value_t**)ap; - jl_value_t *b = *(jl_value_t**)bp; if (a == NULL) return b == NULL ? 0 : 1; if (b == NULL) @@ -458,16 +456,33 @@ static int union_sort_cmp(const void *ap, const void *bp) JL_NOTSAFEPOINT } } +static void isort_union(jl_value_t **a, size_t len) JL_NOTSAFEPOINT +{ + size_t i, j; + for (i = 1; i < len; i++) { + jl_value_t *x = a[i]; + for (j = i; j > 0; j--) { + jl_value_t *y = a[j - 1]; + if (!(union_sort_cmp(x, y) < 0)) + break; + a[j] = y; + } + a[j] = x; + } +} + JL_DLLEXPORT jl_value_t *jl_type_union(jl_value_t **ts, size_t n) { - if (n == 0) return (jl_value_t*)jl_bottom_type; + if (n == 0) + return (jl_value_t*)jl_bottom_type; size_t i; - for(i=0; i < n; i++) { + for (i = 0; i < n; i++) { jl_value_t *pi = ts[i]; if (!(jl_is_type(pi) || jl_is_typevar(pi))) jl_type_error("Union", (jl_value_t*)jl_type_type, pi); } - if (n == 1) return ts[0]; + if (n == 1) + return ts[0]; size_t nt = count_union_components(ts, n); jl_value_t **temp; @@ -476,9 +491,9 @@ JL_DLLEXPORT jl_value_t *jl_type_union(jl_value_t **ts, size_t n) flatten_type_union(ts, n, temp, &count); assert(count == nt); size_t j; - for(i=0; i < nt; i++) { - int has_free = temp[i]!=NULL && jl_has_free_typevars(temp[i]); - for(j=0; j < nt; j++) { + for (i = 0; i < nt; i++) { + int has_free = temp[i] != NULL && jl_has_free_typevars(temp[i]); + for (j = 0; j < nt; j++) { if (j != i && temp[i] && temp[j]) { if (temp[i] == jl_bottom_type || temp[j] == (jl_value_t*)jl_any_type || @@ -490,7 +505,7 @@ JL_DLLEXPORT jl_value_t *jl_type_union(jl_value_t **ts, size_t n) } } } - qsort(temp, nt, sizeof(jl_value_t*), union_sort_cmp); + isort_union(temp, nt); jl_value_t **ptu = &temp[nt]; *ptu = jl_bottom_type; int k; From d4abcaa4aeb3b6e376419d6df97bbbddc90b0353 Mon Sep 17 00:00:00 2001 From: Daniel Karrasch Date: Thu, 7 Jul 2022 10:37:40 +0200 Subject: [PATCH 224/369] Complete size checks in `BLAS.[sy/he]mm!` (#45605) (cherry picked from commit da13d78f9f689e7d761e3c149462c0a2b0dad54f) --- stdlib/LinearAlgebra/src/blas.jl | 52 +++++++++++++++++++++----- stdlib/LinearAlgebra/test/blas.jl | 8 ++++ stdlib/LinearAlgebra/test/symmetric.jl | 6 +++ 3 files changed, 56 insertions(+), 10 deletions(-) diff --git a/stdlib/LinearAlgebra/src/blas.jl b/stdlib/LinearAlgebra/src/blas.jl index 95eed9ceaafff..35d022e84bd17 100644 --- a/stdlib/LinearAlgebra/src/blas.jl +++ b/stdlib/LinearAlgebra/src/blas.jl @@ -1566,11 +1566,27 @@ for (mfname, elty) in ((:dsymm_,:Float64), require_one_based_indexing(A, B, C) m, n = size(C) j = checksquare(A) - if j != (side == 'L' ? m : n) - throw(DimensionMismatch(lazy"A has size $(size(A)), C has size ($m,$n)")) - end - if size(B,2) != n - throw(DimensionMismatch(lazy"B has second dimension $(size(B,2)) but needs to match second dimension of C, $n")) + M, N = size(B) + if side == 'L' + if j != m + throw(DimensionMismatch(lazy"A has first dimension $j but needs to match first dimension of C, $m")) + end + if N != n + throw(DimensionMismatch(lazy"B has second dimension $N but needs to match second dimension of C, $n")) + end + if j != M + throw(DimensionMismatch(lazy"A has second dimension $j but needs to match first dimension of B, $M")) + end + else + if j != n + throw(DimensionMismatch(lazy"B has second dimension $j but needs to match second dimension of C, $n")) + end + if N != j + throw(DimensionMismatch(lazy"A has second dimension $N but needs to match first dimension of B, $j")) + end + if M != m + throw(DimensionMismatch(lazy"A has first dimension $M but needs to match first dimension of C, $m")) + end end chkstride1(A) chkstride1(B) @@ -1640,11 +1656,27 @@ for (mfname, elty) in ((:zhemm_,:ComplexF64), require_one_based_indexing(A, B, C) m, n = size(C) j = checksquare(A) - if j != (side == 'L' ? m : n) - throw(DimensionMismatch(lazy"A has size $(size(A)), C has size ($m,$n)")) - end - if size(B,2) != n - throw(DimensionMismatch(lazy"B has second dimension $(size(B,2)) but needs to match second dimension of C, $n")) + M, N = size(B) + if side == 'L' + if j != m + throw(DimensionMismatch(lazy"A has first dimension $j but needs to match first dimension of C, $m")) + end + if N != n + throw(DimensionMismatch(lazy"B has second dimension $N but needs to match second dimension of C, $n")) + end + if j != M + throw(DimensionMismatch(lazy"A has second dimension $j but needs to match first dimension of B, $M")) + end + else + if j != n + throw(DimensionMismatch(lazy"B has second dimension $j but needs to match second dimension of C, $n")) + end + if N != j + throw(DimensionMismatch(lazy"A has second dimension $N but needs to match first dimension of B, $j")) + end + if M != m + throw(DimensionMismatch(lazy"A has first dimension $M but needs to match first dimension of C, $m")) + end end chkstride1(A) chkstride1(B) diff --git a/stdlib/LinearAlgebra/test/blas.jl b/stdlib/LinearAlgebra/test/blas.jl index 4967d6f18a067..4c2e70b6f5042 100644 --- a/stdlib/LinearAlgebra/test/blas.jl +++ b/stdlib/LinearAlgebra/test/blas.jl @@ -227,11 +227,19 @@ Random.seed!(100) @test_throws DimensionMismatch BLAS.symm('R','U',Cmn,Cnn) @test_throws DimensionMismatch BLAS.symm!('L','U',one(elty),Asymm,Cnn,one(elty),Cmn) @test_throws DimensionMismatch BLAS.symm!('L','U',one(elty),Asymm,Cnn,one(elty),Cnm) + @test_throws DimensionMismatch BLAS.symm!('L','U',one(elty),Asymm,Cmn,one(elty),Cnn) + @test_throws DimensionMismatch BLAS.symm!('R','U',one(elty),Asymm,Cnm,one(elty),Cmn) + @test_throws DimensionMismatch BLAS.symm!('R','U',one(elty),Asymm,Cnn,one(elty),Cnm) + @test_throws DimensionMismatch BLAS.symm!('R','U',one(elty),Asymm,Cmn,one(elty),Cnn) if elty <: BlasComplex @test_throws DimensionMismatch BLAS.hemm('L','U',Cnm,Cnn) @test_throws DimensionMismatch BLAS.hemm('R','U',Cmn,Cnn) @test_throws DimensionMismatch BLAS.hemm!('L','U',one(elty),Aherm,Cnn,one(elty),Cmn) @test_throws DimensionMismatch BLAS.hemm!('L','U',one(elty),Aherm,Cnn,one(elty),Cnm) + @test_throws DimensionMismatch BLAS.hemm!('L','U',one(elty),Aherm,Cmn,one(elty),Cnn) + @test_throws DimensionMismatch BLAS.hemm!('R','U',one(elty),Aherm,Cnm,one(elty),Cmn) + @test_throws DimensionMismatch BLAS.hemm!('R','U',one(elty),Aherm,Cnn,one(elty),Cnm) + @test_throws DimensionMismatch BLAS.hemm!('R','U',one(elty),Aherm,Cmn,one(elty),Cnn) end end end diff --git a/stdlib/LinearAlgebra/test/symmetric.jl b/stdlib/LinearAlgebra/test/symmetric.jl index 47a36df5e7883..60b7f642b3b37 100644 --- a/stdlib/LinearAlgebra/test/symmetric.jl +++ b/stdlib/LinearAlgebra/test/symmetric.jl @@ -352,6 +352,9 @@ end C = zeros(eltya,n,n) @test Hermitian(aherm) * a ≈ aherm * a @test a * Hermitian(aherm) ≈ a * aherm + # rectangular multiplication + @test [a; a] * Hermitian(aherm) ≈ [a; a] * aherm + @test Hermitian(aherm) * [a a] ≈ aherm * [a a] @test Hermitian(aherm) * Hermitian(aherm) ≈ aherm*aherm @test_throws DimensionMismatch Hermitian(aherm) * Vector{eltya}(undef, n+1) LinearAlgebra.mul!(C,a,Hermitian(aherm)) @@ -360,6 +363,9 @@ end @test Symmetric(asym) * Symmetric(asym) ≈ asym*asym @test Symmetric(asym) * a ≈ asym * a @test a * Symmetric(asym) ≈ a * asym + # rectangular multiplication + @test Symmetric(asym) * [a a] ≈ asym * [a a] + @test [a; a] * Symmetric(asym) ≈ [a; a] * asym @test_throws DimensionMismatch Symmetric(asym) * Vector{eltya}(undef, n+1) LinearAlgebra.mul!(C,a,Symmetric(asym)) @test C ≈ a*asym From ce5d15e6f53aba5eeab4543efc6ff2b0283ce14c Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Fri, 8 Jul 2022 15:14:14 +0200 Subject: [PATCH 225/369] set VERSION to 1.8.0-rc2 (#45963) --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 5a77cc6287239..e0645eb76f9ae 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.8.0-rc1 +1.8.0-rc2 From 5c5d54aa3b715e2a73e87beec1a2d3bdc8a60604 Mon Sep 17 00:00:00 2001 From: FX Coudert Date: Sat, 21 May 2022 20:04:59 +0200 Subject: [PATCH 226/369] Update nghttp2 to 1.47.0 (#45408) (cherry picked from commit 69f10f8e649e725203d5202792dac9e3a3f1de3f) --- deps/Versions.make | 2 +- deps/checksums/nghttp2 | 68 ++++++++++++++--------------- deps/nghttp2.mk | 1 - stdlib/nghttp2_jll/Project.toml | 2 +- stdlib/nghttp2_jll/test/runtests.jl | 2 +- 5 files changed, 37 insertions(+), 38 deletions(-) diff --git a/deps/Versions.make b/deps/Versions.make index 0405de70e5bd8..09ba2b4e3e8a9 100644 --- a/deps/Versions.make +++ b/deps/Versions.make @@ -66,7 +66,7 @@ MPFR_VER := 4.1.0 MPFR_JLL_NAME := MPFR # nghttp2 -NGHTTP2_VER := 1.41.0 +NGHTTP2_VER := 1.47.0 NGHTTP2_JLL_NAME := nghttp2 # Objconv (we don't ship this, so no need for a fake JLL; therefore we specify the JLL_VER here) diff --git a/deps/checksums/nghttp2 b/deps/checksums/nghttp2 index 27f120546f34b..5aadf03f2bea7 100644 --- a/deps/checksums/nghttp2 +++ b/deps/checksums/nghttp2 @@ -1,34 +1,34 @@ -nghttp2-1.41.0.tar.bz2/md5/523d330f62560a2fe4268beb84920890 -nghttp2-1.41.0.tar.bz2/sha512/61de1bbbe91230ebe9f7a3ef4d3874391f8180d93c8ff1e94a58035e4061d2f9057e5ba2b90f6fe86f6aefc7244795385d176a862019c47a3aad974b60caa143 -nghttp2.v1.41.0+1.aarch64-apple-darwin.tar.gz/md5/727cf8227b41aff95c91b9db31fbe303 -nghttp2.v1.41.0+1.aarch64-apple-darwin.tar.gz/sha512/86067f3d04bc1b1cbaafd044ee6eb6c306ab27ba1828290412e62bbd2637d1be90cba437c8c39b853df0b11776d90a6525c9d0d9750abd9462003cb319e38cb6 -nghttp2.v1.41.0+1.aarch64-linux-gnu.tar.gz/md5/9a1c71ba214a363072002ea4856c9f93 -nghttp2.v1.41.0+1.aarch64-linux-gnu.tar.gz/sha512/16a18a1d2e3486243cc419362f195e29e0bd64344a2b7167da6b10fe6efff1a6c7bd07806915358aa3ec5dd2590e9bd02024df1e3723432ba3dc833ee52f292f -nghttp2.v1.41.0+1.aarch64-linux-musl.tar.gz/md5/1ed0166911be5703d0d6377b666e63c6 -nghttp2.v1.41.0+1.aarch64-linux-musl.tar.gz/sha512/632b6ea76e89b60d2c4f0379a88b0a33468dafcaa3605b69b3a5f57546d5036e7003341ea14060ecc417e659b74130597278c71cc34052ff7188472e23bf7092 -nghttp2.v1.41.0+1.armv6l-linux-gnueabihf.tar.gz/md5/288b56ea29c570c01cd52683085d1ff4 -nghttp2.v1.41.0+1.armv6l-linux-gnueabihf.tar.gz/sha512/91bd764317b72df51289e67616771d5299ee32ad6222993555abc9bf4af5ce1920bed6a9bb2f03145c41bec557460a357d79f7716774f6b730629b225ec5b2df -nghttp2.v1.41.0+1.armv6l-linux-musleabihf.tar.gz/md5/acba1517897a8e43aa3707d9d02c03a2 -nghttp2.v1.41.0+1.armv6l-linux-musleabihf.tar.gz/sha512/908db4e29550c277acffe2043b97a0e7946b45f9324b93b2c63fbe83bbd9edd5e899a6665925d1bb85c5662f301de7612829cc36e8edccc3de57ac54911d7357 -nghttp2.v1.41.0+1.armv7l-linux-gnueabihf.tar.gz/md5/2b0fb368ffecdd5f527eebca88925092 -nghttp2.v1.41.0+1.armv7l-linux-gnueabihf.tar.gz/sha512/8ddd95df9896856f77be0af35fa9cb3c276a6cab2528553c08a2ba68014a5320d6ba7bd370bde362ba48a2fe097f6d5c348f5d8b20e1762010a9bb63c7bec502 -nghttp2.v1.41.0+1.armv7l-linux-musleabihf.tar.gz/md5/30baa03195b0560adf729f1aefd0d961 -nghttp2.v1.41.0+1.armv7l-linux-musleabihf.tar.gz/sha512/c93d9db188ccacb3da80a51c84799c91d686563cb055e2528094600be2565f608ceb57db9570f36a1933754a45e8f007e3c2a8de13de332effe0e5879814e5ee -nghttp2.v1.41.0+1.i686-linux-gnu.tar.gz/md5/5bc7fbde702b477d28c1843c6ff053cc -nghttp2.v1.41.0+1.i686-linux-gnu.tar.gz/sha512/2f9317172eb8489fab668cdef156462e1f0b71d365731b358c0f246c873e0ad7dc94b2b27d165f54c57ce6caba2c3fe89b9ce2555e235aaab7b05adbcf6a33ea -nghttp2.v1.41.0+1.i686-linux-musl.tar.gz/md5/75a8870627e4db65706df7af92163492 -nghttp2.v1.41.0+1.i686-linux-musl.tar.gz/sha512/f1ea9b7e66d01de30a92da34fcc72cbd9c988ed768f8d8099d68f031ccc33d9f965460289a183ae1f9f507580d25020366a312b61fbbcd3b2f06ee697f8cd133 -nghttp2.v1.41.0+1.i686-w64-mingw32.tar.gz/md5/258224cfa14b53e7af79caa1dea2eb2c -nghttp2.v1.41.0+1.i686-w64-mingw32.tar.gz/sha512/69a783d09e9258df81ad6121906f8102ad2959c623efca9fff7adf062c947d6e9a44fdab27cdd49bb08519b4a4d636bc529715771d276a69c6e3604237712056 -nghttp2.v1.41.0+1.powerpc64le-linux-gnu.tar.gz/md5/a358200b27f3229fc888d3e1763cca0a -nghttp2.v1.41.0+1.powerpc64le-linux-gnu.tar.gz/sha512/cc02237e70e1cafea3e59e9929a4bd86a9b4dbd2928c812b3e654dcc91b87077d91284e7006799186b324ca5f8822d09e3bce1d4a69cea18f42d4e08f6aa5f3b -nghttp2.v1.41.0+1.x86_64-apple-darwin.tar.gz/md5/fe76513593627368edcb95783b830ed1 -nghttp2.v1.41.0+1.x86_64-apple-darwin.tar.gz/sha512/fbabf532cc32277394b66cbd1c011c4d7a65380c2759b1cf57e57599c3c8752fbd2d86b42677159005d6430025b4fde5f623d814629215449fd934d1328589dc -nghttp2.v1.41.0+1.x86_64-linux-gnu.tar.gz/md5/ca57b30aa01b0a8f69babed6398bad9a -nghttp2.v1.41.0+1.x86_64-linux-gnu.tar.gz/sha512/3fa5a6806bf6eeb4305038b2c6c381e815988b1a37bcacb4510c229f9186e280aa98fd023495b3fd77c4f16314f81b7233778cd81cc3e3d64f503dac3e1ad70f -nghttp2.v1.41.0+1.x86_64-linux-musl.tar.gz/md5/043dbfb6df2778a1b0ea57c70b982974 -nghttp2.v1.41.0+1.x86_64-linux-musl.tar.gz/sha512/70d7ad982fe3b9de49cc37758588c02e78e306ab3ac84682e130e2ab4541814790ec3e201daa96cdd900ebc8fc0a7c1ff6e02e796a65f092c6c24b56c1214b3b -nghttp2.v1.41.0+1.x86_64-unknown-freebsd.tar.gz/md5/13a4e74ffd31852b885e44f2f0fed516 -nghttp2.v1.41.0+1.x86_64-unknown-freebsd.tar.gz/sha512/c81b76e9cb2920a0cc554fb9ff23f0cf20f3f9601276fcc07d1ffe0df608cbcc2513b31273f839eed3798cd2183fe9ad0580c833707526a4b8cfddbbc7b53006 -nghttp2.v1.41.0+1.x86_64-w64-mingw32.tar.gz/md5/635cc7c17cbe5de2d7e320c0d920e61c -nghttp2.v1.41.0+1.x86_64-w64-mingw32.tar.gz/sha512/e6e0543b2835eab2f4774e027e921acfd1d2a9229876d6acf5c64dc61f7dc73c078d6489910b3179aee4ccb95aa7281b1502170aa6256e41ab1516982d0da230 +nghttp2-1.47.0.tar.bz2/md5/2bca98caef4b5c27d5bdc4732f36a5d6 +nghttp2-1.47.0.tar.bz2/sha512/4dbd0fe10f5c68d363ee0fff2aceb97f58a755a276796f16b078cd3bec3a17cd5e0dadf1e5027347d3342daa3572332b14df230a4d9675a9b57fff67f8f9e5a3 +nghttp2.v1.47.0+0.aarch64-apple-darwin.tar.gz/md5/76abe33c6e81346a133c3e26593db1b2 +nghttp2.v1.47.0+0.aarch64-apple-darwin.tar.gz/sha512/72a1302134ab4715f4c0b8f702a566498d4595aa7a3fd762e43d7e0ca5987506a9b1dc53318763595ad652d8c4a633c3c5e0500a8f4e3007cb6cf9e30341d9ff +nghttp2.v1.47.0+0.aarch64-linux-gnu.tar.gz/md5/1e5ad3ad31290e017c930c2d1dbda38d +nghttp2.v1.47.0+0.aarch64-linux-gnu.tar.gz/sha512/c8a2543f079751bcaf7165661f5f4053fd1b733cde0f82078736c898503c796fdd7ce587f0da2d1bb3d35a74a644fed6e8cc30a3520e577593d19700e822cc55 +nghttp2.v1.47.0+0.aarch64-linux-musl.tar.gz/md5/7079c203ec5e6fcf45d01bfa1ca0b1b8 +nghttp2.v1.47.0+0.aarch64-linux-musl.tar.gz/sha512/152f34f1e9a5f741d69d62587762a96fd290ecb41ec8eeff46fae39b5e606ff054755b88abe3bcaa07db640526fc12546769da4a3761a18240eb3d2699de8886 +nghttp2.v1.47.0+0.armv6l-linux-gnueabihf.tar.gz/md5/918f3e549998e34f2aa292a2ff7945be +nghttp2.v1.47.0+0.armv6l-linux-gnueabihf.tar.gz/sha512/545c5674a6492dbd5f109303383b920b0b011e37e8a4abfb329b22cab50a6a977d9f74aac6f4aaa833064fbaae4b5ebc019e83d2edb8b4af2515f36f4530937f +nghttp2.v1.47.0+0.armv6l-linux-musleabihf.tar.gz/md5/1345980d4822c6e9c1934378e365e343 +nghttp2.v1.47.0+0.armv6l-linux-musleabihf.tar.gz/sha512/470c66205d257ba3b23b0db8ea93fe40bc71c219d50cd88a6b57abf8c105218bd9912b9a605da12903793893f37803b0e3357566e20035a079ed2b4bcc6d7b78 +nghttp2.v1.47.0+0.armv7l-linux-gnueabihf.tar.gz/md5/e831c03eeb810a48fbd34df2017c20be +nghttp2.v1.47.0+0.armv7l-linux-gnueabihf.tar.gz/sha512/e90270b1f6ae7c90ce746f60c2f451f2271ec6f682003f3a0ee8eb97e9054932495fff22b2ca1f40e3711f847c520fa605c49c7ae671db7f282f78f8d745a0db +nghttp2.v1.47.0+0.armv7l-linux-musleabihf.tar.gz/md5/38d95842aa0d9e9ac9e77e468d18893d +nghttp2.v1.47.0+0.armv7l-linux-musleabihf.tar.gz/sha512/5e595d143248fadd5cfffa1f15b09698f1793c04422b12d5f8e22c52e4ebc5d947845fe3ef7539845ad731d4457c8a7a6e6e2bc1dbb5b32fd3cd374963aa9833 +nghttp2.v1.47.0+0.i686-linux-gnu.tar.gz/md5/a3c54ab31e835ecbc12425b00a201bbf +nghttp2.v1.47.0+0.i686-linux-gnu.tar.gz/sha512/375354d57b14b73d7e4cf751b69872b19e6806b7a110c104c0dc25794a33dd89642f9911216c2c1a2698d45878c12b7d735402e44b9b4ba60a5a9751a522c19b +nghttp2.v1.47.0+0.i686-linux-musl.tar.gz/md5/2cdfc4b177bc88685e629362ac754cab +nghttp2.v1.47.0+0.i686-linux-musl.tar.gz/sha512/cb741c7d6dbfe5815e1691c98fac46c2559b419cb3bc882b925779d9699e7b37332ab197bdb3b7cb944de45ea0cc3c6f6e5f8df04b7556dac25f796e992d7dc5 +nghttp2.v1.47.0+0.i686-w64-mingw32.tar.gz/md5/ec5f305e52c205a246db0e4ded79f6c8 +nghttp2.v1.47.0+0.i686-w64-mingw32.tar.gz/sha512/4bd5f81bd1502bbc04973f0721099a230248b2be907f66f044fd1111326bf05804aae4df123eda65e7e90445157bc07e87d9e837dfd2393038e4e042254c16df +nghttp2.v1.47.0+0.powerpc64le-linux-gnu.tar.gz/md5/01431aaf0c383e2ab1460f41e3c64446 +nghttp2.v1.47.0+0.powerpc64le-linux-gnu.tar.gz/sha512/ef3ed6eb1c77a81f46f7c06e4748d766144231ab3cc4875fb3502c6a553ce04937ee6dcb1516532c91043921b76779c1ea1ca20070907d3639d2f0fb036d0d56 +nghttp2.v1.47.0+0.x86_64-apple-darwin.tar.gz/md5/12650859c3ba16131a35b63510816267 +nghttp2.v1.47.0+0.x86_64-apple-darwin.tar.gz/sha512/a91d6b572ed830bdcd5822d8d0dbca70ce45f0c2706a1fb83aeccacad1a72391ea09683169ae9d8ed6e84a1f28d55d2ee26e49a68cca405dd032e9c128e54858 +nghttp2.v1.47.0+0.x86_64-linux-gnu.tar.gz/md5/62fb16238af3cf50721b0a671d28dc8c +nghttp2.v1.47.0+0.x86_64-linux-gnu.tar.gz/sha512/f662f30ad7057bc9c724fd48e15a2894aa0a345a24d35acaa0f3cb25d73b329772942d3499647ba7563c110d2186e96d4a3b12e8721d28d2cd6491d93df24e05 +nghttp2.v1.47.0+0.x86_64-linux-musl.tar.gz/md5/3224892e3e5c7d7ae24c2380fd731ab8 +nghttp2.v1.47.0+0.x86_64-linux-musl.tar.gz/sha512/35d18c52dee94846a85d5a7a19bff95ce2b05e5290096d532c7f3d144ee809a2ba9072dd24372905c485ee0dfa03309be8cebead2b62292518ab5d63d80c9e4a +nghttp2.v1.47.0+0.x86_64-unknown-freebsd.tar.gz/md5/4b3c9032b11ba078d7a91a30d3cabc6a +nghttp2.v1.47.0+0.x86_64-unknown-freebsd.tar.gz/sha512/21c9d1c95e26bf33a0cedc63ac6e81dcc670d6bc3fefc9a8efbf7faff718875cf6fc51dfdb192afb00acf86257104de7a0dfcaaf29119ba055b69885c31a4dd4 +nghttp2.v1.47.0+0.x86_64-w64-mingw32.tar.gz/md5/7d41384443541bf30b6165381b1c5305 +nghttp2.v1.47.0+0.x86_64-w64-mingw32.tar.gz/sha512/2febfcc452bd4f2a3200e6edb8127f678749a358a4beb219b7b29294ade66bb817e1fbdce665f0e3e20d923ab3bc68598f3c769bd4f09871866e452b6aab52d0 diff --git a/deps/nghttp2.mk b/deps/nghttp2.mk index 9a161e1b238d3..2b8a18728b712 100644 --- a/deps/nghttp2.mk +++ b/deps/nghttp2.mk @@ -8,7 +8,6 @@ $(SRCCACHE)/nghttp2-$(NGHTTP2_VER).tar.bz2: | $(SRCCACHE) $(SRCCACHE)/nghttp2-$(NGHTTP2_VER)/source-extracted: $(SRCCACHE)/nghttp2-$(NGHTTP2_VER).tar.bz2 $(JLCHECKSUM) $< cd $(dir $<) && $(TAR) -jxf $< - cp $(SRCDIR)/patches/config.sub $(SRCCACHE)/nghttp2-$(NGHTTP2_VER)/config.sub touch -c $(SRCCACHE)/nghttp2-$(NGHTTP2_VER)/configure # old target echo 1 > $@ diff --git a/stdlib/nghttp2_jll/Project.toml b/stdlib/nghttp2_jll/Project.toml index 3051afe57d23a..e768d6fc84b96 100644 --- a/stdlib/nghttp2_jll/Project.toml +++ b/stdlib/nghttp2_jll/Project.toml @@ -1,6 +1,6 @@ name = "nghttp2_jll" uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" -version = "1.41.0+1" +version = "1.47.0+0" [deps] Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" diff --git a/stdlib/nghttp2_jll/test/runtests.jl b/stdlib/nghttp2_jll/test/runtests.jl index 07e0a3b8c7730..9a1dcd1c91cc2 100644 --- a/stdlib/nghttp2_jll/test/runtests.jl +++ b/stdlib/nghttp2_jll/test/runtests.jl @@ -11,5 +11,5 @@ end @testset "nghttp2_jll" begin info = unsafe_load(ccall((:nghttp2_version,libnghttp2), Ptr{nghttp2_info}, (Cint,), 0)) - @test VersionNumber(unsafe_string(info.version_str)) == v"1.41.0" + @test VersionNumber(unsafe_string(info.version_str)) == v"1.47.0" end From bf46593e9bdc1094659184d54a636f5a913e3594 Mon Sep 17 00:00:00 2001 From: K Pamnany Date: Fri, 8 Jul 2022 18:47:14 +0000 Subject: [PATCH 227/369] Add channel state checks to reduce exceptions In channel iteration and in the `@sync` race check. (cherry picked from commit 4084f7ebec63cf9b6a53f3a12df91bbf0c0a4161) --- base/channels.jl | 18 +++++++++++------- base/task.jl | 24 +++++++++++++----------- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/base/channels.jl b/base/channels.jl index da7b1d24583ca..0cf3b8d799926 100644 --- a/base/channels.jl +++ b/base/channels.jl @@ -493,14 +493,18 @@ function show(io::IO, ::MIME"text/plain", c::Channel) end function iterate(c::Channel, state=nothing) - try - return (take!(c), nothing) - catch e - if isa(e, InvalidStateException) && e.state === :closed - return nothing - else - rethrow() + if isopen(c) || isready(c) + try + return (take!(c), nothing) + catch e + if isa(e, InvalidStateException) && e.state === :closed + return nothing + else + rethrow() + end end + else + return nothing end end diff --git a/base/task.jl b/base/task.jl index dc08a0257a376..fa6b6df4a7f5d 100644 --- a/base/task.jl +++ b/base/task.jl @@ -415,19 +415,21 @@ function sync_end(c::Channel{Any}) # Capture all waitable objects scheduled after the end of `@sync` and # include them in the exception. This way, the user can check what was # scheduled by examining at the exception object. - local racy - for r in c - if !@isdefined(racy) - racy = [] + if isready(c) + local racy + for r in c + if !@isdefined(racy) + racy = [] + end + push!(racy, r) end - push!(racy, r) - end - if @isdefined(racy) - if !@isdefined(c_ex) - c_ex = CompositeException() + if @isdefined(racy) + if !@isdefined(c_ex) + c_ex = CompositeException() + end + # Since this is a clear programming error, show this exception first: + pushfirst!(c_ex, ScheduledAfterSyncException(racy)) end - # Since this is a clear programming error, show this exception first: - pushfirst!(c_ex, ScheduledAfterSyncException(racy)) end if @isdefined(c_ex) From 9f5e58a4a3dc7aeff6e481f2d22a4f4160c646fd Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Mon, 11 Jul 2022 11:29:47 -0700 Subject: [PATCH 228/369] Update `Documenter` version, deploy to tarball (#45988) * Update `Documenter` version, deploy to tarball This is a necessary change to get documentation deployed in buildkite, where we deploy first to a tarball, then upload in a separate step. * Update doc/make.jl Co-authored-by: Morten Piibeleht Co-authored-by: Morten Piibeleht (cherry picked from commit 43dac095550e29d274d7aadc63c5a32292a6da51) --- doc/Manifest.toml | 8 ++++---- doc/make.jl | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/Manifest.toml b/doc/Manifest.toml index ffd798ec59a90..a1fc86f2e779b 100644 --- a/doc/Manifest.toml +++ b/doc/Manifest.toml @@ -24,9 +24,9 @@ version = "0.8.6" [[deps.Documenter]] deps = ["ANSIColoredPrinters", "Base64", "Dates", "DocStringExtensions", "IOCapture", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"] -git-tree-sha1 = "122d031e8dcb2d3e767ed434bc4d1ae1788b5a7f" +git-tree-sha1 = "e4967ebb9dce1328d582200b03bcc44c69372312" uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4" -version = "0.27.17" +version = "0.27.20" [[deps.IOCapture]] deps = ["Logging", "Random"] @@ -63,9 +63,9 @@ uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" [[deps.Parsers]] deps = ["Dates"] -git-tree-sha1 = "1285416549ccfcdf0c50d4997a94331e88d68413" +git-tree-sha1 = "0044b23da09b5608b4ecacb4e5e6c6332f833a7e" uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" -version = "2.3.1" +version = "2.3.2" [[deps.Printf]] deps = ["Unicode"] diff --git a/doc/make.jl b/doc/make.jl index b33173398467d..1094736fffd02 100644 --- a/doc/make.jl +++ b/doc/make.jl @@ -340,6 +340,8 @@ end # Define our own DeployConfig struct BuildBotConfig <: Documenter.DeployConfig end +Documenter.authentication_method(::BuildBotConfig) = Documenter.HTTPS +Documenter.authenticated_repo_url(::BuildBotConfig) = "https://github.com/JuliaLang/docs.julialang.org.git" function Documenter.deploy_folder(::BuildBotConfig; devurl, repo, branch, kwargs...) haskey(ENV, "DOCUMENTER_KEY") || return Documenter.DeployDecision(; all_ok=false) if Base.GIT_VERSION_INFO.tagged_commit @@ -385,4 +387,5 @@ deploydocs( dirname = "en", devurl = devurl, versions = Versions(["v#.#", devurl => devurl]), + archive = get(ENV, "DOCUMENTER_ARCHIVE", nothing), ) From 3bcba90bbacacb7d4b2a7626f950eafcbbad0e4d Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Tue, 12 Jul 2022 14:30:47 +0200 Subject: [PATCH 229/369] release-1.8: set VERSION to 1.8.0-rc3 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index e0645eb76f9ae..1298ad0a15ac8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.8.0-rc2 +1.8.0-rc3 From 08f12b9cc20b83f8660079afcd7c91cd6c13bcdf Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Thu, 14 Jul 2022 20:22:33 +0200 Subject: [PATCH 230/369] fix convert call in Artifacts.jl (#46040) (cherry picked from commit e96b19d096c45fec5e5d3f0d62a9b5f2a7b2428b) --- stdlib/Artifacts/src/Artifacts.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/Artifacts/src/Artifacts.jl b/stdlib/Artifacts/src/Artifacts.jl index 27e352be59270..724bda22ae531 100644 --- a/stdlib/Artifacts/src/Artifacts.jl +++ b/stdlib/Artifacts/src/Artifacts.jl @@ -697,7 +697,7 @@ end with_artifacts_directory(f::Function, artifacts_dir::AbstractString) = with_artifacts_directory(f, String(artifacts_dir)::String) query_override(pkg::Base.UUID, artifact_name::AbstractString; overrides::Dict=load_overrides()) = - query_override(pkg, String(artifact_name)::String; overrides=convert(Dict{Symbol, Any}(overrides))) + query_override(pkg, String(artifact_name)::String; overrides=convert(Dict{Symbol, Any}, overrides)) unpack_platform(entry::Dict, name::AbstractString, artifacts_toml::AbstractString) = unpack_platform(convert(Dict{String, Any}, entry), String(name)::String, String(artifacts_toml)::String) load_artifacts_toml(artifacts_toml::AbstractString; kwargs...) = From 78ad6ff30f59ff2dbc8ce87557cdf247e1689fec Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Fri, 15 Jul 2022 13:43:58 -0700 Subject: [PATCH 231/369] Allow `BUILDKITE_BRANCH` to provide branch name (#46053) * Allow `BUILDKITE_BRANCH` to provide branch name Our CI system checks commits out as a detached head, which breaks our `Base.GIT_VERSION_INFO.branch` information. * Fix typo (cherry picked from commit d117975aa629bee97901a2c132f028adf23d16ae) --- base/version_git.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/base/version_git.sh b/base/version_git.sh index 2a3352d1066ef..39ebb1b8ec5ee 100644 --- a/base/version_git.sh +++ b/base/version_git.sh @@ -41,7 +41,15 @@ if [ -n "$(git status --porcelain)" ]; then # append dirty mark '*' if the repository has uncommitted changes commit_short="$commit_short"* fi -branch=$(git rev-parse --abbrev-ref HEAD) + +# Our CI system checks commits out as a detached head, and so we must +# use the provided branch name, as we cannot autodetect this commit as +# the tip of any such branch. +if [ -n "${BUILDKITE_BRANCH}" ]; then + branch="${BUILDKITE_BRANCH}" +else + branch=$(git rev-parse --abbrev-ref HEAD) +fi topdir=$(git rev-parse --show-toplevel) verchanged=$(git blame -L ,1 -sl -- "$topdir/VERSION" | cut -f 1 -d " ") From 7674873b4f42d1e32f6846fa38fbb7ef808774a0 Mon Sep 17 00:00:00 2001 From: Ian Date: Sat, 16 Jul 2022 16:05:51 -0400 Subject: [PATCH 232/369] fixup time_imports news entry (cherry picked from commit dad1c7fabcdbfab739195023b8bf5d85978ebace) --- NEWS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 63172f026cac5..c13c55eda38d8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -111,7 +111,6 @@ New library features * `extrema` now accepts an `init` keyword argument ([#36265], [#43604]). * `Iterators.countfrom` now accepts any type that defines `+` ([#37747]). * `@time` now separates out % time spent recompiling invalidated methods ([#45015]). -* `@time_imports` now shows any compilation and recompilation time percentages per import ([#45064]). Standard library changes ------------------------ @@ -147,7 +146,8 @@ Standard library changes #### InteractiveUtils -* New macro `@time_imports` for reporting any time spent importing packages and their dependencies ([#41612]). +* New macro `@time_imports` for reporting any time spent importing packages and their dependencies, highlighting + compilation and recompilation time as percentages per import ([#41612],[#45064]). #### LinearAlgebra From c8c6cc712f50693684c358904aee8bda222583d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Tue, 12 Jul 2022 20:43:49 +0100 Subject: [PATCH 233/369] [LibCURL_jll] Update to v7.84 (#45967) (cherry picked from commit 9629154b023de2b085b75fccb20c9a80a604b244) --- deps/Versions.make | 2 +- deps/checksums/curl | 68 ++++++++++++++++----------------- stdlib/LibCURL_jll/Project.toml | 2 +- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/deps/Versions.make b/deps/Versions.make index 09ba2b4e3e8a9..c250dfe984671 100644 --- a/deps/Versions.make +++ b/deps/Versions.make @@ -26,7 +26,7 @@ GMP_VER := 6.2.1 GMP_JLL_NAME := GMP # LibCURL -CURL_VER := 7.83.1 +CURL_VER := 7.84.0 CURL_JLL_NAME := LibCURL # LAPACK, source-only diff --git a/deps/checksums/curl b/deps/checksums/curl index 77cb46923aefd..0f235d8238e8e 100644 --- a/deps/checksums/curl +++ b/deps/checksums/curl @@ -1,36 +1,36 @@ LibCURL-fd8af649b38ae20c3ff7f5dca53753512ca00376.tar.gz/md5/f082283e6a35fcba5b63c9a6219d8003 LibCURL-fd8af649b38ae20c3ff7f5dca53753512ca00376.tar.gz/sha512/3bea5fa3fb6d29651daa923ae6bcb8eeb356ab9f2a1f3e005a6b746b617b0cf609aed4cadda4181783959840873c04b18e34e45ab973549169d19775a05ea01e -LibCURL.v7.83.1+1.aarch64-apple-darwin.tar.gz/md5/de0048ffcd0cf779f648c58df4d87ea9 -LibCURL.v7.83.1+1.aarch64-apple-darwin.tar.gz/sha512/874d1f83e0ff21ff8a5e39f29ca03588142e5f292a7e3bfb36f6f6f4f3e5b518b76dc8c0272a2df1167daed108b92f0e620277e6f3e2c091aa60934d18c292e4 -LibCURL.v7.83.1+1.aarch64-linux-gnu.tar.gz/md5/55bb17c62f5cf9894770bbc6e9fcce45 -LibCURL.v7.83.1+1.aarch64-linux-gnu.tar.gz/sha512/bb1e2246bb169ad7cc36749d56cf4bf6d3bd57bb9d141c5d807be5048ecc3cb3adeef95438d52c6360b5e70ba0ec75efb134c381affc812d0f5e1d8e76ff9884 -LibCURL.v7.83.1+1.aarch64-linux-musl.tar.gz/md5/52ce54a88113140c7f7c57895054d68c -LibCURL.v7.83.1+1.aarch64-linux-musl.tar.gz/sha512/dbd385d28ba6cf9e7c0ca05e9b10bafc041320c307ea7571bb972ae90b71a29ffa50d7c934d358c9e35cb168d3a378589cf0de66d5f13fe69da8a44ba1712284 -LibCURL.v7.83.1+1.armv6l-linux-gnueabihf.tar.gz/md5/68150dd7d41938065f444a1fc162d8d0 -LibCURL.v7.83.1+1.armv6l-linux-gnueabihf.tar.gz/sha512/0d8eccd3fc30160899789b91ff12ae08d97f48c08c25dcbcf737ceb9a9388fb082b7abac53da6e4711f9a5ff40700ac735d748f13895ea5205f919449182711b -LibCURL.v7.83.1+1.armv6l-linux-musleabihf.tar.gz/md5/963de5f46421087fc4f0c0e3674d6a5b -LibCURL.v7.83.1+1.armv6l-linux-musleabihf.tar.gz/sha512/a9b491384a19d4cb26ab48a09dff8e58989b0e2ba8f143a0740daa582ddcf4a29c21216045baaeec5d121922a2dc38e9072174aa8f5deaf2d38ea1997a1c6ba5 -LibCURL.v7.83.1+1.armv7l-linux-gnueabihf.tar.gz/md5/b64791ed06518e53d5e0bc713bf82af4 -LibCURL.v7.83.1+1.armv7l-linux-gnueabihf.tar.gz/sha512/30dcbbb3f944da18a9764728850fe24ba7612d11fe0b81f6c56e7735479128b0a55bd43d29cb326db20dc8f1fc9a1407bb7f54da1526d5fa182ab223e11377d0 -LibCURL.v7.83.1+1.armv7l-linux-musleabihf.tar.gz/md5/fc64fc8de930b1f2deee6910706da54e -LibCURL.v7.83.1+1.armv7l-linux-musleabihf.tar.gz/sha512/04e9cfdf55403ce2c7077356f05a98fe6a94772b5846ceff0cc81f0ebac95df85e259ecf4ded2baa369f55580892d083c74460e436a33c0286a797db60497558 -LibCURL.v7.83.1+1.i686-linux-gnu.tar.gz/md5/44a4f66754105b24102135fe62691aab -LibCURL.v7.83.1+1.i686-linux-gnu.tar.gz/sha512/9200ec12725fbf93039e534625f8cb14607be820df27ac4bcabcf8332f2e5214604b6c1efd6f4d1ae6c554b8cdd0808a1dda0f9e1fba7764484c0b00e351db7b -LibCURL.v7.83.1+1.i686-linux-musl.tar.gz/md5/bf0a521a03bb216430e66d29e9bd597e -LibCURL.v7.83.1+1.i686-linux-musl.tar.gz/sha512/ef549d533d1a1d40a0e10ec68611f586878fd3a218a9d388ae3328e4fad3dc613ed700671bbbd1f62554555073a7ab224c122fb31e7bcc6c751a7d0ce6fba9f6 -LibCURL.v7.83.1+1.i686-w64-mingw32.tar.gz/md5/c48af4c27cecbc38694cce627412eceb -LibCURL.v7.83.1+1.i686-w64-mingw32.tar.gz/sha512/9dbdbc8cbeafa913debfeed88b0514355fec89a48945716a43baae94e9855cb84cb9ba794cd022958636858a5be9f671f92a40ad3cd3b5145245c94cb26112d7 -LibCURL.v7.83.1+1.powerpc64le-linux-gnu.tar.gz/md5/50256b715d014ef9a2b328668a71a5dd -LibCURL.v7.83.1+1.powerpc64le-linux-gnu.tar.gz/sha512/730eef536baa0be00fc9f1e87f82fb84a051141bab277f11873e7e2fdaeced3964e9a0e4343504e1cb7b89fbf92df8890fa33eaed9b3c6555171c8a8adbf9dcf -LibCURL.v7.83.1+1.x86_64-apple-darwin.tar.gz/md5/367d7944167a83ff2a8d4982c8504e47 -LibCURL.v7.83.1+1.x86_64-apple-darwin.tar.gz/sha512/591f268ecbb0f5c43266876e9e0f33235b5c2e96aae4386d22c50785a4466e4b3f14e5b48117f1751733492c4ccc54638bfcf10c904d12145db7881e07778a23 -LibCURL.v7.83.1+1.x86_64-linux-gnu.tar.gz/md5/57bf4c88945b3f83e336754b075b35f7 -LibCURL.v7.83.1+1.x86_64-linux-gnu.tar.gz/sha512/71984f5240c5962422cf69069b3f0d0529a64c9ccb9995b9f26742a19dc12ae9700e888fe8b79b17edfcaa1b13b24a56b4d776453d83cce233dfa9c3fdb79660 -LibCURL.v7.83.1+1.x86_64-linux-musl.tar.gz/md5/64f3026a24b6a7df77e8325a108e76db -LibCURL.v7.83.1+1.x86_64-linux-musl.tar.gz/sha512/bf0c16b90b7b6ef33ed7d4678df539f88d041f5a78942ca5549d9d0e7ce8cef38af8da1f68d9d3999f969805dd1da546da3d289b32dad442ec1b2b5e44d158cb -LibCURL.v7.83.1+1.x86_64-unknown-freebsd.tar.gz/md5/578ba7e5607ce2de16132ab8f7a213d9 -LibCURL.v7.83.1+1.x86_64-unknown-freebsd.tar.gz/sha512/42c5892038aaedbbb19e192fc867e00d354da7cdf11c90151124f3c9006883960107663eaa865ee482895ee5784b5c5f487ea8aeef2a8ebbbe51f59d693e0778 -LibCURL.v7.83.1+1.x86_64-w64-mingw32.tar.gz/md5/5e5bb662234dd4520f4e4f73f8536daa -LibCURL.v7.83.1+1.x86_64-w64-mingw32.tar.gz/sha512/4553dc10d464771166b8a53473e68a23baa6fb8f65f09a5a274826d313dafc3289348e0e8026abcec6fea98e461aca31001176387526afcf3966167b71ec2178 -curl-7.83.1.tar.bz2/md5/08626822d50cbef47503f220718b920b -curl-7.83.1.tar.bz2/sha512/c43ec2da9c8609a312f723c0b3eff7e171ed1258c6ed1af16020190d4253e6bea63ca3905f04d0ca46a97986a8bb79be1d532f8d68fcbdbacfa80cc42f134db1 +LibCURL.v7.84.0+0.aarch64-apple-darwin.tar.gz/md5/0e1d2884864419df574b61a6db15ef9d +LibCURL.v7.84.0+0.aarch64-apple-darwin.tar.gz/sha512/18986ce04a39a8935d3b2e595e9c7b6ecd38340f1f886cb5b16880ad72b9889a5bba8720c30c2775add115c0385ca1f98956df2cb89cd4ffa92d67e433a8f12b +LibCURL.v7.84.0+0.aarch64-linux-gnu.tar.gz/md5/e4d57ee8f1304b8fde272a373a13cdf6 +LibCURL.v7.84.0+0.aarch64-linux-gnu.tar.gz/sha512/88ee9129a3053b8221808f977561541be573068c5abf388a78b1c748b6c7cca2cd23f8bfcb779541fc83dff07a7a3c979194359f6cd4d0cb6d6696affac03c11 +LibCURL.v7.84.0+0.aarch64-linux-musl.tar.gz/md5/f40a48d02ee841d7393477ef63163c43 +LibCURL.v7.84.0+0.aarch64-linux-musl.tar.gz/sha512/9998db3a896fa46a51d2da2a07b48470a9719fe301fb0589f04e2bd0e1bd116c5c74ca8f03d4dff6529339fdf68a42788ed33c629794bc3886e5147f51c53eb7 +LibCURL.v7.84.0+0.armv6l-linux-gnueabihf.tar.gz/md5/223727927aff997175d1d8bdcea39c79 +LibCURL.v7.84.0+0.armv6l-linux-gnueabihf.tar.gz/sha512/f856ca8a63f55d455ae161e58cd5e195ffb80ceaeeaa7cf306a3d192ae51a1ebfb93e87e27aa90f513294e27beb8e1358c7a07eb5a3a85d434327b4331211426 +LibCURL.v7.84.0+0.armv6l-linux-musleabihf.tar.gz/md5/efc2bcc500edaaf59542f86119b9a090 +LibCURL.v7.84.0+0.armv6l-linux-musleabihf.tar.gz/sha512/297f2999f1544816e2edd1fb78aa5f8abf9dde9b782a62054b0f61974f3dbde7ae67cf4d8dd63c21082de5f89dfeb32aa099e2228851242c3379a811883f92e4 +LibCURL.v7.84.0+0.armv7l-linux-gnueabihf.tar.gz/md5/e5a0a5b7f1e664675bc2ac4970b39297 +LibCURL.v7.84.0+0.armv7l-linux-gnueabihf.tar.gz/sha512/bd9c602b69841dd1b8625627c774dbf99e7c3fcf951b00299dbe8007e8ea2bf5a312fa34f0be9e21a7ac947332652ffa55fdbcdf21096449a8ab982c9a7ce776 +LibCURL.v7.84.0+0.armv7l-linux-musleabihf.tar.gz/md5/05f04c53e4a04ced1d6aefc1e9493332 +LibCURL.v7.84.0+0.armv7l-linux-musleabihf.tar.gz/sha512/7ea517a048d8d7a940f5e32d1476366d9e63bf0103276c8208cd23e1ae7e4dd70e0acba4cdeafd1e9a5db90dfc213bd0895ebef755ea237cab3fc9d39808c325 +LibCURL.v7.84.0+0.i686-linux-gnu.tar.gz/md5/97cffa9e6e771e5b96d77a0acff157af +LibCURL.v7.84.0+0.i686-linux-gnu.tar.gz/sha512/84b81c69c021e8aad542c909c81ace41ea96650ef1dcd46b1ef29b683a870abddff96b8d2ecde593c8cea427256dfa194cf5bd4e5b610b0b8ce779e383aadb76 +LibCURL.v7.84.0+0.i686-linux-musl.tar.gz/md5/3dccdbc2cde661c7d868f2bd7d5c0316 +LibCURL.v7.84.0+0.i686-linux-musl.tar.gz/sha512/7625d1ba19e69cce185d61ef09374af4d433730f4908f1ce5da7d3352c96a58e1543dc66a0cb01000c4ced9033e2b2137877a4d7c9f8f0fa551613e436cb574c +LibCURL.v7.84.0+0.i686-w64-mingw32.tar.gz/md5/bd2b06eadacaf984cc25993c242517eb +LibCURL.v7.84.0+0.i686-w64-mingw32.tar.gz/sha512/21aee096ff42e3c4dfbf6b8c9e3cbdcc4cae234ac784e871d4ca55424263eb59cfd2b159287861a076373017ab5454d0c9f93c99d87e90f263563ddee28d737d +LibCURL.v7.84.0+0.powerpc64le-linux-gnu.tar.gz/md5/221f481553cdb28d97a7caa69a895b12 +LibCURL.v7.84.0+0.powerpc64le-linux-gnu.tar.gz/sha512/90caf2fe245a0e1f5816fadf2c0b8e7bda5df38d716c309aadb37721923f57919af09c6a7396ce2888dc02ae02670da9300c0e5814d5ad851bdb4e661c48bc48 +LibCURL.v7.84.0+0.x86_64-apple-darwin.tar.gz/md5/9f609374291fe24ec9bd752c967d3072 +LibCURL.v7.84.0+0.x86_64-apple-darwin.tar.gz/sha512/8a8461a8cf7591a798d7ed32423a33b38425d32e3a7fd4feda06095237ae6dc43c6737dcc55bb86e260080198d5295f11fee88883354425b132c8e04bfa9feaf +LibCURL.v7.84.0+0.x86_64-linux-gnu.tar.gz/md5/c1cc01bbc7aec5b272f7dbe803fda257 +LibCURL.v7.84.0+0.x86_64-linux-gnu.tar.gz/sha512/e6f9ff29a8ab46537054e1fa364ece163fd4376d16fe7e22dc94c0a640397b45659c143b8e170b1b01ef800ab7f53a9f4087197f2fae9002e061530cefe6157b +LibCURL.v7.84.0+0.x86_64-linux-musl.tar.gz/md5/20dec1cebca3b2ef188a31ae50a40b42 +LibCURL.v7.84.0+0.x86_64-linux-musl.tar.gz/sha512/9d5675f90eb348ecb637ee7ed31d68701504efa7871c9f55eacb331b6717eae893e88c63cb5abd6ca9d13d34a055d67d0cf36ca173f2bd58e19b65cabbd816e7 +LibCURL.v7.84.0+0.x86_64-unknown-freebsd.tar.gz/md5/a57884bfdcbca83c1f14ece9d501224f +LibCURL.v7.84.0+0.x86_64-unknown-freebsd.tar.gz/sha512/f8bf1755b3a758b351532ede8f19af6ace8cfcf59b656067ddfd1135533052b340ca35e9cb0e134e1f082cea19860af2029448fc1ca231a32bf03bd07698d4da +LibCURL.v7.84.0+0.x86_64-w64-mingw32.tar.gz/md5/71182295492b38bb419a71489f01fa54 +LibCURL.v7.84.0+0.x86_64-w64-mingw32.tar.gz/sha512/9d84bfad36ca69b3ed2519bef8845cece4d9b3e8c9e1e040f744c6163469c732cfd1301cf5e5c9e23c25420b1b17a844bcb43bde858a501eb6133dbc266f2f75 +curl-7.84.0.tar.bz2/md5/35fca80437f32dd7ef6c2e30b4916f06 +curl-7.84.0.tar.bz2/sha512/57823295e2c036355d9170b9409d698e1cece882b2cb55ce33fcf384dd30a75c00e68d6550f3b3faba4ef38443e2172c731ddfef6e508b99476f4e36d25bdd1c diff --git a/stdlib/LibCURL_jll/Project.toml b/stdlib/LibCURL_jll/Project.toml index 3719fcbf37bef..45dbb45830837 100644 --- a/stdlib/LibCURL_jll/Project.toml +++ b/stdlib/LibCURL_jll/Project.toml @@ -1,6 +1,6 @@ name = "LibCURL_jll" uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" -version = "7.83.1+1" +version = "7.84.0+0" [deps] LibSSH2_jll = "29816b5a-b9ab-546f-933c-edad1886dfa8" From 3dc152b073612081d30a198080702fc83f92aef0 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Thu, 7 Apr 2022 13:47:50 -0400 Subject: [PATCH 234/369] fix Libc.rand and seed problems (#44432) Continuation from #43606 - Replaces thread-unsafe function `rand` with `jl_rand`. - Fixes `_ad_hoc_entropy_source` fallback in Random. - Uses uv_random for more direct access to quality-randomness (usually a syscall rather than a file.) - Ensures Array{Bool} are valid when created from RandomDevice. (cherry picked from commit b4bed7171730a8ea29b8ead2a16dfa7e78c2b15f) --- base/Base.jl | 5 --- base/error.jl | 2 +- base/libc.jl | 38 ++++++++-------- base/randomdevice.jl | 77 --------------------------------- src/coverage.cpp | 4 +- src/gc-debug.c | 3 +- src/init.c | 1 + src/jl_exported_funcs.inc | 1 - src/jl_uv.c | 9 ---- src/julia.h | 5 +-- src/julia_atomics.h | 2 +- src/julia_internal.h | 13 +++--- src/runtime_ccall.cpp | 2 +- src/signal-handling.c | 2 +- src/signals-unix.c | 2 +- src/sys.c | 34 +++++++++++++++ src/task.c | 28 ++++++------ src/threading.c | 2 +- stdlib/Random/src/RNGs.jl | 79 ++++++++++++---------------------- stdlib/Random/test/runtests.jl | 5 +-- test/error.jl | 10 ++--- 21 files changed, 119 insertions(+), 205 deletions(-) delete mode 100644 base/randomdevice.jl diff --git a/base/Base.jl b/base/Base.jl index a3fe44a2add86..b2e79224edbd7 100644 --- a/base/Base.jl +++ b/base/Base.jl @@ -292,9 +292,6 @@ include("process.jl") include("ttyhascolor.jl") include("secretbuffer.jl") -# RandomDevice support -include("randomdevice.jl") - # core math functions include("floatfuncs.jl") include("math.jl") @@ -484,8 +481,6 @@ end if is_primary_base_module function __init__() - # for the few uses of Libc.rand in Base: - Libc.srand() # Base library init reinit_stdio() Multimedia.reinit_displays() # since Multimedia.displays uses stdout as fallback diff --git a/base/error.jl b/base/error.jl index 9ffcac5d7820c..4459e54def19b 100644 --- a/base/error.jl +++ b/base/error.jl @@ -261,7 +261,7 @@ function iterate(ebo::ExponentialBackOff, state= (ebo.n, min(ebo.first_delay, eb state[1] < 1 && return nothing next_n = state[1]-1 curr_delay = state[2] - next_delay = min(ebo.max_delay, state[2] * ebo.factor * (1.0 - ebo.jitter + (rand(Float64) * 2.0 * ebo.jitter))) + next_delay = min(ebo.max_delay, state[2] * ebo.factor * (1.0 - ebo.jitter + (Libc.rand(Float64) * 2.0 * ebo.jitter))) (curr_delay, (next_n, next_delay)) end length(ebo::ExponentialBackOff) = ebo.n diff --git a/base/libc.jl b/base/libc.jl index 38b62847eaeb4..f6776e8aec4f9 100644 --- a/base/libc.jl +++ b/base/libc.jl @@ -255,7 +255,7 @@ time() = ccall(:jl_clock_now, Float64, ()) Get Julia's process ID. """ -getpid() = ccall(:jl_getpid, Int32, ()) +getpid() = ccall(:uv_os_getpid, Int32, ()) ## network functions ## @@ -376,31 +376,35 @@ free(p::Cwstring) = free(convert(Ptr{Cwchar_t}, p)) ## Random numbers ## +# Access to very high quality (kernel) randomness +function getrandom!(A::Union{Array,Base.RefValue}) + ret = ccall(:uv_random, Cint, (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Csize_t, Cuint, Ptr{Cvoid}), + C_NULL, C_NULL, A, sizeof(A), 0, C_NULL) + Base.uv_error("getrandom", ret) + return A +end +_make_uint64_seed() = getrandom!(Base.RefValue{UInt64}())[] + # To limit dependency on rand functionality implemented in the Random module, -# Libc.rand is used in file.jl, and could be used in error.jl (but it breaks a test) +# Libc.rand is used in Base (it also is independent from Random.seed, so is +# only affected by `Libc.srand(seed)` calls) """ - rand([T::Type]) + rand([T::Type]=UInt32) -Interface to the C `rand()` function. If `T` is provided, generate a value of type `T` -by composing two calls to `rand()`. `T` can be `UInt32` or `Float64`. +Generate a random number of type `T`. `T` can be `UInt32` or `Float64`. """ -rand() = ccall(:rand, Cint, ()) -@static if Sys.iswindows() - # Windows RAND_MAX is 2^15-1 - rand(::Type{UInt32}) = ((rand() % UInt32) << 17) ⊻ ((rand() % UInt32) << 8) ⊻ (rand() % UInt32) -else - # RAND_MAX is at least 2^15-1 in theory, but we assume 2^16-1 - # on non-Windows systems (in practice, it's 2^31-1) - rand(::Type{UInt32}) = ((rand() % UInt32) << 16) ⊻ (rand() % UInt32) -end -rand(::Type{Float64}) = rand(UInt32) * 2.0^-32 +rand() = ccall(:jl_rand, UInt64, ()) % UInt32 +rand(::Type{UInt32}) = rand() +rand(::Type{Float64}) = rand() * 2.0^-32 """ srand([seed]) -Interface to the C `srand(seed)` function. +Set a value for the current global `seed`. """ -srand(seed=Base._make_uint_seed()) = ccall(:srand, Cvoid, (Cuint,), seed) +function srand(seed::Integer=_make_uint64_seed()) + ccall(:jl_srand, Cvoid, (UInt64,), seed % UInt64) +end struct Cpasswd username::Cstring diff --git a/base/randomdevice.jl b/base/randomdevice.jl deleted file mode 100644 index d63ff7edc1647..0000000000000 --- a/base/randomdevice.jl +++ /dev/null @@ -1,77 +0,0 @@ -# This file is a part of Julia. License is MIT: https://julialang.org/license - -# This file contains the minimal support of RandomDevice for Base's own usage. -# The actual RandomDevice type that makes use of this infrastructure is defined -# in the Random stdlib. - -module DevRandomState - if !Sys.iswindows() - mutable struct FileRef - @atomic file::Union{IOStream, Nothing} - end - const DEV_RANDOM = FileRef(nothing) - const DEV_URANDOM = FileRef(nothing) - end - function __init__() - if !Sys.iswindows() - @atomic DEV_RANDOM.file = nothing - @atomic DEV_URANDOM.file = nothing - end - end -end - -if Sys.iswindows() - function RtlGenRandom!(A::Union{Array, Ref}) - Base.windowserror("SystemFunction036 (RtlGenRandom)", 0 == ccall( - (:SystemFunction036, :Advapi32), stdcall, UInt8, (Ptr{Cvoid}, UInt32), - A, sizeof(A))) - end - - # Manually implemented to work without the Random machinery - function _rand_uint() - r = Ref{Cuint}() - RtlGenRandom!(r) - return r[] - end -else # !windows - function _get_dev_random_fd(unlimited::Bool) - ref = unlimited ? DevRandomState.DEV_URANDOM : DevRandomState.DEV_RANDOM - fd = ref.file - if fd === nothing - fd = open(unlimited ? "/dev/urandom" : "/dev/random") - old, ok = @atomicreplace ref.file nothing => fd - if !ok - close(fd) - fd = old::IOStream - end - end - return fd - end - - # Manually implemented to work without the Random machinery - function _rand_uint() - return read(_get_dev_random_fd(true), Cuint) - end -end # os-test - -function _ad_hoc_entropy() - println(stderr, - "Entropy pool not available to seed RNG; using ad-hoc entropy sources.") - seed = reinterpret(UInt64, time()) - seed = hash(seed, getpid() % UInt) - try - seed = hash(seed, parse(UInt64, - read(pipeline(`ifconfig`, `sha1sum`), String)[1:40], - base = 16) % UInt) - catch - end - return seed -end - -function _make_uint_seed() - try - _rand_uint() - catch - return _ad_hoc_entropy() % Cuint - end -end \ No newline at end of file diff --git a/src/coverage.cpp b/src/coverage.cpp index 4ce33c105691c..46363a7e9ac01 100644 --- a/src/coverage.cpp +++ b/src/coverage.cpp @@ -201,7 +201,7 @@ extern "C" JL_DLLEXPORT void jl_write_coverage_data(const char *output) } else { std::string stm; - raw_string_ostream(stm) << "." << jl_getpid() << ".cov"; + raw_string_ostream(stm) << "." << uv_os_getpid() << ".cov"; write_log_data(coverageData, stm.c_str()); } } @@ -209,6 +209,6 @@ extern "C" JL_DLLEXPORT void jl_write_coverage_data(const char *output) extern "C" JL_DLLEXPORT void jl_write_malloc_log(void) { std::string stm; - raw_string_ostream(stm) << "." << jl_getpid() << ".mem"; + raw_string_ostream(stm) << "." << uv_os_getpid() << ".mem"; write_log_data(mallocData, stm.c_str()); } diff --git a/src/gc-debug.c b/src/gc-debug.c index 8403a9f9f2e1b..fcd1b464e5b43 100644 --- a/src/gc-debug.c +++ b/src/gc-debug.c @@ -467,10 +467,9 @@ static void gc_debug_alloc_init(jl_alloc_num_t *num, const char *name) return; if (*env == 'r') { env++; - srand((unsigned)uv_hrtime()); for (int i = 0;i < 3;i++) { while (num->random[i] == 0) { - num->random[i] = rand(); + num->random[i] = jl_rand(); } } } diff --git a/src/init.c b/src/init.c index d2c76bac404e7..3ea8456479c3e 100644 --- a/src/init.c +++ b/src/init.c @@ -685,6 +685,7 @@ JL_DLLEXPORT void julia_init(JL_IMAGE_SEARCH rel) jl_error("cannot generate code-coverage or track allocation information while generating a .o, .bc, or .s output file"); } + jl_init_rand(); jl_init_runtime_ccall(); jl_init_tasks(); jl_init_threading(); diff --git a/src/jl_exported_funcs.inc b/src/jl_exported_funcs.inc index 614ed0d9d16af..4e3849477a5ac 100644 --- a/src/jl_exported_funcs.inc +++ b/src/jl_exported_funcs.inc @@ -201,7 +201,6 @@ XX(jl_getallocationgranularity) \ XX(jl_getnameinfo) \ XX(jl_getpagesize) \ - XX(jl_getpid) \ XX(jl_get_ARCH) \ XX(jl_get_backtrace) \ XX(jl_get_binding) \ diff --git a/src/jl_uv.c b/src/jl_uv.c index 726290605ee32..dcac09ce6afef 100644 --- a/src/jl_uv.c +++ b/src/jl_uv.c @@ -641,15 +641,6 @@ JL_DLLEXPORT void jl_exit(int exitcode) exit(exitcode); } -JL_DLLEXPORT int jl_getpid(void) JL_NOTSAFEPOINT -{ -#ifdef _OS_WINDOWS_ - return GetCurrentProcessId(); -#else - return getpid(); -#endif -} - typedef union { struct sockaddr in; struct sockaddr_in v4; diff --git a/src/julia.h b/src/julia.h index 695d816aa19c1..48f89ec7661e3 100644 --- a/src/julia.h +++ b/src/julia.h @@ -1880,10 +1880,7 @@ typedef struct _jl_task_t { jl_value_t *result; jl_value_t *logstate; jl_function_t *start; - uint64_t rngState0; // really rngState[4], but more convenient to split - uint64_t rngState1; - uint64_t rngState2; - uint64_t rngState3; + uint64_t rngState[4]; _Atomic(uint8_t) _state; uint8_t sticky; // record whether this Task can be migrated to a new thread _Atomic(uint8_t) _isexception; // set if `result` is an exception to throw or that we exited with diff --git a/src/julia_atomics.h b/src/julia_atomics.h index 1f1a7a46cc9b6..cb14e535cd010 100644 --- a/src/julia_atomics.h +++ b/src/julia_atomics.h @@ -149,7 +149,7 @@ bool jl_atomic_cmpswap_explicit(std::atomic *ptr, T *expected, S val, std::me { return std::atomic_compare_exchange_strong_explicit(ptr, expected, val, order, order); } -#define jl_atomic_cmpswap_relaxed(ptr, val) jl_atomic_cmpswap_explicit(ptr, val, memory_order_relaxed) +#define jl_atomic_cmpswap_relaxed(ptr, expected, val) jl_atomic_cmpswap_explicit(ptr, expected, val, memory_order_relaxed) template T jl_atomic_exchange(std::atomic *ptr, S desired) { diff --git a/src/julia_internal.h b/src/julia_internal.h index 873ef2541d6f6..7e47a4c9b453f 100644 --- a/src/julia_internal.h +++ b/src/julia_internal.h @@ -1110,21 +1110,19 @@ void jl_push_excstack(jl_excstack_t **stack JL_REQUIRE_ROOTED_SLOT JL_ROOTING_AR //-------------------------------------------------- // congruential random number generator // for a small amount of thread-local randomness -// we could just use libc:`rand()`, but we want to ensure this is fast -STATIC_INLINE void seed_cong(uint64_t *seed) -{ - *seed = rand(); -} -STATIC_INLINE void unbias_cong(uint64_t max, uint64_t *unbias) +STATIC_INLINE void unbias_cong(uint64_t max, uint64_t *unbias) JL_NOTSAFEPOINT { *unbias = UINT64_MAX - ((UINT64_MAX % max) + 1); } -STATIC_INLINE uint64_t cong(uint64_t max, uint64_t unbias, uint64_t *seed) +STATIC_INLINE uint64_t cong(uint64_t max, uint64_t unbias, uint64_t *seed) JL_NOTSAFEPOINT { while ((*seed = 69069 * (*seed) + 362437) > unbias) ; return *seed % max; } +JL_DLLEXPORT uint64_t jl_rand(void) JL_NOTSAFEPOINT; +JL_DLLEXPORT void jl_srand(uint64_t) JL_NOTSAFEPOINT; +JL_DLLEXPORT void jl_init_rand(void); JL_DLLEXPORT extern void *jl_libjulia_internal_handle; JL_DLLEXPORT extern void *jl_RTLD_DEFAULT_handle; @@ -1156,7 +1154,6 @@ JL_DLLEXPORT const char *jl_dlfind_win32(const char *name); // libuv wrappers: JL_DLLEXPORT int jl_fs_rename(const char *src_path, const char *dst_path); -int jl_getpid(void) JL_NOTSAFEPOINT; #ifdef SEGV_EXCEPTION extern JL_DLLEXPORT jl_value_t *jl_segv_exception; diff --git a/src/runtime_ccall.cpp b/src/runtime_ccall.cpp index 02523abe73479..690062b2d98fb 100644 --- a/src/runtime_ccall.cpp +++ b/src/runtime_ccall.cpp @@ -157,7 +157,7 @@ std::string jl_format_filename(StringRef output_pattern) } switch (c) { case 'p': - outfile << jl_getpid(); + outfile << uv_os_getpid(); break; case 'd': if (got_pwd) diff --git a/src/signal-handling.c b/src/signal-handling.c index d9c53b0211eae..acaa934397485 100644 --- a/src/signal-handling.c +++ b/src/signal-handling.c @@ -341,7 +341,7 @@ JL_DLLEXPORT int jl_profile_init(size_t maxsize, uint64_t delay_nsec) profile_round_robin_thread_order[i] = i; } } - seed_cong(&profile_cong_rng_seed); + profile_cong_rng_seed = jl_rand(); unbias_cong(jl_n_threads, &profile_cong_rng_unbias); bt_data_prof = (jl_bt_element_t*) calloc(maxsize, sizeof(jl_bt_element_t)); if (bt_data_prof == NULL && maxsize > 0) diff --git a/src/signals-unix.c b/src/signals-unix.c index b4eb57a5501cb..ca624c765303f 100644 --- a/src/signals-unix.c +++ b/src/signals-unix.c @@ -897,7 +897,7 @@ static void *signal_listener(void *arg) jl_ptls_t ptls2 = jl_all_tls_states[idx]; nrunning += !jl_atomic_load_relaxed(&ptls2->sleep_check_state); } - jl_safe_printf("\ncmd: %s %d running %d of %d\n", jl_options.julia_bin ? jl_options.julia_bin : "julia", jl_getpid(), nrunning, jl_n_threads); + jl_safe_printf("\ncmd: %s %d running %d of %d\n", jl_options.julia_bin ? jl_options.julia_bin : "julia", uv_os_getpid(), nrunning, jl_n_threads); #endif jl_safe_printf("\nsignal (%d): %s\n", sig, strsignal(sig)); diff --git a/src/sys.c b/src/sys.c index 2538eaf62163c..6cf015eb05c1d 100644 --- a/src/sys.c +++ b/src/sys.c @@ -923,6 +923,40 @@ JL_DLLEXPORT size_t jl_maxrss(void) #endif } +// Simple `rand()` like function, with global seed and added thread-safety +// (but slow and insecure) +static _Atomic(uint64_t) g_rngseed; +JL_DLLEXPORT uint64_t jl_rand(void) JL_NOTSAFEPOINT +{ + uint64_t max = UINT64_MAX; + uint64_t unbias = UINT64_MAX; + uint64_t rngseed0 = jl_atomic_load_relaxed(&g_rngseed); + uint64_t rngseed; + uint64_t rnd; + do { + rngseed = rngseed0; + rnd = cong(max, unbias, &rngseed); + } while (!jl_atomic_cmpswap_relaxed(&g_rngseed, &rngseed0, rngseed)); + return rnd; +} + +JL_DLLEXPORT void jl_srand(uint64_t rngseed) JL_NOTSAFEPOINT +{ + jl_atomic_store_relaxed(&g_rngseed, rngseed); +} + +void jl_init_rand(void) JL_NOTSAFEPOINT +{ + uint64_t rngseed; + if (uv_random(NULL, NULL, &rngseed, sizeof(rngseed), 0, NULL)) { + ios_puts("WARNING: Entropy pool not available to seed RNG; using ad-hoc entropy sources.\n", ios_stderr); + rngseed = uv_hrtime(); + rngseed ^= int64hash(uv_os_getpid()); + } + jl_srand(rngseed); + srand(rngseed); +} + #ifdef __cplusplus } #endif diff --git a/src/task.c b/src/task.c index 1dd4e76b8ba1c..09d6e04c77646 100644 --- a/src/task.c +++ b/src/task.c @@ -706,12 +706,12 @@ JL_DLLEXPORT void jl_rethrow_other(jl_value_t *e JL_MAYBE_UNROOTED) There is a pure Julia implementation in stdlib that tends to be faster when used from within Julia, due to inlining and more agressive architecture-specific optimizations. */ -JL_DLLEXPORT uint64_t jl_tasklocal_genrandom(jl_task_t *task) JL_NOTSAFEPOINT +uint64_t jl_genrandom(uint64_t rngState[4]) JL_NOTSAFEPOINT { - uint64_t s0 = task->rngState0; - uint64_t s1 = task->rngState1; - uint64_t s2 = task->rngState2; - uint64_t s3 = task->rngState3; + uint64_t s0 = rngState[0]; + uint64_t s1 = rngState[1]; + uint64_t s2 = rngState[2]; + uint64_t s3 = rngState[3]; uint64_t t = s1 << 17; uint64_t tmp = s0 + s3; @@ -723,14 +723,14 @@ JL_DLLEXPORT uint64_t jl_tasklocal_genrandom(jl_task_t *task) JL_NOTSAFEPOINT s2 ^= t; s3 = (s3 << 45) | (s3 >> 19); - task->rngState0 = s0; - task->rngState1 = s1; - task->rngState2 = s2; - task->rngState3 = s3; + rngState[0] = s0; + rngState[1] = s1; + rngState[2] = s2; + rngState[3] = s3; return res; } -void rng_split(jl_task_t *from, jl_task_t *to) JL_NOTSAFEPOINT +static void rng_split(jl_task_t *from, jl_task_t *to) JL_NOTSAFEPOINT { /* TODO: consider a less ad-hoc construction Ideally we could just use the output of the random stream to seed the initial @@ -748,10 +748,10 @@ void rng_split(jl_task_t *from, jl_task_t *to) JL_NOTSAFEPOINT 0x3688cf5d48899fa7 == hash(UInt(3))|0x01 0x867b4bb4c42e5661 == hash(UInt(4))|0x01 */ - to->rngState0 = 0x02011ce34bce797f * jl_tasklocal_genrandom(from); - to->rngState1 = 0x5a94851fb48a6e05 * jl_tasklocal_genrandom(from); - to->rngState2 = 0x3688cf5d48899fa7 * jl_tasklocal_genrandom(from); - to->rngState3 = 0x867b4bb4c42e5661 * jl_tasklocal_genrandom(from); + to->rngState[0] = 0x02011ce34bce797f * jl_genrandom(from->rngState); + to->rngState[1] = 0x5a94851fb48a6e05 * jl_genrandom(from->rngState); + to->rngState[2] = 0x3688cf5d48899fa7 * jl_genrandom(from->rngState); + to->rngState[3] = 0x867b4bb4c42e5661 * jl_genrandom(from->rngState); } JL_DLLEXPORT jl_task_t *jl_new_task(jl_function_t *start, jl_value_t *completion_future, size_t ssize) diff --git a/src/threading.c b/src/threading.c index f6e053df410c5..c8c0b7d5cfa8f 100644 --- a/src/threading.c +++ b/src/threading.c @@ -303,7 +303,7 @@ jl_ptls_t jl_init_threadtls(int16_t tid) { jl_ptls_t ptls = (jl_ptls_t)calloc(1, sizeof(jl_tls_states_t)); ptls->system_id = (jl_thread_t)(uintptr_t)uv_thread_self(); - seed_cong(&ptls->rngseed); + ptls->rngseed = jl_rand(); #ifdef _OS_WINDOWS_ if (tid == 0) { if (!DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), diff --git a/stdlib/Random/src/RNGs.jl b/stdlib/Random/src/RNGs.jl index a50f633e68a9c..8c26e5e211586 100644 --- a/stdlib/Random/src/RNGs.jl +++ b/stdlib/Random/src/RNGs.jl @@ -2,50 +2,6 @@ ## RandomDevice -if Sys.iswindows() - struct RandomDevice <: AbstractRNG - buffer::Vector{UInt128} - - RandomDevice() = new(Vector{UInt128}(undef, 1)) - end - - function rand(rd::RandomDevice, sp::SamplerBoolBitInteger) - rand!(rd, rd.buffer) - @inbounds return rd.buffer[1] % sp[] - end - - show(io::IO, ::RandomDevice) = print(io, RandomDevice, "()") - -else # !windows - struct RandomDevice <: AbstractRNG - unlimited::Bool - - RandomDevice(; unlimited::Bool=true) = new(unlimited) - end - - getfile(rd::RandomDevice) = Base._get_dev_random_fd(rd.unlimited) - - rand(rd::RandomDevice, sp::SamplerBoolBitInteger) = read(getfile(rd), sp[]) - rand(rd::RandomDevice, ::SamplerType{Bool}) = read(getfile(rd), UInt8) % Bool - - show(io::IO, rd::RandomDevice) = - print(io, RandomDevice, rd.unlimited ? "()" : "(unlimited=false)") -end # os-test - -# NOTE: this can't be put within the if-else block above -for T in (Bool, BitInteger_types...) - if Sys.iswindows() - @eval function rand!(rd::RandomDevice, A::Array{$T}, ::SamplerType{$T}) - Base.RtlGenRandom!(A) - A - end - else - @eval rand!(rd::RandomDevice, A::Array{$T}, ::SamplerType{$T}) = read!(getfile(rd), A) - end -end - -# RandomDevice produces natively UInt64 -rng_native_52(::RandomDevice) = UInt64 """ RandomDevice() @@ -54,11 +10,31 @@ Create a `RandomDevice` RNG object. Two such objects will always generate different streams of random numbers. The entropy is obtained from the operating system. """ -RandomDevice - -RandomDevice(::Nothing) = RandomDevice() +struct RandomDevice <: AbstractRNG; end +RandomDevice(seed::Nothing) = RandomDevice() seed!(rng::RandomDevice) = rng +rand(rd::RandomDevice, sp::SamplerBoolBitInteger) = Libc.getrandom!(Ref{sp[]}())[] +rand(rd::RandomDevice, ::SamplerType{Bool}) = rand(rd, UInt8) % Bool +function rand!(rd::RandomDevice, A::Array{Bool}, ::SamplerType{Bool}) + Libc.getrandom!(A) + # we need to mask the result so that only the LSB in each byte can be non-zero + GC.@preserve A begin + p = Ptr{UInt8}(pointer(A)) + for i = 1:length(A) + unsafe_store!(p, unsafe_load(p) & 0x1) + p += 1 + end + end + return A +end +for T in BitInteger_types + @eval rand!(rd::RandomDevice, A::Array{$T}, ::SamplerType{$T}) = Libc.getrandom!(A) +end + +# RandomDevice produces natively UInt64 +rng_native_52(::RandomDevice) = UInt64 + ## MersenneTwister @@ -307,11 +283,10 @@ end function make_seed() try return rand(RandomDevice(), UInt32, 4) - catch - println(stderr, - "Entropy pool not available to seed RNG; using ad-hoc entropy sources.") - Base._ad_hoc_entropy_source() - return make_seed(seed) + catch ex + ex isa IOError || rethrow() + @warn "Entropy pool not available to seed RNG; using ad-hoc entropy sources." + return make_seed(Libc.rand()) end end diff --git a/stdlib/Random/test/runtests.jl b/stdlib/Random/test/runtests.jl index c8be4c95cdaf2..6c79f531826bc 100644 --- a/stdlib/Random/test/runtests.jl +++ b/stdlib/Random/test/runtests.jl @@ -449,6 +449,7 @@ end @testset "rand(Bool) uniform distribution" begin for n in [rand(1:8), rand(9:16), rand(17:64)] a = zeros(Bool, n) + a8 = unsafe_wrap(Array, Ptr{UInt8}(pointer(a)), length(a); own=false) # unsafely observe the actual bit patterns in `a` as = zeros(Int, n) # we will test statistical properties for each position of a, # but also for 3 linear combinations of positions (for the array version) @@ -466,6 +467,7 @@ end end else as .+= rand!(rng, a) + @test all(x -> x === 0x00 || x === 0x01, a8) aslcs .+= [xor(getindex.(Ref(a), lcs[i])...) for i in 1:3] end end @@ -912,9 +914,6 @@ end @testset "RandomDevice" begin @test string(RandomDevice()) == "$RandomDevice()" - if !Sys.iswindows() - @test string(RandomDevice(unlimited=false)) == "$RandomDevice(unlimited=false)" - end end end diff --git a/test/error.jl b/test/error.jl index 913d303496e3e..1dae62fb91e58 100644 --- a/test/error.jl +++ b/test/error.jl @@ -6,11 +6,11 @@ @test maximum(ExponentialBackOff(n=10, max_delay=0.06)) == 0.06 ratio(x) = x[2:end]./x[1:end-1] @test all(x->x ≈ 10.0, ratio(collect(ExponentialBackOff(n=10, max_delay=Inf, factor=10, jitter=0.0)))) - Test.guardseed(12345) do - x = ratio(collect(ExponentialBackOff(n=100, max_delay=Inf, factor=1, jitter=0.1))) - xm = sum(x) / length(x) - @test abs(xm - 1.0) < 0.01 - end + Libc.srand(12345) + x = ratio(collect(ExponentialBackOff(n=100, max_delay=Inf, factor=1, jitter=0.1))) + xm = sum(x) / length(x) + @test abs(xm - 1.0) < 0.01 + Libc.srand() end @testset "retrying after errors" begin function foo_error(c, n) From 6a05297f202a9a9b43c43f3e7fda4397fb9aeb43 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Thu, 14 Jul 2022 15:50:29 -0400 Subject: [PATCH 235/369] give finalizers their own RNG state (#45212) fixes #42752 (cherry picked from commit 85b895bb6919ea86d9b6201108af3a66930a349b) --- src/gc.c | 16 ++++++++++++++++ src/task.c | 12 ++++++------ stdlib/Random/src/RNGs.jl | 1 + stdlib/Random/test/runtests.jl | 23 +++++++++++++++++++++++ 4 files changed, 46 insertions(+), 6 deletions(-) diff --git a/src/gc.c b/src/gc.c index 97669e0acfe61..b54f64ffa00fd 100644 --- a/src/gc.c +++ b/src/gc.c @@ -371,6 +371,15 @@ static void jl_gc_run_finalizers_in_list(jl_task_t *ct, arraylist_t *list) JL_GC_POP(); } +static uint64_t finalizer_rngState[4]; + +void jl_rng_split(uint64_t to[4], uint64_t from[4]); + +JL_DLLEXPORT void jl_gc_init_finalizer_rng_state(void) +{ + jl_rng_split(finalizer_rngState, jl_current_task->rngState); +} + static void run_finalizers(jl_task_t *ct) { // Racy fast path: @@ -392,9 +401,16 @@ static void run_finalizers(jl_task_t *ct) } jl_atomic_store_relaxed(&jl_gc_have_pending_finalizers, 0); arraylist_new(&to_finalize, 0); + + uint64_t save_rngState[4]; + memcpy(&save_rngState[0], &ct->rngState[0], sizeof(save_rngState)); + jl_rng_split(ct->rngState, finalizer_rngState); + // This releases the finalizers lock. jl_gc_run_finalizers_in_list(ct, &copied_list); arraylist_free(&copied_list); + + memcpy(&ct->rngState[0], &save_rngState[0], sizeof(save_rngState)); } JL_DLLEXPORT void jl_gc_run_pending_finalizers(jl_task_t *ct) diff --git a/src/task.c b/src/task.c index 09d6e04c77646..34e5d618e2bf1 100644 --- a/src/task.c +++ b/src/task.c @@ -730,7 +730,7 @@ uint64_t jl_genrandom(uint64_t rngState[4]) JL_NOTSAFEPOINT return res; } -static void rng_split(jl_task_t *from, jl_task_t *to) JL_NOTSAFEPOINT +void jl_rng_split(uint64_t to[4], uint64_t from[4]) JL_NOTSAFEPOINT { /* TODO: consider a less ad-hoc construction Ideally we could just use the output of the random stream to seed the initial @@ -748,10 +748,10 @@ static void rng_split(jl_task_t *from, jl_task_t *to) JL_NOTSAFEPOINT 0x3688cf5d48899fa7 == hash(UInt(3))|0x01 0x867b4bb4c42e5661 == hash(UInt(4))|0x01 */ - to->rngState[0] = 0x02011ce34bce797f * jl_genrandom(from->rngState); - to->rngState[1] = 0x5a94851fb48a6e05 * jl_genrandom(from->rngState); - to->rngState[2] = 0x3688cf5d48899fa7 * jl_genrandom(from->rngState); - to->rngState[3] = 0x867b4bb4c42e5661 * jl_genrandom(from->rngState); + to[0] = 0x02011ce34bce797f * jl_genrandom(from); + to[1] = 0x5a94851fb48a6e05 * jl_genrandom(from); + to[2] = 0x3688cf5d48899fa7 * jl_genrandom(from); + to[3] = 0x867b4bb4c42e5661 * jl_genrandom(from); } JL_DLLEXPORT jl_task_t *jl_new_task(jl_function_t *start, jl_value_t *completion_future, size_t ssize) @@ -791,7 +791,7 @@ JL_DLLEXPORT jl_task_t *jl_new_task(jl_function_t *start, jl_value_t *completion // Inherit logger state from parent task t->logstate = ct->logstate; // Fork task-local random state from parent - rng_split(ct, t); + jl_rng_split(t->rngState, ct->rngState); // there is no active exception handler available on this stack yet t->eh = NULL; t->sticky = 1; diff --git a/stdlib/Random/src/RNGs.jl b/stdlib/Random/src/RNGs.jl index 8c26e5e211586..d4dbfa648dc79 100644 --- a/stdlib/Random/src/RNGs.jl +++ b/stdlib/Random/src/RNGs.jl @@ -375,6 +375,7 @@ end function __init__() seed!(GLOBAL_RNG) + ccall(:jl_gc_init_finalizer_rng_state, Cvoid, ()) end diff --git a/stdlib/Random/test/runtests.jl b/stdlib/Random/test/runtests.jl index 6c79f531826bc..1469184c5b1b6 100644 --- a/stdlib/Random/test/runtests.jl +++ b/stdlib/Random/test/runtests.jl @@ -975,3 +975,26 @@ end @test minimum(m) >= 0.094 @test maximum(m) <= 0.106 end + +# issue #42752 +# test that running finalizers that launch tasks doesn't change RNG stream +function f42752(do_gc::Bool, cell = (()->Any[[]])()) + a = rand() + if do_gc + finalizer(cell[1]) do _ + @async nothing + end + cell[1] = nothing + GC.gc() + end + b = rand() + (a, b) +end +guardseed() do + for _ in 1:4 + Random.seed!(1) + val = f42752(false) + Random.seed!(1) + @test f42752(true) === val + end +end From 6ba1d23fca0144d937f356af65e945709a98cd8f Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Tue, 19 Jul 2022 14:23:15 +0200 Subject: [PATCH 236/369] Update LLVM to include additional patches. (#46091) --- deps/Versions.make | 8 +- deps/checksums/clang | 116 ++++---- deps/checksums/llvm | 468 ++++++++++++++++---------------- deps/llvm.version | 4 +- stdlib/libLLVM_jll/Project.toml | 2 +- 5 files changed, 299 insertions(+), 299 deletions(-) diff --git a/deps/Versions.make b/deps/Versions.make index c250dfe984671..91d5285f964c5 100644 --- a/deps/Versions.make +++ b/deps/Versions.make @@ -15,7 +15,7 @@ CSL_JLL_NAME := CompilerSupportLibraries # Clang (paired with LLVM, only here as a JLL download) CLANG_JLL_NAME := Clang -CLANG_JLL_VER := 13.0.1+2 +CLANG_JLL_VER := 13.0.1+3 # DSFMT DSFMT_VER := 2.2.4 @@ -45,13 +45,13 @@ LIBUV_JLL_NAME := LibUV # LLVM LLVM_VER := 13.0.1 -LLVM_ASSERT_JLL_VER := 13.0.1+2 +LLVM_ASSERT_JLL_VER := 13.0.1+3 LLVM_JLL_NAME := libLLVM # LLVM_tools (downloads LLVM_jll to get things like `lit` and `opt`) LLVM_TOOLS_JLL_NAME := LLVM -LLVM_TOOLS_JLL_VER := 13.0.1+2 -LLVM_TOOLS_ASSERT_JLL_VER := 13.0.1+2 +LLVM_TOOLS_JLL_VER := 13.0.1+3 +LLVM_TOOLS_ASSERT_JLL_VER := 13.0.1+3 # LLVM libunwind LLVMUNWIND_VER := 12.0.1 diff --git a/deps/checksums/clang b/deps/checksums/clang index 33424cdb4ac49..928ea6e91afc2 100644 --- a/deps/checksums/clang +++ b/deps/checksums/clang @@ -1,58 +1,58 @@ -Clang.v13.0.1+2.aarch64-apple-darwin.tar.gz/md5/49ca7159ca2c064ded33a7a223d6f409 -Clang.v13.0.1+2.aarch64-apple-darwin.tar.gz/sha512/354a600f210e0b6b6fa4db3315145c4eea8aa3ae2fc3d800c99c02f1a62798181dfd7b75eaf82fe0df1ddbb81e78906c5376a2fcf9f367317a08d3502bba5f80 -Clang.v13.0.1+2.aarch64-linux-gnu-cxx03.tar.gz/md5/66bb905108af01561661d0a7d7f62ff5 -Clang.v13.0.1+2.aarch64-linux-gnu-cxx03.tar.gz/sha512/706e5950194988ffb7c6de59442744d2613141e00c2485e369d1fbfccb816090d7043fd8de368c7c46bded1dd1d9a258491ec552fc0de1fdddb2de3ae858ccdc -Clang.v13.0.1+2.aarch64-linux-gnu-cxx11.tar.gz/md5/f8afd07e400ba048659ccc488c26dacc -Clang.v13.0.1+2.aarch64-linux-gnu-cxx11.tar.gz/sha512/f708eebb2b505b1841af007a5e60a5a41d09c8c01546ef5eb66c25d3b9cfbb17a58fac2cfb29d5f4522c91d36d203577611ed49cb29f8f81825db031b93d7cdc -Clang.v13.0.1+2.aarch64-linux-musl-cxx03.tar.gz/md5/d03e27c1f08a63364a15d9c479b9bebe -Clang.v13.0.1+2.aarch64-linux-musl-cxx03.tar.gz/sha512/1ba08f194abae2af4af742815edc1f73d52449065c9d515dc35ee18dc1aaf5486dfdc0e691709f78b98b191b208fa66fb6e2850f021a472b2f6e699576966a6e -Clang.v13.0.1+2.aarch64-linux-musl-cxx11.tar.gz/md5/00050161006c9ff42b6685e4784f7fc0 -Clang.v13.0.1+2.aarch64-linux-musl-cxx11.tar.gz/sha512/9502305b02bf01d96f1261f31db826374aff4c65b6ec7f043d2b80bf2693a9ef2688fddfb7d53a78254a0b18e40e2d13f035d1cadaf5d0aeec001efaf5ba12c8 -Clang.v13.0.1+2.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/7300c2fcbd210d201a7a3fb773f5d815 -Clang.v13.0.1+2.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/145b44ca3b98ee2450db5f738aaafb3d8560a2eed269d5ddb79f6730024d12d46dbb1e791617eeb2bae27b3474c344d72c22ae610651e083a00d9315d3718d7e -Clang.v13.0.1+2.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/3252d02cef57383411ccb906f29b062a -Clang.v13.0.1+2.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/cc0851d831684e8b7ebf8f43a5d159f041302c0905c2035efcf1bb45dc92073db32570fed63ac73df20271b6e3dddf5a637a99c8b687096de2fb85369f8fe8f5 -Clang.v13.0.1+2.armv6l-linux-musleabihf-cxx03.tar.gz/md5/011545522e96b09e6766be3eddb7d86c -Clang.v13.0.1+2.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/e1c1db11dd7e408ff6d47c0d6247c2fe8aff1b85160deb0f5a8bbfb35c0faf50f12d07296e5f5b30c38c879a3c45f0dec2005e710adad5336ebf46acbde53572 -Clang.v13.0.1+2.armv6l-linux-musleabihf-cxx11.tar.gz/md5/f94ba0082e8823b0bd41f15a38502718 -Clang.v13.0.1+2.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/492ef0d7af2e4176b43751a6f6ffd88c89404589964f7a8c9a957537e3d2ef3d0a9bf277e539589bd4b2b705b43f13ed22f7fec8a75f0400d185833537226331 -Clang.v13.0.1+2.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/c899ce799934067a8037a16e4347d26f -Clang.v13.0.1+2.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/424af8ae2d6735495751d9183c1189afe67a135cc8acd5ca1b2ee6598e6efba3efd1f45a7d1b14cf67c2aa6512a4b088581a4da879ec9e184c9125684e5ccaa3 -Clang.v13.0.1+2.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/66b9e334eb7a2ac5552460d51aa1b895 -Clang.v13.0.1+2.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/01b29f509355fd054e7ba656d7349de90a191ab4992af86f90dfb7de3631a23b3dddc43743ce1dee9e7a5d7855f3a9d6c3525ae9f6581c271139dc7796a50bd7 -Clang.v13.0.1+2.armv7l-linux-musleabihf-cxx03.tar.gz/md5/5bbdc99bf639afcd1079d8c78cd483af -Clang.v13.0.1+2.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/250533d74c4dddc7f5a0ae16deb5d2ee53b1c6870e59e569452bc986e2bc2ccc20bdba5bd0e13124715d924beae531f51d7f9127670f0a3a29d5e4f8fdc59740 -Clang.v13.0.1+2.armv7l-linux-musleabihf-cxx11.tar.gz/md5/6ecb7768b76798d3aca784649da83409 -Clang.v13.0.1+2.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/fb88840b95c1426406b2ea80ee9c399a4ab32157154feddc72e4de8636ebe400849eb302b7744fb8ee506c7f2613aa65bf1e886fdc4bddace1db1aea009e022c -Clang.v13.0.1+2.i686-linux-gnu-cxx03.tar.gz/md5/ebc9cefaa748a0488a2ca4e5e499dd8e -Clang.v13.0.1+2.i686-linux-gnu-cxx03.tar.gz/sha512/13c6743745416b5e67e77c0cc430bb827288311e80d48bd06e03540f7b98e1456d7c73f78fd93240832f08ba43128ac65c5d10bafe517eb0ab953304ebdb4567 -Clang.v13.0.1+2.i686-linux-gnu-cxx11.tar.gz/md5/02761e159f30691376a1874c9a795d34 -Clang.v13.0.1+2.i686-linux-gnu-cxx11.tar.gz/sha512/903a44718282a5625c445536e31576fb91e429ee1bc48b1b033f099f24b293933deac6dcd378fa49257c19f01a35b34f80af42cd355759c3acda1afd3c9ac1b7 -Clang.v13.0.1+2.i686-linux-musl-cxx03.tar.gz/md5/cf269ef3cf165dfc2c7882eaca1f0463 -Clang.v13.0.1+2.i686-linux-musl-cxx03.tar.gz/sha512/d23230838f282a3771939766ac31a2e0e93c5a4e3040b10443e9aee14125700c1cf5c9d92e46e49d9095c7a5709d1bad5178a34e1e0336135772c7f752b8fc01 -Clang.v13.0.1+2.i686-linux-musl-cxx11.tar.gz/md5/152bf5b8acefb741d6a2231945d4d43f -Clang.v13.0.1+2.i686-linux-musl-cxx11.tar.gz/sha512/ed0f9622e44be508a792bc467c87846e672ac2750598dcd416b8b4418ba0e5dbc85e99ced40dc8184db68c2e27e342ecf8609feb077cac395805ab3088f150f7 -Clang.v13.0.1+2.i686-w64-mingw32-cxx03.tar.gz/md5/d676f0e17e2d4f235a571d00f0eeb46a -Clang.v13.0.1+2.i686-w64-mingw32-cxx03.tar.gz/sha512/f2b31fef42800796fab7961508de8aa9baee4cc095af6d7eb441c63a70b3b9a0447d1926b1044190f8fb0d22b3215dfc03277178fdfe96ccd458c6ce28b71421 -Clang.v13.0.1+2.i686-w64-mingw32-cxx11.tar.gz/md5/2bd3ce011bc7da537edf0579a5e4ac68 -Clang.v13.0.1+2.i686-w64-mingw32-cxx11.tar.gz/sha512/67f8d59304f77170a6f8780a750980f946e4aa129f855c97d92039569311077aeda93ed437794752494934e46a4e09fbe42b7f85f001c522bd81e33a8b170dec -Clang.v13.0.1+2.powerpc64le-linux-gnu-cxx03.tar.gz/md5/a51cce404a43140a71c146a5375ed69b -Clang.v13.0.1+2.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/9e45a6b2bd44c6cbcf158972c2bb0a55efbb4c0af135fa4487d9c43c36d643a29aa466666ecfb388722285cf0d20456528a6042b5b5c925f54479b84db3fbbde -Clang.v13.0.1+2.powerpc64le-linux-gnu-cxx11.tar.gz/md5/f0b3becd447111213d206f33d3ceb224 -Clang.v13.0.1+2.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/6ace1ccb0bf924b41db73bde2fe3d987a79c94119fe1017b7fc1ca94482542a35e4a436ff201c5be16034bbdf5b2a8d52fb3bdb7dc1c4077ad2fe1dc26911610 -Clang.v13.0.1+2.x86_64-apple-darwin.tar.gz/md5/15505fa8dde3298bfbb2b9e5f13ad376 -Clang.v13.0.1+2.x86_64-apple-darwin.tar.gz/sha512/dfb2b4dafd6c2f225e6ef098c28aa9555aba798f355efd50b811bfb42d1b2c1cf8d27e67bf25dd5e624821e967aee0c68f3e708e762c4bd4ef973d0d6b05e7d9 -Clang.v13.0.1+2.x86_64-linux-gnu-cxx03.tar.gz/md5/2297ddee8beae10360bf3e287139bd87 -Clang.v13.0.1+2.x86_64-linux-gnu-cxx03.tar.gz/sha512/c5937a52caa13b443f7bc2e3796a9da78a917040bc74684c564f535097c88be5e8714e83d166bb1c073c4783d6783c32598edfd8e121ba640bc672b818e484f2 -Clang.v13.0.1+2.x86_64-linux-gnu-cxx11.tar.gz/md5/f7ecda67d25d35fe3a62159b5fb32bbf -Clang.v13.0.1+2.x86_64-linux-gnu-cxx11.tar.gz/sha512/5b38cff3629043ae4c9bfbe353afe845ff6afdcfc628e5223ca654d52b1be33af439afbf3684c9283360f4f4f4d13611c151c1591cd3e4dae45e1e91665709c6 -Clang.v13.0.1+2.x86_64-linux-musl-cxx03.tar.gz/md5/b13aa15779d1e1a3764fc4600ffb9bc3 -Clang.v13.0.1+2.x86_64-linux-musl-cxx03.tar.gz/sha512/a667b7043b19b6f6c8d9f8c264101ffe05a318bdc93e3541e0719b761422f2cbeda01b9337777b6b327292637fc96a811827978b318564d44b5cb53eed3c2e83 -Clang.v13.0.1+2.x86_64-linux-musl-cxx11.tar.gz/md5/aaba70ed189ccd9723577d9fe3ff918b -Clang.v13.0.1+2.x86_64-linux-musl-cxx11.tar.gz/sha512/4b9fefa074bdf1d98dbde4c3a6394151e0c368228297b876b1fbd3bc64934204cdeae40e4f1d1cac31cde2a2a290a1ed86ea543a43862c4f36fe0f865752dad1 -Clang.v13.0.1+2.x86_64-unknown-freebsd.tar.gz/md5/46dbfa6898be4df10993cdc714193c82 -Clang.v13.0.1+2.x86_64-unknown-freebsd.tar.gz/sha512/d44619dd528bd1ed7e16c96b119fc9bb0b39e761641380b9dec67147f42131572a5e467a86cdad79fb61d10a26ed211e9752f7fad513259188cf7b6402715a9d -Clang.v13.0.1+2.x86_64-w64-mingw32-cxx03.tar.gz/md5/68e1fb6d07e89cc4b7d4b29fef74181d -Clang.v13.0.1+2.x86_64-w64-mingw32-cxx03.tar.gz/sha512/8dae7e50872d83758f89aba5d8bd240916bf21f16ccee747ce1a9f01d05bc06cc706e05f62a1667393af6570aa8057e008321dbdfc5235e066150258be3dc220 -Clang.v13.0.1+2.x86_64-w64-mingw32-cxx11.tar.gz/md5/b4a562ec746df756eaec1ef6b2edf81f -Clang.v13.0.1+2.x86_64-w64-mingw32-cxx11.tar.gz/sha512/d75c40b84069885f21ad4f6a2a30a7714df8f0f978329a112c92917b74974259421551b58494337846d8f3a476927dcbe3fc2f15c11b0abff69778e8cff15777 +Clang.v13.0.1+3.aarch64-apple-darwin.tar.gz/md5/29b104ecbe47b27bdca76e2bfac4e7ba +Clang.v13.0.1+3.aarch64-apple-darwin.tar.gz/sha512/b5b6a524e6f8b9ac3983b00bc2e3672c0439be63f137b234d012d922fae806f029aedc0dd81e8ff78331bea7bfb41b0abc094360d47316caa82204fca7c78389 +Clang.v13.0.1+3.aarch64-linux-gnu-cxx03.tar.gz/md5/745d6aa1ce7570d0a47a56f2e8a77ad4 +Clang.v13.0.1+3.aarch64-linux-gnu-cxx03.tar.gz/sha512/048df0ece3677687d599b3a6d4eefabce01e03cee01588a79e8bf9e1549207a8395f662132cd9b2c918a7aa385fdd8a49e575d67f6825be9722424b27cce9f4f +Clang.v13.0.1+3.aarch64-linux-gnu-cxx11.tar.gz/md5/7c4869c06f6a6bc9889fba5a8c80af6a +Clang.v13.0.1+3.aarch64-linux-gnu-cxx11.tar.gz/sha512/2635ec078e08c654c5339af78552488fa84574379e7d3d0c528dc952393b96e95400a8aef57424461c0394e869572569d7279bf236234128007975e18e590e20 +Clang.v13.0.1+3.aarch64-linux-musl-cxx03.tar.gz/md5/30426e58f03d596e1de78d2627cbc754 +Clang.v13.0.1+3.aarch64-linux-musl-cxx03.tar.gz/sha512/63a090018d00303df1b479ba0bbdc6eb1d654c399a2298340ef8b7c367bb5d75f14eac59eb863f1a7519d6c760ddb40cdddd1776b97b52fa758f1d2c6f548908 +Clang.v13.0.1+3.aarch64-linux-musl-cxx11.tar.gz/md5/9cfd407ed52761a31b5dc076792d1e8d +Clang.v13.0.1+3.aarch64-linux-musl-cxx11.tar.gz/sha512/37be75d49eac83f226e0cd9fdfe6225c03964a60066d5b772604521a99d9710dca5d18f5bd52dc44cbc009d7b0c5fb9cc761ae955a464b41da5f2ec9ba7a886a +Clang.v13.0.1+3.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/33c9677012e496dd93c6f16810060006 +Clang.v13.0.1+3.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/03b7467c7b89cebce8c10231a186e467f875a8992139f897737de5395fa384f6c95eb527172dd6a23fceddeb707ec99b27426cecb5444b54e09ba6b3e4b84611 +Clang.v13.0.1+3.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/b7149a881a72b1cb96386144746eb9a1 +Clang.v13.0.1+3.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/beddd5173e2cd7377505b97b7504346936223323e0c4af50993c450d26b7596f579419dbdf3c0104b8a18a354207788ad5dfd4b1e9f44d00fc3c6ab0dd9431e7 +Clang.v13.0.1+3.armv6l-linux-musleabihf-cxx03.tar.gz/md5/40bae6cdb747b1f56c5737650e1ca242 +Clang.v13.0.1+3.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/a7a7036956a73d905a6a4fed997b7f8284f790112a958fb6b2d9d57f06d20087dfc89f8bd7a3627e2d9d55353ed90ac5d077ff7c46933852a7402c4d7279f041 +Clang.v13.0.1+3.armv6l-linux-musleabihf-cxx11.tar.gz/md5/2246f9cdec4dd5453c27fe92c2aa2da6 +Clang.v13.0.1+3.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/575eb98dd389acd189e52ead20619b5147f73eeda9cc815734d4664a01913971879eda142b68656c48b7a75a220bf6114d28e0bdf699ea2f23112eb715f7f2b7 +Clang.v13.0.1+3.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/3ab681a3e9cfa5fb7e8199b6ad9e0711 +Clang.v13.0.1+3.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/5f8f993eeab9e2b19975c84a8e77ade7e11b5c3755bab5e9a0c0b8a01e4fe8dc3f6d0847ed2be16f93b42c9256310cb7ecb9f3d2d537024d0e6b4eb46a246408 +Clang.v13.0.1+3.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/5062d7d70313878706de86c1448bb70e +Clang.v13.0.1+3.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/156b84392f19afcc5efb6ff1c6cdd6e62f957038d175a36655431ebcc1e4f59754068a2d7146890351fcc1b6ff74741b328a8e1281d22bc21af25a53d1c8a9fd +Clang.v13.0.1+3.armv7l-linux-musleabihf-cxx03.tar.gz/md5/10f4a6fed7c664f3342186175b22804c +Clang.v13.0.1+3.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/354ec1bb2bfe13917a51cd172e12ae2ec675f271881fa728ffd4630846322c7bfb07ef0b1cd957221863ce75c03e4fb9363ab8e4405049134e8cc2eece5914ed +Clang.v13.0.1+3.armv7l-linux-musleabihf-cxx11.tar.gz/md5/91433c50a111b4a4e64f89bc926cf7ad +Clang.v13.0.1+3.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/1abf06235564eacc19f5bb678d3519b98e63f5f727b9fd98de657fe5aa947a71763aa49b106ad3ae5376d2026a12b7afe24325af69d848fc59e3e0aa14be1e9d +Clang.v13.0.1+3.i686-linux-gnu-cxx03.tar.gz/md5/2709c6871b2cb9a4882dcac5346ea867 +Clang.v13.0.1+3.i686-linux-gnu-cxx03.tar.gz/sha512/f0b84e9ca2d39db23ef6f5d9d6104582f0803102718fa576a2f422bb48f246352b981fdd3e780eb74e0f112ca1dcd63c6f49c13eeba7d8ab39cd1aeb1aeeb9a4 +Clang.v13.0.1+3.i686-linux-gnu-cxx11.tar.gz/md5/3e32b2bb40ec94ad8f4c8fe577286e02 +Clang.v13.0.1+3.i686-linux-gnu-cxx11.tar.gz/sha512/6d614d4c1ddba0fe78d549bf6a2a882567308321fad85b5747b9db3f9e2176ef28b5f7b32ebb003f19d036e755b1e8c72a19de689dcd3cbf9fe89a1a88bf15a5 +Clang.v13.0.1+3.i686-linux-musl-cxx03.tar.gz/md5/06ea1f4d33203c3915d64ab6b5f1ed01 +Clang.v13.0.1+3.i686-linux-musl-cxx03.tar.gz/sha512/9da8092e5ff1cd15428175d09e5ac2e815391d7dc80138baee9276225d5ace24734c66e383c8ed6360657474df0be43ee68f029eb3e6a6a879a72d0f5da0b572 +Clang.v13.0.1+3.i686-linux-musl-cxx11.tar.gz/md5/1eb9bc45aee0589e1d5d781b7743c823 +Clang.v13.0.1+3.i686-linux-musl-cxx11.tar.gz/sha512/b8e5a0dc0e3216b419175c1ae030e1edacc44704b04f83d41f4b555ee903dc6e2ac8d0568ce7c24e379c416852f1ca507ef0cff9d4abeed3395b21ebafe4aad6 +Clang.v13.0.1+3.i686-w64-mingw32-cxx03.tar.gz/md5/437cc45276d3bee1233308db766968cf +Clang.v13.0.1+3.i686-w64-mingw32-cxx03.tar.gz/sha512/488a6a4d6bc222f6f1f6254a7c19eafbe99751954dd8f4ba9c7a425fc4b3b49a2d48d6bd5aa3d703f71a59d662bc667950b76bbc865aa130bacda90d584f63a5 +Clang.v13.0.1+3.i686-w64-mingw32-cxx11.tar.gz/md5/6a88c0716a99b016339e28dc22d30bec +Clang.v13.0.1+3.i686-w64-mingw32-cxx11.tar.gz/sha512/ccdba53efb9743a7d41d3f27bddbd0970853ade094ebbdae1c35c42a27b488b97f9b2610256e36f433f0a17c3f8574ebed7d2d5430bc42657fb09a186154bc48 +Clang.v13.0.1+3.powerpc64le-linux-gnu-cxx03.tar.gz/md5/ed6bcaf4915cc827492320b96ee510e7 +Clang.v13.0.1+3.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/e65d787e0cfe3bb36fd816a4f16b74dbb99f30c96cc7bcba53ebea2fcc1f647bdce252df856cc783451e3c96dd93669fb5ba5ded27e65c6123e5d6709de40503 +Clang.v13.0.1+3.powerpc64le-linux-gnu-cxx11.tar.gz/md5/6af5ec7b71e0b5851d76954bf730c45c +Clang.v13.0.1+3.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/25352739f23767168660c752e6834ea9607a860d07e6a4ac2f985c0a4a7552e44804024b5abe185c2b0fd6dd4b35132923ba0f190aad8abb0f17f0a48691db34 +Clang.v13.0.1+3.x86_64-apple-darwin.tar.gz/md5/1dc57f6914486f548e431a66dcc1e9f4 +Clang.v13.0.1+3.x86_64-apple-darwin.tar.gz/sha512/199d2248287bdd3dd9074b40f3c468fb00b1e117215260c59f9ad2c80f6a20d1cac5a77822e4dade6181139451f9d4d309db0abda4ee09dbff2cd917eabb9b56 +Clang.v13.0.1+3.x86_64-linux-gnu-cxx03.tar.gz/md5/a2c0c38cbcc160906abe46e5acc6fb9c +Clang.v13.0.1+3.x86_64-linux-gnu-cxx03.tar.gz/sha512/84f2fa261244a03b9ed59c657aa477f075ebb98cc3d0bc0f765ee2de8982a1c0b71fdac0eb15aaef2b5852176074917d7ba3760918d622ca247870ffaa3aafc9 +Clang.v13.0.1+3.x86_64-linux-gnu-cxx11.tar.gz/md5/ee724a7ab8333f31226ba76850c9a94c +Clang.v13.0.1+3.x86_64-linux-gnu-cxx11.tar.gz/sha512/f1b5f1f412ebd7767ba25c5347fd6bb982b0db0f30f604591582716605dd96eeae1a306d7b956b594582095dd2a2a9ce44c94086b5f17fa0aece85d598f8fec2 +Clang.v13.0.1+3.x86_64-linux-musl-cxx03.tar.gz/md5/965f47dc273c3e00a6d25ace35e74867 +Clang.v13.0.1+3.x86_64-linux-musl-cxx03.tar.gz/sha512/e9c5e20a2fc046eaa522676b6a25bb943fc7721cfee2e00be7f63d9c43e1a635b1ed8692de56a55f0269c8baa8b94f52d0c9095b90337cc62c56809e543a29cc +Clang.v13.0.1+3.x86_64-linux-musl-cxx11.tar.gz/md5/035d3be1bb3aeb439010fe109953836b +Clang.v13.0.1+3.x86_64-linux-musl-cxx11.tar.gz/sha512/f08013b9d843bf0f7f88898d37729778512bda54ead64cb4360cc4edf1a0b43b4504c99dbe5caa99427c6b5ffe194dd98f361bee2799d41243264f0f40dd88c9 +Clang.v13.0.1+3.x86_64-unknown-freebsd.tar.gz/md5/724ccae9319c81f1ef23796e82aaef5e +Clang.v13.0.1+3.x86_64-unknown-freebsd.tar.gz/sha512/7340ac0014c731cacf9b576ab4e0897f5dbc74b82aded291fecf3e6a4885652edd544598801565ec2c5bffe53e3ff61513827a0faea7a314dc80b8bf55e11dd5 +Clang.v13.0.1+3.x86_64-w64-mingw32-cxx03.tar.gz/md5/0ad85f1a244c18e3aa50bd9e207638a8 +Clang.v13.0.1+3.x86_64-w64-mingw32-cxx03.tar.gz/sha512/49691db5dd493f1b91d84c0fe00857f0b31d1cb0bf398f5bd393afdfb1a5a9bfab083dedd6403a492fcabb87867b9bff1352ac52a516d0885bbf9c3d85b46e54 +Clang.v13.0.1+3.x86_64-w64-mingw32-cxx11.tar.gz/md5/8c80f1d91f7161dfd8e409e9897047f7 +Clang.v13.0.1+3.x86_64-w64-mingw32-cxx11.tar.gz/sha512/d282f9cfc3336af5d9ccdefed2dfbf188d22b05617c86f98fe41afcfb28bcd0b919aa4fe51bdfb4f1bda9a099490d00e97c4c5972eff0be4a0b20cb68b143dc9 diff --git a/deps/checksums/llvm b/deps/checksums/llvm index d1dfdc0d7f2a5..b1791ca666311 100644 --- a/deps/checksums/llvm +++ b/deps/checksums/llvm @@ -1,61 +1,61 @@ -LLVM.v13.0.1+2.aarch64-apple-darwin.tar.gz/md5/6815ee15551aa80f13f9eb61605c5e22 -LLVM.v13.0.1+2.aarch64-apple-darwin.tar.gz/sha512/a8fa0e03574965227b764c05bc4c8621e691d94515c3d07d47ec5f01c0559f98ff8aba7ef6f40e38cf4870de45f39ad070a80b4c1be8b70eed6916d6a4060323 -LLVM.v13.0.1+2.aarch64-linux-gnu-cxx03.tar.gz/md5/b728279d46118d1956e0cadb4baddbcc -LLVM.v13.0.1+2.aarch64-linux-gnu-cxx03.tar.gz/sha512/01975b8759cbbc10dfac452aab57e1d64b71930812854c6875895d32456400548327940c2fa17d3ddec6671bced60fa81c9080fda1179e213b1f3e2ce621546f -LLVM.v13.0.1+2.aarch64-linux-gnu-cxx11.tar.gz/md5/9baa16cdbb3d061d011495d169181dd9 -LLVM.v13.0.1+2.aarch64-linux-gnu-cxx11.tar.gz/sha512/28dd7d67609cdf3d28464eda565a28c893d13e3019ec2d8969fe118cd90a4caea3b5c5ade8215b14bb2db96ca704e94893e800d4130d85aea1a757eecd6d325a -LLVM.v13.0.1+2.aarch64-linux-musl-cxx03.tar.gz/md5/6dbbabf22fac39bf2ae0b457ecf7b33a -LLVM.v13.0.1+2.aarch64-linux-musl-cxx03.tar.gz/sha512/460355189f72a47afca677c119d34dc58897612121219c482decb447272409a1558904346692cdc05fd83571d8af71ec058c2cf48a30473c16665e46d83b236c -LLVM.v13.0.1+2.aarch64-linux-musl-cxx11.tar.gz/md5/d590608235f692f974168702490963ac -LLVM.v13.0.1+2.aarch64-linux-musl-cxx11.tar.gz/sha512/56a89ac86b9d1a28baf1d2f246c9353e7d51931189c02a96aeaea23e3094fe48785085efa986ab01b7ac4118f42c3fac0f1844907ed0f2fa0375ff4d789f4c60 -LLVM.v13.0.1+2.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/341b2814710a2d012f2ea47e0ecb9a33 -LLVM.v13.0.1+2.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/9af49ea105a90199163f34ef4f6cc480a125e7d637d3ed26122476d8facba3d2beabd70b12239ec00c123ddbdcd8332cbe79476ea2a0d507fe169270cfdf57bc -LLVM.v13.0.1+2.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/c20bf6b9e83179745451ad077a66d789 -LLVM.v13.0.1+2.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/15a1be3aa4791036bd30d39a541ffe131ecf5e2b8636b7617aac82dd4ab8aadae937d526de35c5aaeed3c9ff2598a2f4da07b7601b549d047b07c01979dc49c3 -LLVM.v13.0.1+2.armv6l-linux-musleabihf-cxx03.tar.gz/md5/366ea65aab6eff78d311d4e68ee4f008 -LLVM.v13.0.1+2.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/665556314ff0a9faaf8813f691c9f4d0fcb9f01878543c30113259233d22652ec3750cde8deca3e9d08eed7930568d68d71fc7913299a065f90e0c2db15b01d7 -LLVM.v13.0.1+2.armv6l-linux-musleabihf-cxx11.tar.gz/md5/386a521b3bd07787ae39d1bdd04749c6 -LLVM.v13.0.1+2.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/fae5cadf82a25c32df40744d831ff499f7a38b3e67622fe6bad25735bda921b42cdf46ae97476eba34097070625e2d389c13658d33383d9c30434ec6fb0c86a7 -LLVM.v13.0.1+2.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/a8f5a44968b76c3b9ffc9f167b8d7019 -LLVM.v13.0.1+2.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/1194766a8b9e8383ce9571b118800b5dd8638bc6bd81b70f0748bff2904155b1d3dc12b04a2cd49b569cbabbe5838e1aca80fb932159d4f6131a3b301fcc25d8 -LLVM.v13.0.1+2.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/929e2cb09e3ee879d079c756ed45e807 -LLVM.v13.0.1+2.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/05076dd00ead60efe0565e2429f28b7c8db8e18b375ddff9839924d0edd2fb8c5de75c3e8096c8b4425a85e3d79bfc9e3f05c8e445ed185d4024a2101bd98324 -LLVM.v13.0.1+2.armv7l-linux-musleabihf-cxx03.tar.gz/md5/2cab2db22a48a03e58e37371cb60fb95 -LLVM.v13.0.1+2.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/a8420c326d21b975cd2be24809b523722dfcb44f3721a10fa9ff9e37b20d28a9ecf868cef84fa8ab01fac14fd321487fe555c06427aa1776cca4712a22dc2008 -LLVM.v13.0.1+2.armv7l-linux-musleabihf-cxx11.tar.gz/md5/ce5efd7e8646572719f2faf39df99f0e -LLVM.v13.0.1+2.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/752c66ed76d25970c796e92900a371e42e1812cb5aad5440a5f769f7bdbea8d9984ac0822b15dcf6bb59209bada33427cafba57abf2100c27bf97db603f6032e -LLVM.v13.0.1+2.i686-linux-gnu-cxx03.tar.gz/md5/477bf71f1757565fac29bfcf25a89ebd -LLVM.v13.0.1+2.i686-linux-gnu-cxx03.tar.gz/sha512/56114bf02a2d84a2e3c875c486b8186c07b6300fc4433b277010c0931365e582dfc820a357af4a23c831ef5ca84d7214764d4787c53f543f75f5b57c2569ad72 -LLVM.v13.0.1+2.i686-linux-gnu-cxx11.tar.gz/md5/e21d6ac180e25cd60e10beeb32702152 -LLVM.v13.0.1+2.i686-linux-gnu-cxx11.tar.gz/sha512/1baf767b024d5d0ffd5040c7cddf8f31f66f47819aa924bfb3545dcf63eeaf611518b802d29957b8009b03df553d6b3f018e4090885cc0cf7d9d79385e8f4bf3 -LLVM.v13.0.1+2.i686-linux-musl-cxx03.tar.gz/md5/ff449600df86f6ded0798ced95e7db36 -LLVM.v13.0.1+2.i686-linux-musl-cxx03.tar.gz/sha512/eb379ce9f84f36665a17002c86b0f59733e23809267736b628123f82482ac5af17ce649f7bd77751921db58a7a79a82ccb95e27a5214ad0abe6ac465f66da995 -LLVM.v13.0.1+2.i686-linux-musl-cxx11.tar.gz/md5/087a933781b85de3729d5db84fa20cd7 -LLVM.v13.0.1+2.i686-linux-musl-cxx11.tar.gz/sha512/7a52633e487273d82637e3a24c7efd788fcfc01be424505fb34aed4665cfe60b6ae04953c808476bfecf4f2022bccf01ee245b99f759baa9de9cd1f163faf12b -LLVM.v13.0.1+2.i686-w64-mingw32-cxx03.tar.gz/md5/b4ecd35d0e0dc5e675e62169f217f191 -LLVM.v13.0.1+2.i686-w64-mingw32-cxx03.tar.gz/sha512/8bc51431c5852df4c6145f7a5518fbb2bc4b5a8710aab8d8a5af4f0a128356fb259f9eff477abd0c91506c22e480af496fd9c05728b6b45993c26688eebb3b50 -LLVM.v13.0.1+2.i686-w64-mingw32-cxx11.tar.gz/md5/fec011e6f4eabde8123402aa8f1c35ae -LLVM.v13.0.1+2.i686-w64-mingw32-cxx11.tar.gz/sha512/a3f5d8849cf35cb27aec8241187fb60c1de7c4bc6248b7e777c18407c005f57e5a2e843886f1a514419f4abbf8c5df2ff2cbbc7a973b1620630ee8c8794f02e0 -LLVM.v13.0.1+2.powerpc64le-linux-gnu-cxx03.tar.gz/md5/26f7fc57f435a103511f2808b14abe3e -LLVM.v13.0.1+2.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/2364470348b727771919bfc5dc92d2e81532c8021e7a7c47df3595f546cd0e155a8dcce5a899ff593de46ffdee1bc574e5b5591941648593057ad118c8d3904f -LLVM.v13.0.1+2.powerpc64le-linux-gnu-cxx11.tar.gz/md5/c9acc3d5378866db53f51e4347e59f37 -LLVM.v13.0.1+2.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/b6d1db7096bbf831619990e8e4307b8ae6483ab004649412346afdff64ba14d355ae829dd993a10d418396b001754f40030ad1ea7f3bc89acf7ff044671f7a0d -LLVM.v13.0.1+2.x86_64-apple-darwin.tar.gz/md5/c9d2b7b516d61602ae26bf6e3de02a5f -LLVM.v13.0.1+2.x86_64-apple-darwin.tar.gz/sha512/2ae15491e51828f60d35a6c16b63ca3ccc5089f84418fbc317834439a4160d95370139cbde0e62010e64020067eafafbcea28bbaf05fde19dd407f497eae6b4f -LLVM.v13.0.1+2.x86_64-linux-gnu-cxx03.tar.gz/md5/5fcd6aaaa858b1540a84dc766147289f -LLVM.v13.0.1+2.x86_64-linux-gnu-cxx03.tar.gz/sha512/7bb91cb89fd50afee9613d117cbad32b53dd101d6b58d6f8e134dba5462129e856837dafd9faa745f5c5412d6a3b8de237e691cb70189c90bee04f4308669c59 -LLVM.v13.0.1+2.x86_64-linux-gnu-cxx11.tar.gz/md5/a021bf040adc51fcebc64da3c4b6a84c -LLVM.v13.0.1+2.x86_64-linux-gnu-cxx11.tar.gz/sha512/0b6dff3addf1cf48f384738a83b99aaeb540d28089f86196532e2b103b2671f440ab469599c261f9a3644361766e3f397bc4f834e0718a75db12beea0c81cd1a -LLVM.v13.0.1+2.x86_64-linux-musl-cxx03.tar.gz/md5/d1387495bd3fa2aa4418cf589670d473 -LLVM.v13.0.1+2.x86_64-linux-musl-cxx03.tar.gz/sha512/37c19f25ddbf44ede9a6942a6118ea38b54368e97b0d7c12d23498623c5bd6cacc7c784a85df491c682d34d6a96e3aa6063bb9fbc4f4828bfa440c4e49b93390 -LLVM.v13.0.1+2.x86_64-linux-musl-cxx11.tar.gz/md5/5240bb7c39a0a91893d5aea6064c1364 -LLVM.v13.0.1+2.x86_64-linux-musl-cxx11.tar.gz/sha512/60898ab7e662f5eb86ddda86debb6dff1a6b86732c2eda1dccd89b7782edaaa554af2e8a2e29e5d4dd5a7d1407d8ca7a94e4db93f1c8e7cf7468d79b4cda9a85 -LLVM.v13.0.1+2.x86_64-unknown-freebsd.tar.gz/md5/b086062730235e7669ed3df473be9a41 -LLVM.v13.0.1+2.x86_64-unknown-freebsd.tar.gz/sha512/8ebe5230c59ebd9066d339878dca2c0fb7f9e505ca5f00c87cedc6a2b3b9b621a3a33da077611f7fcfdd940a8268790b9fdde3bf5339137a7a958a9c8a01d81d -LLVM.v13.0.1+2.x86_64-w64-mingw32-cxx03.tar.gz/md5/ecc17eefa6e0f6e329b248a734d1836d -LLVM.v13.0.1+2.x86_64-w64-mingw32-cxx03.tar.gz/sha512/337a47ebf8740e63caeb342756107d6cbf2fda2af298ed948790b8aedc0f68d56dd930130958d2bbb42cdd54e94d647c0b954f324399a407b6326e2f6cf93c60 -LLVM.v13.0.1+2.x86_64-w64-mingw32-cxx11.tar.gz/md5/8be5b54888fa98967a73268842d5cfcf -LLVM.v13.0.1+2.x86_64-w64-mingw32-cxx11.tar.gz/sha512/0fcb7ed50d27cf8a830f62c53ffee0a95f79934f302b92c660a6955b26439b794b036a7958ab4597fe28001955f9fb02ded533104b9932bed310f19ce0cfe681 +LLVM.v13.0.1+3.aarch64-apple-darwin.tar.gz/md5/7e54f07bd943ac6e38d9939e04352aca +LLVM.v13.0.1+3.aarch64-apple-darwin.tar.gz/sha512/80895cab8fdca2c6136bd3205a7a77845bb6d5005dfc1505e241976849ed3fdee749f43d5d4c3ebf155c438765ce0d76fcbc03f206afa3ddd2e5dc38852b8d8f +LLVM.v13.0.1+3.aarch64-linux-gnu-cxx03.tar.gz/md5/c5f1ecaa98eb67227fc0282987e9151f +LLVM.v13.0.1+3.aarch64-linux-gnu-cxx03.tar.gz/sha512/fa96f48d8b9ca3bf8a951c8359069ed75f0e1efee4d8d790ce3a0b8d94466a8c6900b0a07328b8fb44c03c02c0a0138601f110f766362b87c96bbfa62b866778 +LLVM.v13.0.1+3.aarch64-linux-gnu-cxx11.tar.gz/md5/027de943c11d982de077bf0f88f24fa8 +LLVM.v13.0.1+3.aarch64-linux-gnu-cxx11.tar.gz/sha512/1a5e1ea812959e11d2ec9b520c09207c74510b1f547b7c44e13b85692b36db65f7c49db807cffda7ddfabf9bcae66b9c1ff84b25f3b482064ac31cf4b20adf07 +LLVM.v13.0.1+3.aarch64-linux-musl-cxx03.tar.gz/md5/5d488ba42737890f91fcd9e0cc0813ad +LLVM.v13.0.1+3.aarch64-linux-musl-cxx03.tar.gz/sha512/f52f1099b74c3beccaf3f2d8b1fa40ba0bdbf2e141edd1d904f4fccf1cf70f7c66655a8a2b2eca62eddbaa2956eea191e3e8c9f57fb184a4185d42341937755e +LLVM.v13.0.1+3.aarch64-linux-musl-cxx11.tar.gz/md5/a8da56138949f51b906db422b54920a5 +LLVM.v13.0.1+3.aarch64-linux-musl-cxx11.tar.gz/sha512/ce4adb7a3f0e57e1e5c0585741ca20f02b77ec763bfed2b6ed243bedda91691b0797786ba2c69d357192e71df5ad396f7f6981e5bd6215075d8dae9c520008b5 +LLVM.v13.0.1+3.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/2fb082473ed69815efcf2cb7a619594c +LLVM.v13.0.1+3.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/8c8ae5e19f08cba9cb163880ed5dabc5465ef8302285e3e1b428418c91c8f37f469c66476bdb2ede0f619e7d00ba6bd15cb43bd9f7b0c725669e32f0b3ef9004 +LLVM.v13.0.1+3.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/eb294526c9fe3b83644a2a1ae4165371 +LLVM.v13.0.1+3.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/59d665c0a47fdcacc978fb67d5cf43ddefa0c5fe526915387f7207a68b39bc66e27718865468885f1c8adf673ab61d9ac63cceac9a87f3fdb88a22b81b3b6521 +LLVM.v13.0.1+3.armv6l-linux-musleabihf-cxx03.tar.gz/md5/00125dfb5ac98ec5f04cae4ee3ca42f4 +LLVM.v13.0.1+3.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/933d5c4b0a7753388f0aff98cf6fb542f5985558baad3601416e20aac97c31ec7d893aa11001b128487d31c5fcf4406d7e56ec92c71bad5d6662f0e3bf52ab74 +LLVM.v13.0.1+3.armv6l-linux-musleabihf-cxx11.tar.gz/md5/e2343894fa4ef39d9ab084c532978f45 +LLVM.v13.0.1+3.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/bc030ba9d1064208cbc84090cb635d5f46810214f7c990117c3d28ea85d1e45e1b827b313b50d5e452f3f9667dddd974dfa70911a55dfb7db66d37c87fd7ac7f +LLVM.v13.0.1+3.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/67e03b303bce634cd51b8e9bdacb04a4 +LLVM.v13.0.1+3.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/f37e26e00b01bba76824b71751e912f895b28d2793fd0b37ab6f220fc6224d40db2c456eacf574eef2e42f365223427ddcb38f77afe489a575913907c611872b +LLVM.v13.0.1+3.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/be091b1864250f1c0dfdc46f315047e4 +LLVM.v13.0.1+3.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/6a9313e8774c0262a6bffa067f6c621d035f93851837b248ec60a187d431064139c1c5a9126d27056d30b6c3c97d7a6125d7bcccc3fc21b85cdf84df2887cf3d +LLVM.v13.0.1+3.armv7l-linux-musleabihf-cxx03.tar.gz/md5/a55ef08ae7f1fd0f415cd42ff2475c2d +LLVM.v13.0.1+3.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/35240b891fc4d3c2941191a52d371a9dd26a483018ec1c9d1ea1d05793161928479fad612d53da104becad0e6a70aef9bcbe5feb8e5248c5a20c374fa0034be4 +LLVM.v13.0.1+3.armv7l-linux-musleabihf-cxx11.tar.gz/md5/6401e7c969852977315dbe8d33c93dc4 +LLVM.v13.0.1+3.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/0da5f372f6147dd7c61b1be3275e279e71d0754e80096b22cbac06bc89535218614c78b82b1efcaae0bb89d252b0e47a9115c65fd0f22975fa4a0b84b5ff3632 +LLVM.v13.0.1+3.i686-linux-gnu-cxx03.tar.gz/md5/6d201680c49908b358757dd70b32f55c +LLVM.v13.0.1+3.i686-linux-gnu-cxx03.tar.gz/sha512/e5d6bf52f3c40ec631b35336bd64e0002bdc224d22572cce069583d14ac5d6134055d5a849ecd6013e9250318f0ab1a022c96c2ea0c02e8ab1b88bc109ac451a +LLVM.v13.0.1+3.i686-linux-gnu-cxx11.tar.gz/md5/02f5dab2de74cbb5d3d024e606e09f2b +LLVM.v13.0.1+3.i686-linux-gnu-cxx11.tar.gz/sha512/544a27a7d8ffcaf202df4f812e595d37382c2c498c8e181d020cd2cf8dc2cbda5b767eab382e41fd2819aa8df45010a9601a8b830de91ce4c9428c8a7eaf8c04 +LLVM.v13.0.1+3.i686-linux-musl-cxx03.tar.gz/md5/5dc8d990bcd629d32f300b9b86cc9d62 +LLVM.v13.0.1+3.i686-linux-musl-cxx03.tar.gz/sha512/add858bc54e94c93aaccc11f67d26d3aba1d30198059903d42244ba5bc7eadd3edb7a60d446b3b8ceb576addd7ab255960f633ff3da0d7ce82d46a8903f125eb +LLVM.v13.0.1+3.i686-linux-musl-cxx11.tar.gz/md5/4049845df139ccd2bffbede82c204869 +LLVM.v13.0.1+3.i686-linux-musl-cxx11.tar.gz/sha512/e5178f3f0dfd0626049145db232c729a3c322fff7672b0c06d1a2e73cb17572ac114242cf7d2e9bec502fb49a12f26015f2efd720a5c23cf1ddf105c4640121c +LLVM.v13.0.1+3.i686-w64-mingw32-cxx03.tar.gz/md5/b75c3382567956fb06bd5efd60963055 +LLVM.v13.0.1+3.i686-w64-mingw32-cxx03.tar.gz/sha512/143d3171ee87e65cd1547532e8b95884a936f3a107f2d8ae33407c90f7364e3a5f6e01c477341018eeb87a2ffe3cb75170d458df5605615192fb788b4315cfee +LLVM.v13.0.1+3.i686-w64-mingw32-cxx11.tar.gz/md5/ca1415e2f032404687a341af97183224 +LLVM.v13.0.1+3.i686-w64-mingw32-cxx11.tar.gz/sha512/d87f47ec51bfb532515f27c0b2322de45c78797921215429bdd4e7eea14b2b0a1baff435f8d03186eb9d742991c0609174d748ac4dd7130cf1b71556fe27db44 +LLVM.v13.0.1+3.powerpc64le-linux-gnu-cxx03.tar.gz/md5/fb4cf2380b1ac91a1d3ee3c3847dbb08 +LLVM.v13.0.1+3.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/bbe75d62e034257244fceb984ebfae3d64e81b3197150e3eaddc2a5ec9a26d7ad73260d0a6a693d160c2a5fb91eb050aaea180287debf930438c10dcd4c849ff +LLVM.v13.0.1+3.powerpc64le-linux-gnu-cxx11.tar.gz/md5/c720870d6d5e3e8c4cb316c9ad287dc9 +LLVM.v13.0.1+3.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/c824e1feadecce7616b69b02b67be9bc54eb071ea65f5f0c4c8f7e9477f1aba73f3e41939aa4676619139a19a6391a670db11b29eb2a9ec93a813857156bfa31 +LLVM.v13.0.1+3.x86_64-apple-darwin.tar.gz/md5/0b36eb64ea8b95e82d277593a9cd3191 +LLVM.v13.0.1+3.x86_64-apple-darwin.tar.gz/sha512/cdc942ac779e706bd7aa55d0c9309e83c34d36f1e7a05647b2db1fde81fbbe1a1aba77ab233f7c95285886a0058cdefd46f7fd385fc59d711e2a3cbde2e1d42c +LLVM.v13.0.1+3.x86_64-linux-gnu-cxx03.tar.gz/md5/0e30dc3de41b111d4cd5b53262a33e89 +LLVM.v13.0.1+3.x86_64-linux-gnu-cxx03.tar.gz/sha512/7c1609a7c161ca085a31e4176bb8faa4312a00fa7a53fd4f4a8c18f04dab971f36cda7f8d39982b1630402cd20b9af66cb5b78a2fdd6634b1ce46689f1033e11 +LLVM.v13.0.1+3.x86_64-linux-gnu-cxx11.tar.gz/md5/6e5bd025600bf274f13dad34f918c53c +LLVM.v13.0.1+3.x86_64-linux-gnu-cxx11.tar.gz/sha512/dc1760d1b61c3852fcde0692d8ed798de695178834b13d68723ad07c5224c79786af0749b72876a777197a432f2b717240450106cfa31ad504b4841380f8b3ac +LLVM.v13.0.1+3.x86_64-linux-musl-cxx03.tar.gz/md5/1927e9d011b42710139ebe63abc62f00 +LLVM.v13.0.1+3.x86_64-linux-musl-cxx03.tar.gz/sha512/c7bb01d99f18ee4b41ae5363df5789ce314fec35f70710924cfbc99e559a1d4560cda2ccd5d01889f839a11c68bf3a4105b53593cd5383425fbea4a2e9096a3e +LLVM.v13.0.1+3.x86_64-linux-musl-cxx11.tar.gz/md5/d0f5d9dc987afe93475ff9775cb9cceb +LLVM.v13.0.1+3.x86_64-linux-musl-cxx11.tar.gz/sha512/067b4be79d0b7a3cbe00011b6b1f7b424f45dc37d5288406bc7618684db37a7f0289a5f26efb6aeb8f858be60beb6515b3a36188285e680757e8253e26e27e3e +LLVM.v13.0.1+3.x86_64-unknown-freebsd.tar.gz/md5/ec222de607f1c3a3e446a3eb3ec57f14 +LLVM.v13.0.1+3.x86_64-unknown-freebsd.tar.gz/sha512/bc643903b7b60cdd0be38035985d628e8b9be3fa07f5d11d5bf40b71087bb352f8bb853b1eb2678ba47379b43aecfde8177128c2aa9583e1e1139aa634e20507 +LLVM.v13.0.1+3.x86_64-w64-mingw32-cxx03.tar.gz/md5/f76aa08ab8cbccabb4ac4100218bb2b5 +LLVM.v13.0.1+3.x86_64-w64-mingw32-cxx03.tar.gz/sha512/115e683bae15be4aa78423416b703f8d4f2b92949d6430810ea5fedc42137d06bb96215fa296af22f6fca7504ea6ae15666573c0ab900b5f1d9671b3ac1b9095 +LLVM.v13.0.1+3.x86_64-w64-mingw32-cxx11.tar.gz/md5/7da1b840c39b6369d8e60527f9b965f9 +LLVM.v13.0.1+3.x86_64-w64-mingw32-cxx11.tar.gz/sha512/0ccc6eb5842eb668e7e8cc23c25e180832f3de0c93e8534338c49949a7378f195d118ae38e0262ccfb9f708ee5cb0dfb530fefa7e2b4e24aaa7252ac224a75e5 LLVMLibUnwind.v12.0.1+0.aarch64-apple-darwin.tar.gz/md5/b95ad4844e649bf46db43683b55b9f4f LLVMLibUnwind.v12.0.1+0.aarch64-apple-darwin.tar.gz/sha512/15e0996aebe6db91fe58121001aa7ea4b23685ead3c26b5d89afae34b535e34b4e801a971f4854d8e1a1fbc805cece06272470622eef863e225358113a127913 LLVMLibUnwind.v12.0.1+0.aarch64-linux-gnu.tar.gz/md5/6d8783dc9b86c9884e0877f0d8ac4167 @@ -88,181 +88,181 @@ LLVMLibUnwind.v12.0.1+0.x86_64-unknown-freebsd.tar.gz/md5/54ac594b4c8e7f261034a8 LLVMLibUnwind.v12.0.1+0.x86_64-unknown-freebsd.tar.gz/sha512/a43756afd92081e6dd7244d162862fc318b41ca110a5e8be6e4ee2d8fdfd8fb0f79961ae55e48913e055779791bd1c0ecd34fd59281fb66b3c4f24a1f44128f0 LLVMLibUnwind.v12.0.1+0.x86_64-w64-mingw32.tar.gz/md5/83cf8fc2a085a73b8af4245a82b7d32f LLVMLibUnwind.v12.0.1+0.x86_64-w64-mingw32.tar.gz/sha512/297a5c7b33bd3f57878871eccb3b9879ea5549639523a1b9db356b710cafb232906a74d668315340d60ba0c5087d3400f14ab92c3704e32e062e6b546abf7df6 -LLVM_assert.v13.0.1+2.aarch64-apple-darwin.tar.gz/md5/e474b6580bd1347d9342b648d69d52b4 -LLVM_assert.v13.0.1+2.aarch64-apple-darwin.tar.gz/sha512/3c5b4b623e6c47e63eb1297988aa9070adf8cb587cb6b2f7a02bffca1d1c8a6cb56423df0072d7af028f4caece652af57f695ac3ffae8c53075be39014b2af54 -LLVM_assert.v13.0.1+2.aarch64-linux-gnu-cxx03.tar.gz/md5/0e2c5c7a0e8929294bd757e5d6e94ab5 -LLVM_assert.v13.0.1+2.aarch64-linux-gnu-cxx03.tar.gz/sha512/c486dc9181d23c2f97d2405100ed9b8eebff83c3b1db82486d3c60643523bd2a27ea8b4825a1a918f4a5e44ec5da25d791b1751f1c4b84d896dd3df8e7cda759 -LLVM_assert.v13.0.1+2.aarch64-linux-gnu-cxx11.tar.gz/md5/2b1d4d10434d57925ac3d60312b40522 -LLVM_assert.v13.0.1+2.aarch64-linux-gnu-cxx11.tar.gz/sha512/1fae1e2a5d0713961d465bbfaff758d360df11bf5aa62b8f400e6604024adff081c378a79c32c954cf6918ac92115a9b8e18201b14f303883772609ce87ba9a2 -LLVM_assert.v13.0.1+2.aarch64-linux-musl-cxx03.tar.gz/md5/e9af424fa0186fbf7a7a40dd300a41e6 -LLVM_assert.v13.0.1+2.aarch64-linux-musl-cxx03.tar.gz/sha512/ef21ca4f7b3ab2a2e58b031254fecc740c63c770a3634b5f47a2a8cf6d84f1cc16e22b84d643916902831a6bbbe743622e3a8cf4ff6a4ca793975331500560da -LLVM_assert.v13.0.1+2.aarch64-linux-musl-cxx11.tar.gz/md5/3f97399e3965a1cc0d6460933e0a9aea -LLVM_assert.v13.0.1+2.aarch64-linux-musl-cxx11.tar.gz/sha512/49a7141b3c94fb7112974d378dfa61740971d80aab4fbd4454f47177d90413aa324e70bdf39de0ccd2c91f5698a12af77b8b71bd848c0b7036da52578a7f15b0 -LLVM_assert.v13.0.1+2.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/b170cec3c1fddce17990ea922b7817ff -LLVM_assert.v13.0.1+2.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/93a89ca141392831a4eed79d0634e8bb0607bf9bfb45e6e8b91883c57991da4f244eeb8debde510697de09d19b527218c50a47d960387aa81149f4d22c37a73e -LLVM_assert.v13.0.1+2.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/a0bcae6c39c024f7a0601a82fe89532e -LLVM_assert.v13.0.1+2.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/5a2f7b34c9b30b21635567603e34c0bd0c1705788f5e44e549fb5387a0122ac6d481702daf90738fc5aa8447cb74b941a93e6ee17a231031f3f0727029d27d9e -LLVM_assert.v13.0.1+2.armv6l-linux-musleabihf-cxx03.tar.gz/md5/76c423b23300174364fababd773ffbe6 -LLVM_assert.v13.0.1+2.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/be0c48f6f634a8e95dc68d4f134570ace8190afa58640e5fa49cd07eeeec047f64b9e9a27e7503773fc3264fd97d979175a7ab6608a92cc4dfba6e9ee28d0557 -LLVM_assert.v13.0.1+2.armv6l-linux-musleabihf-cxx11.tar.gz/md5/0b68aedeacc9edd33e9cfa9f0fcdfaf2 -LLVM_assert.v13.0.1+2.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/14ef3bc186ff354a16e4282b8658726d77c4c70e7907218647e5ee240a2693783c9db1507a6ec2b6a40645e21f257f764ba5d8b6423a8ed4c3b3a3c4a3c2728a -LLVM_assert.v13.0.1+2.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/0aed5cc59441335062cda8b07688c913 -LLVM_assert.v13.0.1+2.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/a898a4ed9b53c6089665f4c0c9bf6645ef78a11ca05d1ea7435eca0c074c95d8de50b722d2b0e2d01b43def5007e08e87dac44276ba8050d95ca230cb799070e -LLVM_assert.v13.0.1+2.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/773f3b5191e14e67750e74597a4dd441 -LLVM_assert.v13.0.1+2.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/f9ec71d14b2db4ebe7c9a859e299e33fdc16a0e36b41e02e58a25682c5aa16a68000bc47991ab93013aa09806f6deb1e5f6f0a0f92c1c035b977ee6ef32c09a1 -LLVM_assert.v13.0.1+2.armv7l-linux-musleabihf-cxx03.tar.gz/md5/c779f1595078e720f80263a93626498c -LLVM_assert.v13.0.1+2.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/d5ce18e405d304607c28fbd1a3f8d4bf12d70eb26fc987214ab631297c0e977fa6408a7f282562ad4fc32387edadbe13a8a4d78e00e4e6d6749f04e1babd32df -LLVM_assert.v13.0.1+2.armv7l-linux-musleabihf-cxx11.tar.gz/md5/e8a9fa7f10b552e4734e6136a2067f75 -LLVM_assert.v13.0.1+2.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/ccc278d988f59349db4998cab399f0610a9c6daff1e3e2ba0d3c5c66febe2228cc42022040b505e1e6298a0495293a7d8a37359a5cc33050ea574050f6ca675c -LLVM_assert.v13.0.1+2.i686-linux-gnu-cxx03.tar.gz/md5/790620f4cd621c78b898c843222b2bbb -LLVM_assert.v13.0.1+2.i686-linux-gnu-cxx03.tar.gz/sha512/ef3b4390701a5ad4f449c77052466183af824762d3ac050afb0c5154a72c6256c31dc642c2fbb9f024121125a06f74aed522483de0e3c05805dd90f79721a836 -LLVM_assert.v13.0.1+2.i686-linux-gnu-cxx11.tar.gz/md5/85d2cb6f80252d8421f489400ef775bd -LLVM_assert.v13.0.1+2.i686-linux-gnu-cxx11.tar.gz/sha512/00dc218b38d0400a80ab6f4a657d57db663a8f3ef43e2adbd01a563d8c4640086c644eb248a2fce82e48718300ac03517ec9592956275bb173bf9f520f7eb359 -LLVM_assert.v13.0.1+2.i686-linux-musl-cxx03.tar.gz/md5/736ce38ce38e817768366cd0d0e6d97d -LLVM_assert.v13.0.1+2.i686-linux-musl-cxx03.tar.gz/sha512/15e1ba329e0d938ad80ef729e2b10f12f95ec85aea28a072847caef15b53afe6a6679d666027cc83f18affed67228fa9e18e3ca02f297b283c44c155ddb5077f -LLVM_assert.v13.0.1+2.i686-linux-musl-cxx11.tar.gz/md5/c6ed71b0915b6bae9f215129a20b47df -LLVM_assert.v13.0.1+2.i686-linux-musl-cxx11.tar.gz/sha512/f34851f8796d92b6be16f055b2fbc447ad937e9b6f2b3c4e1fed82780863a433d8c60802fdc95fb321e15713736db4b745f6218078b88dbc5272bb6ce348e567 -LLVM_assert.v13.0.1+2.i686-w64-mingw32-cxx03.tar.gz/md5/83e20f2c5756e4aa8930c5bfda1cda61 -LLVM_assert.v13.0.1+2.i686-w64-mingw32-cxx03.tar.gz/sha512/5c69109d543ea4bf10a2e2031ae3bd5f3a049344144dcf6897ce7d7b1c76025ecf4dc86fa4ac77093993141286bc63e762894f4f064383cd2dccc60734988064 -LLVM_assert.v13.0.1+2.i686-w64-mingw32-cxx11.tar.gz/md5/bae6a74bc87765e25e8bd36beb664acd -LLVM_assert.v13.0.1+2.i686-w64-mingw32-cxx11.tar.gz/sha512/8787e0c6afd4bbe430c41bd624afb665ad1900957c0a86bdc670c745b187085c210fbb17f5fad34626d59da1b21dfa5055ac0101db3f020fd1fd8f9bcd727b30 -LLVM_assert.v13.0.1+2.powerpc64le-linux-gnu-cxx03.tar.gz/md5/da4418b577f3ae2300629454620f1d28 -LLVM_assert.v13.0.1+2.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/dff6844546dcd7da8c3c0f1857ca8a91a283e65b16143502c0f3f1791f66faf7ec78ef9e7e9753f931984883c777d75b7e73b917ae10765dca29e4730a2151e8 -LLVM_assert.v13.0.1+2.powerpc64le-linux-gnu-cxx11.tar.gz/md5/7bd0dac8b19f07d4abb0eb58c42b021d -LLVM_assert.v13.0.1+2.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/17feb6913fe13f85c2373171e4fb2ad1064ed57439993db3f01af8464647615dc4486fac76cec665460f8f6bcca392dc2762f550cc3382b2fce3e9950d90d051 -LLVM_assert.v13.0.1+2.x86_64-apple-darwin.tar.gz/md5/9c8143eb5281f6d8661ccac98587c181 -LLVM_assert.v13.0.1+2.x86_64-apple-darwin.tar.gz/sha512/4ace34db86319706cf3b7fde5af326b03dad6b0e615fd3ce8f0fa0598b2d9e8c527ca030444f3e9a15bd6ffe6b0081af2dd9aea1934c699846dadae681cb39cf -LLVM_assert.v13.0.1+2.x86_64-linux-gnu-cxx03.tar.gz/md5/0f495b3e6ab2142723e939445fa15a9d -LLVM_assert.v13.0.1+2.x86_64-linux-gnu-cxx03.tar.gz/sha512/2d27a8bdcd3c64f858ea4cc0b5d5856b00fd93b31027d9cc928f90ad4b344b64696b80b5e238f59f99d400186c359b97894a4e32c2cf514da626db848d75ab10 -LLVM_assert.v13.0.1+2.x86_64-linux-gnu-cxx11.tar.gz/md5/6d68a06c05e13591753331c909dc6d83 -LLVM_assert.v13.0.1+2.x86_64-linux-gnu-cxx11.tar.gz/sha512/4685898829542b686012fc2d3114cc5d11fa2ada310562847b598f72b1549f2e1b00b6f6806f6205422af6a24339d52a6d53c597e6e9a657029b8bac0c43ef10 -LLVM_assert.v13.0.1+2.x86_64-linux-musl-cxx03.tar.gz/md5/da06328307b31df461875cf5ec2488b3 -LLVM_assert.v13.0.1+2.x86_64-linux-musl-cxx03.tar.gz/sha512/ed74c3bbcefef5495b006cfcfd848af36a7faca78d8b6d4ee84b515413ff061e002b942d91b8d25dde87b09bf50f4ae187126d018eeda1eedaa77eea1bb0b805 -LLVM_assert.v13.0.1+2.x86_64-linux-musl-cxx11.tar.gz/md5/97f7b2df4ebe26168bf8aba8d7a433e7 -LLVM_assert.v13.0.1+2.x86_64-linux-musl-cxx11.tar.gz/sha512/5f3b1930593d28b8445c77b20f9e064ea5fee0e1cd9c327a2d59ced38349a0425c9f4e07ed745789270a5906a4e64631b801a0088886784e34e8db501ec52b17 -LLVM_assert.v13.0.1+2.x86_64-unknown-freebsd.tar.gz/md5/8cdb3adcbb93769ee87c52d81f68a25c -LLVM_assert.v13.0.1+2.x86_64-unknown-freebsd.tar.gz/sha512/fb39e79f39af14cecd4cda84ffdeadc9b2a80aab1f755d484571336e8a55dc69e6eb07774de614ed715767e1ed127ad9d6ffd63a011d4f72ff0ece212ca703ad -LLVM_assert.v13.0.1+2.x86_64-w64-mingw32-cxx03.tar.gz/md5/00101e6a75b72d7facb88204c42c43a0 -LLVM_assert.v13.0.1+2.x86_64-w64-mingw32-cxx03.tar.gz/sha512/9d6da10934a375c5ae58688c6133d99683a2b04c64d4ecfcc515146344f163b99e054f33afaccefe051ca403b63d7a65e05c56b2c695cf2a5fc32f41fe59efaf -LLVM_assert.v13.0.1+2.x86_64-w64-mingw32-cxx11.tar.gz/md5/a5608dff32644cde660d453f051999a9 -LLVM_assert.v13.0.1+2.x86_64-w64-mingw32-cxx11.tar.gz/sha512/18ed54aeec018219975baa610b3851dfdb4504e0e4a42ae403d90c936bc27ef233a6d86a9e3f7e2018010056a494ae686d2c05db276a047368cfd5932ba32265 -libLLVM.v13.0.1+2.aarch64-apple-darwin.tar.gz/md5/db865124e4808e1d9d3bf673fd413fe7 -libLLVM.v13.0.1+2.aarch64-apple-darwin.tar.gz/sha512/63d9b2bd2274949e8b3184e788790fd2c7976eb41bda63a765cd5090bdad78dd2554108a040f55da7914737f82d6f62037cfc033c121a52a09b414d4386f01bd -libLLVM.v13.0.1+2.aarch64-linux-gnu-cxx03.tar.gz/md5/12896808215cd92bcccf1862d21bdf3a -libLLVM.v13.0.1+2.aarch64-linux-gnu-cxx03.tar.gz/sha512/4e776f1e2f8010f90602b5f2939e6d5f5cff6d2fbdd4ec4278170387cef4734b95f4d63e83849b6a7136978db1e8af37139321350d13cc4c62186641d7e94217 -libLLVM.v13.0.1+2.aarch64-linux-gnu-cxx11.tar.gz/md5/0899638d95c01e5694134095c37cf7b6 -libLLVM.v13.0.1+2.aarch64-linux-gnu-cxx11.tar.gz/sha512/17c7d7303a29e6d9eeadde8293b5c0e32bf7cb11f40ad99853ab97499598bb153dd9ed99e0c3f974f578f21075d3608a4479b359c8e1a870f43a0b4e96a85233 -libLLVM.v13.0.1+2.aarch64-linux-musl-cxx03.tar.gz/md5/28a87ce1a49b04162ffcb9a1c69f3d08 -libLLVM.v13.0.1+2.aarch64-linux-musl-cxx03.tar.gz/sha512/1bfeea1dd10b1d3c743544ecefa4e3b5e7eea36d9f053fa68e3d12067b39648cb2bfa224ce2adb674250015b26724b5bb1e363e43332e0b1a62699fb2acb0b33 -libLLVM.v13.0.1+2.aarch64-linux-musl-cxx11.tar.gz/md5/179933143843b8d02800afa6247224a2 -libLLVM.v13.0.1+2.aarch64-linux-musl-cxx11.tar.gz/sha512/4f590f21355374ccfa4d83e15f50e05dec44187ef47c4cc3b8ef18189763df2a29f0f314dfb2486d03b15e4dbb1f75707d83656b7c711ea7923fc8dbf2ab8530 -libLLVM.v13.0.1+2.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/74743252af0303c21d45be20564b301d -libLLVM.v13.0.1+2.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/e93922b32a8558f3dc5261d8e8f226f02106c3d6c1d54251318b70a91f1192c78de589dabd50778af40e8c38825b5d772d6ec0cbf64374ac23e7e6175a87bb1f -libLLVM.v13.0.1+2.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/6da3d1ad82396c57b670316199a849cc -libLLVM.v13.0.1+2.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/699c710160e0c5914669f842c055bc98e9ed96bc0f4825258ecc9649cbbfdb65a32edd6bf53f8a087183adbca486460a9ebdfc4987d8a8333980327402323707 -libLLVM.v13.0.1+2.armv6l-linux-musleabihf-cxx03.tar.gz/md5/9f6eb18ac80047e7ac8970196355aa10 -libLLVM.v13.0.1+2.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/8f7b78c4faca36cdedcbf8f9f35175092571ac1782cfe22e2f35c72f20d2737d573acf2c964c97a809d646550262567f8579f61b247b5d4eb041c02342795b51 -libLLVM.v13.0.1+2.armv6l-linux-musleabihf-cxx11.tar.gz/md5/b7e2234f55b932a11f8d1d79e045fa90 -libLLVM.v13.0.1+2.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/f513840d7abbf85dd1f2506d7d51c0d203bddda152750fde88fa2328d7a1b9efa872f11bdd828b4a04f14d630a3f009d7230cb7b9ada49e6a16682049a893233 -libLLVM.v13.0.1+2.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/2b9aa510d139a231e10eb6c5620c35d1 -libLLVM.v13.0.1+2.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/37a0230ea751d198a2996832ff9bbf751e7d1906648de982f796393cc25a8ffbda081484075ab8d7c16e9ce26dd9325f3f448f16108a3c4968b15c0a80366b70 -libLLVM.v13.0.1+2.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/d2e7262c367908e43e25579a7f0893a7 -libLLVM.v13.0.1+2.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/8f3f24e7e653bec2d5269d4875deadad4592e1c76ed491b17c528f853a2d233d7bdb2d3182a2aea9a2d1aa24c02d967c17a38b160b97f2ffd3d46eaae7a749e0 -libLLVM.v13.0.1+2.armv7l-linux-musleabihf-cxx03.tar.gz/md5/9c1d38c2c54fae44143caa2dba78bb64 -libLLVM.v13.0.1+2.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/0e50dae8e3bd4372b16fd96418241c99e46278f8f2fb8191d1cacf136cd0d429bd74a6472ad0edaab6a17bb03ee576e11778d3569ad4b20184ebf82b6359de62 -libLLVM.v13.0.1+2.armv7l-linux-musleabihf-cxx11.tar.gz/md5/cc58770ca889bd4c4a68236ee7aca8ce -libLLVM.v13.0.1+2.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/c1211ea7e8317b96dff0276c69301029658d3c3c2d88f69b56527205a72f75eac5941eca6f518a184b5ffbab6865656b9fc27a88433c88f2a701eff6de170d03 -libLLVM.v13.0.1+2.i686-linux-gnu-cxx03.tar.gz/md5/c4af3f5036fff0a110dc16b6226fce3c -libLLVM.v13.0.1+2.i686-linux-gnu-cxx03.tar.gz/sha512/e5a9e017efada516e4f902a2ad98a63a99b52052d66dea9b4c20f2a8f8f6ecebf765022d9761b89b759571364065ba712686f3b417c34e46447ff4f7119b7ed3 -libLLVM.v13.0.1+2.i686-linux-gnu-cxx11.tar.gz/md5/91f397cc9dd9594977a46da558e8d310 -libLLVM.v13.0.1+2.i686-linux-gnu-cxx11.tar.gz/sha512/32e570b4845a65c2cb5526164ceb377845d73698a542a324dce343200b4f8509df37cac805890de45bf9475cb0007dc9d7daac029e736a623ccab05133e8eb52 -libLLVM.v13.0.1+2.i686-linux-musl-cxx03.tar.gz/md5/5eb6f2aac0a48a799cee5c0b42213689 -libLLVM.v13.0.1+2.i686-linux-musl-cxx03.tar.gz/sha512/6a0e6574931c68703fe5b638799e238f0bc105683d4c7ced0d7e8c25b4eb9617770a4dbb5b9c5f65f8d8e2b63a4fcc594b386afee8ed723e937bbc49b153ad2f -libLLVM.v13.0.1+2.i686-linux-musl-cxx11.tar.gz/md5/f650178dc0dc04babd2fcabaa3ffc35a -libLLVM.v13.0.1+2.i686-linux-musl-cxx11.tar.gz/sha512/32d48203c6d4c2b2ca2a8bf3927b2dff84cf264d3607f3215456baac2109e7710d53685c8572718d74f614e867f5a911ac62466815c28c5ad0ddc8761bec8437 -libLLVM.v13.0.1+2.i686-w64-mingw32-cxx03.tar.gz/md5/edb299dfe330144360ae0348ff241682 -libLLVM.v13.0.1+2.i686-w64-mingw32-cxx03.tar.gz/sha512/613af75a89930091bd2e6938463a97aafcef7a9bac4d38618979d98dedb8e95180b065e079214e88709700dd28f6a18cd465eda9440e77cac5a232d9a733febf -libLLVM.v13.0.1+2.i686-w64-mingw32-cxx11.tar.gz/md5/32372fe46245d0e93dcbd73e48303692 -libLLVM.v13.0.1+2.i686-w64-mingw32-cxx11.tar.gz/sha512/53da82205f30e2d7e5f1053ac8f254b7cf84f33e1952c6b96e0f4562b164827818ce507ac4c36364c6b34499c08d4f7392866f4075f031e1de91b464b282ba61 -libLLVM.v13.0.1+2.powerpc64le-linux-gnu-cxx03.tar.gz/md5/cd4323bbcfc6af0047d43561d395cc7a -libLLVM.v13.0.1+2.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/e6d6ce334515d46f9400f999de4a3af28791c362e48fd17ee7a1135d88dff87caaf86292c4ef2f05d78c6bfa8b0248bc9a50687b4c3094a1e83bf7da9d44f80d -libLLVM.v13.0.1+2.powerpc64le-linux-gnu-cxx11.tar.gz/md5/ec85afc77c883a45d342e11c0a3fe5c4 -libLLVM.v13.0.1+2.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/fa0e44b8e5efcb770b1ed7c0fa47b03c2fef0b6c1a0c992d35119aa5860f6f1fa039296fc477e6f78c8b9a904ab78394ea962bbd34548a697c7e06891ff37b05 -libLLVM.v13.0.1+2.x86_64-apple-darwin.tar.gz/md5/d8fb6e02698b7be3383df9bf979a7b5f -libLLVM.v13.0.1+2.x86_64-apple-darwin.tar.gz/sha512/a248f58e3e692f8fe2c3a10a513dc0ec25d8e771d0433d80845eff2ecddc46a7cee54c34235603de07daa5345eab279c3ba492df336f23e408d094f0669de7ac -libLLVM.v13.0.1+2.x86_64-linux-gnu-cxx03.tar.gz/md5/e0870d923fac327918a634b327b9761c -libLLVM.v13.0.1+2.x86_64-linux-gnu-cxx03.tar.gz/sha512/60185760fdf65066bec0c9065f2e3553d3ffd9baf2cdf40674b966d04c3b1eadc98670ffc858c49506427999c5527d85fba335d5e82fa879e0a9bd15b1f79780 -libLLVM.v13.0.1+2.x86_64-linux-gnu-cxx11.tar.gz/md5/53a958655d9e0f44babd05ce1e74c8a2 -libLLVM.v13.0.1+2.x86_64-linux-gnu-cxx11.tar.gz/sha512/afd4a7f78b17cf9aad9021613bf2c1fa904835e0d8f473e9abec1d6ebd40b75d1d529fac579cc4f5dc8fff68d2bab8a141f0558dd149294e7fe30b21f4093e8d -libLLVM.v13.0.1+2.x86_64-linux-musl-cxx03.tar.gz/md5/94e731b4f67e99be5c35b1a389e80bb8 -libLLVM.v13.0.1+2.x86_64-linux-musl-cxx03.tar.gz/sha512/f46ffe8ea2b71c4a46976403bcf7fcf97c127d5e69100cc0e52d7ae21a7cf2ba88fc5988ae022c3e42f856d08b3b53a7f6c0e5feed1bed832c74b9363b8b49c9 -libLLVM.v13.0.1+2.x86_64-linux-musl-cxx11.tar.gz/md5/52076835b1d0e41353090923f56651c3 -libLLVM.v13.0.1+2.x86_64-linux-musl-cxx11.tar.gz/sha512/accac4f426f3831b846a1fd4a97344854f5d07e891f1c8d7e458108c7155dc835457225830aa43cc30784fa310729f06c50928816a095e2122280ae2f4fa9512 -libLLVM.v13.0.1+2.x86_64-unknown-freebsd.tar.gz/md5/b19dd47acb743dcf2d42e126d42bd3a8 -libLLVM.v13.0.1+2.x86_64-unknown-freebsd.tar.gz/sha512/38d846acdd788926f6f7cec7ccd2cde13dc55155cb2817ba6eab92f52b4a8583ea753ff879441241949eb3d4c06dfed2dc17703cc37ca77044cb40080520fd3d -libLLVM.v13.0.1+2.x86_64-w64-mingw32-cxx03.tar.gz/md5/7c63d16ebddd4b64f925badc70e81342 -libLLVM.v13.0.1+2.x86_64-w64-mingw32-cxx03.tar.gz/sha512/356ab0a607d034abdf36c955cd704bd6a130bb6f68cc9bf675b9cd1920034fa221103038855ef0735e0a8663965017a2e6138bb379288f31f6c6a4a5bad5ef43 -libLLVM.v13.0.1+2.x86_64-w64-mingw32-cxx11.tar.gz/md5/003ac94ddc23551ed3ecd633825b2c1b -libLLVM.v13.0.1+2.x86_64-w64-mingw32-cxx11.tar.gz/sha512/6c6d8e76c0ac4ac8a37324de60b1ed4a3965556e31f5a14138b880c4f1ad66a4d9621aacd1e35fbd312e720eeee48de1ac30ad66ad70814180cdeff550600710 -libLLVM_assert.v13.0.1+2.aarch64-apple-darwin.tar.gz/md5/6db0cfb11b96d461ead66743f0a49e29 -libLLVM_assert.v13.0.1+2.aarch64-apple-darwin.tar.gz/sha512/10fa8e2725d297d6bd29e98e0c6547e2f870c99f6db5eb31636a7d13d2894b513db0379dbd94979c1adfae5d947d873d2c7debede791c7a7a6baf9428277fda6 -libLLVM_assert.v13.0.1+2.aarch64-linux-gnu-cxx03.tar.gz/md5/d8265030dbcc311ca51b2f7c193d4a89 -libLLVM_assert.v13.0.1+2.aarch64-linux-gnu-cxx03.tar.gz/sha512/7d1096d83cef13590af442383f70e5e5684b7fc1425bfa61855b4a4185b4540f5a3ceb7411e71234b072318b146bf308c38da88d4df29008fdcb409da9d86d04 -libLLVM_assert.v13.0.1+2.aarch64-linux-gnu-cxx11.tar.gz/md5/a96add0e10401d642b56257b9fce2b62 -libLLVM_assert.v13.0.1+2.aarch64-linux-gnu-cxx11.tar.gz/sha512/b8e96c03ddbff403a2576a5429d9798207ded44322d78cda2087ede37615fce8c11cbcbe0d39923878a963a7f7b8c99d891b6531faf4f201ec8bb12684ce462b -libLLVM_assert.v13.0.1+2.aarch64-linux-musl-cxx03.tar.gz/md5/db846ddc21e550abaf84d9298f8a126e -libLLVM_assert.v13.0.1+2.aarch64-linux-musl-cxx03.tar.gz/sha512/3e81700354800d714a87fc280f07098f95638e561f97efdab6287ac78e056771cfca61372c72f010ff7c60ccf90221c2aecfdfa4dfcb068fff9eec9bbec99580 -libLLVM_assert.v13.0.1+2.aarch64-linux-musl-cxx11.tar.gz/md5/b96153a15db02d2068a42cb49c181a6d -libLLVM_assert.v13.0.1+2.aarch64-linux-musl-cxx11.tar.gz/sha512/4250e16b1efafc2466261faab9b1db6426caaea37d169ebe2c14066df0f270550825996355315bacb0d29fd65add71873cbbe05db7462f14939baa0b94348000 -libLLVM_assert.v13.0.1+2.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/f26da04aaaae16d09f9934b5135cc4ae -libLLVM_assert.v13.0.1+2.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/87d5f4b6a6e9b4930b8247a2230e68d177c9ff0c2e148cc523f0c9a585882970a30c0383f3a22730fa363d3b8eb467a00dd678908e30eea9b876f3f296ca7ee0 -libLLVM_assert.v13.0.1+2.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/0dc7603dc37f55f06bd685ab1e76151c -libLLVM_assert.v13.0.1+2.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/89ef75f0ccb845836afd530dd5976ff7ac3a68f6abec830c5baddfe0116a1e9321cd2c899c663ac5e3b816346d26f9f3831d7185d5958e1c66560a4bc972d587 -libLLVM_assert.v13.0.1+2.armv6l-linux-musleabihf-cxx03.tar.gz/md5/048b75ef0762ee79902ba0601e6e6054 -libLLVM_assert.v13.0.1+2.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/921cb24d6035afc48a8f6f59c034850448b89f8e38bcbd1e238470a1901e1b917f0a479895a44dfd17e1ceeefb5d2b17c038a18f4051bd42ec811d1c8a8f21b4 -libLLVM_assert.v13.0.1+2.armv6l-linux-musleabihf-cxx11.tar.gz/md5/4f7da2eb48a580a56e7a888a8553c7de -libLLVM_assert.v13.0.1+2.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/d7ced8375c4a931294f3f103b9139ca44777744926c8e259bba7d5dd199284888752fecc6dda376eaf5cd4ff4933e1982933468024cefbe1a0469f7c03c54fde -libLLVM_assert.v13.0.1+2.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/e0b0e376d56c0d59691b8514522abce7 -libLLVM_assert.v13.0.1+2.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/f48652ed9a186729b2de70d6cfe782a2778c50520dcde234e31d67bd9043aeeefb2f2f5497400d25507a44fa2a8be50f6f0a65c54ba89b34b3b341132fea3e0f -libLLVM_assert.v13.0.1+2.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/a8e910783f176a4e74845bcf792895b1 -libLLVM_assert.v13.0.1+2.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/c2bd2b2d4bb38f248ed69eee64269ad17505a3ac7ba64320aab5b10069e120dcc3d06beee8355514e6140e43fd8614d61f9d5c484195a2d0e3c25145ca391968 -libLLVM_assert.v13.0.1+2.armv7l-linux-musleabihf-cxx03.tar.gz/md5/c49214e76b086459357d90f242834245 -libLLVM_assert.v13.0.1+2.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/4c70bfed6c12e7ea53749ebbba434870637271211ffbbeeaa3f136337cbb9c65f02fbd6d7a1fc6f441de68df3099b2c30790494b9e2dd3bc4dbc45d687c41a5b -libLLVM_assert.v13.0.1+2.armv7l-linux-musleabihf-cxx11.tar.gz/md5/7dfa45c315adf488855cd501c565c99e -libLLVM_assert.v13.0.1+2.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/56b6743a756cffea541f64e38444d3e1788e2a59404840d3852f26f175d2564973a8faa278446819a4e63fc8b789506f8c356132dacbe5045a9b1e13f34e86bb -libLLVM_assert.v13.0.1+2.i686-linux-gnu-cxx03.tar.gz/md5/e0a91a1099a93f332d8af332f3162d33 -libLLVM_assert.v13.0.1+2.i686-linux-gnu-cxx03.tar.gz/sha512/a36c73fad0968a0702f4bc946d4bbc2d221d61e5ada21a6fef6c1ec93bfc4737995b059a8769c8f728c434459fd311506b27459419fc068e472fe2f7387d97bb -libLLVM_assert.v13.0.1+2.i686-linux-gnu-cxx11.tar.gz/md5/bf896902f6ec4fb758ae57e0eb76f163 -libLLVM_assert.v13.0.1+2.i686-linux-gnu-cxx11.tar.gz/sha512/d653cc299ba864ee247648c3cdf67b9946c14b9a557e2c57b71c356d25d5b2ec8de93d406dbd783bcf19f245e08152bc54bca84eac26f51be100bf09bbec8776 -libLLVM_assert.v13.0.1+2.i686-linux-musl-cxx03.tar.gz/md5/74b85af091b0adad05393c0e791321d3 -libLLVM_assert.v13.0.1+2.i686-linux-musl-cxx03.tar.gz/sha512/c48f8c181e3c8a36fab4ce2075f1ecdaaca5c6e73c09cca49f7d7bf7f60752478020eb9de1fc74c0a4746200ff59ad4828558023ec43047e9719b705e153de30 -libLLVM_assert.v13.0.1+2.i686-linux-musl-cxx11.tar.gz/md5/77425352387848e8ac76018e0d74edb4 -libLLVM_assert.v13.0.1+2.i686-linux-musl-cxx11.tar.gz/sha512/1cea3a6fe8c49b732677d7e313691cda2165a0a6d4dca44f01c8d7ab048329433e77758ba5291e580791f8b3b84ed8125575a4fec37bf5b6cff817b87f8528f4 -libLLVM_assert.v13.0.1+2.i686-w64-mingw32-cxx03.tar.gz/md5/9d388d44c619d2cb0a9824778f1bd164 -libLLVM_assert.v13.0.1+2.i686-w64-mingw32-cxx03.tar.gz/sha512/a8629e54c166b4748a891592d9f2b8e015d008570f49eca09c70489c1e0b50a19556e60f34717f868b9767f2a10578e48010c0686c50f0771cfbd06e3446e219 -libLLVM_assert.v13.0.1+2.i686-w64-mingw32-cxx11.tar.gz/md5/f7f59e413e7dc94135920df1b234eab5 -libLLVM_assert.v13.0.1+2.i686-w64-mingw32-cxx11.tar.gz/sha512/85c1d61c0546c1c679e0b2edf56230c63aa60a4ef31df73e6e797ac873dc8d4b0eaa084e1610435903e5e279186c54e679da7b635750e9ecd61695170fe4d5d3 -libLLVM_assert.v13.0.1+2.powerpc64le-linux-gnu-cxx03.tar.gz/md5/9e22f7f6b2a22b1926a0f68a84f20b00 -libLLVM_assert.v13.0.1+2.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/49ac6e7fe4dd9e61b848ba953082a6149945ad3c733b7d42a89a0b7cc05d0af4a37610cd6dc729c10540d9a7134abf6e5a65d69d072df7056ca17fc48251d951 -libLLVM_assert.v13.0.1+2.powerpc64le-linux-gnu-cxx11.tar.gz/md5/f80e5e501f879e214feeed6cc971a5e9 -libLLVM_assert.v13.0.1+2.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/e75e26dfb6fd42ce1305acd65701468eee6da7721dfa37c959f2aab0921eaf95fa0d94b1f4c97c59df5858539c7b1cc2949a732be98d36b44845beecc7c1bf0c -libLLVM_assert.v13.0.1+2.x86_64-apple-darwin.tar.gz/md5/a53b7fcbd8149fd5211b7c887711607b -libLLVM_assert.v13.0.1+2.x86_64-apple-darwin.tar.gz/sha512/1b0ad43d312420c5da5cd6bc88138f0e38b65f9e5d36d1dbeb7d4aeac7e472e66b326261c4065565e4dbb81d720f8d6370178bd97ce85ef8502abb462ec2fb57 -libLLVM_assert.v13.0.1+2.x86_64-linux-gnu-cxx03.tar.gz/md5/c1c290bcb3b5fc2268a29ceed211245f -libLLVM_assert.v13.0.1+2.x86_64-linux-gnu-cxx03.tar.gz/sha512/1ac3c8b5ea9e1232c8820481364be61184e9fa8c9da7fc66707c965b283f56b8e1a590b40aaad518f152a3bb14903967392d0c77673c324664292263815a1ba2 -libLLVM_assert.v13.0.1+2.x86_64-linux-gnu-cxx11.tar.gz/md5/9bcb827c673cb07f316a752707c3144e -libLLVM_assert.v13.0.1+2.x86_64-linux-gnu-cxx11.tar.gz/sha512/cb4559d5b6f68c4754ee4aa1238f9c2e5f91131d2e93f34ef0037512886ef4ca9795243f4556838511024c3c7c9f511c07e64cd773bb98f9e7b653c76f194e57 -libLLVM_assert.v13.0.1+2.x86_64-linux-musl-cxx03.tar.gz/md5/6b400208db2fc0cce2871ec881d3ec2c -libLLVM_assert.v13.0.1+2.x86_64-linux-musl-cxx03.tar.gz/sha512/2e7405516e973610d090d6966a25293bc252c883e5886fcff59de60d2d1324db9507ba27ebcdcc4565f7f2d6066149b4190513cf26d634fc4260c02b6bf1fb9f -libLLVM_assert.v13.0.1+2.x86_64-linux-musl-cxx11.tar.gz/md5/e1f9fe84eab47bb2670a1ac4424a71df -libLLVM_assert.v13.0.1+2.x86_64-linux-musl-cxx11.tar.gz/sha512/80487d4e1cd60cf117e735e78631b3c2095cb4bc98f193077f499d22db9000715738ff1b929dd4bce4f1bbbfa6fb417bd704a034cf0d8996e6a8872eb4a3d84b -libLLVM_assert.v13.0.1+2.x86_64-unknown-freebsd.tar.gz/md5/3c1d3bce109eb88d8a1a20ae655a384b -libLLVM_assert.v13.0.1+2.x86_64-unknown-freebsd.tar.gz/sha512/f1ca50d1f135d7b82da71145ad6d4c11d781044c74f705c362885d2becfb17f585ff7e167dd279f4898d92496ded9af9082afc1a5e3b7c271f262647383edf08 -libLLVM_assert.v13.0.1+2.x86_64-w64-mingw32-cxx03.tar.gz/md5/83399cb1b8201cc5991c895e54fdbc2c -libLLVM_assert.v13.0.1+2.x86_64-w64-mingw32-cxx03.tar.gz/sha512/449ba8cf0d3ace07f426c27dafdb24f1dfa9b56fdd4bc31d118aef6dba357fb5788a3bc7a62d860f41287a4bdee82851c1da7d6a6817104af5225bd3c6ec4e2b -libLLVM_assert.v13.0.1+2.x86_64-w64-mingw32-cxx11.tar.gz/md5/3493be4fc51854d5c3a6e848a99be415 -libLLVM_assert.v13.0.1+2.x86_64-w64-mingw32-cxx11.tar.gz/sha512/262c0f26b542ae9e97846f83257084a1344fad4ad81ce8ef1f20b6ea2741a737674dc018b3b8e1493685ff10eecb35f137cf82c4603e0d28f32f62101621201e -llvm-julia-13.0.1-2.tar.gz/md5/ecf89f679a0114cdd52eea79dd3c28ae -llvm-julia-13.0.1-2.tar.gz/sha512/3e93cbb4878d2e0890d6c91a6101ab76d89d8d11110a95731fc041d5300ecee5b03e8f8c26bddb58cbf177799c4656c7d54e23ed6d90fc402a5941e39c4ae508 +LLVM_assert.v13.0.1+3.aarch64-apple-darwin.tar.gz/md5/4238209fd5dbd7bd9a91f0f262bbdc5c +LLVM_assert.v13.0.1+3.aarch64-apple-darwin.tar.gz/sha512/c8b9d57af32c5cf93577f3a5e24a4bb1e656f5741c9927992c9195ab9ad41a983afb405aefe70a6644e1f4663b09b685766a69ef5398d2c5da15d6ab9d18277e +LLVM_assert.v13.0.1+3.aarch64-linux-gnu-cxx03.tar.gz/md5/40cf170d280bc9c09266fe1f73a39b26 +LLVM_assert.v13.0.1+3.aarch64-linux-gnu-cxx03.tar.gz/sha512/576c2fe5f7d8f4c898247d4813538956b05a5f8d31d173b7a685057d515dddf2365c94eb7d2b168fd2fa0d032ac15773e5141069885161cb8b5bda3a4d4c7281 +LLVM_assert.v13.0.1+3.aarch64-linux-gnu-cxx11.tar.gz/md5/3d65040e45fb4867589d3daaa1a030da +LLVM_assert.v13.0.1+3.aarch64-linux-gnu-cxx11.tar.gz/sha512/c058a322cdc2bd7ad4977acd00dff8091b470736a1599ecfecef5d3e508ff4657fb1bb02e95da1b89fefb7603c8b2c1a7b8c541c09e115fd472690f75f428f57 +LLVM_assert.v13.0.1+3.aarch64-linux-musl-cxx03.tar.gz/md5/2b1300da2d1bd07698d3bd75941b6977 +LLVM_assert.v13.0.1+3.aarch64-linux-musl-cxx03.tar.gz/sha512/3622aa0327f9e28ab792151eb7b0a8edf6a98fe2107e7ed43322b07bba9fa584e58305e3c8516c4555cdf6808f86b03ea0baf6297b87cdba3c93b546959bba42 +LLVM_assert.v13.0.1+3.aarch64-linux-musl-cxx11.tar.gz/md5/a49324adc6b6b1d30e63473a1a473463 +LLVM_assert.v13.0.1+3.aarch64-linux-musl-cxx11.tar.gz/sha512/f541ebc736b576bddc1b95509c71b2d8f162378ef8686ef68a2cdcad89f3e05bf1988bd49486dbd0607138a4cf51d240b53ef5fc962eee96152ad8fe7f4fd08c +LLVM_assert.v13.0.1+3.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/b96c309b0f3ab2999648efc7c96eb713 +LLVM_assert.v13.0.1+3.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/0927a9f6483d676414cf7e6a32eea08f90678ea1df35ce32c3527d265adb062b7a8a8ca590bf7a3421062ffca123b9bea16e491d64e1e344321af704d05592fd +LLVM_assert.v13.0.1+3.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/be710a0305351ea35d6d17380a79bde9 +LLVM_assert.v13.0.1+3.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/60537a9b6fc1d6d2747b3782eecc9b551385e2f6bb09feaeaed7e1a9461ed11b291b162239624f078823fbb584986b426aee4a688c441122afdf4ba614bcf9e4 +LLVM_assert.v13.0.1+3.armv6l-linux-musleabihf-cxx03.tar.gz/md5/e2c6a84424d8e29cf6eae7e6633f88d7 +LLVM_assert.v13.0.1+3.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/f62ef18cbca2551d60eb292b86c4d7cc0cb2d990c84237c4c1127a1b12fe0158d68991a01173dfd136c241ad95529edb7174cc85463d97b343579273f69f12ea +LLVM_assert.v13.0.1+3.armv6l-linux-musleabihf-cxx11.tar.gz/md5/fecab7a2d89d15921c129ca9cfa58745 +LLVM_assert.v13.0.1+3.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/98de746870af5d4d746e71ac69e93c224fffbfda4ec422ebdbffbda72148c9144993003238cfe9d657b7eefb81f3c682abbe255a9d43a171f167144ed86d23c2 +LLVM_assert.v13.0.1+3.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/6049c4b4782c2da8a2b237fedcc9d5e2 +LLVM_assert.v13.0.1+3.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/e3f0b21374b71325a25aadcd79a07a29f56fb839b3c4520e3c5df204a393f24ae1224d81a8658b3fdacc5a3242ba382a2a7da949d31ca7f1ebfac1ade0d942e3 +LLVM_assert.v13.0.1+3.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/f14bc3e481eb90e421d229a8ab00e8cf +LLVM_assert.v13.0.1+3.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/305ef648d8178e7de11943f4bfc209b49ca833b0638512d31b7fb8e485ff53ed2c57aacc6dd9bddedd81a99ce4a0340fb723877f8f93c340ae88139ce53e6a1a +LLVM_assert.v13.0.1+3.armv7l-linux-musleabihf-cxx03.tar.gz/md5/8002ce77e74582e6936581a29167551c +LLVM_assert.v13.0.1+3.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/8bd604d952b7b14b590b21005156f7084f40ed302b249410c46ae83a9accff5f7627ff0a91f83d2ccc91c13eae59b5f01e0aab2418429498a5ef5348d09dfd8b +LLVM_assert.v13.0.1+3.armv7l-linux-musleabihf-cxx11.tar.gz/md5/61a1e29875fb4c61d9fbe4b88acd3522 +LLVM_assert.v13.0.1+3.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/8fb0747b10b90a14470d5fdc2c13472df9d42ec976af75a5a538771f34238da090280f62feb6789cb49ff9b2cb296b178f20cfbf0d4a2a3272e20b92d2fdaf97 +LLVM_assert.v13.0.1+3.i686-linux-gnu-cxx03.tar.gz/md5/9833f50be2a26c0f677b3ba9ba3826d7 +LLVM_assert.v13.0.1+3.i686-linux-gnu-cxx03.tar.gz/sha512/3d747f05fbe4b9a2f2cb63f0efd25c0e31ad6b08985553299545b6723fa30595db813b370036af9dab008710fc68679f53d653eeb4b3c6b34cf44500ca0fb604 +LLVM_assert.v13.0.1+3.i686-linux-gnu-cxx11.tar.gz/md5/13e3e5a25ce57ad37a9311ac7d7e0708 +LLVM_assert.v13.0.1+3.i686-linux-gnu-cxx11.tar.gz/sha512/26abdd0c6030f61014d5b1caabae6be21240c2f298a6081c56e2cbb6c63ec8d56e753fa1a1b9a9f92efecf5199060f6cea5ea562c21f218a85b8ff032c68b5c6 +LLVM_assert.v13.0.1+3.i686-linux-musl-cxx03.tar.gz/md5/fa987d61bc041186b2706b3b1b8c9e3d +LLVM_assert.v13.0.1+3.i686-linux-musl-cxx03.tar.gz/sha512/0c1ca9f55664d1dc1bbc0ebcd826182e6aa590d3447133088430d2cc3901abfde4ec385a2d2134d05f833ba1ca813eba54b9f6b9fefce4463e3cda32c02eedc9 +LLVM_assert.v13.0.1+3.i686-linux-musl-cxx11.tar.gz/md5/a0b074d6b68cd1eb6385604bcf5d8755 +LLVM_assert.v13.0.1+3.i686-linux-musl-cxx11.tar.gz/sha512/207ed3118853b44dc86f2bac218156410e85d341c1ef2bdef0a244ea249e9186c96e90a85ec4a0c884fc5bae9884fccfc5525ecb829da955177197e2438a0469 +LLVM_assert.v13.0.1+3.i686-w64-mingw32-cxx03.tar.gz/md5/055dcf4e056240a00d98f8aceb9e93a3 +LLVM_assert.v13.0.1+3.i686-w64-mingw32-cxx03.tar.gz/sha512/785e8f8610f72560c533c1ebfafbd9dded6206e493ef64c0a8b02227cc9d46df98d5938f16e11eb4eb3d91616c4feee9865283d5671220dd1cac7880e48ad0f8 +LLVM_assert.v13.0.1+3.i686-w64-mingw32-cxx11.tar.gz/md5/b8acf21ae21e88fd946522298980ec96 +LLVM_assert.v13.0.1+3.i686-w64-mingw32-cxx11.tar.gz/sha512/cf26f621f4d48bf911af8cb0dda9648e7455755c55b8bd207f58e759d9eb6e710fe81bd4ed8732e6785168c0a68269761c3d3f573909a5ab33923301399b0a91 +LLVM_assert.v13.0.1+3.powerpc64le-linux-gnu-cxx03.tar.gz/md5/db3be34417bd11f054b2a62d8bd10498 +LLVM_assert.v13.0.1+3.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/98116ec343d17ae723e071c4214fa2443723a3a2ef232ed89875981536a79834647f9c11b4a5bc22ddfa000a1f88a0f01f6407f6c100b38ba051ee2c13a5e788 +LLVM_assert.v13.0.1+3.powerpc64le-linux-gnu-cxx11.tar.gz/md5/d5f2c6adefc09660f86d9e235614eb0c +LLVM_assert.v13.0.1+3.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/5ca0c6a5a909139f30ce136ea9f325cc15c0eb13abfc2b8dd30b74f05fb9a1e49b519bddf010f0b70345cfee32100d83317bdf27e87fe7d5b1b047aaf465de5b +LLVM_assert.v13.0.1+3.x86_64-apple-darwin.tar.gz/md5/04c5a264ae50d2558f42687f868abf21 +LLVM_assert.v13.0.1+3.x86_64-apple-darwin.tar.gz/sha512/3e97f7a3207ecbb8c4eb9189df263719ff5068aa7b087d4bf52e2227aa9aa7fc9a16d8c3cf8ecb918211e4783256be57e31832d57d6ebc78fecd89c34b89bf5b +LLVM_assert.v13.0.1+3.x86_64-linux-gnu-cxx03.tar.gz/md5/6667ed5bd1226f889470fcc14f431583 +LLVM_assert.v13.0.1+3.x86_64-linux-gnu-cxx03.tar.gz/sha512/fea2f4a9c6f2df097763d9885a68b3aac91bc500c1b69f5216b194516e026343cf4d3cf842b963f1c0dba80a7d61482f0a8f3f627f5a109c6677450a2b854a2d +LLVM_assert.v13.0.1+3.x86_64-linux-gnu-cxx11.tar.gz/md5/299ee88f23697006b882afb06c672b36 +LLVM_assert.v13.0.1+3.x86_64-linux-gnu-cxx11.tar.gz/sha512/7dd5f83d7bc5047710b378ba5441faf3c539574970f23502b537ad5746db5feb7785aadc0143a8b778fd01638ff8d4e2123c5e2d11c60375e209751e4b086c1b +LLVM_assert.v13.0.1+3.x86_64-linux-musl-cxx03.tar.gz/md5/c46054b995ab150f18f47d6040a5fddb +LLVM_assert.v13.0.1+3.x86_64-linux-musl-cxx03.tar.gz/sha512/bbbfeb43f90240a1b531e3aaa557aa1bf714d0bafa873dde6ffe3a44f4d94ad9cec66c61bc310ebf218f5a4ac24fbf02b0dd380f7100e4e2fd3911bca7964036 +LLVM_assert.v13.0.1+3.x86_64-linux-musl-cxx11.tar.gz/md5/335213de9ea1ad6d3783158e226c8674 +LLVM_assert.v13.0.1+3.x86_64-linux-musl-cxx11.tar.gz/sha512/2a60efc697cb42531f2fe559518f73a5ffb9278de1cd6cd0fd502c1f1ffa8bc1ed4efac1ac0a2c5dedd972fbd6f409008c65383733d2d69aebddaed2b4af6743 +LLVM_assert.v13.0.1+3.x86_64-unknown-freebsd.tar.gz/md5/3ecbf33f06795a0b9fc010d284f3ee67 +LLVM_assert.v13.0.1+3.x86_64-unknown-freebsd.tar.gz/sha512/9a0d4c20f40caa39fc31e2d6ea363a403938558cbbe88845f444e516da7d56151cfdce88c7d4ff765b07a42361b5092a3a631b38148a3983c6e34383310e5f1d +LLVM_assert.v13.0.1+3.x86_64-w64-mingw32-cxx03.tar.gz/md5/7aa7e19bf2e89718047b91efb8556c8c +LLVM_assert.v13.0.1+3.x86_64-w64-mingw32-cxx03.tar.gz/sha512/86f05d14c1fb8ff1f689972cf3f52e1d46209a2e57e86d3cd1b2db74e5791f4afd008203b55a1c6a76fa67822ba7a71ac62b4e15a9598f923075224df26a2699 +LLVM_assert.v13.0.1+3.x86_64-w64-mingw32-cxx11.tar.gz/md5/b1a88cf4caa01a556436e36dec8ea7d6 +LLVM_assert.v13.0.1+3.x86_64-w64-mingw32-cxx11.tar.gz/sha512/5f711f489d95e705a8873769baad99fad3a5b3572fbdca754d1b96add6f2d1274172ef6a0509833fa825489f514214f1b6bc03d5961c7b3e102dd5d26e3299d5 +libLLVM.v13.0.1+3.aarch64-apple-darwin.tar.gz/md5/9f639b46576af60e2fb6683331b820ea +libLLVM.v13.0.1+3.aarch64-apple-darwin.tar.gz/sha512/9f250d1bfd33f6d6bbdeaa6d45db94fa54ce1ee82e81dad620911fa78773336aa5ed2d0f48a517a7503a4dca59ca5118971b96b762bfc0642740e9154bf1a37f +libLLVM.v13.0.1+3.aarch64-linux-gnu-cxx03.tar.gz/md5/02bcb07db1bdf5debc88ab3c4cba6ec4 +libLLVM.v13.0.1+3.aarch64-linux-gnu-cxx03.tar.gz/sha512/43f0abe520a731c08cbbb2d74969d72f4254db2d4fe680ed5846106e359adda95f3df63336aad2cccf74ed004a45bca0e27593472ecf3f70f003bcd7d11565b7 +libLLVM.v13.0.1+3.aarch64-linux-gnu-cxx11.tar.gz/md5/b848f6304e5c33e5e8dda66a11f77549 +libLLVM.v13.0.1+3.aarch64-linux-gnu-cxx11.tar.gz/sha512/9bb1811a05506a88ee6a25f883999546d0079eb7e7b7c725ee6adb74302ec56f53339936e72ee20f927e030f5e41225254c1cc11ec8d68dd896cd728a4fe60f0 +libLLVM.v13.0.1+3.aarch64-linux-musl-cxx03.tar.gz/md5/43a12603d01c66837917fb2e5cf560e6 +libLLVM.v13.0.1+3.aarch64-linux-musl-cxx03.tar.gz/sha512/e64e5daa31b6ab85c39a33f4045cbe9af39b423bb85e18a33954d378cdd1b66ecb778b63c1b6d8fd552c1c25685729b5cd9d0d583eeb084885df260266c1ce85 +libLLVM.v13.0.1+3.aarch64-linux-musl-cxx11.tar.gz/md5/f29fcd99763d1ca14fc85664f7ff16d4 +libLLVM.v13.0.1+3.aarch64-linux-musl-cxx11.tar.gz/sha512/69b8ae0381d4487049b0ef8f76b885e5a7a2cc575df2764408bf1c51b63bb0340936cb7acc2c8edd105d39b63193c5b3cea0a507f75f369f7a8668633808d8b7 +libLLVM.v13.0.1+3.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/48c227d2b2a708296360cefd686786e0 +libLLVM.v13.0.1+3.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/13d262fb15ed23b9d9a77635584eaeb94461db940eaee59bc573b5ccb11e010ced4cc5ab1e055c0100fece8cd606af6c9416c8b5149eac664424b71d797af899 +libLLVM.v13.0.1+3.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/17214d9b9abbc83339dfc24f41afbd8c +libLLVM.v13.0.1+3.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/a31687bc40830064779e892b13c1751a6dd43810a0ba5cfebad0bf13372d2f095ce772fa3513dfa9c777f383051741fb4987e966de1f714ef5573b2e12ef06d9 +libLLVM.v13.0.1+3.armv6l-linux-musleabihf-cxx03.tar.gz/md5/2a8a83a00fe8124f4757e272df63b6cf +libLLVM.v13.0.1+3.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/f6d8a0493b13761f7663960355da47263507b98f898438042bb0e59e05ff669d77c6664f0d54bb44c5f7a95b29e3b405ba8db561fcd3b9410eef2fb54a7bc5e3 +libLLVM.v13.0.1+3.armv6l-linux-musleabihf-cxx11.tar.gz/md5/e5c66ed86daab1d4dbc35c7888c3ff00 +libLLVM.v13.0.1+3.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/93426e669de1b330429f8ef79aed80f09183c2e31b334fb9b8795c6b140621432f56aadadd24615a3f0352cacbb3cf2bb49a3ca8d839facafa9ec7f29e938055 +libLLVM.v13.0.1+3.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/3c582361a2381cd8f54990e923738194 +libLLVM.v13.0.1+3.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/9941c99dd681542a1d1be91eb3517fcd46f89383993c9560bab438e29e8c7ab59f7b242f70df2c8fbba953a90548ec2322f2870cb33d127fad6f19280ea36419 +libLLVM.v13.0.1+3.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/fa6d470b8eeea99ac27f8a793f1ef836 +libLLVM.v13.0.1+3.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/08eab24eb95d4b2e340dfbbaacd1fe3ec8effcac744b3375e9398606dfa86ff56c0ad7704c3db74a96bbdf58ad109e30eb10782c9dca2cb87a55472e764c73c4 +libLLVM.v13.0.1+3.armv7l-linux-musleabihf-cxx03.tar.gz/md5/8744333ae16500b8f8cf7df1b648a876 +libLLVM.v13.0.1+3.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/b01afeca35eae9deb19fb54dfc440d3e27dbc2b95d293d1c6617de91a2002d4018a20f9bfbb3691e84284ca3cb65eab308f90e175d6b0dd828cd33ca0a4e783b +libLLVM.v13.0.1+3.armv7l-linux-musleabihf-cxx11.tar.gz/md5/3489e6a1f8d6f1450391d1e29f0ec2be +libLLVM.v13.0.1+3.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/997b9b0ccd3dd45c09221a2f9b19ba20bf55fec1c99073f95a29cbae565844608cc4e0bad5dc31ed11a024562a2ed5d05815cf566f9d184296563049979937d2 +libLLVM.v13.0.1+3.i686-linux-gnu-cxx03.tar.gz/md5/aed4f76e23909b9c754fc76bb8c198f9 +libLLVM.v13.0.1+3.i686-linux-gnu-cxx03.tar.gz/sha512/1e69161199eed23b252bf4ae3e7ca896f3a9f8d66d7c5310e39acc42a8d19bb60530378f9f75ab23c5894c9525ac2092a28ae016bc9618eafd19f39160eedb2e +libLLVM.v13.0.1+3.i686-linux-gnu-cxx11.tar.gz/md5/de7651793e730ebc2716483fc76313c1 +libLLVM.v13.0.1+3.i686-linux-gnu-cxx11.tar.gz/sha512/392d7008e1119aa8acc65815a883086d810674634053c258382bba573054defbecbb717ab938b5942847c6e8cd2c6121f11c2afcaa494e105fd9def77e052261 +libLLVM.v13.0.1+3.i686-linux-musl-cxx03.tar.gz/md5/dd67afbbffff403aad38c8fd502003bf +libLLVM.v13.0.1+3.i686-linux-musl-cxx03.tar.gz/sha512/a2f4bd0e4aec8775edfdb2e47932762714f4adcaf5c84f3da2924fcfce5801562ab478656b6480c446ddc29fbdb0929e70a93e2a3fa8500c0b16ea6ddf456024 +libLLVM.v13.0.1+3.i686-linux-musl-cxx11.tar.gz/md5/9e7abad42d1ac954d8da668369ec33fb +libLLVM.v13.0.1+3.i686-linux-musl-cxx11.tar.gz/sha512/142363729bfe4ff0abb9641f06fa69a2d6b728ca3898c2561999bd26764f6f8be8b47455d6dab4d0d8d75e4b3f68e014cdafb3b80d000c0450ca0a532ba05ecf +libLLVM.v13.0.1+3.i686-w64-mingw32-cxx03.tar.gz/md5/7b1de9a77dbfeb0edad627c3c6885ca0 +libLLVM.v13.0.1+3.i686-w64-mingw32-cxx03.tar.gz/sha512/b7de578b419a605e049b9d81a84276aadb56538415fa064b6abd2a184ebdc3f858d6eae3f22d14568f9601d22c2257a129347e0328bde2adc7d9f77cad708a4a +libLLVM.v13.0.1+3.i686-w64-mingw32-cxx11.tar.gz/md5/725838263b3b938ac4cc269f54ef950c +libLLVM.v13.0.1+3.i686-w64-mingw32-cxx11.tar.gz/sha512/6ff1f3940b921297b01afe4eb03020f682466141f6d4b633f4ec8dbfa051a8e68bbd53cc3e73d4cbde7a446fd19edd3ca93607d09db705105a95dd5a5ba2b51e +libLLVM.v13.0.1+3.powerpc64le-linux-gnu-cxx03.tar.gz/md5/3a8923c00e5dc38e9fd34f2540e10a6e +libLLVM.v13.0.1+3.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/5e6bfa4cd850eaaa22a450a716917f0e918b0cfa15894236b0ff07ba48f0fa67c874805ff3e604e2d77076a4259c52e646341ca5c966b16505266c6eb009feca +libLLVM.v13.0.1+3.powerpc64le-linux-gnu-cxx11.tar.gz/md5/1cd1bd7a9b5fc1acfc3ea5333bbac3c1 +libLLVM.v13.0.1+3.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/b0b1928a4ef0a22ec3d22ada322dadc75ea608b7544de851c98e488b75ee12fbd477d3cab1d565a5694f55123388a519d7d3a938a5a77ee51925f9d1ad84c806 +libLLVM.v13.0.1+3.x86_64-apple-darwin.tar.gz/md5/bd660aa548a155aad9aa5c4588fabe29 +libLLVM.v13.0.1+3.x86_64-apple-darwin.tar.gz/sha512/5408cd0752d2c9e7f3bc1845e4ffd6a429ad4b3695f4a8955fbf35d2d899349aa16ea639f048f9e0facfbc92639e2e7946c9b3cd1a0a68b4b5000358a57b4c7e +libLLVM.v13.0.1+3.x86_64-linux-gnu-cxx03.tar.gz/md5/2e49b05ced2cbbf78e1445a96fd45fdc +libLLVM.v13.0.1+3.x86_64-linux-gnu-cxx03.tar.gz/sha512/15392a7a02e234f4a39a6eace44bff2d660bc18c3c05e6d9ece0400bc5adad238a92df9c34ffa6bfdaf9643c199c5c896ff81b61f26962d19d2b4ddb5a83280f +libLLVM.v13.0.1+3.x86_64-linux-gnu-cxx11.tar.gz/md5/8772e63621d3c706765889299e5d314e +libLLVM.v13.0.1+3.x86_64-linux-gnu-cxx11.tar.gz/sha512/3f7f632f1a8ec007302de945a4320d27f4cb1803db3338b1cbcdd57091807d9182700df854c4e4b71ece2c4190ede55a559fdaa721d6cd0f167d801b3344ad16 +libLLVM.v13.0.1+3.x86_64-linux-musl-cxx03.tar.gz/md5/86213783a3fb8a6129b7f239d4b2e99e +libLLVM.v13.0.1+3.x86_64-linux-musl-cxx03.tar.gz/sha512/2942497a3f212e57c31e7a98fd13418f027480c85894a0a960eac2f1a6aa78dd0c08b792f45e44b8721c2c0b35290c1db569f3517c9f9de3797e04e446b10e41 +libLLVM.v13.0.1+3.x86_64-linux-musl-cxx11.tar.gz/md5/db4b5aa3cd4c596d60143e1cf348b8a5 +libLLVM.v13.0.1+3.x86_64-linux-musl-cxx11.tar.gz/sha512/c5942e29bb3be051ffcefe94539e59942cdd3e629b94914210d8bcd2c8d16bbe377cd323b9fc1c534251bd79b61c879e27358d2a61fd28e09829967b6c7cfc98 +libLLVM.v13.0.1+3.x86_64-unknown-freebsd.tar.gz/md5/a0f4dc0423ad627e659ed1765c9c5471 +libLLVM.v13.0.1+3.x86_64-unknown-freebsd.tar.gz/sha512/0dd5ff7f1262099e9d07e588545d239abc8d145a357f259aa527836e88ad65265db6231ad91e9edb17edbe823c4581f0f17588f78f1262c5823d153975049786 +libLLVM.v13.0.1+3.x86_64-w64-mingw32-cxx03.tar.gz/md5/a8c706306da173757582068b2a17d408 +libLLVM.v13.0.1+3.x86_64-w64-mingw32-cxx03.tar.gz/sha512/ba9322c578512c43513b0bb168bcfa5c2ada4c8f15a12b540c26cf73e290aa9e4024f58ed5ee64bd02d0ffa61bf9a1311066c5208facbb83e5364923d03ced50 +libLLVM.v13.0.1+3.x86_64-w64-mingw32-cxx11.tar.gz/md5/a808061161c37d447e78265b1f6c6b02 +libLLVM.v13.0.1+3.x86_64-w64-mingw32-cxx11.tar.gz/sha512/069669ca2d63d92c8ef13c87b2e19b9b2f9d380f44b7111093798610b87f5c7c4778567792a120f40861d31538aa69d606f8cd778e3125f1087b8bbe35d9eafa +libLLVM_assert.v13.0.1+3.aarch64-apple-darwin.tar.gz/md5/cecdcc4a66d77e38cfb25332b9c2998c +libLLVM_assert.v13.0.1+3.aarch64-apple-darwin.tar.gz/sha512/e99fa7ab6e099b9b8e370963d0fb887f2f6907697038fc58b9730062b49761366161e6fdff2a77c507729c141fa694230d0bf072368ca9e02539de324dce6d62 +libLLVM_assert.v13.0.1+3.aarch64-linux-gnu-cxx03.tar.gz/md5/5456909e24b043cb90323f6ac4186f7e +libLLVM_assert.v13.0.1+3.aarch64-linux-gnu-cxx03.tar.gz/sha512/752055aa561ea42bdd78dd59745e7f32c68e46349e01abeca252e2306dca0109656a37ccf7577daad11ab082ba919a10616573d1235a5078090264b0364094ed +libLLVM_assert.v13.0.1+3.aarch64-linux-gnu-cxx11.tar.gz/md5/06dfa17a470fd0808b77b35abdcfe5f5 +libLLVM_assert.v13.0.1+3.aarch64-linux-gnu-cxx11.tar.gz/sha512/f8cd8e0629aa46c4b659cf717a95614a82baf9a78bf8b24b9c212c2f9c0828b3b42b095cf276b9f7e6ff191728f1958fd1a671655556a52007bb10faf96a6a08 +libLLVM_assert.v13.0.1+3.aarch64-linux-musl-cxx03.tar.gz/md5/27bb7687ec6096066d629ff572afd643 +libLLVM_assert.v13.0.1+3.aarch64-linux-musl-cxx03.tar.gz/sha512/30d4e2af85b30b86628051e791045b1bd0fa9771b0afd323b8f7d6ef886889b629944cdcf3d747f4d3d24944b8d8138b893e7b1c6595778e04d211cd900ba53a +libLLVM_assert.v13.0.1+3.aarch64-linux-musl-cxx11.tar.gz/md5/c64fb515e68de2f4537213c72c7eeee1 +libLLVM_assert.v13.0.1+3.aarch64-linux-musl-cxx11.tar.gz/sha512/6835b61ef3e3e4f0e59477d7475d369f4305921cca16a78580c9d2ffa729c18b4d28fc91b70a4f52af30cb7f5e463bfd96925cedae207605974862736df83d35 +libLLVM_assert.v13.0.1+3.armv6l-linux-gnueabihf-cxx03.tar.gz/md5/7575d53041ca19ab5d6c382762bfdb09 +libLLVM_assert.v13.0.1+3.armv6l-linux-gnueabihf-cxx03.tar.gz/sha512/b8fa3145fe500da65129c06c697cc89ab3726d7493014f6d59972811de39413b286e1ccd88ef10aa6cdbc32f933a103e2609817443d03a1ac297d094ac214dde +libLLVM_assert.v13.0.1+3.armv6l-linux-gnueabihf-cxx11.tar.gz/md5/77aaa82a76c58d598074532b25ff5650 +libLLVM_assert.v13.0.1+3.armv6l-linux-gnueabihf-cxx11.tar.gz/sha512/0d3eb16f966510eb8e1b604a08eee0feddbcafc23ebc11a3f7eb84ea8035fe28d352d6971b49cc4ec463ba6c606134aa42252fa87132aa3bbafc90630b07ede3 +libLLVM_assert.v13.0.1+3.armv6l-linux-musleabihf-cxx03.tar.gz/md5/04ea3be9581f51f78a9627fa15776e9c +libLLVM_assert.v13.0.1+3.armv6l-linux-musleabihf-cxx03.tar.gz/sha512/72bf6bedb01d9be4dfdcd68ac699a46ec0dc1f96f15da380fd87a3f9a2c998937499f435a969210a6551dfdcc6f62b4c27ceb06533890f2e6919a2bf8a5d0b12 +libLLVM_assert.v13.0.1+3.armv6l-linux-musleabihf-cxx11.tar.gz/md5/98c3e6dd8f8d11c3ab4654944ee1e897 +libLLVM_assert.v13.0.1+3.armv6l-linux-musleabihf-cxx11.tar.gz/sha512/e81335b0a27393fdfe31512f3f034975a4907019818cd9033a136b1f5893be12a36a87367b1a7643823edbf15564173dd106ae6a1f9328ffe632c599182c19cb +libLLVM_assert.v13.0.1+3.armv7l-linux-gnueabihf-cxx03.tar.gz/md5/2673ec467214d14d3e2029db5c236746 +libLLVM_assert.v13.0.1+3.armv7l-linux-gnueabihf-cxx03.tar.gz/sha512/556f0aecff72c84ca269d9ac5261002eed323c27b3bfc0c1c971bcf126474f42b2d1350fc0abb611bec24dbab99ce0662359d5431dd1970c4a57a9f186e25714 +libLLVM_assert.v13.0.1+3.armv7l-linux-gnueabihf-cxx11.tar.gz/md5/b809891f64ed17a66f98996f69d67ba7 +libLLVM_assert.v13.0.1+3.armv7l-linux-gnueabihf-cxx11.tar.gz/sha512/39da829ac04fa74de6c707b2be6de831dd488c6cb2dd2a736c6422ae2ddd9183f5ba33eac01937231febde18f44fcb1ea59be88a6a95c08d6dcee451f8bb4d8a +libLLVM_assert.v13.0.1+3.armv7l-linux-musleabihf-cxx03.tar.gz/md5/925cc3c7796bff0b9c96694295a6b88d +libLLVM_assert.v13.0.1+3.armv7l-linux-musleabihf-cxx03.tar.gz/sha512/c29dc5b2c548d1f3098be5ccddde5c1cdd5c89a496891d2f55e4f164658f65b149f44fd7bdad056f52aa6564e85539305ce869a509e2ada576555b26168d609e +libLLVM_assert.v13.0.1+3.armv7l-linux-musleabihf-cxx11.tar.gz/md5/3057d2c9a2d21a82c3b9dbabdd865910 +libLLVM_assert.v13.0.1+3.armv7l-linux-musleabihf-cxx11.tar.gz/sha512/32395ec4fe275851b5bff84c7f3dbd306ca49f782dd85947b018a2227dd37c9b18da6557b9f2d797dc1347b7b102a130dc44b879a2e19d82635f454871868869 +libLLVM_assert.v13.0.1+3.i686-linux-gnu-cxx03.tar.gz/md5/a64e80ed42db9a8307879dddcff01b3f +libLLVM_assert.v13.0.1+3.i686-linux-gnu-cxx03.tar.gz/sha512/bfca007bc6701692b5f7725d47f1d4fc2cad6185e433b6b485ca0226352a57a023f3d1310ec649c236f9cea6468ce267d00c05fb7a4b2f5172a47f1872fd8e25 +libLLVM_assert.v13.0.1+3.i686-linux-gnu-cxx11.tar.gz/md5/5263d390f40980415d3b418642f1637e +libLLVM_assert.v13.0.1+3.i686-linux-gnu-cxx11.tar.gz/sha512/698863bc1e93eb7c9870b304ac80bc79d754422d6f22bfc32885439f84607131d1898778cd1b6e91a19a77b1e158c31ad01297389bed38cf11d2f2e41599e158 +libLLVM_assert.v13.0.1+3.i686-linux-musl-cxx03.tar.gz/md5/d406c113c172b6cfdf39b1593c2548fb +libLLVM_assert.v13.0.1+3.i686-linux-musl-cxx03.tar.gz/sha512/9f2a14fb40b106f12146768aaf6f9f3bea2f7500a6f004aaf98bac93e9e1d5997890872ec88c18e77512e7fc0e78e834268d3bc078cd9fd69381fd5fda1e900b +libLLVM_assert.v13.0.1+3.i686-linux-musl-cxx11.tar.gz/md5/fbbccbf6c1d18a3a312cada88b65cbb7 +libLLVM_assert.v13.0.1+3.i686-linux-musl-cxx11.tar.gz/sha512/40a16568616b85fc2e180dcea5c52ec3a501148ea58312a9b200c43f6113973eee7221cc8c5221dd00aadc3816eb82e15bd18de51e73fe3b727fe52801cc4b56 +libLLVM_assert.v13.0.1+3.i686-w64-mingw32-cxx03.tar.gz/md5/7a1f274ba7b0f50e877725d653c92cd0 +libLLVM_assert.v13.0.1+3.i686-w64-mingw32-cxx03.tar.gz/sha512/a016dde21bc3d41fa995b977d360014b84075e532f8c988b5e1157fc059af4f7a0c4b77694f0b486a47361485eca298a188eb5cea531126ff5330a180d514d40 +libLLVM_assert.v13.0.1+3.i686-w64-mingw32-cxx11.tar.gz/md5/693ca23c86c1d119b18f4022e8304be0 +libLLVM_assert.v13.0.1+3.i686-w64-mingw32-cxx11.tar.gz/sha512/abbce3b1ac395b3e1eff6bd522e0852efa2cb64be9b72cf3cbb31b7f00bc7dfe142c1ec1f99b163906792b2119f5b76e613dbc75cfb66eee8825180ae85089cf +libLLVM_assert.v13.0.1+3.powerpc64le-linux-gnu-cxx03.tar.gz/md5/2e3441179e71840d5fbe43e844dc0e8f +libLLVM_assert.v13.0.1+3.powerpc64le-linux-gnu-cxx03.tar.gz/sha512/2ef466de5f3a6bf17b1b39efed34bef99693d1edfc0a7f6a5462b9f1b01ec13d6283ce4be96d5f91489d0652f2b8c628f5aa0c4e605e7b5cd07a32cab90e98c2 +libLLVM_assert.v13.0.1+3.powerpc64le-linux-gnu-cxx11.tar.gz/md5/b26dd0b96e5abba39104402c1771df2c +libLLVM_assert.v13.0.1+3.powerpc64le-linux-gnu-cxx11.tar.gz/sha512/6cc05d72a75f9d4f465d0ab52f9a70738d66e065f985bd0aa5b08252f9ae5a640a27b338108add6ee5f37b9c82c65bb8dc22a26fbb384859a6afe7c6945c51ce +libLLVM_assert.v13.0.1+3.x86_64-apple-darwin.tar.gz/md5/edd575c3cfdfe7a92b07291741aa0fab +libLLVM_assert.v13.0.1+3.x86_64-apple-darwin.tar.gz/sha512/4f4f16ffe46288e8a917b41cae03fbbd7167fe4504b301b6f736016f8c50be36773a2d8ddf7517c1bf8ccf0353007a1b251a1685462874c9e3aead5f5b047322 +libLLVM_assert.v13.0.1+3.x86_64-linux-gnu-cxx03.tar.gz/md5/51135f72aca8df13389d0cdc7d510ab3 +libLLVM_assert.v13.0.1+3.x86_64-linux-gnu-cxx03.tar.gz/sha512/edc8bd63dcf0d397a781c899e8777a59b62889681d77cf12bbeb0425c9f70a693770e1e6e53b89f84e8bc6d48110156cc97096dc07c7e7ea922d8434060f720d +libLLVM_assert.v13.0.1+3.x86_64-linux-gnu-cxx11.tar.gz/md5/988764309b61c77ae5b896d90933fd5b +libLLVM_assert.v13.0.1+3.x86_64-linux-gnu-cxx11.tar.gz/sha512/2e3a38830419351b4edfacc8747ffbf2fd34abf4b029a1ccb225df7ea0afb27dd7a7404a1824a03477b536ca775ca91a88f0eb64c246c2d25d8e5d96de32fbac +libLLVM_assert.v13.0.1+3.x86_64-linux-musl-cxx03.tar.gz/md5/83411cf8609daeaaadb50dd77e76faea +libLLVM_assert.v13.0.1+3.x86_64-linux-musl-cxx03.tar.gz/sha512/0dddae0698edf5030394dbb8e386a60309443f7a1eea6bc09f7e49cdb82b0e45c8bfde4bc0cad816f2d007270c0cb65007401944dc86b467c466852e5d2c9e90 +libLLVM_assert.v13.0.1+3.x86_64-linux-musl-cxx11.tar.gz/md5/a076618da1e24ae6001fcdff431da5d8 +libLLVM_assert.v13.0.1+3.x86_64-linux-musl-cxx11.tar.gz/sha512/233b362bbedb375182a4da81de63c581d1027b829c171e176c0f1128d7982a7298d117dcafd74d98bc81da6a4df16832d53e5eb20898ad9a396cb1ae0b330307 +libLLVM_assert.v13.0.1+3.x86_64-unknown-freebsd.tar.gz/md5/9aae3e1a64a4ef948edb2798b0cfddd1 +libLLVM_assert.v13.0.1+3.x86_64-unknown-freebsd.tar.gz/sha512/0b9bfd0019cf23b4dca035aa7dc31bf683c78cc4ad503a150dfeb237c8ac9e3ff4605e8988263b2eb0aabd945a8bf38c068d043cd3c64a17cf47208a8eb799eb +libLLVM_assert.v13.0.1+3.x86_64-w64-mingw32-cxx03.tar.gz/md5/4871e44b013700baa99e9bd1dbf75e78 +libLLVM_assert.v13.0.1+3.x86_64-w64-mingw32-cxx03.tar.gz/sha512/0f9823969d5c535740616d4fe3f084125f15fac7ee3839266c2bcdeae3ee0e256e7f0e4b81a0b842f7cbc676ad178661f1f771a336cf0f03f37355a96e7f99ba +libLLVM_assert.v13.0.1+3.x86_64-w64-mingw32-cxx11.tar.gz/md5/49c7085cc5d7f65ba78ba190c006d87a +libLLVM_assert.v13.0.1+3.x86_64-w64-mingw32-cxx11.tar.gz/sha512/18fd4cfdc7c50197a9a53dbb784dcd1a4181739fb5c078d01a5c1a29b71f571c3d85bb5df2705f84ec9e9c6a56635c3934e67be4f2f9738b7a42f36723889c96 +llvm-julia-13.0.1-3.tar.gz/md5/aafdb10632eb982a9ff2a62a339a1220 +llvm-julia-13.0.1-3.tar.gz/sha512/6ce8deb400efd5ec8ca0fc0c7b72a9ad8b1d07ba0059b53db837b0721bd6122abaf13a96d00006661cb39006c40046f134bada6807657c12735b24fd500dea87 llvmunwind-12.0.1.tar.xz/md5/4ec327cee517fdb1f6a20e83748e2c7b llvmunwind-12.0.1.tar.xz/sha512/847b6ba03010a43f4fdbfdc49bf16d18fd18474d01584712e651b11191814bf7c1cf53475021d9ee447ed78413202b4ed97973d7bdd851d3e49f8d06f55a7af4 diff --git a/deps/llvm.version b/deps/llvm.version index 68b68b56a4926..e55705dc61da4 100644 --- a/deps/llvm.version +++ b/deps/llvm.version @@ -1,2 +1,2 @@ -LLVM_BRANCH=julia-13.0.1-2 -LLVM_SHA1=julia-13.0.1-2 +LLVM_BRANCH=julia-13.0.1-3 +LLVM_SHA1=julia-13.0.1-3 diff --git a/stdlib/libLLVM_jll/Project.toml b/stdlib/libLLVM_jll/Project.toml index cda68e4352d06..e934fa7aeb2fe 100644 --- a/stdlib/libLLVM_jll/Project.toml +++ b/stdlib/libLLVM_jll/Project.toml @@ -1,6 +1,6 @@ name = "libLLVM_jll" uuid = "8f36deef-c2a5-5394-99ed-8e07531fb29a" -version = "13.0.1+2" +version = "13.0.1+3" [deps] Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" From 2bb4aeccf88116682ee8f1bf833f32b858307efd Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Thu, 9 Jun 2022 23:12:55 +0200 Subject: [PATCH 237/369] Unset NDEBUG in analyzers (cherry picked from commit 2ad2e85b5f7a3cc44155a5507d9bd985b274b8e2) --- src/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Makefile b/src/Makefile index 57dd4482a1a34..475f2eb949d6e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -442,6 +442,8 @@ clangsa: $(build_shlibdir)/libGCCheckerPlugin.$(SHLIB_EXT) clangsa: $(build_shlibdir)/libImplicitAtomicsPlugin.$(SHLIB_EXT) # TODO: clangsa: $(build_shlibdir)/libImplicitAtomics2Plugin.$(SHLIB_EXT) +# make sure LLVM's invariant information is not discarded with -DNDEBUG +clang-sagc-%: JL_CXXFLAGS += -UNDEBUG clang-sagc-%: $(SRCDIR)/%.c $(build_shlibdir)/libGCCheckerPlugin.$(SHLIB_EXT) .FORCE | analyzegc-deps-check @$(call PRINT_ANALYZE, $(build_depsbindir)/clang -D__clang_gcanalyzer__ --analyze -Xanalyzer -analyzer-werror -Xanalyzer -analyzer-output=text --analyzer-no-default-checks \ -Xclang -load -Xclang $(build_shlibdir)/libGCCheckerPlugin.$(SHLIB_EXT) -Xclang -analyzer-checker=core$(COMMA)julia.GCChecker \ @@ -458,6 +460,7 @@ SA_EXCEPTIONS-subtype.c := -Xanalyzer -analyzer-disable-chec # these need to be annotated (and possibly fixed) SKIP_IMPLICIT_ATOMICS := dump.c gf.c jitlayers.cpp module.c precompile.c rtutils.c staticdata.c toplevel.c codegen.cpp +clang-sa-%: JL_CXXFLAGS += -UNDEBUG clang-sa-%: $(SRCDIR)/%.c $(build_shlibdir)/libImplicitAtomicsPlugin.$(SHLIB_EXT) .FORCE | analyzegc-deps-check @$(call PRINT_ANALYZE, $(build_depsbindir)/clang --analyze -Xanalyzer -analyzer-werror -Xanalyzer -analyzer-output=text \ $(if $(findstring $(notdir $<),$(SKIP_IMPLICIT_ATOMICS)),,-Xclang -load -Xclang $(build_shlibdir)/libImplicitAtomicsPlugin.$(SHLIB_EXT) -Xclang -analyzer-checker=julia.ImplicitAtomics) \ From dcd915b8532ff4b174c7ff6295bb78abdd0dab1d Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Mon, 20 Jun 2022 14:46:52 -0400 Subject: [PATCH 238/369] Don't segfault when running atexit before jl_threads_init (cherry picked from commit 3b77febf62c2491fd4f2415e1718d32b8b2f2108) --- src/gc.c | 4 +++- test/cmdlineargs.jl | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gc.c b/src/gc.c index b54f64ffa00fd..90db3dea5eabd 100644 --- a/src/gc.c +++ b/src/gc.c @@ -493,9 +493,11 @@ static void schedule_all_finalizers(arraylist_t *flist) JL_NOTSAFEPOINT void jl_gc_run_all_finalizers(jl_task_t *ct) { schedule_all_finalizers(&finalizer_list_marked); + // This could be run before we had a chance to setup all threads for (int i = 0;i < jl_n_threads;i++) { jl_ptls_t ptls2 = jl_all_tls_states[i]; - schedule_all_finalizers(&ptls2->finalizers); + if (ptls2) + schedule_all_finalizers(&ptls2->finalizers); } run_finalizers(ct); } diff --git a/test/cmdlineargs.jl b/test/cmdlineargs.jl index 8d58672d30f09..59e9251e1e827 100644 --- a/test/cmdlineargs.jl +++ b/test/cmdlineargs.jl @@ -249,6 +249,9 @@ let exename = `$(Base.julia_cmd()) --startup-file=no --color=no` @test read(`$exename -p2 -t2 -e $code`, String) == "6" end + # Combining --threads and invalid -C should yield a decent error + @test !success(`$exename -t 2 -C invalidtarget`) + # --procs @test readchomp(`$exename -q -p 2 -e "println(nworkers())"`) == "2" @test !success(`$exename -p 0`) From 47cd899fbee0b53f1d566b2361ea74f360bc520c Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Mon, 20 Jun 2022 11:54:04 -0700 Subject: [PATCH 239/369] Explicitly test for a failing exit code, do not include signals We accidentally ignored some test failures because we only tested for `!success(p)`, which passes even if `p` segfaulted. (cherry picked from commit 67a43c52fcb24fca14af6b545df24974ae2b3409) --- test/cmdlineargs.jl | 73 +++++++++++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 32 deletions(-) diff --git a/test/cmdlineargs.jl b/test/cmdlineargs.jl index 59e9251e1e827..bf6b696948fff 100644 --- a/test/cmdlineargs.jl +++ b/test/cmdlineargs.jl @@ -31,6 +31,16 @@ function format_filename(s) return r end +# Returns true if the given command errors, but doesn't signal +function errors_not_signals(cmd::Cmd) + p = run(pipeline(ignorestatus(cmd); stdout=devnull, stderr=devnull)) + return errors_not_signals(p) +end +function errors_not_signals(p::Base.Process) + wait(p) + return process_exited(p) && !Base.process_signaled(p) && !success(p) +end + let fn = format_filename("a%d %p %i %L %l %u z") hd = withenv("HOME" => nothing) do @@ -161,22 +171,22 @@ let exename = `$(Base.julia_cmd()) --startup-file=no --color=no` # --eval @test success(`$exename -e "exit(0)"`) - @test !success(`$exename -e "exit(1)"`) + @test errors_not_signals(`$exename -e "exit(1)"`) @test success(`$exename --eval="exit(0)"`) - @test !success(`$exename --eval="exit(1)"`) - @test !success(`$exename -e`) - @test !success(`$exename --eval`) + @test errors_not_signals(`$exename --eval="exit(1)"`) + @test errors_not_signals(`$exename -e`) + @test errors_not_signals(`$exename --eval`) # --eval --interactive (replaced --post-boot) @test success(`$exename -i -e "exit(0)"`) - @test !success(`$exename -i -e "exit(1)"`) + @test errors_not_signals(`$exename -i -e "exit(1)"`) # issue #34924 @test success(`$exename -e 'const LOAD_PATH=1'`) # --print @test read(`$exename -E "1+1"`, String) == "2\n" @test read(`$exename --print="1+1"`, String) == "2\n" - @test !success(`$exename -E`) - @test !success(`$exename --print`) + @test errors_not_signals(`$exename -E`) + @test errors_not_signals(`$exename --print`) # --load let testfile = tempname() @@ -209,12 +219,13 @@ let exename = `$(Base.julia_cmd()) --startup-file=no --color=no` end end # -L, --load requires an argument - @test !success(`$exename -L`) - @test !success(`$exename --load`) + @test errors_not_signals(`$exename -L`) + @test errors_not_signals(`$exename --load`) # --cpu-target (requires LLVM enabled) - @test !success(`$exename -C invalidtarget`) - @test !success(`$exename --cpu-target=invalidtarget`) + # Strictly test for failed error, not a segfault, since we had a false positive with just `success()` before. + @test errors_not_signals(`$exename -C invalidtarget`) + @test errors_not_signals(`$exename --cpu-target=invalidtarget`) # -t, --threads code = "print(Threads.nthreads())" @@ -240,8 +251,8 @@ let exename = `$(Base.julia_cmd()) --startup-file=no --color=no` withenv("JULIA_NUM_THREADS" => string(cpu_threads)) do @test read(`$exename -e $code`, String) == string(cpu_threads) end - @test !success(`$exename -t 0`) - @test !success(`$exename -t -1`) + @test errors_not_signals(`$exename -t 0`) + @test errors_not_signals(`$exename -t -1`) # Combining --threads and --procs: --threads does propagate withenv("JULIA_NUM_THREADS" => nothing) do @@ -250,11 +261,11 @@ let exename = `$(Base.julia_cmd()) --startup-file=no --color=no` end # Combining --threads and invalid -C should yield a decent error - @test !success(`$exename -t 2 -C invalidtarget`) + @test errors_not_signals(`$exename -t 2 -C invalidtarget`) # --procs @test readchomp(`$exename -q -p 2 -e "println(nworkers())"`) == "2" - @test !success(`$exename -p 0`) + @test errors_not_signals(`$exename -p 0`) let p = run(`$exename --procs=1.0`, wait=false) wait(p) @test p.exitcode == 1 && p.termsignal == 0 @@ -281,14 +292,14 @@ let exename = `$(Base.julia_cmd()) --startup-file=no --color=no` # --color @test readchomp(`$exename --color=yes -E "Base.have_color"`) == "true" @test readchomp(`$exename --color=no -E "Base.have_color"`) == "false" - @test !success(`$exename --color=false`) + @test errors_not_signals(`$exename --color=false`) # --history-file @test readchomp(`$exename -E "Bool(Base.JLOptions().historyfile)" --history-file=yes`) == "true" @test readchomp(`$exename -E "Bool(Base.JLOptions().historyfile)" --history-file=no`) == "false" - @test !success(`$exename --history-file=false`) + @test errors_not_signals(`$exename --history-file=false`) # --code-coverage mktempdir() do dir @@ -452,16 +463,16 @@ let exename = `$(Base.julia_cmd()) --startup-file=no --color=no` --check-bounds=no`)) == JL_OPTIONS_CHECK_BOUNDS_OFF end # check-bounds takes yes/no as argument - @test !success(`$exename -E "exit(0)" --check-bounds=false`) + @test errors_not_signals(`$exename -E "exit(0)" --check-bounds=false`) # --depwarn @test readchomp(`$exename --depwarn=no -E "Base.JLOptions().depwarn"`) == "0" @test readchomp(`$exename --depwarn=yes -E "Base.JLOptions().depwarn"`) == "1" - @test !success(`$exename --depwarn=false`) + @test errors_not_signals(`$exename --depwarn=false`) # test deprecated syntax - @test !success(`$exename -e "foo (x::Int) = x * x" --depwarn=error`) + @test errors_not_signals(`$exename -e "foo (x::Int) = x * x" --depwarn=error`) # test deprecated method - @test !success(`$exename -e " + @test errors_not_signals(`$exename -e " foo() = :foo; bar() = :bar @deprecate foo() bar() foo() @@ -479,7 +490,7 @@ let exename = `$(Base.julia_cmd()) --startup-file=no --color=no` Foo.Deprecated """ - @test !success(`$exename -E "$code" --depwarn=error`) + @test errors_not_signals(`$exename -E "$code" --depwarn=error`) @test readchomperrors(`$exename -E "$code" --depwarn=yes`) == (true, "true", "WARNING: Foo.Deprecated is deprecated, use NotDeprecated instead.\n likely near none:8") @@ -493,14 +504,14 @@ let exename = `$(Base.julia_cmd()) --startup-file=no --color=no` @test readchomp(`$exename --inline=yes -E "Bool(Base.JLOptions().can_inline)"`) == "true" @test readchomp(`$exename --inline=no -E "Bool(Base.JLOptions().can_inline)"`) == "false" # --inline takes yes/no as argument - @test !success(`$exename --inline=false`) + @test errors_not_signals(`$exename --inline=false`) # --polly @test readchomp(`$exename -E "Bool(Base.JLOptions().polly)"`) == "true" @test readchomp(`$exename --polly=yes -E "Bool(Base.JLOptions().polly)"`) == "true" @test readchomp(`$exename --polly=no -E "Bool(Base.JLOptions().polly)"`) == "false" # --polly takes yes/no as argument - @test !success(`$exename --polly=false`) + @test errors_not_signals(`$exename --polly=false`) # --fast-math let JL_OPTIONS_FAST_MATH_DEFAULT = 0, @@ -518,7 +529,7 @@ let exename = `$(Base.julia_cmd()) --startup-file=no --color=no` # --worker takes default / custom as argument (default/custom arguments # tested in test/parallel.jl) - @test !success(`$exename --worker=true`) + @test errors_not_signals(`$exename --worker=true`) # test passing arguments mktempdir() do dir @@ -544,7 +555,7 @@ let exename = `$(Base.julia_cmd()) --startup-file=no --color=no` @test readchomp(`$exename -L $testfile $testfile`) == output @test readchomp(`$exename --startup-file=yes $testfile`) == output - @test !success(`$exename --foo $testfile`) + @test errors_not_signals(`$exename --foo $testfile`) @test readchomp(`$exename -L $testfile -e 'exit(0)' -- foo -bar -- baz`) == "[\"foo\", \"-bar\", \"--\", \"baz\"]" end @@ -615,7 +626,7 @@ let exename = `$(Base.julia_cmd()) --startup-file=no --color=no` "Bool(Base.JLOptions().use_compiled_modules)"`) == "true" @test readchomp(`$exename --compiled-modules=no -E "Bool(Base.JLOptions().use_compiled_modules)"`) == "false" - @test !success(`$exename --compiled-modules=foo -e "exit(0)"`) + @test errors_not_signals(`$exename --compiled-modules=foo -e "exit(0)"`) # issue #12671, starting from a non-directory # rm(dir) fails on windows with Permission denied @@ -661,8 +672,7 @@ let exename = `$(Base.julia_cmd().exec[1]) -t 1` @test !occursin("Segmentation fault", s) @test !occursin("EXCEPTION_ACCESS_VIOLATION", s) end - @test !success(p) - @test !Base.process_signaled(p) + @test errors_not_signals(p) @test p.exitcode == 1 end end @@ -672,8 +682,7 @@ let exename = `$(Base.julia_cmd().exec[1]) -t 1` let s = read(err, String) @test s == "ERROR: System image file failed consistency check: maybe opened the wrong version?\n" end - @test !success(p) - @test !Base.process_signaled(p) + @test errors_not_signals(p) @test p.exitcode == 1 end end @@ -691,7 +700,7 @@ let exename = Base.julia_cmd() @test parse(Int,readchomp(`$exename -E "Base.JLOptions().startupfile" --startup-file=no`)) == JL_OPTIONS_STARTUPFILE_OFF end - @test !success(`$exename --startup-file=false`) + @test errors_not_signals(`$exename --startup-file=false`) end # Make sure `julia --lisp` doesn't break From 9bb96253156f19462847cae95acd7f2757077a4d Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Sat, 25 Jun 2022 16:08:00 +0000 Subject: [PATCH 240/369] Don't call `jl_errorf()` when we're early in bringup When calling `jl_error()` or `jl_errorf()`, we must check to see if we are so early in the bringup process that it is dangerous to attempt to construct a backtrace because the data structures used to provide line information are not properly setup. This can be easily triggered by running: ``` julia -C invalid ``` On an `i686-linux-gnu` build, this will hit the "Invalid CPU Name" branch in `jitlayers.cpp`, which calls `jl_errorf()`. This in turn calls `jl_throw()`, which will eventually call `jl_DI_for_fptr` as part of the backtrace printing process, which fails as the object maps are not fully initialized. See the below `gdb` stacktrace for details: ``` $ gdb -batch -ex 'r' -ex 'bt' --args ./julia -C invalid ... fatal: error thrown and no exception handler available. ErrorException("Invalid CPU name "invalid".") Thread 1 "julia" received signal SIGSEGV, Segmentation fault. 0xf75bd665 in std::_Rb_tree, std::_Select1st >, std::greater, std::allocator > >::lower_bound (__k=, this=0x248) at /usr/local/i686-linux-gnu/include/c++/9.1.0/bits/stl_tree.h:1277 1277 /usr/local/i686-linux-gnu/include/c++/9.1.0/bits/stl_tree.h: No such file or directory. #0 0xf75bd665 in std::_Rb_tree, std::_Select1st >, std::greater, std::allocator > >::lower_bound (__k=, this=0x248) at /usr/local/i686-linux-gnu/include/c++/9.1.0/bits/stl_tree.h:1277 #1 std::map, std::allocator > >::lower_bound (__x=, this=0x248) at /usr/local/i686-linux-gnu/include/c++/9.1.0/bits/stl_map.h:1258 #2 jl_DI_for_fptr (fptr=4155049385, symsize=symsize@entry=0xffffcfa8, slide=slide@entry=0xffffcfa0, Section=Section@entry=0xffffcfb8, context=context@entry=0xffffcf94) at /cache/build/default-amdci5-4/julialang/julia-master/src/debuginfo.cpp:1181 #3 0xf75c056a in jl_getFunctionInfo_impl (frames_out=0xffffd03c, pointer=4155049385, skipC=0, noInline=0) at /cache/build/default-amdci5-4/julialang/julia-master/src/debuginfo.cpp:1210 #4 0xf7a6ca98 in jl_print_native_codeloc (ip=4155049385) at /cache/build/default-amdci5-4/julialang/julia-master/src/stackwalk.c:636 #5 0xf7a6cd54 in jl_print_bt_entry_codeloc (bt_entry=0xf0798018) at /cache/build/default-amdci5-4/julialang/julia-master/src/stackwalk.c:657 #6 jlbacktrace () at /cache/build/default-amdci5-4/julialang/julia-master/src/stackwalk.c:1090 #7 0xf7a3cd2b in ijl_no_exc_handler (e=0xf0794010) at /cache/build/default-amdci5-4/julialang/julia-master/src/task.c:605 #8 0xf7a3d10a in throw_internal (ct=ct@entry=0xf070c010, exception=, exception@entry=0xf0794010) at /cache/build/default-amdci5-4/julialang/julia-master/src/task.c:638 #9 0xf7a3d330 in ijl_throw (e=0xf0794010) at /cache/build/default-amdci5-4/julialang/julia-master/src/task.c:654 #10 0xf7a905aa in ijl_errorf (fmt=fmt@entry=0xf7647cd4 "Invalid CPU name \"%s\".") at /cache/build/default-amdci5-4/julialang/julia-master/src/rtutils.c:77 #11 0xf75a4b22 in (anonymous namespace)::createTargetMachine () at /cache/build/default-amdci5-4/julialang/julia-master/src/jitlayers.cpp:823 #12 JuliaOJIT::JuliaOJIT (this=) at /cache/build/default-amdci5-4/julialang/julia-master/src/jitlayers.cpp:1044 #13 0xf7531793 in jl_init_llvm () at /cache/build/default-amdci5-4/julialang/julia-master/src/codegen.cpp:8585 #14 0xf75318a8 in jl_init_codegen_impl () at /cache/build/default-amdci5-4/julialang/julia-master/src/codegen.cpp:8648 #15 0xf7a51a52 in jl_restore_system_image_from_stream (f=) at /cache/build/default-amdci5-4/julialang/julia-master/src/staticdata.c:2131 #16 0xf7a55c03 in ijl_restore_system_image_data (buf=0xe859c1c0 "8'\031\003", len=125161105) at /cache/build/default-amdci5-4/julialang/julia-master/src/staticdata.c:2184 #17 0xf7a55cf9 in jl_load_sysimg_so () at /cache/build/default-amdci5-4/julialang/julia-master/src/staticdata.c:424 #18 ijl_restore_system_image (fname=0x80a0900 "/build/bk_download/julia-d78fdad601/lib/julia/sys.so") at /cache/build/default-amdci5-4/julialang/julia-master/src/staticdata.c:2157 #19 0xf7a3bdfc in _finish_julia_init (rel=rel@entry=JL_IMAGE_JULIA_HOME, ct=, ptls=) at /cache/build/default-amdci5-4/julialang/julia-master/src/init.c:741 #20 0xf7a3c8ac in julia_init (rel=) at /cache/build/default-amdci5-4/julialang/julia-master/src/init.c:728 #21 0xf7a7f61d in jl_repl_entrypoint (argc=, argv=0xffffddf4) at /cache/build/default-amdci5-4/julialang/julia-master/src/jlapi.c:705 #22 0x080490a7 in main (argc=3, argv=0xffffddf4) at /cache/build/default-amdci5-4/julialang/julia-master/cli/loader_exe.c:59 ``` To prevent this, we simply avoid calling `jl_errorf` this early in the process, punting the problem to a later PR that can update guard conditions within `jl_error*`. (cherry picked from commit 21ab24eeca1220aab049c6da21566e4f8d96d1ad) --- src/codegen.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/codegen.cpp b/src/codegen.cpp index 517577df0f324..cfd0e7154ce68 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -8258,13 +8258,20 @@ extern "C" void jl_init_llvm(void) SmallVector targetFeatures(target.second.begin(), target.second.end()); std::string errorstr; const Target *TheTarget = TargetRegistry::lookupTarget("", TheTriple, errorstr); - if (!TheTarget) - jl_errorf("%s", errorstr.c_str()); + if (!TheTarget) { + // Note we are explicitly not using `jl_errorf()` here, as it will attempt to + // collect a backtrace, but we're too early in LLVM initialization for that. + jl_printf(JL_STDERR, "ERROR: %s", errorstr.c_str()); + exit(1); + } if (jl_processor_print_help || (target_flags & JL_TARGET_UNKNOWN_NAME)) { std::unique_ptr MSTI( TheTarget->createMCSubtargetInfo(TheTriple.str(), "", "")); - if (!MSTI->isCPUStringValid(TheCPU)) - jl_errorf("Invalid CPU name \"%s\".", TheCPU.c_str()); + if (!MSTI->isCPUStringValid(TheCPU)) { + // Same as above, we are too early to use `jl_errorf()` here. + jl_printf(JL_STDERR, "ERROR: Invalid CPU name \"%s\".", TheCPU.c_str()); + exit(1); + } if (jl_processor_print_help) { // This is the only way I can find to print the help message once. // It'll be nice if we can iterate through the features and print our own help From 6d7539ba8c47a724de6c8cf521d5f32f6b9440b4 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Fri, 15 Apr 2022 11:43:52 -0400 Subject: [PATCH 241/369] more friendly/useful error for stack overflow in type inference (#44971) fixes #44852 (cherry picked from commit 401d578214514a85590adcc21033861f46c8e922) --- src/gf.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/gf.c b/src/gf.c index a37883251e9c2..ad84c1c523be8 100644 --- a/src/gf.c +++ b/src/gf.c @@ -319,10 +319,19 @@ jl_code_info_t *jl_type_infer(jl_method_instance_t *mi, size_t world, int force) src = (jl_code_info_t*)jl_apply(fargs, 3); } JL_CATCH { - jl_printf((JL_STREAM*)STDERR_FILENO, "Internal error: encountered unexpected error in runtime:\n"); - jl_static_show((JL_STREAM*)STDERR_FILENO, jl_current_exception()); - jl_printf((JL_STREAM*)STDERR_FILENO, "\n"); - jlbacktrace(); // written to STDERR_FILENO + jl_value_t *e = jl_current_exception(); + if (e == jl_stackovf_exception) { + jl_printf((JL_STREAM*)STDERR_FILENO, "Internal error: stack overflow in type inference of "); + jl_static_show_func_sig((JL_STREAM*)STDERR_FILENO, (jl_value_t*)mi->specTypes); + jl_printf((JL_STREAM*)STDERR_FILENO, ".\n"); + jl_printf((JL_STREAM*)STDERR_FILENO, "This might be caused by recursion over very long tuples or argument lists.\n"); + } + else { + jl_printf((JL_STREAM*)STDERR_FILENO, "Internal error: encountered unexpected error in runtime:\n"); + jl_static_show((JL_STREAM*)STDERR_FILENO, e); + jl_printf((JL_STREAM*)STDERR_FILENO, "\n"); + jlbacktrace(); // written to STDERR_FILENO + } src = NULL; } ct->world_age = last_age; From d6e8e5dc7fc60521b8e3ba0a0efc448631655fa2 Mon Sep 17 00:00:00 2001 From: Oscar Smith Date: Thu, 14 Jul 2022 21:39:32 -0700 Subject: [PATCH 242/369] mark two_mul as consistent (#46022) should let the compiler prove that float64^int always gives the same result. (cherry picked from commit fd70eabc1dd6c79149edb82da9e9c37d89e249d9) --- base/math.jl | 4 ++-- test/math.jl | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/base/math.jl b/base/math.jl index a8ec2a97f0f61..47f9512d4efff 100644 --- a/base/math.jl +++ b/base/math.jl @@ -42,7 +42,7 @@ end # non-type specific math functions -@inline function two_mul(x::Float64, y::Float64) +@assume_effects :consistent @inline function two_mul(x::Float64, y::Float64) if Core.Intrinsics.have_fma(Float64) xy = x*y return xy, fma(x, y, -xy) @@ -50,7 +50,7 @@ end return Base.twomul(x,y) end -@inline function two_mul(x::T, y::T) where T<: Union{Float16, Float32} +@assume_effects :consistent @inline function two_mul(x::T, y::T) where T<: Union{Float16, Float32} if Core.Intrinsics.have_fma(T) xy = x*y return xy, fma(x, y, -xy) diff --git a/test/math.jl b/test/math.jl index e93ad225d3111..55d0a3b6c5ed4 100644 --- a/test/math.jl +++ b/test/math.jl @@ -1421,3 +1421,7 @@ end # the compiler ever gets good enough to figure # that out by itself, move this to inference). @test code_typed(x->Val{x^0.0}(), Tuple{Float64})[1][2] == Val{1.0} + +for T in (Float32, Float64) + @test Core.Compiler.is_foldable(Base.infer_effects(^, (T,Int))) +end From ef18da71bb9575346ddb19a20a1530e2be5682fd Mon Sep 17 00:00:00 2001 From: KristofferC Date: Wed, 20 Jul 2022 09:57:17 +0200 Subject: [PATCH 243/369] Export jl_is_foreign_type --- src/jl_exported_funcs.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jl_exported_funcs.inc b/src/jl_exported_funcs.inc index 4e3849477a5ac..b81e0ef5b6489 100644 --- a/src/jl_exported_funcs.inc +++ b/src/jl_exported_funcs.inc @@ -285,6 +285,7 @@ XX(jl_is_char_signed) \ XX(jl_is_const) \ XX(jl_is_debugbuild) \ + XX(jl_is_foreign_type) \ XX(jl_is_identifier) \ XX(jl_is_imported) \ XX(jl_is_initialized) \ @@ -567,4 +568,3 @@ YY(LLVMExtraAddGCInvariantVerifierPass) \ YY(LLVMExtraAddDemoteFloat16Pass) \ YY(LLVMExtraAddCPUFeaturesPass) \ - From 54a6806d01cbdd2a6c95d0ef94150b13a80caf1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Sun, 17 Jul 2022 19:14:07 +0100 Subject: [PATCH 244/369] [nghttp2_jll] Upgrade to v1.48.0 (#45980) * [nghttp2_jll] Upgrade to v1.48.0 * [nghttp2_jll] Fix test (cherry picked from commit 707f59b980b54541af8362a9aa94d9690d72df8f) --- deps/Versions.make | 2 +- deps/checksums/nghttp2 | 68 ++++++++++++++--------------- stdlib/nghttp2_jll/Project.toml | 2 +- stdlib/nghttp2_jll/test/runtests.jl | 2 +- 4 files changed, 37 insertions(+), 37 deletions(-) diff --git a/deps/Versions.make b/deps/Versions.make index 91d5285f964c5..f507b3c9fba32 100644 --- a/deps/Versions.make +++ b/deps/Versions.make @@ -66,7 +66,7 @@ MPFR_VER := 4.1.0 MPFR_JLL_NAME := MPFR # nghttp2 -NGHTTP2_VER := 1.47.0 +NGHTTP2_VER := 1.48.0 NGHTTP2_JLL_NAME := nghttp2 # Objconv (we don't ship this, so no need for a fake JLL; therefore we specify the JLL_VER here) diff --git a/deps/checksums/nghttp2 b/deps/checksums/nghttp2 index 5aadf03f2bea7..5cc0b22d2d778 100644 --- a/deps/checksums/nghttp2 +++ b/deps/checksums/nghttp2 @@ -1,34 +1,34 @@ -nghttp2-1.47.0.tar.bz2/md5/2bca98caef4b5c27d5bdc4732f36a5d6 -nghttp2-1.47.0.tar.bz2/sha512/4dbd0fe10f5c68d363ee0fff2aceb97f58a755a276796f16b078cd3bec3a17cd5e0dadf1e5027347d3342daa3572332b14df230a4d9675a9b57fff67f8f9e5a3 -nghttp2.v1.47.0+0.aarch64-apple-darwin.tar.gz/md5/76abe33c6e81346a133c3e26593db1b2 -nghttp2.v1.47.0+0.aarch64-apple-darwin.tar.gz/sha512/72a1302134ab4715f4c0b8f702a566498d4595aa7a3fd762e43d7e0ca5987506a9b1dc53318763595ad652d8c4a633c3c5e0500a8f4e3007cb6cf9e30341d9ff -nghttp2.v1.47.0+0.aarch64-linux-gnu.tar.gz/md5/1e5ad3ad31290e017c930c2d1dbda38d -nghttp2.v1.47.0+0.aarch64-linux-gnu.tar.gz/sha512/c8a2543f079751bcaf7165661f5f4053fd1b733cde0f82078736c898503c796fdd7ce587f0da2d1bb3d35a74a644fed6e8cc30a3520e577593d19700e822cc55 -nghttp2.v1.47.0+0.aarch64-linux-musl.tar.gz/md5/7079c203ec5e6fcf45d01bfa1ca0b1b8 -nghttp2.v1.47.0+0.aarch64-linux-musl.tar.gz/sha512/152f34f1e9a5f741d69d62587762a96fd290ecb41ec8eeff46fae39b5e606ff054755b88abe3bcaa07db640526fc12546769da4a3761a18240eb3d2699de8886 -nghttp2.v1.47.0+0.armv6l-linux-gnueabihf.tar.gz/md5/918f3e549998e34f2aa292a2ff7945be -nghttp2.v1.47.0+0.armv6l-linux-gnueabihf.tar.gz/sha512/545c5674a6492dbd5f109303383b920b0b011e37e8a4abfb329b22cab50a6a977d9f74aac6f4aaa833064fbaae4b5ebc019e83d2edb8b4af2515f36f4530937f -nghttp2.v1.47.0+0.armv6l-linux-musleabihf.tar.gz/md5/1345980d4822c6e9c1934378e365e343 -nghttp2.v1.47.0+0.armv6l-linux-musleabihf.tar.gz/sha512/470c66205d257ba3b23b0db8ea93fe40bc71c219d50cd88a6b57abf8c105218bd9912b9a605da12903793893f37803b0e3357566e20035a079ed2b4bcc6d7b78 -nghttp2.v1.47.0+0.armv7l-linux-gnueabihf.tar.gz/md5/e831c03eeb810a48fbd34df2017c20be -nghttp2.v1.47.0+0.armv7l-linux-gnueabihf.tar.gz/sha512/e90270b1f6ae7c90ce746f60c2f451f2271ec6f682003f3a0ee8eb97e9054932495fff22b2ca1f40e3711f847c520fa605c49c7ae671db7f282f78f8d745a0db -nghttp2.v1.47.0+0.armv7l-linux-musleabihf.tar.gz/md5/38d95842aa0d9e9ac9e77e468d18893d -nghttp2.v1.47.0+0.armv7l-linux-musleabihf.tar.gz/sha512/5e595d143248fadd5cfffa1f15b09698f1793c04422b12d5f8e22c52e4ebc5d947845fe3ef7539845ad731d4457c8a7a6e6e2bc1dbb5b32fd3cd374963aa9833 -nghttp2.v1.47.0+0.i686-linux-gnu.tar.gz/md5/a3c54ab31e835ecbc12425b00a201bbf -nghttp2.v1.47.0+0.i686-linux-gnu.tar.gz/sha512/375354d57b14b73d7e4cf751b69872b19e6806b7a110c104c0dc25794a33dd89642f9911216c2c1a2698d45878c12b7d735402e44b9b4ba60a5a9751a522c19b -nghttp2.v1.47.0+0.i686-linux-musl.tar.gz/md5/2cdfc4b177bc88685e629362ac754cab -nghttp2.v1.47.0+0.i686-linux-musl.tar.gz/sha512/cb741c7d6dbfe5815e1691c98fac46c2559b419cb3bc882b925779d9699e7b37332ab197bdb3b7cb944de45ea0cc3c6f6e5f8df04b7556dac25f796e992d7dc5 -nghttp2.v1.47.0+0.i686-w64-mingw32.tar.gz/md5/ec5f305e52c205a246db0e4ded79f6c8 -nghttp2.v1.47.0+0.i686-w64-mingw32.tar.gz/sha512/4bd5f81bd1502bbc04973f0721099a230248b2be907f66f044fd1111326bf05804aae4df123eda65e7e90445157bc07e87d9e837dfd2393038e4e042254c16df -nghttp2.v1.47.0+0.powerpc64le-linux-gnu.tar.gz/md5/01431aaf0c383e2ab1460f41e3c64446 -nghttp2.v1.47.0+0.powerpc64le-linux-gnu.tar.gz/sha512/ef3ed6eb1c77a81f46f7c06e4748d766144231ab3cc4875fb3502c6a553ce04937ee6dcb1516532c91043921b76779c1ea1ca20070907d3639d2f0fb036d0d56 -nghttp2.v1.47.0+0.x86_64-apple-darwin.tar.gz/md5/12650859c3ba16131a35b63510816267 -nghttp2.v1.47.0+0.x86_64-apple-darwin.tar.gz/sha512/a91d6b572ed830bdcd5822d8d0dbca70ce45f0c2706a1fb83aeccacad1a72391ea09683169ae9d8ed6e84a1f28d55d2ee26e49a68cca405dd032e9c128e54858 -nghttp2.v1.47.0+0.x86_64-linux-gnu.tar.gz/md5/62fb16238af3cf50721b0a671d28dc8c -nghttp2.v1.47.0+0.x86_64-linux-gnu.tar.gz/sha512/f662f30ad7057bc9c724fd48e15a2894aa0a345a24d35acaa0f3cb25d73b329772942d3499647ba7563c110d2186e96d4a3b12e8721d28d2cd6491d93df24e05 -nghttp2.v1.47.0+0.x86_64-linux-musl.tar.gz/md5/3224892e3e5c7d7ae24c2380fd731ab8 -nghttp2.v1.47.0+0.x86_64-linux-musl.tar.gz/sha512/35d18c52dee94846a85d5a7a19bff95ce2b05e5290096d532c7f3d144ee809a2ba9072dd24372905c485ee0dfa03309be8cebead2b62292518ab5d63d80c9e4a -nghttp2.v1.47.0+0.x86_64-unknown-freebsd.tar.gz/md5/4b3c9032b11ba078d7a91a30d3cabc6a -nghttp2.v1.47.0+0.x86_64-unknown-freebsd.tar.gz/sha512/21c9d1c95e26bf33a0cedc63ac6e81dcc670d6bc3fefc9a8efbf7faff718875cf6fc51dfdb192afb00acf86257104de7a0dfcaaf29119ba055b69885c31a4dd4 -nghttp2.v1.47.0+0.x86_64-w64-mingw32.tar.gz/md5/7d41384443541bf30b6165381b1c5305 -nghttp2.v1.47.0+0.x86_64-w64-mingw32.tar.gz/sha512/2febfcc452bd4f2a3200e6edb8127f678749a358a4beb219b7b29294ade66bb817e1fbdce665f0e3e20d923ab3bc68598f3c769bd4f09871866e452b6aab52d0 +nghttp2-1.48.0.tar.bz2/md5/887336a68dbf6e2fa78dd4fc2a515e01 +nghttp2-1.48.0.tar.bz2/sha512/319b8c4f5f276e699fb04cf2a9aadd07bb0a26b78d8b37eb84e6dab603718b3d2c9bf6dca54816d4644cd6833177d842d7f7d3a1438a1c723d2b73e4ec2fb344 +nghttp2.v1.48.0+0.aarch64-apple-darwin.tar.gz/md5/362b35eecbb86a49b956fa57168ec61c +nghttp2.v1.48.0+0.aarch64-apple-darwin.tar.gz/sha512/d8c35686ac6baf4ba6038355f1d3a275f2c3a9696d1b751a54c6e671cbd96c38b4600c6ac00d77e43efc4fbb01c7672d917142530efb0360c38a4159703b9156 +nghttp2.v1.48.0+0.aarch64-linux-gnu.tar.gz/md5/2eb064be49b1990250a7c8ebffcc4a1e +nghttp2.v1.48.0+0.aarch64-linux-gnu.tar.gz/sha512/0fcef4bfa0cea2d7727241961551b0ff73337aefbe8f29a6ca06f856b142681e251af57795ba26edc25784a1845040a0a3865dd0ba26ea65c43478a02ea02080 +nghttp2.v1.48.0+0.aarch64-linux-musl.tar.gz/md5/80f505a5b1f092e9a2e4609ff4b16b9f +nghttp2.v1.48.0+0.aarch64-linux-musl.tar.gz/sha512/3e260d9bb34058c7c841034d874dec2141e71f40c0e75fb751740dc46fe1cd5668c713e7efc154f1e7c964ed41b8fed9a08b780370e4a4fb44eb564eff1a2c72 +nghttp2.v1.48.0+0.armv6l-linux-gnueabihf.tar.gz/md5/6b167502a95dac6f55cf2d312af09b91 +nghttp2.v1.48.0+0.armv6l-linux-gnueabihf.tar.gz/sha512/da620c8e50ce4ca2fd150c7b83b0d1d40d3d9e184cb5dfff6883723b574e8c68ffd121a74154a0544e5beb7991740634c19916bb66b1349f46d772ddff3ceddf +nghttp2.v1.48.0+0.armv6l-linux-musleabihf.tar.gz/md5/b9079b10a7f0e190232426cbed35f8e9 +nghttp2.v1.48.0+0.armv6l-linux-musleabihf.tar.gz/sha512/dd0afaa8eed6df8c0b4f78c3408e6a0b881957d183b5dfa4e6d9aa131d92a7485198da316dfbb28280b6e5e281432ee1dc1bbff5906a29cc29afa77390d83e09 +nghttp2.v1.48.0+0.armv7l-linux-gnueabihf.tar.gz/md5/cfacf5fcb143757b6fa64081011807d6 +nghttp2.v1.48.0+0.armv7l-linux-gnueabihf.tar.gz/sha512/5b9acc860474722c07f73b3d049c5d131c86212264a49270253861b897b165e4a8cd608ac3735ee72c90cdd36ea9342208e1eee48e9e2407b3b10ca2cf23f2d1 +nghttp2.v1.48.0+0.armv7l-linux-musleabihf.tar.gz/md5/76dfdc217fb52e74955b6dd95bace880 +nghttp2.v1.48.0+0.armv7l-linux-musleabihf.tar.gz/sha512/05b7b6ae7cee062409eb941147e45e0b1b68a0ddcd8a022bd008a2f04a1249051a6e69dba511398b3e98e1144004bf0e6580fb4417f5500746f5b4b3eb65179f +nghttp2.v1.48.0+0.i686-linux-gnu.tar.gz/md5/8ec510d34f87830be0cea46378474a0c +nghttp2.v1.48.0+0.i686-linux-gnu.tar.gz/sha512/c3262180298ebfe1aee5fa3b25a491f4fc6122d0936c0fcfdd1d3f7f884dbcdbc9cbca05df986782e200334c4d97bd5ed5b75a9286910d04b00eac9efa43d67a +nghttp2.v1.48.0+0.i686-linux-musl.tar.gz/md5/90fa7935261e782dbd14aa858ae2d511 +nghttp2.v1.48.0+0.i686-linux-musl.tar.gz/sha512/790bcac85995a2e5caddaf19023c90a5b9566d166da48b98581de2e12d84c7beaa74e7ef9ae55bcf4a68c91e1e873204328c8672634e5ed3fc79721a9939b480 +nghttp2.v1.48.0+0.i686-w64-mingw32.tar.gz/md5/b7654776af03333caf4ba1517ffd2636 +nghttp2.v1.48.0+0.i686-w64-mingw32.tar.gz/sha512/b8f82c7a8f3ca6cb3cd8ab760d8299b0dcc6a03c7e51be965168c01de07b900891e48e13fbcee67856afddb10c41b402a4b384a06d3fbee41c4d5f3b6e352c53 +nghttp2.v1.48.0+0.powerpc64le-linux-gnu.tar.gz/md5/eaee75e48bb77137c09abc5abccc6db1 +nghttp2.v1.48.0+0.powerpc64le-linux-gnu.tar.gz/sha512/4b99d91a7f751c05835c73bb6b0f49c851ca36ead41c5137aedf5e96bd48d894768b9fdb65f83560ea86e0c3f854e52bf66f8859dcd920446db1a121c7a5e0f2 +nghttp2.v1.48.0+0.x86_64-apple-darwin.tar.gz/md5/1720e70d0e72afbf36900ed75cba45d0 +nghttp2.v1.48.0+0.x86_64-apple-darwin.tar.gz/sha512/4c07a7d78bb1366a913321d8258d0cbd0d0b7d85f43b5980617fd1451dc39e7859134e86ec59b06b3b6dc8b62b71f9890eecf2737f8cf4e441bf08c2e61cefc6 +nghttp2.v1.48.0+0.x86_64-linux-gnu.tar.gz/md5/a94aab74d021578fcda21836c8030c9b +nghttp2.v1.48.0+0.x86_64-linux-gnu.tar.gz/sha512/c1c31e32e60087fe7facbfea4bd4897649c8eeef92101093df4897f41847461851497e436c4a4e1c847c9bf5ac678934aba1eca0d8a6e17302d9474ca3064fb5 +nghttp2.v1.48.0+0.x86_64-linux-musl.tar.gz/md5/677ad574f615b2d77fecdac0c75111db +nghttp2.v1.48.0+0.x86_64-linux-musl.tar.gz/sha512/737637a68364096ea6c507e37c9305df875c8830d58a05404ceb2e76d69bd6e44c82483e0f8228cdc7a64b0419de75d2d99151fac369bacd42fc06a71b35ec54 +nghttp2.v1.48.0+0.x86_64-unknown-freebsd.tar.gz/md5/b65cf09003912eb4201db80253fc5b04 +nghttp2.v1.48.0+0.x86_64-unknown-freebsd.tar.gz/sha512/fdf7c733f4247f66733dd36e314cf6772abfecb82ec99c613db66910eb956849851587d74b9e940e1f0d743142555ccf96bf7b990b3502e17028cbdd8bc504d8 +nghttp2.v1.48.0+0.x86_64-w64-mingw32.tar.gz/md5/cfb494369553277c10a7b1eaf1c116fd +nghttp2.v1.48.0+0.x86_64-w64-mingw32.tar.gz/sha512/066b8a9cbf3fe710704b56af2917279f32cd3cef69808bb56872d367061402832dc1cbb01988b35652751e66c937d29a0190b98bfcd846a50fd80392b5a7e1bd diff --git a/stdlib/nghttp2_jll/Project.toml b/stdlib/nghttp2_jll/Project.toml index e768d6fc84b96..32ea7d0f34134 100644 --- a/stdlib/nghttp2_jll/Project.toml +++ b/stdlib/nghttp2_jll/Project.toml @@ -1,6 +1,6 @@ name = "nghttp2_jll" uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" -version = "1.47.0+0" +version = "1.48.0+0" [deps] Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" diff --git a/stdlib/nghttp2_jll/test/runtests.jl b/stdlib/nghttp2_jll/test/runtests.jl index 9a1dcd1c91cc2..d752251f98ebc 100644 --- a/stdlib/nghttp2_jll/test/runtests.jl +++ b/stdlib/nghttp2_jll/test/runtests.jl @@ -11,5 +11,5 @@ end @testset "nghttp2_jll" begin info = unsafe_load(ccall((:nghttp2_version,libnghttp2), Ptr{nghttp2_info}, (Cint,), 0)) - @test VersionNumber(unsafe_string(info.version_str)) == v"1.47.0" + @test VersionNumber(unsafe_string(info.version_str)) == v"1.48.0" end From 9fa6b7f2deed51561919fe847312fa70363daf4b Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Mon, 18 Jul 2022 15:02:46 -0400 Subject: [PATCH 245/369] fix #45825, BitArray methods assuming 1-indexing of AbstractArray (#45835) (cherry picked from commit 820c08b896e408d9ed1e064ada8f9138dd6a3a6b) --- base/abstractarray.jl | 10 +++++--- base/bitarray.jl | 53 +++++++++++++++++++++++-------------------- test/bitarray.jl | 37 +++++++++++++++++++++++++++++- 3 files changed, 71 insertions(+), 29 deletions(-) diff --git a/base/abstractarray.jl b/base/abstractarray.jl index 3922552668e24..49aec27cb0a58 100644 --- a/base/abstractarray.jl +++ b/base/abstractarray.jl @@ -1011,6 +1011,10 @@ julia> y """ function copyto!(dest::AbstractArray, src::AbstractArray) isempty(src) && return dest + if dest isa BitArray + # avoid ambiguities with other copyto!(::AbstractArray, ::SourceArray) methods + return _copyto_bitarray!(dest, src) + end src′ = unalias(dest, src) copyto_unaliased!(IndexStyle(dest), dest, IndexStyle(src′), src′) end @@ -1115,10 +1119,10 @@ function copyto!(B::AbstractVecOrMat{R}, ir_dest::AbstractRange{Int}, jr_dest::A return B end -function copyto_axcheck!(dest, src) - @noinline checkaxs(axd, axs) = axd == axs || throw(DimensionMismatch("axes must agree, got $axd and $axs")) +@noinline _checkaxs(axd, axs) = axd == axs || throw(DimensionMismatch("axes must agree, got $axd and $axs")) - checkaxs(axes(dest), axes(src)) +function copyto_axcheck!(dest, src) + _checkaxs(axes(dest), axes(src)) copyto!(dest, src) end diff --git a/base/bitarray.jl b/base/bitarray.jl index 33e2715572018..7dd337c15867f 100644 --- a/base/bitarray.jl +++ b/base/bitarray.jl @@ -501,40 +501,42 @@ function Array{T,N}(B::BitArray{N}) where {T,N} end BitArray(A::AbstractArray{<:Any,N}) where {N} = BitArray{N}(A) + function BitArray{N}(A::AbstractArray{T,N}) where N where T B = BitArray(undef, convert(Dims{N}, size(A)::Dims{N})) - Bc = B.chunks - l = length(B) + _checkaxs(axes(B), axes(A)) + _copyto_bitarray!(B, A) + return B::BitArray{N} +end + +function _copyto_bitarray!(B::BitArray, A::AbstractArray) + l = length(A) l == 0 && return B - ind = 1 + l > length(B) && throw(BoundsError(B, length(B)+1)) + Bc = B.chunks + nc = num_bit_chunks(l) + Ai = first(eachindex(A)) @inbounds begin - for i = 1:length(Bc)-1 + for i = 1:nc-1 c = UInt64(0) for j = 0:63 - c |= (UInt64(convert(Bool, A[ind])::Bool) << j) - ind += 1 + c |= (UInt64(convert(Bool, A[Ai])::Bool) << j) + Ai = nextind(A, Ai) end Bc[i] = c end c = UInt64(0) - for j = 0:_mod64(l-1) - c |= (UInt64(convert(Bool, A[ind])::Bool) << j) - ind += 1 + tail = _mod64(l - 1) + 1 + for j = 0:tail-1 + c |= (UInt64(convert(Bool, A[Ai])::Bool) << j) + Ai = nextind(A, Ai) end - Bc[end] = c + msk = _msk_end(tail) + Bc[nc] = (c & msk) | (Bc[nc] & ~msk) end return B end -function BitArray{N}(A::Array{Bool,N}) where N - B = BitArray(undef, size(A)) - Bc = B.chunks - l = length(B) - l == 0 && return B - copy_to_bitarray_chunks!(Bc, 1, A, 1, l) - return B::BitArray{N} -end - reinterpret(::Type{Bool}, B::BitArray, dims::NTuple{N,Int}) where {N} = reinterpret(B, dims) reinterpret(B::BitArray, dims::NTuple{N,Int}) where {N} = reshape(B, dims) @@ -721,24 +723,25 @@ function _unsafe_setindex!(B::BitArray, X::AbstractArray, I::BitArray) lx = length(X) last_chunk_len = _mod64(length(B)-1)+1 - c = 1 + Xi = first(eachindex(X)) + lastXi = last(eachindex(X)) for i = 1:lc @inbounds Imsk = Ic[i] @inbounds C = Bc[i] u = UInt64(1) for j = 1:(i < lc ? 64 : last_chunk_len) if Imsk & u != 0 - lx < c && throw_setindex_mismatch(X, c) - @inbounds x = convert(Bool, X[c]) + Xi > lastXi && throw_setindex_mismatch(X, count(I)) + @inbounds x = convert(Bool, X[Xi]) C = ifelse(x, C | u, C & ~u) - c += 1 + Xi = nextind(X, Xi) end u <<= 1 end @inbounds Bc[i] = C end - if length(X) != c-1 - throw_setindex_mismatch(X, c-1) + if Xi != nextind(X, lastXi) + throw_setindex_mismatch(X, count(I)) end return B end diff --git a/test/bitarray.jl b/test/bitarray.jl index 75a6389815336..2add644cb1caa 100644 --- a/test/bitarray.jl +++ b/test/bitarray.jl @@ -1767,4 +1767,39 @@ end @test all(bitarray[rangeout, rangein] .== true) @test all(bitarray[rangein, rangeout] .== true) end -end \ No newline at end of file +end + +# issue #45825 + +isdefined(Main, :OffsetArrays) || @eval Main include("testhelpers/OffsetArrays.jl") +using .Main.OffsetArrays + +let all_false = OffsetArray(falses(2001), -1000:1000) + @test !any(==(true), all_false) + # should be run with --check-bounds=yes + @test_throws DimensionMismatch BitArray(all_false) + all_false = OffsetArray(falses(2001), 1:2001) + @test !any(==(true), BitArray(all_false)) + all_false = OffsetArray(falses(100, 100), 0:99, -1:98) + @test !any(==(true), all_false) + @test_throws DimensionMismatch BitArray(all_false) + all_false = OffsetArray(falses(100, 100), 1:100, 1:100) + @test !any(==(true), all_false) +end +let a = falses(1000), + msk = BitArray(rand(Bool, 1000)), + n = count(msk), + b = OffsetArray(rand(Bool, n), (-n÷2):(n÷2)-iseven(n)) + a[msk] = b + @test a[msk] == collect(b) + a = falses(100, 100) + msk = BitArray(rand(Bool, 100, 100)) + n = count(msk) + b = OffsetArray(rand(Bool, 1, n), 1:1, (-n÷2):(n÷2)-iseven(n)) + a[msk] = b + @test a[msk] == vec(collect(b)) +end +let b = trues(10) + copyto!(b, view([0,0,0], :)) + @test b == [0,0,0,1,1,1,1,1,1,1] +end From bcac3c28a231b65216b6ecc8aaf20399b4ba8c3b Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Sun, 17 Jul 2022 16:12:51 -0400 Subject: [PATCH 246/369] remove examples of time_imports nesting given it was a bug (#46072) (cherry picked from commit 29586ef30f7536c1263290c70e9afbc183841695) --- stdlib/InteractiveUtils/src/macros.jl | 48 +++++++++++---------------- 1 file changed, 20 insertions(+), 28 deletions(-) diff --git a/stdlib/InteractiveUtils/src/macros.jl b/stdlib/InteractiveUtils/src/macros.jl index b0005e6d7d783..7c4ce6f0dd588 100644 --- a/stdlib/InteractiveUtils/src/macros.jl +++ b/stdlib/InteractiveUtils/src/macros.jl @@ -356,39 +356,31 @@ See also: [`code_native`](@ref), [`@code_llvm`](@ref), [`@code_typed`](@ref) and A macro to execute an expression and produce a report of any time spent importing packages and their dependencies. Any compilation time will be reported as a percentage, and how much of which was recompilation, if any. -If a package's dependencies have already been imported either globally or by another dependency they will -not appear under that package and the package will accurately report a faster load time than if it were to -be loaded in isolation. - -!!! compat "Julia 1.9" - Reporting of any compilation and recompilation time was added in Julia 1.9 +!!! note + During the load process a package sequentially imports all of its dependencies, not just its direct dependencies. ```julia-repl julia> @time_imports using CSV - 0.4 ms ┌ IteratorInterfaceExtensions - 11.1 ms ┌ TableTraits 84.88% compilation time - 145.4 ms ┌ SentinelArrays 66.73% compilation time - 42.3 ms ┌ Parsers 19.66% compilation time - 4.1 ms ┌ Compat - 8.2 ms ┌ OrderedCollections - 1.4 ms ┌ Zlib_jll - 2.3 ms ┌ TranscodingStreams - 6.1 ms ┌ CodecZlib - 0.3 ms ┌ DataValueInterfaces - 15.2 ms ┌ FilePathsBase 30.06% compilation time - 9.3 ms ┌ InlineStrings - 1.5 ms ┌ DataAPI - 31.4 ms ┌ WeakRefStrings - 14.8 ms ┌ Tables - 24.2 ms ┌ PooledArrays - 2002.4 ms CSV 83.49% compilation time + 50.7 ms Parsers 17.52% compilation time + 0.2 ms DataValueInterfaces + 1.6 ms DataAPI + 0.1 ms IteratorInterfaceExtensions + 0.1 ms TableTraits + 17.5 ms Tables + 26.8 ms PooledArrays + 193.7 ms SentinelArrays 75.12% compilation time + 8.6 ms InlineStrings + 20.3 ms WeakRefStrings + 2.0 ms TranscodingStreams + 1.4 ms Zlib_jll + 1.8 ms CodecZlib + 0.8 ms Compat + 13.1 ms FilePathsBase 28.39% compilation time + 1681.2 ms CSV 92.40% compilation time ``` -!!! note - During the load process a package sequentially imports where necessary all of its dependencies, not just - its direct dependencies. That is also true for the dependencies themselves so nested importing will likely - occur, but not always. Therefore the nesting shown in this output report is not equivalent to the dependency - tree, but does indicate where import time has accumulated. +!!! compat "Julia 1.8" + This macro requires at least Julia 1.8 """ :@time_imports From 169567d6dd9a0b994fa4cf4db5bd956e844713cf Mon Sep 17 00:00:00 2001 From: N5N3 <2642243996@qq.com> Date: Wed, 20 Jul 2022 16:04:46 +0800 Subject: [PATCH 247/369] Fix fast path for `strides(::ReinterpretArray)` with dense parent. (#46114) (cherry picked from commit 017228af116f2565b1d6687b018ec65235dc71de) --- base/reinterpretarray.jl | 2 +- test/abstractarray.jl | 3 +++ test/reinterpretarray.jl | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/base/reinterpretarray.jl b/base/reinterpretarray.jl index 7ca50f9e2859e..d0e559f60f657 100644 --- a/base/reinterpretarray.jl +++ b/base/reinterpretarray.jl @@ -153,7 +153,7 @@ stride(A::Union{DenseArray,StridedReshapedArray,StridedReinterpretArray}, k::Int k ≤ ndims(A) ? strides(A)[k] : length(A) function strides(a::ReinterpretArray{T,<:Any,S,<:AbstractArray{S},IsReshaped}) where {T,S,IsReshaped} - _checkcontiguous(Bool, a) && return size_to_strides(1, size(a)) + _checkcontiguous(Bool, a) && return size_to_strides(1, size(a)...) stp = strides(parent(a)) els, elp = sizeof(T), sizeof(S) els == elp && return stp # 0dim parent is also handled here. diff --git a/test/abstractarray.jl b/test/abstractarray.jl index 43f4223affe62..c811f0d11176f 100644 --- a/test/abstractarray.jl +++ b/test/abstractarray.jl @@ -1615,6 +1615,9 @@ Base.size(::FakeZeroDimArray) = () # Zero dimensional parent a = reshape(FakeZeroDimArray(),1,1,1) @test @inferred(strides(a)) == (1, 1, 1) + # Dense parent (but not StridedArray) + A = reinterpret(Int8, reinterpret(reshape, Int16, rand(Int8, 2, 3, 3))) + @test check_strides(reshape(A, 3, 2, 3)) end @testset "stride for 0 dims array #44087" begin diff --git a/test/reinterpretarray.jl b/test/reinterpretarray.jl index bc3ffa63b0b0c..5d7f87fdbdee7 100644 --- a/test/reinterpretarray.jl +++ b/test/reinterpretarray.jl @@ -197,6 +197,9 @@ end end @test check_strides(reinterpret(Float32, view(A, 8:-1:1, viewax2))) end + # issue 46113 + A = reinterpret(Int8, reinterpret(reshape, Int16, rand(Int8, 2, 3, 3))) + @test check_strides(A) end @testset "strides for ReshapedReinterpretArray" begin From bfc7e3e78befc1e3fb3412e540596f32f0af8a14 Mon Sep 17 00:00:00 2001 From: KristofferC Date: Wed, 20 Jul 2022 10:10:11 +0200 Subject: [PATCH 248/369] bump Pkg version to latest 1.8 --- .../Pkg-57ca49fcbb45b578b78ac77a702913b5e2de7c7c.tar.gz/md5 | 1 + .../Pkg-57ca49fcbb45b578b78ac77a702913b5e2de7c7c.tar.gz/sha512 | 1 + .../Pkg-f0bef8af0ab951d9cf3cceb3c709873737df9471.tar.gz/md5 | 1 - .../Pkg-f0bef8af0ab951d9cf3cceb3c709873737df9471.tar.gz/sha512 | 1 - stdlib/Pkg.version | 2 +- 5 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 deps/checksums/Pkg-57ca49fcbb45b578b78ac77a702913b5e2de7c7c.tar.gz/md5 create mode 100644 deps/checksums/Pkg-57ca49fcbb45b578b78ac77a702913b5e2de7c7c.tar.gz/sha512 delete mode 100644 deps/checksums/Pkg-f0bef8af0ab951d9cf3cceb3c709873737df9471.tar.gz/md5 delete mode 100644 deps/checksums/Pkg-f0bef8af0ab951d9cf3cceb3c709873737df9471.tar.gz/sha512 diff --git a/deps/checksums/Pkg-57ca49fcbb45b578b78ac77a702913b5e2de7c7c.tar.gz/md5 b/deps/checksums/Pkg-57ca49fcbb45b578b78ac77a702913b5e2de7c7c.tar.gz/md5 new file mode 100644 index 0000000000000..713275d000c87 --- /dev/null +++ b/deps/checksums/Pkg-57ca49fcbb45b578b78ac77a702913b5e2de7c7c.tar.gz/md5 @@ -0,0 +1 @@ +505a28c1e9246f92d0440b7ed9599e27 diff --git a/deps/checksums/Pkg-57ca49fcbb45b578b78ac77a702913b5e2de7c7c.tar.gz/sha512 b/deps/checksums/Pkg-57ca49fcbb45b578b78ac77a702913b5e2de7c7c.tar.gz/sha512 new file mode 100644 index 0000000000000..61c1603670788 --- /dev/null +++ b/deps/checksums/Pkg-57ca49fcbb45b578b78ac77a702913b5e2de7c7c.tar.gz/sha512 @@ -0,0 +1 @@ +67d76980cc5430274bc7c1d5c1de4cc163a1583bbd373e074fc15296481e8bc202f7a4b77af6fd32677a974e9ad5d65dcfd72d74bf0ff657d4cee067eba595f0 diff --git a/deps/checksums/Pkg-f0bef8af0ab951d9cf3cceb3c709873737df9471.tar.gz/md5 b/deps/checksums/Pkg-f0bef8af0ab951d9cf3cceb3c709873737df9471.tar.gz/md5 deleted file mode 100644 index 86b193c4518a1..0000000000000 --- a/deps/checksums/Pkg-f0bef8af0ab951d9cf3cceb3c709873737df9471.tar.gz/md5 +++ /dev/null @@ -1 +0,0 @@ -e02bd98209effd4e05361f29e0a4abbc diff --git a/deps/checksums/Pkg-f0bef8af0ab951d9cf3cceb3c709873737df9471.tar.gz/sha512 b/deps/checksums/Pkg-f0bef8af0ab951d9cf3cceb3c709873737df9471.tar.gz/sha512 deleted file mode 100644 index 59d2f75ab089f..0000000000000 --- a/deps/checksums/Pkg-f0bef8af0ab951d9cf3cceb3c709873737df9471.tar.gz/sha512 +++ /dev/null @@ -1 +0,0 @@ -983ebbd8531dbccd12f757d4b79bee75a0f8cbeba5d8cdea9ecd945dc3c53cccfe68691952187736a00fb49d368239daa7b43e918809b61d5f6b91dbb7be9aac diff --git a/stdlib/Pkg.version b/stdlib/Pkg.version index abaf21b3b6ba3..06c1c50590065 100644 --- a/stdlib/Pkg.version +++ b/stdlib/Pkg.version @@ -1,4 +1,4 @@ PKG_BRANCH = master -PKG_SHA1 = f0bef8af0ab951d9cf3cceb3c709873737df9471 +PKG_SHA1 = 57ca49fcbb45b578b78ac77a702913b5e2de7c7c PKG_GIT_URL := https://github.com/JuliaLang/Pkg.jl.git PKG_TAR_URL = https://api.github.com/repos/JuliaLang/Pkg.jl/tarball/$1 From 1549064fb37d9c810262c271bd5ba280db4886e9 Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Wed, 20 Jul 2022 10:08:27 +0200 Subject: [PATCH 249/369] Specialize tuple setindex to avoid ntuple-related performance regression. (#46050) (cherry picked from commit d7c56ba30594a7752be75203237ac0daaf65c94a) --- base/tuple.jl | 4 ++-- test/tuple.jl | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/base/tuple.jl b/base/tuple.jl index 3b5142d03039d..21676877d0426 100644 --- a/base/tuple.jl +++ b/base/tuple.jl @@ -55,9 +55,9 @@ function setindex(x::Tuple, v, i::Integer) _setindex(v, i, x...) end -function _setindex(v, i::Integer, args...) +function _setindex(v, i::Integer, args::Vararg{Any,N}) where {N} @inline - return ntuple(j -> ifelse(j == i, v, args[j]), length(args)) + return ntuple(j -> ifelse(j == i, v, args[j]), Val{N}()) end diff --git a/test/tuple.jl b/test/tuple.jl index f3b82de733f16..1b539ea2e6766 100644 --- a/test/tuple.jl +++ b/test/tuple.jl @@ -710,3 +710,6 @@ g42457(a, b) = Base.isequal(a, b) ? 1 : 2.0 @test only(Base.return_types(g42457, (NTuple{3, Int}, Tuple))) === Union{Float64, Int} @test only(Base.return_types(g42457, (NTuple{3, Int}, NTuple))) === Union{Float64, Int} @test only(Base.return_types(g42457, (NTuple{3, Int}, NTuple{4}))) === Float64 + +# issue #46049: setindex(::Tuple) regression +@inferred Base.setindex((1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16), 42, 1) From f3bc6bf09e1dd98a449b419bb121be18c3c56656 Mon Sep 17 00:00:00 2001 From: Chris Elrod Date: Wed, 20 Jul 2022 04:16:13 -0400 Subject: [PATCH 250/369] Use `max(1, Sys.CPU_THREADS)` BLAS threads for apple `aarch64`. (#46085) (cherry picked from commit 97df6db548520227a9585e69a7bff8d6583af183) --- stdlib/LinearAlgebra/src/LinearAlgebra.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/stdlib/LinearAlgebra/src/LinearAlgebra.jl b/stdlib/LinearAlgebra/src/LinearAlgebra.jl index e8c2de0ac056a..86e07e118c708 100644 --- a/stdlib/LinearAlgebra/src/LinearAlgebra.jl +++ b/stdlib/LinearAlgebra/src/LinearAlgebra.jl @@ -583,7 +583,11 @@ function __init__() Base.at_disable_library_threading(() -> BLAS.set_num_threads(1)) if !haskey(ENV, "OPENBLAS_NUM_THREADS") - BLAS.set_num_threads(max(1, Sys.CPU_THREADS ÷ 2)) + @static if Sys.isapple() && Base.BinaryPlatforms.arch(Base.BinaryPlatforms.HostPlatform()) == "aarch64" + BLAS.set_num_threads(max(1, Sys.CPU_THREADS)) + else + BLAS.set_num_threads(max(1, Sys.CPU_THREADS ÷ 2)) + end end end From a382f32daf1c4be75b3be0aca70795a228da160a Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Tue, 12 Apr 2022 05:59:32 -0700 Subject: [PATCH 251/369] Make gcd/lcm effect-free by using LazyString (#44935) --- base/checked.jl | 9 +++++---- base/intfuncs.jl | 3 ++- test/intfuncs.jl | 7 +++++++ 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/base/checked.jl b/base/checked.jl index ad92a44e1e5bc..1f9e319f50fbd 100644 --- a/base/checked.jl +++ b/base/checked.jl @@ -115,9 +115,10 @@ function checked_abs end function checked_abs(x::SignedInt) r = ifelse(x<0, -x, x) - r<0 && throw(OverflowError(string("checked arithmetic: cannot compute |x| for x = ", x, "::", typeof(x)))) - r - end + r<0 || return r + msg = LazyString("checked arithmetic: cannot compute |x| for x = ", x, "::", typeof(x)) + throw(OverflowError(msg)) +end checked_abs(x::UnsignedInt) = x checked_abs(x::Bool) = x @@ -151,7 +152,7 @@ end throw_overflowerr_binaryop(op, x, y) = (@noinline; - throw(OverflowError(Base.invokelatest(string, x, " ", op, " ", y, " overflowed for type ", typeof(x))))) + throw(OverflowError(LazyString(x, " ", op, " ", y, " overflowed for type ", typeof(x))))) """ Base.checked_add(x, y) diff --git a/base/intfuncs.jl b/base/intfuncs.jl index 44c7be0626126..076f8b288ee55 100644 --- a/base/intfuncs.jl +++ b/base/intfuncs.jl @@ -54,7 +54,8 @@ function gcd(a::T, b::T) where T<:BitInteger signbit(r) && __throw_gcd_overflow(a, b) return r end -@noinline __throw_gcd_overflow(a, b) = throw(OverflowError("gcd($a, $b) overflows")) +@noinline __throw_gcd_overflow(a, b) = + throw(OverflowError(LazyString("gcd(", a, ", ", b, ") overflows"))) # binary GCD (aka Stein's) algorithm # about 1.7x (2.1x) faster for random Int64s (Int128s) diff --git a/test/intfuncs.jl b/test/intfuncs.jl index 4fc21c3bcf1b2..cf7ae89ea1dd7 100644 --- a/test/intfuncs.jl +++ b/test/intfuncs.jl @@ -2,6 +2,8 @@ using Random +is_effect_free(args...) = Core.Compiler.is_effect_free(Base.infer_effects(args...)) + @testset "gcd/lcm" begin # All Integer data types take different code paths -- test all # TODO: Test gcd and lcm for BigInt. @@ -146,6 +148,11 @@ using Random @test gcd(0xf, 20) == 5 @test gcd(UInt32(6), Int8(-50)) == 2 @test gcd(typemax(UInt), -16) == 1 + + @testset "effects" begin + @test is_effect_free(gcd, Tuple{Int,Int}) + @test is_effect_free(lcm, Tuple{Int,Int}) + end end @testset "gcd/lcm for arrays" begin From 8dc9f5887996f23520c50710369c9b7d3fbb4f51 Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Fri, 18 Mar 2022 20:37:25 -0400 Subject: [PATCH 252/369] Fix return_type model when run in toplevel context (#44670) Fixes the test failure observed in #44652. --- base/compiler/abstractinterpretation.jl | 1 + base/compiler/inferencestate.jl | 6 +++++- base/compiler/tfuncs.jl | 6 ++++++ base/compiler/types.jl | 2 +- test/compiler/inference.jl | 7 +++++++ 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index ca68fca8f9be6..dd4fa27e342b1 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -644,6 +644,7 @@ function abstract_call_method(interp::AbstractInterpreter, method::Method, @nosp if edge === nothing edgecycle = edgelimited = true end + # we look for the termination effect override here as well, since the :terminates effect # may have been tainted due to recursion at this point even if it's overridden if is_effect_overridden(sv, :terminates_globally) diff --git a/base/compiler/inferencestate.jl b/base/compiler/inferencestate.jl index c920a0a64e17f..c4415ec788100 100644 --- a/base/compiler/inferencestate.jl +++ b/base/compiler/inferencestate.jl @@ -59,6 +59,10 @@ mutable struct InferenceState inferred::Bool dont_work_on_me::Bool + # Whether to restrict inference of abstract call sites to avoid excessive work + # Set by default for toplevel frame. + restrict_abstract_call_sites::Bool + # Inferred purity flags ipo_effects::Effects @@ -133,7 +137,7 @@ mutable struct InferenceState #=callers_in_cycle=#Vector{InferenceState}(), #=parent=#nothing, #=cached=#cache === :global, - #=inferred=#false, #=dont_work_on_me=#false, + #=inferred=#false, #=dont_work_on_me=#false, #=restrict_abstract_call_sites=# isa(linfo.def, Module), #=ipo_effects=#Effects(EFFECTS_TOTAL; consistent, inbounds_taints_consistency), interp) result.result = frame diff --git a/base/compiler/tfuncs.jl b/base/compiler/tfuncs.jl index c188d3e24e143..46075d7008881 100644 --- a/base/compiler/tfuncs.jl +++ b/base/compiler/tfuncs.jl @@ -1993,7 +1993,13 @@ function return_type_tfunc(interp::AbstractInterpreter, argtypes::Vector{Any}, s if contains_is(argtypes_vec, Union{}) return CallMeta(Const(Union{}), false) end + # Run the abstract_call without restricting abstract call + # sites. Otherwise, our behavior model of abstract_call + # below will be wrong. + old_restrict = sv.restrict_abstract_call_sites + sv.restrict_abstract_call_sites = false call = abstract_call(interp, ArgInfo(nothing, argtypes_vec), sv, -1) + sv.restrict_abstract_call_sites = old_restrict info = verbose_stmt_info(interp) ? ReturnTypeCallInfo(call.info) : false rt = widenconditional(call.rt) if isa(rt, Const) diff --git a/base/compiler/types.jl b/base/compiler/types.jl index 8893866822102..a0884bd86d1d3 100644 --- a/base/compiler/types.jl +++ b/base/compiler/types.jl @@ -407,7 +407,7 @@ It also bails out from local statement/frame inference when any lattice element but `AbstractInterpreter` doesn't provide a specific interface for configuring it. """ bail_out_toplevel_call(::AbstractInterpreter, @nospecialize(callsig), sv#=::InferenceState=#) = - return isa(sv.linfo.def, Module) && !isdispatchtuple(callsig) + return sv.restrict_abstract_call_sites && !isdispatchtuple(callsig) bail_out_call(::AbstractInterpreter, @nospecialize(rt), sv#=::InferenceState=#) = return rt === Any bail_out_apply(::AbstractInterpreter, @nospecialize(rt), sv#=::InferenceState=#) = diff --git a/test/compiler/inference.jl b/test/compiler/inference.jl index 7e1ea8f84b271..9ed5234107e8e 100644 --- a/test/compiler/inference.jl +++ b/test/compiler/inference.jl @@ -4108,3 +4108,10 @@ end |> !Core.Compiler.is_foldable @test !fully_eliminated() do entry_to_be_invalidated('a') end + +# Make sure return_type_tfunc doesn't accidentally cause bad inference if used +# at top level. +@test let + Base.Experimental.@force_compile + Core.Compiler.return_type(+, NTuple{2, Rational}) +end == Rational From 1110f2b3ba479740b6bac6558530798d9e60da74 Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Mon, 16 May 2022 00:56:16 -0400 Subject: [PATCH 253/369] Merge pull request #45299 from JuliaLang/kf/rt_effect_free Fix effects modeling for return_type --- base/compiler/abstractinterpretation.jl | 114 ++++++++++++------------ base/compiler/optimize.jl | 1 - base/compiler/ssair/inlining.jl | 3 - base/compiler/stmtinfo.jl | 3 +- base/compiler/tfuncs.jl | 26 +++--- test/compiler/inline.jl | 20 +++++ 6 files changed, 93 insertions(+), 74 deletions(-) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index dd4fa27e342b1..4feba83574a8e 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -55,8 +55,8 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), # At this point we are guaranteed to end up throwing on this path, # which is all that's required for :consistent-cy. Of course, we don't # know anything else about this statement. - tristate_merge!(sv, Effects(; consistent=ALWAYS_TRUE, nonoverlayed)) - return CallMeta(Any, false) + effects = Effects(; consistent=ALWAYS_TRUE, nonoverlayed) + return CallMeta(Any, effects, false) end argtypes = arginfo.argtypes @@ -64,8 +64,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), InferenceParams(interp).MAX_UNION_SPLITTING, max_methods) if isa(matches, FailedMethodMatch) add_remark!(interp, sv, matches.reason) - tristate_merge!(sv, Effects()) - return CallMeta(Any, false) + return CallMeta(Any, Effects(), false) end (; valid_worlds, applicable, info) = matches @@ -89,7 +88,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), # try pure-evaluation val = pure_eval_call(interp, f, applicable, arginfo, sv) - val !== nothing && return CallMeta(val, MethodResultPure(info)) # TODO: add some sort of edge(s) + val !== nothing && return CallMeta(val, all_effects, MethodResultPure(info)) # TODO: add some sort of edge(s) for i in 1:napplicable match = applicable[i]::MethodMatch @@ -232,8 +231,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), delete!(sv.pclimitations, caller) end end - tristate_merge!(sv, all_effects) - return CallMeta(rettype, info) + return CallMeta(rettype, all_effects, info) end struct FailedMethodMatch @@ -1160,7 +1158,7 @@ function abstract_iteration(interp::AbstractInterpreter, @nospecialize(itft), @n # WARNING: Changes to the iteration protocol must be reflected here, # this is not just an optimization. # TODO: this doesn't realize that Array, SimpleVector, Tuple, and NamedTuple do not use the iterate protocol - stateordonet === Bottom && return Any[Bottom], AbstractIterationInfo(CallMeta[CallMeta(Bottom, info)]) + stateordonet === Bottom && return Any[Bottom], AbstractIterationInfo(CallMeta[CallMeta(Bottom, call.effects, info)]) valtype = statetype = Bottom ret = Any[] calls = CallMeta[call] @@ -1236,16 +1234,15 @@ function abstract_apply(interp::AbstractInterpreter, argtypes::Vector{Any}, sv:: max_methods::Int = get_max_methods(sv.mod, interp)) itft = argtype_by_index(argtypes, 2) aft = argtype_by_index(argtypes, 3) - (itft === Bottom || aft === Bottom) && return CallMeta(Bottom, false) + (itft === Bottom || aft === Bottom) && return CallMeta(Bottom, EFFECTS_THROWS, false) aargtypes = argtype_tail(argtypes, 4) aftw = widenconst(aft) if !isa(aft, Const) && !isa(aft, PartialOpaque) && (!isType(aftw) || has_free_typevars(aftw)) if !isconcretetype(aftw) || (aftw <: Builtin) add_remark!(interp, sv, "Core._apply_iterate called on a function of a non-concrete type") - tristate_merge!(sv, Effects()) # bail now, since it seems unlikely that abstract_call will be able to do any better after splitting # this also ensures we don't call abstract_call_gf_by_type below on an IntrinsicFunction or Builtin - return CallMeta(Any, false) + return CallMeta(Any, Effects(), false) end end res = Union{} @@ -1253,6 +1250,7 @@ function abstract_apply(interp::AbstractInterpreter, argtypes::Vector{Any}, sv:: splitunions = 1 < unionsplitcost(aargtypes) <= InferenceParams(interp).MAX_APPLY_UNION_ENUM ctypes = [Any[aft]] infos = Vector{MaybeAbstractIterationInfo}[MaybeAbstractIterationInfo[]] + effects = EFFECTS_TOTAL for i = 1:nargs ctypes´ = Vector{Any}[] infos′ = Vector{MaybeAbstractIterationInfo}[] @@ -1315,6 +1313,7 @@ function abstract_apply(interp::AbstractInterpreter, argtypes::Vector{Any}, sv:: call = abstract_call(interp, ArgInfo(nothing, ct), sv, max_methods) push!(retinfos, ApplyCallInfo(call.info, arginfo)) res = tmerge(res, call.rt) + effects = tristate_merge(effects, call.effects) if bail_out_apply(interp, res, sv) if i != length(ctypes) # No point carrying forward the info, we're not gonna inline it anyway @@ -1325,7 +1324,7 @@ function abstract_apply(interp::AbstractInterpreter, argtypes::Vector{Any}, sv:: end # TODO: Add a special info type to capture all the iteration info. # For now, only propagate info if we don't also union-split the iteration - return CallMeta(res, retinfo) + return CallMeta(res, effects, retinfo) end function argtype_by_index(argtypes::Vector{Any}, i::Int) @@ -1506,21 +1505,21 @@ end function abstract_invoke(interp::AbstractInterpreter, (; fargs, argtypes)::ArgInfo, sv::InferenceState) ft′ = argtype_by_index(argtypes, 2) ft = widenconst(ft′) - ft === Bottom && return CallMeta(Bottom, false), EFFECTS_THROWS + ft === Bottom && return CallMeta(Bottom, EFFECTS_THROWS, false) (types, isexact, isconcrete, istype) = instanceof_tfunc(argtype_by_index(argtypes, 3)) - types === Bottom && return CallMeta(Bottom, false), EFFECTS_THROWS - isexact || return CallMeta(Any, false), Effects() + types === Bottom && return CallMeta(Bottom, EFFECTS_THROWS, false) + isexact || return CallMeta(Any, Effects(), false) argtype = argtypes_to_type(argtype_tail(argtypes, 4)) nargtype = typeintersect(types, argtype) - nargtype === Bottom && return CallMeta(Bottom, false), EFFECTS_THROWS - nargtype isa DataType || return CallMeta(Any, false), Effects() # other cases are not implemented below - isdispatchelem(ft) || return CallMeta(Any, false), Effects() # check that we might not have a subtype of `ft` at runtime, before doing supertype lookup below + nargtype === Bottom && return CallMeta(Bottom, EFFECTS_THROWS, false) + nargtype isa DataType || return CallMeta(Any, Effects(), false) # other cases are not implemented below + isdispatchelem(ft) || return CallMeta(Any, Effects(), false) # check that we might not have a subtype of `ft` at runtime, before doing supertype lookup below ft = ft::DataType types = rewrap_unionall(Tuple{ft, unwrap_unionall(types).parameters...}, types)::Type nargtype = Tuple{ft, nargtype.parameters...} argtype = Tuple{ft, argtype.parameters...} match, valid_worlds, overlayed = findsup(types, method_table(interp)) - match === nothing && return CallMeta(Any, false), Effects() + match === nothing && return CallMeta(Any, Effects(), false) update_valid_age!(sv, valid_worlds) method = match.method (ti, env::SimpleVector) = ccall(:jl_type_intersection_with_env, Any, (Any, Any), nargtype, method.sig)::SimpleVector @@ -1547,7 +1546,7 @@ function abstract_invoke(interp::AbstractInterpreter, (; fargs, argtypes)::ArgIn end end effects = Effects(effects; nonoverlayed=!overlayed) - return CallMeta(from_interprocedural!(rt, sv, arginfo, sig), InvokeCallInfo(match, const_result)), effects + return CallMeta(from_interprocedural!(rt, sv, arginfo, sig), effects, InvokeCallInfo(match, const_result)) end function invoke_rewrite(xs::Vector{Any}) @@ -1568,37 +1567,30 @@ function abstract_call_known(interp::AbstractInterpreter, @nospecialize(f), if f === _apply_iterate return abstract_apply(interp, argtypes, sv, max_methods) elseif f === invoke - call, effects = abstract_invoke(interp, arginfo, sv) - tristate_merge!(sv, effects) - return call + return abstract_invoke(interp, arginfo, sv) elseif f === modifyfield! - tristate_merge!(sv, Effects()) # TODO return abstract_modifyfield!(interp, argtypes, sv) end rt = abstract_call_builtin(interp, f, arginfo, sv, max_methods) - tristate_merge!(sv, builtin_effects(f, argtypes, rt)) - return CallMeta(rt, false) + return CallMeta(rt, builtin_effects(f, argtypes, rt), false) elseif isa(f, Core.OpaqueClosure) # calling an OpaqueClosure about which we have no information returns no information - tristate_merge!(sv, Effects()) - return CallMeta(Any, false) + return CallMeta(Any, Effects(), false) elseif f === Core.kwfunc if la == 2 aty = argtypes[2] if !isvarargtype(aty) ft = widenconst(aty) if isa(ft, DataType) && isdefined(ft.name, :mt) && isdefined(ft.name.mt, :kwsorter) - return CallMeta(Const(ft.name.mt.kwsorter), MethodResultPure()) + return CallMeta(Const(ft.name.mt.kwsorter), EFFECTS_TOTAL, MethodResultPure()) end end end - tristate_merge!(sv, EFFECTS_UNKNOWN) # TODO - return CallMeta(Any, false) + return CallMeta(Any, EFFECTS_UNKNOWN, false) elseif f === TypeVar # Manually look through the definition of TypeVar to # make sure to be able to get `PartialTypeVar`s out. - tristate_merge!(sv, EFFECTS_UNKNOWN) # TODO - (la < 2 || la > 4) && return CallMeta(Union{}, false) + (la < 2 || la > 4) && return CallMeta(Union{}, EFFECTS_UNKNOWN, false) n = argtypes[2] ub_var = Const(Any) lb_var = Const(Union{}) @@ -1608,36 +1600,33 @@ function abstract_call_known(interp::AbstractInterpreter, @nospecialize(f), elseif la == 3 ub_var = argtypes[3] end - return CallMeta(typevar_tfunc(n, lb_var, ub_var), false) + return CallMeta(typevar_tfunc(n, lb_var, ub_var), EFFECTS_UNKNOWN, false) elseif f === UnionAll - tristate_merge!(sv, EFFECTS_UNKNOWN) # TODO - return CallMeta(abstract_call_unionall(argtypes), false) + return CallMeta(abstract_call_unionall(argtypes), EFFECTS_UNKNOWN, false) elseif f === Tuple && la == 2 - tristate_merge!(sv, EFFECTS_UNKNOWN) # TODO aty = argtypes[2] ty = isvarargtype(aty) ? unwrapva(aty) : widenconst(aty) if !isconcretetype(ty) - return CallMeta(Tuple, false) + return CallMeta(Tuple, EFFECTS_UNKNOWN, false) end elseif is_return_type(f) - tristate_merge!(sv, EFFECTS_UNKNOWN) # TODO return return_type_tfunc(interp, argtypes, sv) elseif la == 2 && istopfunction(f, :!) # handle Conditional propagation through !Bool aty = argtypes[2] if isa(aty, Conditional) call = abstract_call_gf_by_type(interp, f, ArgInfo(fargs, Any[Const(f), Bool]), Tuple{typeof(f), Bool}, sv, max_methods) # make sure we've inferred `!(::Bool)` - return CallMeta(Conditional(aty.var, aty.elsetype, aty.vtype), call.info) + return CallMeta(Conditional(aty.var, aty.elsetype, aty.vtype), call.effects, call.info) end elseif la == 3 && istopfunction(f, :!==) # mark !== as exactly a negated call to === rty = abstract_call_known(interp, (===), arginfo, sv, max_methods).rt if isa(rty, Conditional) - return CallMeta(Conditional(rty.var, rty.elsetype, rty.vtype), false) # swap if-else + return CallMeta(Conditional(rty.var, rty.elsetype, rty.vtype), EFFECTS_TOTAL, false) # swap if-else elseif isa(rty, Const) - return CallMeta(Const(rty.val === false), MethodResultPure()) + return CallMeta(Const(rty.val === false), EFFECTS_TOTAL, MethodResultPure()) end - return CallMeta(rty, false) + return CallMeta(rty, EFFECTS_TOTAL, false) elseif la == 3 && istopfunction(f, :(>:)) # mark issupertype as a exact alias for issubtype # swap T1 and T2 arguments and call <: @@ -1647,28 +1636,28 @@ function abstract_call_known(interp::AbstractInterpreter, @nospecialize(f), fargs = nothing end argtypes = Any[typeof(<:), argtypes[3], argtypes[2]] - return CallMeta(abstract_call_known(interp, <:, ArgInfo(fargs, argtypes), sv, max_methods).rt, false) + return CallMeta(abstract_call_known(interp, <:, ArgInfo(fargs, argtypes), sv, max_methods).rt, EFFECTS_TOTAL, false) elseif la == 2 && (a2 = argtypes[2]; isa(a2, Const)) && (svecval = a2.val; isa(svecval, SimpleVector)) && istopfunction(f, :length) # mark length(::SimpleVector) as @pure - return CallMeta(Const(length(svecval)), MethodResultPure()) + return CallMeta(Const(length(svecval)), EFFECTS_TOTAL, MethodResultPure()) elseif la == 3 && (a2 = argtypes[2]; isa(a2, Const)) && (svecval = a2.val; isa(svecval, SimpleVector)) && (a3 = argtypes[3]; isa(a3, Const)) && (idx = a3.val; isa(idx, Int)) && istopfunction(f, :getindex) # mark getindex(::SimpleVector, i::Int) as @pure if 1 <= idx <= length(svecval) && isassigned(svecval, idx) - return CallMeta(Const(getindex(svecval, idx)), MethodResultPure()) + return CallMeta(Const(getindex(svecval, idx)), EFFECTS_TOTAL, MethodResultPure()) end elseif la == 2 && istopfunction(f, :typename) - return CallMeta(typename_static(argtypes[2]), MethodResultPure()) + return CallMeta(typename_static(argtypes[2]), EFFECTS_TOTAL, MethodResultPure()) elseif max_methods > 1 && istopfunction(f, :copyto!) max_methods = 1 elseif la == 3 && istopfunction(f, :typejoin) if is_all_const_arg(arginfo) val = _pure_eval_call(f, arginfo) - return CallMeta(val === nothing ? Type : val, MethodResultPure()) + return CallMeta(val === nothing ? Type : val, EFFECTS_TOTAL, MethodResultPure()) end end atype = argtypes_to_type(argtypes) @@ -1677,7 +1666,7 @@ end function abstract_call_opaque_closure(interp::AbstractInterpreter, closure::PartialOpaque, arginfo::ArgInfo, sv::InferenceState) sig = argtypes_to_type(arginfo.argtypes) - (; rt, edge) = result = abstract_call_method(interp, closure.source, sig, Core.svec(), false, sv) + (; rt, edge, edge_effects) = result = abstract_call_method(interp, closure.source, sig, Core.svec(), false, sv) edge !== nothing && add_backedge!(edge, sv) tt = closure.typ sigT = (unwrap_unionall(tt)::DataType).parameters[1] @@ -1693,7 +1682,7 @@ function abstract_call_opaque_closure(interp::AbstractInterpreter, closure::Part end end info = OpaqueClosureCallInfo(match, const_result) - return CallMeta(from_interprocedural!(rt, sv, arginfo, match.spec_types), info) + return CallMeta(from_interprocedural!(rt, sv, arginfo, match.spec_types), edge_effects, info) end function most_general_argtypes(closure::PartialOpaque) @@ -1715,18 +1704,30 @@ function abstract_call(interp::AbstractInterpreter, arginfo::ArgInfo, if isa(ft, PartialOpaque) newargtypes = copy(argtypes) newargtypes[1] = ft.env - tristate_merge!(sv, Effects()) # TODO - return abstract_call_opaque_closure(interp, ft, ArgInfo(arginfo.fargs, newargtypes), sv) + body_call = abstract_call_opaque_closure(interp, ft, ArgInfo(arginfo.fargs, newargtypes), sv) + # Analyze implicit type asserts on argument and return type + ftt = ft.typ + (at, rt) = unwrap_unionall(ftt).parameters + if isa(rt, TypeVar) + rt = rewrap_unionall(rt.lb, ftt) + else + rt = rewrap_unionall(rt, ftt) + end + nothrow = body_call.rt ⊑ rt + if nothrow + nothrow = tuple_tfunc(newargtypes[2:end]) ⊑ rewrap_unionall(at, ftt) + end + return CallMeta(body_call.rt, Effects(body_call.effects, + nothrow = nothrow ? TRISTATE_UNKNOWN : body_call.effects.nothrow), + body_call.info) elseif (uft = unwrap_unionall(widenconst(ft)); isa(uft, DataType) && uft.name === typename(Core.OpaqueClosure)) - tristate_merge!(sv, Effects()) # TODO - return CallMeta(rewrap_unionall((uft::DataType).parameters[2], widenconst(ft)), false) + return CallMeta(rewrap_unionall((uft::DataType).parameters[2], widenconst(ft)), Effects(), false) elseif f === nothing # non-constant function, but the number of arguments is known # and the ft is not a Builtin or IntrinsicFunction if hasintersect(widenconst(ft), Union{Builtin, Core.OpaqueClosure}) - tristate_merge!(sv, Effects()) add_remark!(interp, sv, "Could not identify method table for call") - return CallMeta(Any, false) + return CallMeta(Any, Effects(), false) end return abstract_call_gf_by_type(interp, nothing, arginfo, argtypes_to_type(argtypes), sv, max_methods) end @@ -1852,6 +1853,7 @@ function abstract_eval_statement(interp::AbstractInterpreter, @nospecialize(e), t = Bottom else callinfo = abstract_call(interp, ArgInfo(ea, argtypes), sv) + tristate_merge!(sv, callinfo.effects) sv.stmt_info[sv.currpc] = callinfo.info t = callinfo.rt end diff --git a/base/compiler/optimize.jl b/base/compiler/optimize.jl index cd27dbb01b625..3c975b04146fa 100644 --- a/base/compiler/optimize.jl +++ b/base/compiler/optimize.jl @@ -202,7 +202,6 @@ function stmt_effect_free(@nospecialize(stmt), @nospecialize(rt), src::Union{IRC f = argextype(args[1], src) f = singleton_type(f) f === nothing && return false - is_return_type(f) && return true if isa(f, IntrinsicFunction) intrinsic_effect_free_if_nothrow(f) || return false return intrinsic_nothrow(f, diff --git a/base/compiler/ssair/inlining.jl b/base/compiler/ssair/inlining.jl index db2a6b1d33db3..e51581e62569d 100644 --- a/base/compiler/ssair/inlining.jl +++ b/base/compiler/ssair/inlining.jl @@ -1166,9 +1166,6 @@ function process_simple!(ir::IRCode, idx::Int, state::InliningState, todo::Vecto ir[SSAValue(idx)][:inst] = lateres.val check_effect_free!(ir, idx, lateres.val, rt) return nothing - elseif is_return_type(sig.f) - check_effect_free!(ir, idx, stmt, rt) - return nothing end return stmt, sig diff --git a/base/compiler/stmtinfo.jl b/base/compiler/stmtinfo.jl index 3eeff0c2c86a8..bce7d7425ca23 100644 --- a/base/compiler/stmtinfo.jl +++ b/base/compiler/stmtinfo.jl @@ -10,6 +10,7 @@ and any additional information (`call.info`) for a given generic call. """ struct CallMeta rt::Any + effects::Effects info::Any end @@ -75,7 +76,7 @@ effect-free, including being no-throw (typically because the value was computed by calling an `@pure` function). """ struct MethodResultPure - info::Union{MethodMatchInfo,UnionSplitInfo,Bool} + info::Any end let instance = MethodResultPure(false) global MethodResultPure diff --git a/base/compiler/tfuncs.jl b/base/compiler/tfuncs.jl index 46075d7008881..2411fc0514b80 100644 --- a/base/compiler/tfuncs.jl +++ b/base/compiler/tfuncs.jl @@ -1010,10 +1010,10 @@ end function abstract_modifyfield!(interp::AbstractInterpreter, argtypes::Vector{Any}, sv::InferenceState) nargs = length(argtypes) if !isempty(argtypes) && isvarargtype(argtypes[nargs]) - nargs - 1 <= 6 || return CallMeta(Bottom, false) - nargs > 3 || return CallMeta(Any, false) + nargs - 1 <= 6 || return CallMeta(Bottom, EFFECTS_THROWS, false) + nargs > 3 || return CallMeta(Any, EFFECTS_UNKNOWN, false) else - 5 <= nargs <= 6 || return CallMeta(Bottom, false) + 5 <= nargs <= 6 || return CallMeta(Bottom, EFFECTS_THROWS, false) end o = unwrapva(argtypes[2]) f = unwrapva(argtypes[3]) @@ -1036,7 +1036,7 @@ function abstract_modifyfield!(interp::AbstractInterpreter, argtypes::Vector{Any end info = callinfo.info end - return CallMeta(RT, info) + return CallMeta(RT, Effects(), info) end replacefield!_tfunc(o, f, x, v, success_order, failure_order) = (@nospecialize; replacefield!_tfunc(o, f, x, v)) replacefield!_tfunc(o, f, x, v, success_order) = (@nospecialize; replacefield!_tfunc(o, f, x, v)) @@ -1991,7 +1991,7 @@ function return_type_tfunc(interp::AbstractInterpreter, argtypes::Vector{Any}, s if isa(af_argtype, DataType) && af_argtype <: Tuple argtypes_vec = Any[aft, af_argtype.parameters...] if contains_is(argtypes_vec, Union{}) - return CallMeta(Const(Union{}), false) + return CallMeta(Const(Union{}), EFFECTS_TOTAL, false) end # Run the abstract_call without restricting abstract call # sites. Otherwise, our behavior model of abstract_call @@ -2000,36 +2000,36 @@ function return_type_tfunc(interp::AbstractInterpreter, argtypes::Vector{Any}, s sv.restrict_abstract_call_sites = false call = abstract_call(interp, ArgInfo(nothing, argtypes_vec), sv, -1) sv.restrict_abstract_call_sites = old_restrict - info = verbose_stmt_info(interp) ? ReturnTypeCallInfo(call.info) : false + info = verbose_stmt_info(interp) ? MethodResultPure(ReturnTypeCallInfo(call.info)) : MethodResultPure() rt = widenconditional(call.rt) if isa(rt, Const) # output was computed to be constant - return CallMeta(Const(typeof(rt.val)), info) + return CallMeta(Const(typeof(rt.val)), EFFECTS_TOTAL, info) end rt = widenconst(rt) if rt === Bottom || (isconcretetype(rt) && !iskindtype(rt)) # output cannot be improved so it is known for certain - return CallMeta(Const(rt), info) + return CallMeta(Const(rt), EFFECTS_TOTAL, info) elseif !isempty(sv.pclimitations) # conservatively express uncertainty of this result # in two ways: both as being a subtype of this, and # because of LimitedAccuracy causes - return CallMeta(Type{<:rt}, info) + return CallMeta(Type{<:rt}, EFFECTS_TOTAL, info) elseif (isa(tt, Const) || isconstType(tt)) && (isa(aft, Const) || isconstType(aft)) # input arguments were known for certain # XXX: this doesn't imply we know anything about rt - return CallMeta(Const(rt), info) + return CallMeta(Const(rt), EFFECTS_TOTAL, info) elseif isType(rt) - return CallMeta(Type{rt}, info) + return CallMeta(Type{rt}, EFFECTS_TOTAL, info) else - return CallMeta(Type{<:rt}, info) + return CallMeta(Type{<:rt}, EFFECTS_TOTAL, info) end end end end end - return CallMeta(Type, false) + return CallMeta(Type, EFFECTS_THROWS, false) end # N.B.: typename maps type equivalence classes to a single value diff --git a/test/compiler/inline.jl b/test/compiler/inline.jl index 8318b733727d7..dfcea14584713 100644 --- a/test/compiler/inline.jl +++ b/test/compiler/inline.jl @@ -1128,3 +1128,23 @@ end let src = code_typed1(f44200) @test count(x -> isa(x, Core.PiNode), src.code) == 0 end + +# Test that effect modeling for return_type doesn't incorrectly pick +# up the effects of the function being analyzed +function f_throws() + error() +end + +@noinline function return_type_unused(x) + Core.Compiler.return_type(f_throws, Tuple{}) + return x+1 +end + +@test fully_eliminated(Tuple{Int}) do x + return_type_unused(x) + return nothing +end + +# Test that inlining doesn't accidentally delete a bad return_type call +f_bad_return_type() = Core.Compiler.return_type(+, 1, 2) +@test_throws MethodError f_bad_return_type() From 55eb09d80676c177d46120f56127a368a5cf1952 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Sat, 11 Jun 2022 17:36:53 +0900 Subject: [PATCH 254/369] Merge pull request #45613 from JuliaLang/avi/concretemath improve concrete-foldability of core math functions --- base/intfuncs.jl | 28 ++++++++++++++-------------- base/special/exp.jl | 12 ++++++++---- base/special/log.jl | 28 +++++++++++++++++----------- base/special/rem_pio2.jl | 5 ++++- test/math.jl | 18 ++++++++++++++++++ 5 files changed, 61 insertions(+), 30 deletions(-) diff --git a/base/intfuncs.jl b/base/intfuncs.jl index 076f8b288ee55..a0a38003980a9 100644 --- a/base/intfuncs.jl +++ b/base/intfuncs.jl @@ -248,20 +248,20 @@ end # ^ for any x supporting * to_power_type(x) = convert(Base._return_type(*, Tuple{typeof(x), typeof(x)}), x) -@noinline throw_domerr_powbysq(::Any, p) = throw(DomainError(p, - string("Cannot raise an integer x to a negative power ", p, '.', - "\nConvert input to float."))) -@noinline throw_domerr_powbysq(::Integer, p) = throw(DomainError(p, - string("Cannot raise an integer x to a negative power ", p, '.', - "\nMake x or $p a float by adding a zero decimal ", - "(e.g., 2.0^$p or 2^$(float(p)) instead of 2^$p), ", - "or write 1/x^$(-p), float(x)^$p, x^float($p) or (x//1)^$p"))) -@noinline throw_domerr_powbysq(::AbstractMatrix, p) = throw(DomainError(p, - string("Cannot raise an integer matrix x to a negative power ", p, '.', - "\nMake x a float matrix by adding a zero decimal ", - "(e.g., [2.0 1.0;1.0 0.0]^$p instead ", - "of [2 1;1 0]^$p), or write float(x)^$p or Rational.(x)^$p"))) -function power_by_squaring(x_, p::Integer) +@noinline throw_domerr_powbysq(::Any, p) = throw(DomainError(p, LazyString( + "Cannot raise an integer x to a negative power ", p, ".", + "\nConvert input to float."))) +@noinline throw_domerr_powbysq(::Integer, p) = throw(DomainError(p, LazyString( + "Cannot raise an integer x to a negative power ", p, ".", + "\nMake x or ", p, " a float by adding a zero decimal ", + "(e.g., 2.0^", p, " or 2^", float(p), " instead of 2^", p, ")", + "or write 1/x^", -p, ", float(x)^", p, ", x^float(", p, ") or (x//1)^", p, "."))) +@noinline throw_domerr_powbysq(::AbstractMatrix, p) = throw(DomainError(p, LazyString( + "Cannot raise an integer matrix x to a negative power ", p, ".", + "\nMake x a float matrix by adding a zero decimal ", + "(e.g., [2.0 1.0;1.0 0.0]^", p, " instead of [2 1;1 0]^", p, ")", + "or write float(x)^", p, " or Rational.(x)^", p, "."))) +@assume_effects :terminates_locally function power_by_squaring(x_, p::Integer) x = to_power_type(x_) if p == 1 return copy(x) diff --git a/base/special/exp.jl b/base/special/exp.jl index c2bbb47902360..00a9c0c2d19c6 100644 --- a/base/special/exp.jl +++ b/base/special/exp.jl @@ -175,7 +175,11 @@ const J_TABLE = (0x0000000000000000, 0xaac00b1afa5abcbe, 0x9b60163da9fb3335, 0xa 0xa66f0f9c1cb64129, 0x93af252b376bba97, 0xacdf3ac948dd7273, 0x99df50765b6e4540, 0x9faf6632798844f8, 0xa12f7bfdad9cbe13, 0xaeef91d802243c88, 0x874fa7c1819e90d8, 0xacdfbdba3692d513, 0x62efd3c22b8f71f1, 0x74afe9d96b2a23d9) -@inline function table_unpack(ind) +# XXX we want to mark :consistent-cy here so that this function can be concrete-folded, +# because the effect analysis currently can't prove it in the presence of `@inbounds` or +# `:boundscheck`, but still the access to `J_TABLE` is really safe here +Base.@assume_effects :consistent @inline function table_unpack(ind::Int32) + ind = ind & 255 + 1 # 255 == length(J_TABLE) - 1 j = @inbounds J_TABLE[ind] jU = reinterpret(Float64, JU_CONST | (j&JU_MASK)) jL = reinterpret(Float64, JL_CONST | (j>>8)) @@ -211,7 +215,7 @@ end r = muladd(N_float, LogBo256U(base, T), x) r = muladd(N_float, LogBo256L(base, T), r) k = N >> 8 - jU, jL = table_unpack(N&255 + 1) + jU, jL = table_unpack(N) small_part = muladd(jU, expm1b_kernel(base, r), jL) + jU if !(abs(x) <= SUBNORM_EXP(base, T)) @@ -236,7 +240,7 @@ end r = muladd(N_float, LogBo256U(base, T), x) r = muladd(N_float, LogBo256L(base, T), r) k = N >> 8 - jU, jL = table_unpack(N&255 + 1) + jU, jL = table_unpack(N) very_small = muladd(jU, expm1b_kernel(base, r), jL) small_part = muladd(jU,xlo,very_small) + jU if !(abs(x) <= SUBNORM_EXP(base, T)) @@ -438,7 +442,7 @@ function expm1(x::Float64) r = muladd(N_float, LogBo256U(Val(:ℯ), T), x) r = muladd(N_float, LogBo256L(Val(:ℯ), T), r) k = Int64(N >> 8) - jU, jL = table_unpack(N&255 +1) + jU, jL = table_unpack(N) p = expm1b_kernel(Val(:ℯ), r) twopk = reinterpret(Float64, (1023+k) << 52) twopnk = reinterpret(Float64, (1023-k) << 52) diff --git a/base/special/log.jl b/base/special/log.jl index bca0d7143db48..f16ba03d70f0d 100644 --- a/base/special/log.jl +++ b/base/special/log.jl @@ -92,7 +92,6 @@ const t_log_Float64 = ((0.0,0.0),(0.007782140442941454,-8.865052917267247e-13), (0.6853040030982811,6.383161517064652e-13),(0.6892332812385575,2.5144230728376075e-13), (0.6931471805601177,-1.7239444525614835e-13)) - # Float32 lookup table # to generate values: # N=16 @@ -156,7 +155,12 @@ logbU(::Type{Float64},::Val{10}) = 0.4342944819032518 logbL(::Type{Float64},::Val{10}) = 1.098319650216765e-17 # Procedure 1 -@inline function log_proc1(y::Float64,mf::Float64,F::Float64,f::Float64,jp::Int,base=Val(:ℯ)) +# XXX we want to mark :consistent-cy here so that this function can be concrete-folded, +# because the effect analysis currently can't prove it in the presence of `@inbounds` or +# `:boundscheck`, but still the access to `t_log_Float64` is really safe here +Base.@assume_effects :consistent @inline function log_proc1(y::Float64,mf::Float64,F::Float64,f::Float64,base=Val(:ℯ)) + jp = unsafe_trunc(Int,128.0*F)-127 + ## Steps 1 and 2 @inbounds hi,lo = t_log_Float64[jp] l_hi = mf* 0.6931471805601177 + hi @@ -211,8 +215,13 @@ end return fma(m_hi, u, fma(m_lo, u, m_hi*fma(fma(-u,f,2(f-u)), g, q))) end +# Procedure 1 +# XXX we want to mark :consistent-cy here so that this function can be concrete-folded, +# because the effect analysis currently can't prove it in the presence of `@inbounds` or +# `:boundscheck`, but still the access to `t_log_Float32` is really safe here +Base.@assume_effects :consistent @inline function log_proc1(y::Float32,mf::Float32,F::Float32,f::Float32,base=Val(:ℯ)) + jp = unsafe_trunc(Int,128.0f0*F)-127 -@inline function log_proc1(y::Float32,mf::Float32,F::Float32,f::Float32,jp::Int,base=Val(:ℯ)) ## Steps 1 and 2 @inbounds hi = t_log_Float32[jp] l = mf*0.6931471805599453 + hi @@ -232,6 +241,7 @@ end Float32(logb(Float32, base)*(l + (u + q))) end +# Procedure 2 @inline function log_proc2(f::Float32,base=Val(:ℯ)) ## Step 1 # compute in higher precision @@ -281,9 +291,8 @@ function _log(x::Float64, base, func) mf = Float64(m) F = (y + 3.5184372088832e13) - 3.5184372088832e13 # 0x1p-7*round(0x1p7*y) f = y-F - jp = unsafe_trunc(Int,128.0*F)-127 - return log_proc1(y,mf,F,f,jp,base) + return log_proc1(y,mf,F,f,base) elseif x == 0.0 -Inf elseif isnan(x) @@ -317,9 +326,8 @@ function _log(x::Float32, base, func) mf = Float32(m) F = (y + 65536.0f0) - 65536.0f0 # 0x1p-7*round(0x1p7*y) f = y-F - jp = unsafe_trunc(Int,128.0f0*F)-127 - log_proc1(y,mf,F,f,jp,base) + log_proc1(y,mf,F,f,base) elseif x == 0f0 -Inf32 elseif isnan(x) @@ -352,9 +360,8 @@ function log1p(x::Float64) mf = Float64(m) F = (y + 3.5184372088832e13) - 3.5184372088832e13 # 0x1p-7*round(0x1p7*y) f = (y - F) + c*s #2^m(F+f) = 1+x = z+c - jp = unsafe_trunc(Int,128.0*F)-127 - log_proc1(y,mf,F,f,jp) + log_proc1(y,mf,F,f) elseif x == -1.0 -Inf elseif isnan(x) @@ -385,9 +392,8 @@ function log1p(x::Float32) mf = Float32(m) F = (y + 65536.0f0) - 65536.0f0 # 0x1p-7*round(0x1p7*y) f = (y - F) + s*c #2^m(F+f) = 1+x = z+c - jp = unsafe_trunc(Int,128.0*F)-127 - log_proc1(y,mf,F,f,jp) + log_proc1(y,mf,F,f) elseif x == -1f0 -Inf32 elseif isnan(x) diff --git a/base/special/rem_pio2.jl b/base/special/rem_pio2.jl index 4ec9945885e7e..c9767f50358c6 100644 --- a/base/special/rem_pio2.jl +++ b/base/special/rem_pio2.jl @@ -125,7 +125,10 @@ function fromfraction(f::Int128) return (z1,z2) end -function paynehanek(x::Float64) +# XXX we want to mark :consistent-cy here so that this function can be concrete-folded, +# because the effect analysis currently can't prove it in the presence of `@inbounds` or +# `:boundscheck`, but still the accesses to `INV_2PI` are really safe here +Base.@assume_effects :consistent function paynehanek(x::Float64) # 1. Convert to form # # x = X * 2^k, diff --git a/test/math.jl b/test/math.jl index 55d0a3b6c5ed4..6e7908d890c81 100644 --- a/test/math.jl +++ b/test/math.jl @@ -1425,3 +1425,21 @@ end for T in (Float32, Float64) @test Core.Compiler.is_foldable(Base.infer_effects(^, (T,Int))) end + +# test constant-foldability +for fn in (:sin, :cos, :tan, :log, :log2, :log10, :log1p, :exponent, :sqrt, :cbrt, + # TODO :asin, :atan, :acos, :sinh, :cosh, :tanh, :asinh, :acosh, :atanh, + # TODO :exp, :exp2, :exp10, :expm1 + ) + for T in (Float32, Float64) + f = getfield(@__MODULE__, fn) + eff = Base.infer_effects(f, (T,)) + if Core.Compiler.is_foldable(eff) + @test true + else + @error "bad effects found for $f(::$T)" eff + @test false + end + end +end +@test Core.Compiler.is_foldable(Base.infer_effects(^, (Float32,Int))) From 1835d8f0363c91a9c292e3a348ee087cad70f6a5 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Thu, 16 Jun 2022 03:37:38 +0900 Subject: [PATCH 255/369] test: allow new concrete-foldability tests to fail (#45670) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit But just print bad effects instead – especially `[sin|cos|tan](::Float32)` seem to be analyzed as non-foldable sometimes non-deterministically, somehow. We need to dig into what's leading to the bad analysis with Cthulhu on each platform, but this homework is left for the readers with access. Tests added in #45613 --- test/math.jl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/math.jl b/test/math.jl index 6e7908d890c81..5daf1ef465509 100644 --- a/test/math.jl +++ b/test/math.jl @@ -1428,8 +1428,8 @@ end # test constant-foldability for fn in (:sin, :cos, :tan, :log, :log2, :log10, :log1p, :exponent, :sqrt, :cbrt, - # TODO :asin, :atan, :acos, :sinh, :cosh, :tanh, :asinh, :acosh, :atanh, - # TODO :exp, :exp2, :exp10, :expm1 + # TODO? :asin, :atan, :acos, :sinh, :cosh, :tanh, :asinh, :acosh, :atanh, + # TODO? :exp, :exp2, :exp10, :expm1 ) for T in (Float32, Float64) f = getfield(@__MODULE__, fn) @@ -1437,8 +1437,10 @@ for fn in (:sin, :cos, :tan, :log, :log2, :log10, :log1p, :exponent, :sqrt, :cbr if Core.Compiler.is_foldable(eff) @test true else - @error "bad effects found for $f(::$T)" eff - @test false + # XXX only print bad effects – especially `[sin|cos|tan](::Float32)` are analyzed + # as non-foldable sometimes but non-deterministically somehow, we need to dig + # into what's leading to the bad analysis with Cthulhu on each platform + @warn "bad effects found for $f(::$T)" eff end end end From 2daf1fdb604fb4ad91226c81fa280051f5dc0f63 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Tue, 12 Jul 2022 12:54:00 +0900 Subject: [PATCH 256/369] compiler: move effects-related test cases into dedicated file (#45992) --- test/choosetests.jl | 4 +-- test/compiler/effects.jl | 64 ++++++++++++++++++++++++++++++++++++++ test/compiler/inference.jl | 63 ------------------------------------- 3 files changed, 66 insertions(+), 65 deletions(-) create mode 100644 test/compiler/effects.jl diff --git a/test/choosetests.jl b/test/choosetests.jl index 099dfa18a71c5..f5775bbc00911 100644 --- a/test/choosetests.jl +++ b/test/choosetests.jl @@ -140,8 +140,8 @@ function choosetests(choices = []) "strings/io", "strings/types"]) # do subarray before sparse but after linalg filtertests!(tests, "subarray") - filtertests!(tests, "compiler", ["compiler/inference", "compiler/validation", - "compiler/ssair", "compiler/irpasses", "compiler/codegen", + filtertests!(tests, "compiler", ["compiler/inference", "compiler/effects", + "compiler/validation", "compiler/ssair", "compiler/irpasses", "compiler/codegen", "compiler/inline", "compiler/contextual", "compiler/AbstractInterpreter", "compiler/EscapeAnalysis/local", "compiler/EscapeAnalysis/interprocedural"]) filtertests!(tests, "compiler/EscapeAnalysis", [ diff --git a/test/compiler/effects.jl b/test/compiler/effects.jl new file mode 100644 index 0000000000000..55b99dee6a968 --- /dev/null +++ b/test/compiler/effects.jl @@ -0,0 +1,64 @@ +using Test +include("irutils.jl") + +# control flow backedge should taint `terminates` +@test Base.infer_effects((Int,)) do n + for i = 1:n; end +end |> !Core.Compiler.is_terminates + +# effects propagation for `Core.invoke` calls +# https://github.com/JuliaLang/julia/issues/44763 +global x44763::Int = 0 +increase_x44763!(n) = (global x44763; x44763 += n) +invoke44763(x) = @invoke increase_x44763!(x) +@test Base.return_types() do + invoke44763(42) +end |> only === Int +@test x44763 == 0 + +# Test that purity doesn't try to accidentally run unreachable code due to +# boundscheck elimination +function f_boundscheck_elim(n) + # Inbounds here assumes that this is only ever called with n==0, but of + # course the compiler has no way of knowing that, so it must not attempt + # to run the @inbounds `getfield(sin, 1)`` that ntuple generates. + ntuple(x->(@inbounds getfield(sin, x)), n) +end +@test Tuple{} <: code_typed(f_boundscheck_elim, Tuple{Int})[1][2] + +# Test that purity modeling doesn't accidentally introduce new world age issues +f_redefine_me(x) = x+1 +f_call_redefine() = f_redefine_me(0) +f_mk_opaque() = Base.Experimental.@opaque ()->Base.inferencebarrier(f_call_redefine)() +const op_capture_world = f_mk_opaque() +f_redefine_me(x) = x+2 +@test op_capture_world() == 1 +@test f_mk_opaque()() == 2 + +# backedge insertion for Any-typed, effect-free frame +const CONST_DICT = let d = Dict() + for c in 'A':'z' + push!(d, c => Int(c)) + end + d +end +Base.@assume_effects :foldable getcharid(c) = CONST_DICT[c] +@noinline callf(f, args...) = f(args...) +function entry_to_be_invalidated(c) + return callf(getcharid, c) +end +@test Base.infer_effects((Char,)) do x + entry_to_be_invalidated(x) +end |> Core.Compiler.is_foldable +@test fully_eliminated(; retval=97) do + entry_to_be_invalidated('a') +end +getcharid(c) = CONST_DICT[c] # now this is not eligible for concrete evaluation +@test Base.infer_effects((Char,)) do x + entry_to_be_invalidated(x) +end |> !Core.Compiler.is_foldable +@test !fully_eliminated() do + entry_to_be_invalidated('a') +end + +@test !Core.Compiler.builtin_nothrow(Core.get_binding_type, Any[Rational{Int}, Core.Const(:foo)], Any) diff --git a/test/compiler/inference.jl b/test/compiler/inference.jl index 9ed5234107e8e..69fd1a2a36ca1 100644 --- a/test/compiler/inference.jl +++ b/test/compiler/inference.jl @@ -4048,70 +4048,7 @@ end end |> only === Union{} end -# Test that purity modeling doesn't accidentally introduce new world age issues -f_redefine_me(x) = x+1 -f_call_redefine() = f_redefine_me(0) -f_mk_opaque() = @Base.Experimental.opaque ()->Base.inferencebarrier(f_call_redefine)() -const op_capture_world = f_mk_opaque() -f_redefine_me(x) = x+2 -@test op_capture_world() == 1 -@test f_mk_opaque()() == 2 - -# Test that purity doesn't try to accidentally run unreachable code due to -# boundscheck elimination -function f_boundscheck_elim(n) - # Inbounds here assumes that this is only ever called with n==0, but of - # course the compiler has no way of knowing that, so it must not attempt - # to run the @inbounds `getfield(sin, 1)`` that ntuple generates. - ntuple(x->(@inbounds getfield(sin, x)), n) -end -@test Tuple{} <: code_typed(f_boundscheck_elim, Tuple{Int})[1][2] - -@test !Core.Compiler.builtin_nothrow(Core.get_binding_type, Any[Rational{Int}, Core.Const(:foo)], Any) - # https://github.com/JuliaLang/julia/issues/44965 let t = Core.Compiler.tuple_tfunc(Any[Core.Const(42), Vararg{Any}]) @test Core.Compiler.issimplertype(t, t) end - -# https://github.com/JuliaLang/julia/issues/44763 -global x44763::Int = 0 -increase_x44763!(n) = (global x44763; x44763 += n) -invoke44763(x) = Base.@invoke increase_x44763!(x) -@test Base.return_types() do - invoke44763(42) -end |> only === Int -@test x44763 == 0 - -# backedge insertion for Any-typed, effect-free frame -const CONST_DICT = let d = Dict() - for c in 'A':'z' - push!(d, c => Int(c)) - end - d -end -Base.@assume_effects :foldable getcharid(c) = CONST_DICT[c] -@noinline callf(f, args...) = f(args...) -function entry_to_be_invalidated(c) - return callf(getcharid, c) -end -@test Base.infer_effects((Char,)) do x - entry_to_be_invalidated(x) -end |> Core.Compiler.is_foldable -@test fully_eliminated(; retval=97) do - entry_to_be_invalidated('a') -end -getcharid(c) = CONST_DICT[c] # now this is not eligible for concrete evaluation -@test Base.infer_effects((Char,)) do x - entry_to_be_invalidated(x) -end |> !Core.Compiler.is_foldable -@test !fully_eliminated() do - entry_to_be_invalidated('a') -end - -# Make sure return_type_tfunc doesn't accidentally cause bad inference if used -# at top level. -@test let - Base.Experimental.@force_compile - Core.Compiler.return_type(+, NTuple{2, Rational}) -end == Rational From 1390613d29220acac1c375e102ae2f2428c2fb95 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Tue, 12 Jul 2022 18:09:23 +0900 Subject: [PATCH 257/369] Merge pull request #45993 from JuliaLang/avi/recursion-effects effects: relax recursion detection for effects analysis --- base/compiler/abstractinterpretation.jl | 64 ++++++++++++++++++------- test/compiler/effects.jl | 15 ++++++ 2 files changed, 61 insertions(+), 18 deletions(-) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index 4feba83574a8e..31441407dc31a 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -652,14 +652,43 @@ function abstract_call_method(interp::AbstractInterpreter, method::Method, @nosp # this edge is known to terminate edge_effects = Effects(edge_effects; terminates=ALWAYS_TRUE) elseif edgecycle - # Some sort of recursion was detected. Even if we did not limit types, - # we cannot guarantee that the call will terminate - edge_effects = Effects(edge_effects; terminates=TRISTATE_UNKNOWN) + # Some sort of recursion was detected. + if edge !== nothing && !edgelimited && !is_edge_recursed(edge, sv) + # no `MethodInstance` cycles -- don't taint :terminate + else + # we cannot guarantee that the call will terminate + edge_effects = Effects(edge_effects; terminates=ALWAYS_FALSE) + end end return MethodCallResult(rt, edgecycle, edgelimited, edge, edge_effects) end -# keeps result and context information of abstract method call, will be used by succeeding constant-propagation +function is_edge_recursed(edge::MethodInstance, sv::InferenceState) + return any(InfStackUnwind(sv)) do infstate + return edge === infstate.linfo + end +end + +function is_method_recursed(method::Method, sv::InferenceState) + return any(InfStackUnwind(sv)) do infstate + return method === infstate.linfo.def + end +end + +function is_constprop_edge_recursed(edge::MethodInstance, sv::InferenceState) + return any(InfStackUnwind(sv)) do infstate + return edge === infstate.linfo && any(infstate.result.overridden_by_const) + end +end + +function is_constprop_method_recursed(method::Method, sv::InferenceState) + return any(InfStackUnwind(sv)) do infstate + return method === infstate.linfo.def && any(infstate.result.overridden_by_const) + end +end + +# keeps result and context information of abstract_method_call, which will later be used for +# backedge computation, and concrete evaluation or constant-propagation struct MethodCallResult rt edgecycle::Bool @@ -801,17 +830,14 @@ function abstract_call_method_with_const_args(interp::AbstractInterpreter, resul if inf_result === nothing # if there might be a cycle, check to make sure we don't end up # calling ourselves here. - let result = result # prevent capturing - if result.edgecycle && _any(InfStackUnwind(sv)) do infstate - # if the type complexity limiting didn't decide to limit the call signature (`result.edgelimited = false`) - # we can relax the cycle detection by comparing `MethodInstance`s and allow inference to - # propagate different constant elements if the recursion is finite over the lattice - return (result.edgelimited ? match.method === infstate.linfo.def : mi === infstate.linfo) && - any(infstate.result.overridden_by_const) - end - add_remark!(interp, sv, "[constprop] Edge cycle encountered") - return nothing - end + if result.edgecycle && (result.edgelimited ? + is_constprop_method_recursed(match.method, sv) : + # if the type complexity limiting didn't decide to limit the call signature (`result.edgelimited = false`) + # we can relax the cycle detection by comparing `MethodInstance`s and allow inference to + # propagate different constant elements if the recursion is finite over the lattice + is_constprop_edge_recursed(mi, sv)) + add_remark!(interp, sv, "[constprop] Edge cycle encountered") + return nothing end inf_result = InferenceResult(mi, (arginfo, sv)) if !any(inf_result.overridden_by_const) @@ -922,8 +948,8 @@ function is_const_prop_profitable_arg(@nospecialize(arg)) isa(arg, PartialOpaque) && return true isa(arg, Const) || return true val = arg.val - # don't consider mutable values or Strings useful constants - return isa(val, Symbol) || isa(val, Type) || (!isa(val, String) && !ismutable(val)) + # don't consider mutable values useful constants + return isa(val, Symbol) || isa(val, Type) || !ismutable(val) end function is_const_prop_profitable_conditional(cnd::Conditional, fargs::Vector{Any}, sv::InferenceState) @@ -1275,7 +1301,7 @@ function abstract_apply(interp::AbstractInterpreter, argtypes::Vector{Any}, sv:: end cti = Any[Vararg{argt}] end - if _any(t -> t === Bottom, cti) + if any(@nospecialize(t) -> t === Bottom, cti) continue end for j = 1:length(ctypes) @@ -1954,6 +1980,8 @@ function abstract_eval_statement(interp::AbstractInterpreter, @nospecialize(e), for i = 3:length(e.args) if abstract_eval_value(interp, e.args[i], vtypes, sv) === Bottom t = Bottom + tristate_merge!(sv, EFFECTS_THROWS) + @goto t_computed end end cconv = e.args[5] diff --git a/test/compiler/effects.jl b/test/compiler/effects.jl index 55b99dee6a968..101adfb97683c 100644 --- a/test/compiler/effects.jl +++ b/test/compiler/effects.jl @@ -6,6 +6,21 @@ include("irutils.jl") for i = 1:n; end end |> !Core.Compiler.is_terminates +# interprocedural-recursion should taint `terminates` **appropriately** +function sumrecur(a, x) + isempty(a) && return x + return sumrecur(Base.tail(a), x + first(a)) +end +@test Base.infer_effects(sumrecur, (Tuple{Int,Int,Int},Int)) |> Core.Compiler.is_terminates +@test Base.infer_effects(sumrecur, (Tuple{Int,Int,Int,Vararg{Int}},Int)) |> !Core.Compiler.is_terminates + +# https://github.com/JuliaLang/julia/issues/45781 +@test Base.infer_effects((Float32,)) do a + out1 = promote_type(Irrational{:π}, Bool) + out2 = sin(a) + out1, out2 +end |> Core.Compiler.is_terminates + # effects propagation for `Core.invoke` calls # https://github.com/JuliaLang/julia/issues/44763 global x44763::Int = 0 From 1645d1d8a8888ac56210d7ef329690fb0c8f7f77 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Mon, 25 Jul 2022 10:20:34 -0400 Subject: [PATCH 258/369] Merge pull request #46111 from JuliaLang/avi/correct-consistent effects: fix correctness issues of `:consistent`-cy analysis --- base/compiler/abstractinterpretation.jl | 33 ++++--- base/compiler/tfuncs.jl | 65 +++++++++++++- test/compiler/effects.jl | 115 ++++++++++++++++++++++++ 3 files changed, 197 insertions(+), 16 deletions(-) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index 31441407dc31a..430cfc1796f60 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -1809,18 +1809,21 @@ function abstract_eval_cfunction(interp::AbstractInterpreter, e::Expr, vtypes::V end function abstract_eval_value_expr(interp::AbstractInterpreter, e::Expr, vtypes::VarTable, sv::InferenceState) - if e.head === :static_parameter + head = e.head + if head === :static_parameter n = e.args[1]::Int t = Any if 1 <= n <= length(sv.sptypes) t = sv.sptypes[n] end return t - elseif e.head === :boundscheck + elseif head === :boundscheck return Bool - else + elseif head === :the_exception + tristate_merge!(sv, Effects(EFFECTS_TOTAL; consistent=ALWAYS_FALSE)) return Any end + return Any end function abstract_eval_special_value(interp::AbstractInterpreter, @nospecialize(e), vtypes::VarTable, sv::InferenceState) @@ -1886,6 +1889,7 @@ function abstract_eval_statement(interp::AbstractInterpreter, @nospecialize(e), elseif ehead === :new t, isexact = instanceof_tfunc(abstract_eval_value(interp, e.args[1], vtypes, sv)) is_nothrow = true + is_consistent = false if isconcretedispatch(t) fcount = fieldcount(t) nargs = length(e.args) - 1 @@ -1916,22 +1920,27 @@ function abstract_eval_statement(interp::AbstractInterpreter, @nospecialize(e), # For now, don't allow: # - Const/PartialStruct of mutables # - partially initialized Const/PartialStruct - if !ismutabletype(t) && fcount == nargs - if allconst - argvals = Vector{Any}(undef, nargs) - for j in 1:nargs - argvals[j] = (ats[j]::Const).val + if !ismutabletype(t) + if fcount == nargs + is_consistent = true + if allconst + argvals = Vector{Any}(undef, nargs) + for j in 1:nargs + argvals[j] = (ats[j]::Const).val + end + t = Const(ccall(:jl_new_structv, Any, (Any, Ptr{Cvoid}, UInt32), t, argvals, nargs)) + elseif anyrefine + t = PartialStruct(t, ats) end - t = Const(ccall(:jl_new_structv, Any, (Any, Ptr{Cvoid}, UInt32), t, argvals, nargs)) - elseif anyrefine - t = PartialStruct(t, ats) + else + is_consistent = all(i::Int -> is_undefref_fieldtype(fieldtype(t, i)), (nargs+1):fcount) end end else is_nothrow = false end tristate_merge!(sv, Effects(EFFECTS_TOTAL; - consistent = !ismutabletype(t) ? ALWAYS_TRUE : TRISTATE_UNKNOWN, + consistent = is_consistent ? ALWAYS_TRUE : TRISTATE_UNKNOWN, nothrow = is_nothrow ? ALWAYS_TRUE : TRISTATE_UNKNOWN)) elseif ehead === :splatnew t, isexact = instanceof_tfunc(abstract_eval_value(interp, e.args[1], vtypes, sv)) diff --git a/base/compiler/tfuncs.jl b/base/compiler/tfuncs.jl index 2411fc0514b80..7cbde8e7d54ab 100644 --- a/base/compiler/tfuncs.jl +++ b/base/compiler/tfuncs.jl @@ -861,7 +861,7 @@ function _getfield_tfunc(@nospecialize(s00), @nospecialize(name), setfield::Bool end isa(s, DataType) || return Any isabstracttype(s) && return Any - if s <: Tuple && !(Int <: widenconst(name)) + if s <: Tuple && !hasintersect(widenconst(name), Int) return Bottom end if s <: Module @@ -936,6 +936,57 @@ function _getfield_tfunc(@nospecialize(s00), @nospecialize(name), setfield::Bool return rewrap_unionall(R, s00) end +function getfield_notundefined(@nospecialize(typ0), @nospecialize(name)) + typ = unwrap_unionall(typ0) + if isa(typ, Union) + return getfield_notundefined(rewrap_unionall(typ.a, typ0), name) && + getfield_notundefined(rewrap_unionall(typ.b, typ0), name) + end + isa(typ, DataType) || return false + if typ.name === Tuple.name || typ.name === _NAMEDTUPLE_NAME + # tuples and named tuples can't be instantiated with undefined fields, + # so we don't need to be conservative here + return true + end + if !isa(name, Const) + isvarargtype(name) && return false + if !hasintersect(widenconst(name), Union{Int,Symbol}) + return true # no undefined behavior if thrown + end + # field isn't known precisely, but let's check if all the fields can't be + # initialized with undefined value so to avoid being too conservative + fcnt = fieldcount_noerror(typ) + fcnt === nothing && return false + all(i::Int->is_undefref_fieldtype(fieldtype(typ,i)), 1:fcnt) && return true + return false + end + name = name.val + if isa(name, Symbol) + fidx = fieldindex(typ, name, false) + fidx === nothing && return true # no undefined behavior if thrown + elseif isa(name, Int) + fidx = name + else + return true # no undefined behavior if thrown + end + fcnt = fieldcount_noerror(typ) + fcnt === nothing && return false + 0 < fidx ≤ fcnt || return true # no undefined behavior if thrown + ftyp = fieldtype(typ, fidx) + is_undefref_fieldtype(ftyp) && return true + return fidx ≤ datatype_min_ninitialized(typ) +end +# checks if a field of this type will not be initialized with undefined value +# and the access to that uninitialized field will cause and `UndefRefError`, e.g., +# - is_undefref_fieldtype(String) === true +# - is_undefref_fieldtype(Integer) === true +# - is_undefref_fieldtype(Any) === true +# - is_undefref_fieldtype(Int) === false +# - is_undefref_fieldtype(Union{Int32,Int64}) === false +function is_undefref_fieldtype(@nospecialize ftyp) + return !has_free_typevars(ftyp) && !allocatedinline(ftyp) +end + function setfield!_tfunc(o, f, v, order) @nospecialize if !isvarargtype(order) @@ -1772,9 +1823,15 @@ function builtin_effects(f::Builtin, argtypes::Vector{Any}, rt) end s = s::DataType ipo_consistent = !ismutabletype(s) - nothrow = false - if f === Core.getfield && !isvarargtype(argtypes[end]) && - getfield_boundscheck(argtypes[2:end]) !== true + # access to `isbitstype`-field initialized with undefined value leads to undefined behavior + # so should taint `:consistent`-cy while access to uninitialized non-`isbitstype` field + # throws `UndefRefError` so doesn't need to taint it + # NOTE `getfield_notundefined` conservatively checks if this field is never initialized + # with undefined value so that we don't taint `:consistent`-cy too aggressively here + if f === Core.getfield && !getfield_notundefined(s, argtypes[2]) + ipo_consistent = false + end + if f === Core.getfield && !isvarargtype(argtypes[end]) && getfield_boundscheck(argtypes) !== true # If we cannot independently prove inboundsness, taint consistency. # The inbounds-ness assertion requires dynamic reachability, while # :consistent needs to be true for all input values. diff --git a/test/compiler/effects.jl b/test/compiler/effects.jl index 101adfb97683c..0f2a82a3395f1 100644 --- a/test/compiler/effects.jl +++ b/test/compiler/effects.jl @@ -21,6 +21,121 @@ end out1, out2 end |> Core.Compiler.is_terminates +# :the_exception expression should taint :consistent-cy +global inconsistent_var::Int = 42 +function throw_inconsistent() # this is still :consistent + throw(inconsistent_var) +end +function catch_inconsistent() + try + throw_inconsistent() + catch err + err + end +end +@test !Core.Compiler.is_consistent(Base.infer_effects(catch_inconsistent)) +cache_inconsistent() = catch_inconsistent() +function compare_inconsistent() + a = cache_inconsistent() + global inconsistent_var = 0 + b = cache_inconsistent() + global inconsistent_var = 42 + return a === b +end +@test !compare_inconsistent() +# return type information shouldn't be able to refine it also +function catch_inconsistent(x::T) where T + v = x + try + throw_inconsistent() + catch err + v = err::T + end + return v +end +@test !Core.Compiler.is_consistent(Base.infer_effects(catch_inconsistent, (Int,))) +cache_inconsistent(x) = catch_inconsistent(x) +function compare_inconsistent(x::T) where T + x = one(T) + a = cache_inconsistent(x) + global inconsistent_var = 0 + b = cache_inconsistent(x) + global inconsistent_var = 42 + return a === b +end +@test !compare_inconsistent(3) + +# allocation/access of uninitialized fields should taint the :consistent-cy +struct Maybe{T} + x::T + Maybe{T}() where T = new{T}() + Maybe{T}(x) where T = new{T}(x) + Maybe(x::T) where T = new{T}(x) +end +Base.getindex(x::Maybe) = x.x + +import Core.Compiler: Const, getfield_notundefined +for T = (Base.RefValue, Maybe) # both mutable and immutable + for name = (Const(1), Const(:x)) + @test getfield_notundefined(T{String}, name) + @test getfield_notundefined(T{Integer}, name) + @test getfield_notundefined(T{Union{String,Integer}}, name) + @test getfield_notundefined(Union{T{String},T{Integer}}, name) + @test !getfield_notundefined(T{Int}, name) + @test !getfield_notundefined(T{<:Integer}, name) + @test !getfield_notundefined(T{Union{Int32,Int64}}, name) + @test !getfield_notundefined(T, name) + end + # throw doesn't account for undefined behavior + for name = (Const(0), Const(2), Const(1.0), Const(:y), Const("x"), + Float64, String, Nothing) + @test getfield_notundefined(T{String}, name) + @test getfield_notundefined(T{Int}, name) + @test getfield_notundefined(T{Integer}, name) + @test getfield_notundefined(T{<:Integer}, name) + @test getfield_notundefined(T{Union{Int32,Int64}}, name) + @test getfield_notundefined(T, name) + end + # should not be too conservative when field isn't known very well but object information is accurate + @test getfield_notundefined(T{String}, Int) + @test getfield_notundefined(T{String}, Symbol) + @test getfield_notundefined(T{Integer}, Int) + @test getfield_notundefined(T{Integer}, Symbol) + @test !getfield_notundefined(T{Int}, Int) + @test !getfield_notundefined(T{Int}, Symbol) + @test !getfield_notundefined(T{<:Integer}, Int) + @test !getfield_notundefined(T{<:Integer}, Symbol) +end +# should be conservative when object information isn't accurate +@test !getfield_notundefined(Any, Const(1)) +@test !getfield_notundefined(Any, Const(:x)) +# tuples and namedtuples should be okay if not given accurate information +for TupleType = Any[Tuple{Int,Int,Int}, Tuple{Int,Vararg{Int}}, Tuple{Any}, Tuple, + NamedTuple{(:a, :b), Tuple{Int,Int}}, NamedTuple{(:x,),Tuple{Any}}, NamedTuple], + FieldType = Any[Int, Symbol, Any] + @test getfield_notundefined(TupleType, FieldType) +end + +# TODO add equivalent test cases for `Ref` once we handle mutability more nicely +@test Base.infer_effects() do + Maybe{Int}() +end |> !Core.Compiler.is_consistent +@test Base.infer_effects() do + Maybe{Int}()[] +end |> !Core.Compiler.is_consistent +@test !fully_eliminated() do + Maybe{Int}()[] +end +@test Base.infer_effects() do + Maybe{String}() +end |> Core.Compiler.is_consistent +@test Base.infer_effects() do + Maybe{String}()[] +end |> Core.Compiler.is_consistent +@test Base.return_types() do + Maybe{String}()[] # this expression should be concrete evaluated +end |> only === Union{} + # effects propagation for `Core.invoke` calls # https://github.com/JuliaLang/julia/issues/44763 global x44763::Int = 0 From a1937abab49ee49b64118b46647ac3ad5ee4193c Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki Date: Mon, 20 Jun 2022 15:37:16 +0900 Subject: [PATCH 259/369] effects: improve tri-state printing --- base/compiler/ssair/show.jl | 15 ++++++++++++++- base/show.jl | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/base/compiler/ssair/show.jl b/base/compiler/ssair/show.jl index f4c826a45156f..2ec160077354c 100644 --- a/base/compiler/ssair/show.jl +++ b/base/compiler/ssair/show.jl @@ -791,7 +791,11 @@ function show_ir(io::IO, code::Union{IRCode, CodeInfo}, config::IRShowConfig=def end tristate_letter(t::TriState) = t === ALWAYS_TRUE ? '+' : t === ALWAYS_FALSE ? '!' : '?' -tristate_color(t::TriState) = t === ALWAYS_TRUE ? :green : t === ALWAYS_FALSE ? :red : :orange +tristate_color(t::TriState) = t === ALWAYS_TRUE ? :green : t === ALWAYS_FALSE ? :red : :yellow +tristate_repr(t::TriState) = + t === ALWAYS_TRUE ? "ALWAYS_TRUE" : + t === ALWAYS_FALSE ? "ALWAYS_FALSE" : + t === TRISTATE_UNKNOWN ? "TRISTATE_UNKNOWN" : nothing function Base.show(io::IO, e::Core.Compiler.Effects) print(io, "(") @@ -806,4 +810,13 @@ function Base.show(io::IO, e::Core.Compiler.Effects) e.nonoverlayed || printstyled(io, '′'; color=:red) end +function Base.show(io::IO, t::TriState) + s = tristate_repr(t) + if s !== nothing + printstyled(io, s; color = tristate_color(t)) + else # unknown state, redirect to the fallback printing + Base.@invoke show(io::IO, t::Any) + end +end + @specialize diff --git a/base/show.jl b/base/show.jl index 607f13d3778e7..381a17f188482 100644 --- a/base/show.jl +++ b/base/show.jl @@ -2490,7 +2490,7 @@ module IRShow import ..Base import .Compiler: IRCode, ReturnNode, GotoIfNot, CFG, scan_ssa_use!, Argument, isexpr, compute_basic_blocks, block_for_inst, - TriState, Effects, ALWAYS_TRUE, ALWAYS_FALSE + TriState, Effects, ALWAYS_TRUE, ALWAYS_FALSE, TRISTATE_UNKNOWN Base.getindex(r::Compiler.StmtRange, ind::Integer) = Compiler.getindex(r, ind) Base.size(r::Compiler.StmtRange) = Compiler.size(r) Base.first(r::Compiler.StmtRange) = Compiler.first(r) From 431a5e51c692459159c6cfd457559cbb6c5158ff Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki Date: Mon, 25 Jul 2022 17:16:57 -0400 Subject: [PATCH 260/369] manual fixes, `@invoke` isn't exported on 1.8 --- base/compiler/ssair/show.jl | 2 +- test/compiler/effects.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/base/compiler/ssair/show.jl b/base/compiler/ssair/show.jl index 2ec160077354c..17b7fd7e925dc 100644 --- a/base/compiler/ssair/show.jl +++ b/base/compiler/ssair/show.jl @@ -815,7 +815,7 @@ function Base.show(io::IO, t::TriState) if s !== nothing printstyled(io, s; color = tristate_color(t)) else # unknown state, redirect to the fallback printing - Base.@invoke show(io::IO, t::Any) + Core.invoke(show, Tuple{IO,Any}, io, t) end end diff --git a/test/compiler/effects.jl b/test/compiler/effects.jl index 0f2a82a3395f1..0c00ef42df6ea 100644 --- a/test/compiler/effects.jl +++ b/test/compiler/effects.jl @@ -140,7 +140,7 @@ end |> only === Union{} # https://github.com/JuliaLang/julia/issues/44763 global x44763::Int = 0 increase_x44763!(n) = (global x44763; x44763 += n) -invoke44763(x) = @invoke increase_x44763!(x) +invoke44763(x) = Base.@invoke increase_x44763!(x) @test Base.return_types() do invoke44763(42) end |> only === Int From 843b322f3415d1a7fb9aa5f1dd2ce3508cbfd5c2 Mon Sep 17 00:00:00 2001 From: Markus Kuhn Date: Thu, 28 Jul 2022 09:36:53 +0100 Subject: [PATCH 261/369] release-1.8: NEWS and README update (#46195) * NEWS item: Distributed SSHManager csh support (#46126) * Bump version in README --- NEWS.md | 6 ++++++ README.md | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 63172f026cac5..3bbe7d6c0cfe4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -232,6 +232,11 @@ Standard library changes definitions, including to other function calls, while recording all intermediate test results ([#42518]). * `TestLogger` and `LogRecord` are now exported from the Test stdlib ([#44080]). +#### Distributed + +* SSHManager now supports workers with csh/tcsh login shell, via `addprocs()` option `shell=:csh` ([#41485]). + + Deprecated or removed --------------------- @@ -273,6 +278,7 @@ Tooling Improvements [#41312]: https://github.com/JuliaLang/julia/issues/41312 [#41328]: https://github.com/JuliaLang/julia/issues/41328 [#41449]: https://github.com/JuliaLang/julia/issues/41449 +[#41485]: https://github.com/JuliaLang/julia/issues/41485 [#41551]: https://github.com/JuliaLang/julia/issues/41551 [#41576]: https://github.com/JuliaLang/julia/issues/41576 [#41612]: https://github.com/JuliaLang/julia/issues/41612 diff --git a/README.md b/README.md index 368d971fed77b..b1847beec3d85 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ Julia. However, most users should use the [most recent stable version](https://g of Julia. You can get this version by changing to the Julia directory and running: - git checkout v1.7.2 + git checkout v1.8.0 Now run `make` to build the `julia` executable. From 9b38226670ac44d060978cc90551cce0a15ec26b Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Fri, 29 Jul 2022 06:18:47 -0400 Subject: [PATCH 262/369] inference: fix #46207, make sure we never form nested `Conditional` (#46208) --- base/compiler/abstractinterpretation.jl | 6 ++++++ test/compiler/inference.jl | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index 430cfc1796f60..5c1133b4d40ec 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -1430,20 +1430,26 @@ function abstract_call_builtin(interp::AbstractInterpreter, f::Builtin, (; fargs if isa(aty, Const) && isa(b, SlotNumber) if rt === Const(false) aty = Union{} + bty = widenconditional(bty) elseif rt === Const(true) bty = Union{} elseif bty isa Type && isdefined(typeof(aty.val), :instance) # can only widen a if it is a singleton bty = typesubtract(bty, typeof(aty.val), InferenceParams(interp).MAX_UNION_SPLITTING) + else + bty = widenconditional(bty) end return Conditional(b, aty, bty) end if isa(bty, Const) && isa(a, SlotNumber) if rt === Const(false) bty = Union{} + aty = widenconditional(aty) elseif rt === Const(true) aty = Union{} elseif aty isa Type && isdefined(typeof(bty.val), :instance) # same for b aty = typesubtract(aty, typeof(bty.val), InferenceParams(interp).MAX_UNION_SPLITTING) + else + aty = widenconditional(aty) end return Conditional(a, bty, aty) end diff --git a/test/compiler/inference.jl b/test/compiler/inference.jl index 69fd1a2a36ca1..8ea3a55030fe3 100644 --- a/test/compiler/inference.jl +++ b/test/compiler/inference.jl @@ -2102,6 +2102,16 @@ let M = Module() @test rt == Tuple{Union{Nothing,Int},Any} end +# make sure we never form nested `Conditional` (https://github.com/JuliaLang/julia/issues/46207) +@test Base.return_types((Any,)) do a + c = isa(a, Integer) + 42 === c ? :a : "b" +end |> only === String +@test Base.return_types((Any,)) do a + c = isa(a, Integer) + c === 42 ? :a : "b" +end |> only === String + @testset "conditional constraint propagation from non-`Conditional` object" begin @test Base.return_types((Bool,)) do b if b From c02b4e18a35243f9be0c953bfb63f9116a8ae0e3 Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Wed, 20 Jul 2022 11:51:39 -0400 Subject: [PATCH 263/369] Fix timev compilation time tracking and add tests (#46100) (cherry picked from commit f3c22273d44ca9daedff3f72994e6ccf9c04c13e) --- base/timing.jl | 2 ++ test/misc.jl | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) diff --git a/base/timing.jl b/base/timing.jl index 1579cd5673bc9..a72f2980ca3b8 100644 --- a/base/timing.jl +++ b/base/timing.jl @@ -342,9 +342,11 @@ macro timev(msg, ex) Experimental.@force_compile local stats = gc_num() local elapsedtime = time_ns() + cumulative_compile_timing(true) local compile_elapsedtimes = cumulative_compile_time_ns() local val = @__tryfinally($(esc(ex)), (elapsedtime = time_ns() - elapsedtime; + cumulative_compile_timing(false); compile_elapsedtimes = cumulative_compile_time_ns() .- compile_elapsedtimes) ) local diff = GC_Diff(gc_num(), stats) diff --git a/test/misc.jl b/test/misc.jl index acefe3981674c..9ad9b4e21acac 100644 --- a/test/misc.jl +++ b/test/misc.jl @@ -354,6 +354,80 @@ after_comp, after_recomp = Base.cumulative_compile_time_ns() # no need to turn t end # redirect_stdout +macro capture_stdout(ex) + quote + mktemp() do fname, f + redirect_stdout(f) do + $(esc(ex)) + end + seekstart(f) + read(f, String) + end + end +end + +# compilation reports in @time, @timev +let f = gensym("f"), callf = gensym("callf"), call2f = gensym("call2f") + @eval begin + $f(::Real) = 1 + $callf(container) = $f(container[1]) + $call2f(container) = $callf(container) + c64 = [1.0] + c32 = [1.0f0] + cabs = AbstractFloat[1.0] + + out = @capture_stdout @time $call2f(c64) + @test occursin("% compilation time", out) + out = @capture_stdout @time $call2f(c64) + @test occursin("% compilation time", out) == false + + out = @capture_stdout @time $call2f(c32) + @test occursin("% compilation time", out) + out = @capture_stdout @time $call2f(c32) + @test occursin("% compilation time", out) == false + + out = @capture_stdout @time $call2f(cabs) + @test occursin("% compilation time", out) + out = @capture_stdout @time $call2f(cabs) + @test occursin("% compilation time", out) == false + + $f(::Float64) = 2 + out = @capture_stdout @time $call2f(c64) + @test occursin("% compilation time:", out) + @test occursin("% of which was recompilation", out) + end +end +let f = gensym("f"), callf = gensym("callf"), call2f = gensym("call2f") + @eval begin + $f(::Real) = 1 + $callf(container) = $f(container[1]) + $call2f(container) = $callf(container) + c64 = [1.0] + c32 = [1.0f0] + cabs = AbstractFloat[1.0] + + out = @capture_stdout @timev $call2f(c64) + @test occursin("% compilation time", out) + out = @capture_stdout @timev $call2f(c64) + @test occursin("% compilation time", out) == false + + out = @capture_stdout @timev $call2f(c32) + @test occursin("% compilation time", out) + out = @capture_stdout @timev $call2f(c32) + @test occursin("% compilation time", out) == false + + out = @capture_stdout @timev $call2f(cabs) + @test occursin("% compilation time", out) + out = @capture_stdout @timev $call2f(cabs) + @test occursin("% compilation time", out) == false + + $f(::Float64) = 2 + out = @capture_stdout @timev $call2f(c64) + @test occursin("% compilation time:", out) + @test occursin("% of which was recompilation", out) + end +end + # interactive utilities struct ambigconvert; end # inject a problematic `convert` method to ensure it still works From 20ef7d9bb059f82cf0cb1209eaef96b93fa601b6 Mon Sep 17 00:00:00 2001 From: Ian Date: Mon, 1 Aug 2022 13:09:43 -0400 Subject: [PATCH 264/369] update Pkg branch & commit --- .../Pkg-57ca49fcbb45b578b78ac77a702913b5e2de7c7c.tar.gz/md5 | 1 - .../sha512 | 1 - .../Pkg-63f4405d17e11decd2e5eb786cc491322b68c58c.tar.gz/md5 | 1 + .../sha512 | 1 + stdlib/Pkg.version | 4 ++-- 5 files changed, 4 insertions(+), 4 deletions(-) delete mode 100644 deps/checksums/Pkg-57ca49fcbb45b578b78ac77a702913b5e2de7c7c.tar.gz/md5 delete mode 100644 deps/checksums/Pkg-57ca49fcbb45b578b78ac77a702913b5e2de7c7c.tar.gz/sha512 create mode 100644 deps/checksums/Pkg-63f4405d17e11decd2e5eb786cc491322b68c58c.tar.gz/md5 create mode 100644 deps/checksums/Pkg-63f4405d17e11decd2e5eb786cc491322b68c58c.tar.gz/sha512 diff --git a/deps/checksums/Pkg-57ca49fcbb45b578b78ac77a702913b5e2de7c7c.tar.gz/md5 b/deps/checksums/Pkg-57ca49fcbb45b578b78ac77a702913b5e2de7c7c.tar.gz/md5 deleted file mode 100644 index 713275d000c87..0000000000000 --- a/deps/checksums/Pkg-57ca49fcbb45b578b78ac77a702913b5e2de7c7c.tar.gz/md5 +++ /dev/null @@ -1 +0,0 @@ -505a28c1e9246f92d0440b7ed9599e27 diff --git a/deps/checksums/Pkg-57ca49fcbb45b578b78ac77a702913b5e2de7c7c.tar.gz/sha512 b/deps/checksums/Pkg-57ca49fcbb45b578b78ac77a702913b5e2de7c7c.tar.gz/sha512 deleted file mode 100644 index 61c1603670788..0000000000000 --- a/deps/checksums/Pkg-57ca49fcbb45b578b78ac77a702913b5e2de7c7c.tar.gz/sha512 +++ /dev/null @@ -1 +0,0 @@ -67d76980cc5430274bc7c1d5c1de4cc163a1583bbd373e074fc15296481e8bc202f7a4b77af6fd32677a974e9ad5d65dcfd72d74bf0ff657d4cee067eba595f0 diff --git a/deps/checksums/Pkg-63f4405d17e11decd2e5eb786cc491322b68c58c.tar.gz/md5 b/deps/checksums/Pkg-63f4405d17e11decd2e5eb786cc491322b68c58c.tar.gz/md5 new file mode 100644 index 0000000000000..267a11ce9e392 --- /dev/null +++ b/deps/checksums/Pkg-63f4405d17e11decd2e5eb786cc491322b68c58c.tar.gz/md5 @@ -0,0 +1 @@ +eb99c4458db02049e01122431211678a diff --git a/deps/checksums/Pkg-63f4405d17e11decd2e5eb786cc491322b68c58c.tar.gz/sha512 b/deps/checksums/Pkg-63f4405d17e11decd2e5eb786cc491322b68c58c.tar.gz/sha512 new file mode 100644 index 0000000000000..de1835da35995 --- /dev/null +++ b/deps/checksums/Pkg-63f4405d17e11decd2e5eb786cc491322b68c58c.tar.gz/sha512 @@ -0,0 +1 @@ +57fe5f9d897ff82ba64c6e4d8f102a2fc5d689340b41993c4f2cab3af0f516427d5e3696e0db75cedc49866ef19d4c87194e175f2a51391e1ae76546b10e997d diff --git a/stdlib/Pkg.version b/stdlib/Pkg.version index 06c1c50590065..464e7fd2c45a4 100644 --- a/stdlib/Pkg.version +++ b/stdlib/Pkg.version @@ -1,4 +1,4 @@ -PKG_BRANCH = master -PKG_SHA1 = 57ca49fcbb45b578b78ac77a702913b5e2de7c7c +PKG_BRANCH = release-1.8 +PKG_SHA1 = 63f4405d17e11decd2e5eb786cc491322b68c58c PKG_GIT_URL := https://github.com/JuliaLang/Pkg.jl.git PKG_TAR_URL = https://api.github.com/repos/JuliaLang/Pkg.jl/tarball/$1 From a9bf474a60208baf5307485bcbbc9ab7f8880e00 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Sat, 11 Jun 2022 16:59:49 -0400 Subject: [PATCH 265/369] Prefix Float16 intrinsics (cherry picked from commit f6518663878bbef442af566a3e91e3502d087f2c) --- src/APInt-C.cpp | 6 ++-- src/julia.expmap | 6 ---- src/julia_internal.h | 14 +++++++-- src/runtime_intrinsics.c | 64 +++++++++++++++++++++++----------------- 4 files changed, 52 insertions(+), 38 deletions(-) diff --git a/src/APInt-C.cpp b/src/APInt-C.cpp index bc0a62e21dd3e..f06d4362bf958 100644 --- a/src/APInt-C.cpp +++ b/src/APInt-C.cpp @@ -316,7 +316,7 @@ void LLVMByteSwap(unsigned numbits, integerPart *pa, integerPart *pr) { void LLVMFPtoInt(unsigned numbits, void *pa, unsigned onumbits, integerPart *pr, bool isSigned, bool *isExact) { double Val; if (numbits == 16) - Val = __gnu_h2f_ieee(*(uint16_t*)pa); + Val = julia__gnu_h2f_ieee(*(uint16_t*)pa); else if (numbits == 32) Val = *(float*)pa; else if (numbits == 64) @@ -391,7 +391,7 @@ void LLVMSItoFP(unsigned numbits, integerPart *pa, unsigned onumbits, integerPar val = a.roundToDouble(true); } if (onumbits == 16) - *(uint16_t*)pr = __gnu_f2h_ieee(val); + *(uint16_t*)pr = julia__gnu_f2h_ieee(val); else if (onumbits == 32) *(float*)pr = val; else if (onumbits == 64) @@ -408,7 +408,7 @@ void LLVMUItoFP(unsigned numbits, integerPart *pa, unsigned onumbits, integerPar val = a.roundToDouble(false); } if (onumbits == 16) - *(uint16_t*)pr = __gnu_f2h_ieee(val); + *(uint16_t*)pr = julia__gnu_f2h_ieee(val); else if (onumbits == 32) *(float*)pr = val; else if (onumbits == 64) diff --git a/src/julia.expmap b/src/julia.expmap index 2d801dceae044..6717f8d00c621 100644 --- a/src/julia.expmap +++ b/src/julia.expmap @@ -37,12 +37,6 @@ environ; __progname; - /* compiler run-time intrinsics */ - __gnu_h2f_ieee; - __extendhfsf2; - __gnu_f2h_ieee; - __truncdfhf2; - local: *; }; diff --git a/src/julia_internal.h b/src/julia_internal.h index 7e47a4c9b453f..98ef613e3be9a 100644 --- a/src/julia_internal.h +++ b/src/julia_internal.h @@ -1520,8 +1520,18 @@ jl_sym_t *_jl_symbol(const char *str, size_t len) JL_NOTSAFEPOINT; #define JL_GC_ASSERT_LIVE(x) (void)(x) #endif -float __gnu_h2f_ieee(uint16_t param) JL_NOTSAFEPOINT; -uint16_t __gnu_f2h_ieee(float param) JL_NOTSAFEPOINT; +JL_DLLEXPORT float julia__gnu_h2f_ieee(uint16_t param) JL_NOTSAFEPOINT; +JL_DLLEXPORT uint16_t julia__gnu_f2h_ieee(float param) JL_NOTSAFEPOINT; +JL_DLLEXPORT uint16_t julia__truncdfhf2(double param) JL_NOTSAFEPOINT; +//JL_DLLEXPORT double julia__extendhfdf2(uint16_t n) JL_NOTSAFEPOINT; +//JL_DLLEXPORT int32_t julia__fixhfsi(uint16_t n) JL_NOTSAFEPOINT; +//JL_DLLEXPORT int64_t julia__fixhfdi(uint16_t n) JL_NOTSAFEPOINT; +//JL_DLLEXPORT uint32_t julia__fixunshfsi(uint16_t n) JL_NOTSAFEPOINT; +//JL_DLLEXPORT uint64_t julia__fixunshfdi(uint16_t n) JL_NOTSAFEPOINT; +//JL_DLLEXPORT uint16_t julia__floatsihf(int32_t n) JL_NOTSAFEPOINT; +//JL_DLLEXPORT uint16_t julia__floatdihf(int64_t n) JL_NOTSAFEPOINT; +//JL_DLLEXPORT uint16_t julia__floatunsihf(uint32_t n) JL_NOTSAFEPOINT; +//JL_DLLEXPORT uint16_t julia__floatundihf(uint64_t n) JL_NOTSAFEPOINT; #ifdef __cplusplus } diff --git a/src/runtime_intrinsics.c b/src/runtime_intrinsics.c index 9525b655dc5e3..f505a9d5e5d5a 100644 --- a/src/runtime_intrinsics.c +++ b/src/runtime_intrinsics.c @@ -15,9 +15,6 @@ const unsigned int host_char_bit = 8; // float16 intrinsics -// TODO: use LLVM's compiler-rt on all platforms (Xcode already links compiler-rt) - -#if !defined(_OS_DARWIN_) static inline float half_to_float(uint16_t ival) JL_NOTSAFEPOINT { @@ -188,22 +185,17 @@ static inline uint16_t float_to_half(float param) JL_NOTSAFEPOINT return h; } -JL_DLLEXPORT float __gnu_h2f_ieee(uint16_t param) +JL_DLLEXPORT float julia__gnu_h2f_ieee(uint16_t param) { return half_to_float(param); } -JL_DLLEXPORT float __extendhfsf2(uint16_t param) -{ - return half_to_float(param); -} - -JL_DLLEXPORT uint16_t __gnu_f2h_ieee(float param) +JL_DLLEXPORT uint16_t julia__gnu_f2h_ieee(float param) { return float_to_half(param); } -JL_DLLEXPORT uint16_t __truncdfhf2(double param) +JL_DLLEXPORT uint16_t julia__truncdfhf2(double param) { float res = (float)param; uint32_t resi; @@ -225,7 +217,25 @@ JL_DLLEXPORT uint16_t __truncdfhf2(double param) return float_to_half(res); } -#endif +//JL_DLLEXPORT double julia__extendhfdf2(uint16_t n) { return (double)julia__gnu_h2f_ieee(n); } +//JL_DLLEXPORT int32_t julia__fixhfsi(uint16_t n) { return (int32_t)julia__gnu_h2f_ieee(n); } +//JL_DLLEXPORT int64_t julia__fixhfdi(uint16_t n) { return (int64_t)julia__gnu_h2f_ieee(n); } +//JL_DLLEXPORT uint32_t julia__fixunshfsi(uint16_t n) { return (uint32_t)julia__gnu_h2f_ieee(n); } +//JL_DLLEXPORT uint64_t julia__fixunshfdi(uint16_t n) { return (uint64_t)julia__gnu_h2f_ieee(n); } +//JL_DLLEXPORT uint16_t julia__floatsihf(int32_t n) { return julia__gnu_f2h_ieee((float)n); } +//JL_DLLEXPORT uint16_t julia__floatdihf(int64_t n) { return julia__gnu_f2h_ieee((float)n); } +//JL_DLLEXPORT uint16_t julia__floatunsihf(uint32_t n) { return julia__gnu_f2h_ieee((float)n); } +//JL_DLLEXPORT uint16_t julia__floatundihf(uint64_t n) { return julia__gnu_f2h_ieee((float)n); } +//HANDLE_LIBCALL(F16, F128, __extendhftf2) +//HANDLE_LIBCALL(F16, F80, __extendhfxf2) +//HANDLE_LIBCALL(F80, F16, __truncxfhf2) +//HANDLE_LIBCALL(F128, F16, __trunctfhf2) +//HANDLE_LIBCALL(PPCF128, F16, __trunctfhf2) +//HANDLE_LIBCALL(F16, I128, __fixhfti) +//HANDLE_LIBCALL(F16, I128, __fixunshfti) +//HANDLE_LIBCALL(I128, F16, __floattihf) +//HANDLE_LIBCALL(I128, F16, __floatuntihf) + // run time version of bitcast intrinsic JL_DLLEXPORT jl_value_t *jl_bitcast(jl_value_t *ty, jl_value_t *v) @@ -551,9 +561,9 @@ static inline unsigned select_by_size(unsigned sz) JL_NOTSAFEPOINT } #define fp_select(a, func) \ - sizeof(a) == sizeof(float) ? func##f((float)a) : func(a) + sizeof(a) <= sizeof(float) ? func##f((float)a) : func(a) #define fp_select2(a, b, func) \ - sizeof(a) == sizeof(float) ? func##f(a, b) : func(a, b) + sizeof(a) <= sizeof(float) ? func##f(a, b) : func(a, b) // fast-function generators // @@ -597,11 +607,11 @@ static inline void name(unsigned osize, void *pa, void *pr) JL_NOTSAFEPOINT \ static inline void name(unsigned osize, void *pa, void *pr) JL_NOTSAFEPOINT \ { \ uint16_t a = *(uint16_t*)pa; \ - float A = __gnu_h2f_ieee(a); \ + float A = julia__gnu_h2f_ieee(a); \ if (osize == 16) { \ float R; \ OP(&R, A); \ - *(uint16_t*)pr = __gnu_f2h_ieee(R); \ + *(uint16_t*)pr = julia__gnu_f2h_ieee(R); \ } else { \ OP((uint16_t*)pr, A); \ } \ @@ -625,11 +635,11 @@ static void jl_##name##16(unsigned runtime_nbits, void *pa, void *pb, void *pr) { \ uint16_t a = *(uint16_t*)pa; \ uint16_t b = *(uint16_t*)pb; \ - float A = __gnu_h2f_ieee(a); \ - float B = __gnu_h2f_ieee(b); \ + float A = julia__gnu_h2f_ieee(a); \ + float B = julia__gnu_h2f_ieee(b); \ runtime_nbits = 16; \ float R = OP(A, B); \ - *(uint16_t*)pr = __gnu_f2h_ieee(R); \ + *(uint16_t*)pr = julia__gnu_f2h_ieee(R); \ } // float or integer inputs, bool output @@ -650,8 +660,8 @@ static int jl_##name##16(unsigned runtime_nbits, void *pa, void *pb) JL_NOTSAFEP { \ uint16_t a = *(uint16_t*)pa; \ uint16_t b = *(uint16_t*)pb; \ - float A = __gnu_h2f_ieee(a); \ - float B = __gnu_h2f_ieee(b); \ + float A = julia__gnu_h2f_ieee(a); \ + float B = julia__gnu_h2f_ieee(b); \ runtime_nbits = 16; \ return OP(A, B); \ } @@ -691,12 +701,12 @@ static void jl_##name##16(unsigned runtime_nbits, void *pa, void *pb, void *pc, uint16_t a = *(uint16_t*)pa; \ uint16_t b = *(uint16_t*)pb; \ uint16_t c = *(uint16_t*)pc; \ - float A = __gnu_h2f_ieee(a); \ - float B = __gnu_h2f_ieee(b); \ - float C = __gnu_h2f_ieee(c); \ + float A = julia__gnu_h2f_ieee(a); \ + float B = julia__gnu_h2f_ieee(b); \ + float C = julia__gnu_h2f_ieee(c); \ runtime_nbits = 16; \ float R = OP(A, B, C); \ - *(uint16_t*)pr = __gnu_f2h_ieee(R); \ + *(uint16_t*)pr = julia__gnu_f2h_ieee(R); \ } @@ -1318,7 +1328,7 @@ static inline int fpiseq##nbits(c_type a, c_type b) JL_NOTSAFEPOINT { \ fpiseq_n(float, 32) fpiseq_n(double, 64) #define fpiseq(a,b) \ - sizeof(a) == sizeof(float) ? fpiseq32(a, b) : fpiseq64(a, b) + sizeof(a) <= sizeof(float) ? fpiseq32(a, b) : fpiseq64(a, b) bool_fintrinsic(eq,eq_float) bool_fintrinsic(ne,ne_float) @@ -1367,7 +1377,7 @@ cvt_iintrinsic(LLVMFPtoUI, fptoui) if (!(osize < 8 * sizeof(a))) \ jl_error("fptrunc: output bitsize must be < input bitsize"); \ else if (osize == 16) \ - *(uint16_t*)pr = __gnu_f2h_ieee(a); \ + *(uint16_t*)pr = julia__gnu_f2h_ieee(a); \ else if (osize == 32) \ *(float*)pr = a; \ else if (osize == 64) \ From 71d062c83e388dd945b691d96195dbe64c699959 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Sat, 11 Jun 2022 17:26:34 -0400 Subject: [PATCH 266/369] Define aliases to FP16 crt in the OJIT (cherry picked from commit ff360153dd70491c6ec7812a486c860c54a3f55c) --- src/jitlayers.cpp | 18 ++++++++++++++++-- src/jitlayers.h | 1 + test/intrinsics.jl | 24 ++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/src/jitlayers.cpp b/src/jitlayers.cpp index 93ae9b16d7f16..034cef516da5b 100644 --- a/src/jitlayers.cpp +++ b/src/jitlayers.cpp @@ -909,12 +909,26 @@ JuliaOJIT::JuliaOJIT(TargetMachine &TM, LLVMContext *LLVMCtx) } JD.addToLinkOrder(GlobalJD, orc::JITDylibLookupFlags::MatchExportedSymbolsOnly); + + orc::SymbolAliasMap jl_crt = { + { mangle("__gnu_h2f_ieee"), { mangle("julia__gnu_h2f_ieee"), JITSymbolFlags::Exported } }, + { mangle("__extendhfsf2"), { mangle("julia__gnu_h2f_ieee"), JITSymbolFlags::Exported } }, + { mangle("__gnu_f2h_ieee"), { mangle("julia__gnu_f2h_ieee"), JITSymbolFlags::Exported } }, + { mangle("__truncsfhf2"), { mangle("julia__gnu_f2h_ieee"), JITSymbolFlags::Exported } }, + { mangle("__truncdfhf2"), { mangle("julia__truncdfhf2"), JITSymbolFlags::Exported } } + }; + cantFail(GlobalJD.define(orc::symbolAliases(jl_crt))); } -void JuliaOJIT::addGlobalMapping(StringRef Name, uint64_t Addr) +orc::SymbolStringPtr JuliaOJIT::mangle(StringRef Name) { std::string MangleName = getMangledName(Name); - cantFail(JD.define(orc::absoluteSymbols({{ES.intern(MangleName), JITEvaluatedSymbol::fromPointer((void*)Addr)}}))); + return ES.intern(MangleName); +} + +void JuliaOJIT::addGlobalMapping(StringRef Name, uint64_t Addr) +{ + cantFail(JD.define(orc::absoluteSymbols({{mangle(Name), JITEvaluatedSymbol::fromPointer((void*)Addr)}}))); } void JuliaOJIT::addModule(std::unique_ptr M) diff --git a/src/jitlayers.h b/src/jitlayers.h index af47102173a7b..30e130f07273a 100644 --- a/src/jitlayers.h +++ b/src/jitlayers.h @@ -204,6 +204,7 @@ class JuliaOJIT { void RegisterJITEventListener(JITEventListener *L); #endif + orc::SymbolStringPtr mangle(StringRef Name); void addGlobalMapping(StringRef Name, uint64_t Addr); void addModule(std::unique_ptr M); diff --git a/test/intrinsics.jl b/test/intrinsics.jl index 2f2ef0cd505d5..ea373a9260d3a 100644 --- a/test/intrinsics.jl +++ b/test/intrinsics.jl @@ -164,6 +164,30 @@ end @test_intrinsic Core.Intrinsics.fptoui UInt Float16(3.3) UInt(3) end +if Sys.ARCH == :aarch64 + # On AArch64 we are following the `_Float16` ABI. Buthe these functions expect `Int16`. + # TODO: SHould we have `Chalf == Int16` and `Cfloat16 == Float16`? + extendhfsf2(x::Float16) = ccall("extern __extendhfsf2", llvmcall, Float32, (Int16,), reinterpret(Int16, x)) + gnu_h2f_ieee(x::Float16) = ccall("extern __gnu_h2f_ieee", llvmcall, Float32, (Int16,), reinterpret(Int16, x)) + truncsfhf2(x::Float32) = reinterpret(Float16, ccall("extern __truncsfhf2", llvmcall, Int16, (Float32,), x)) + gnu_f2h_ieee(x::Float32) = reinterpret(Float16, ccall("extern __gnu_f2h_ieee", llvmcall, Int16, (Float32,), x)) + truncdfhf2(x::Float64) = reinterpret(Float16, ccall("extern __truncdfhf2", llvmcall, Int16, (Float64,), x)) +else + extendhfsf2(x::Float16) = ccall("extern __extendhfsf2", llvmcall, Float32, (Float16,), x) + gnu_h2f_ieee(x::Float16) = ccall("extern __gnu_h2f_ieee", llvmcall, Float32, (Float16,), x) + truncsfhf2(x::Float32) = ccall("extern __truncsfhf2", llvmcall, Float16, (Float32,), x) + gnu_f2h_ieee(x::Float32) = ccall("extern __gnu_f2h_ieee", llvmcall, Float16, (Float32,), x) + truncdfhf2(x::Float64) = ccall("extern __truncdfhf2", llvmcall, Float16, (Float64,), x) +end + +@testset "Float16 intrinsics (crt)" begin + @test extendhfsf2(Float16(3.3)) == 3.3007812f0 + @test gnu_h2f_ieee(Float16(3.3)) == 3.3007812f0 + @test truncsfhf2(3.3f0) == Float16(3.3) + @test gnu_f2h_ieee(3.3f0) == Float16(3.3) + @test truncdfhf2(3.3) == Float16(3.3) +end + using Base.Experimental: @force_compile @test_throws ConcurrencyViolationError("invalid atomic ordering") (@force_compile; Core.Intrinsics.atomic_fence(:u)) === nothing @test_throws ConcurrencyViolationError("invalid atomic ordering") (@force_compile; Core.Intrinsics.atomic_fence(Symbol("u", "x"))) === nothing From 7ff795cae919e62f2269e3844aa9380bf28107b8 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Sun, 12 Jun 2022 11:59:05 -0400 Subject: [PATCH 267/369] Emit aliases into the system image - Put the interposer in llvm.compiler.used. - Injecting the aliases after optimization: Our multiversioning pass interacts badly with the llvm.compiler.used gvar. - run `postopt` passes independent of optimization passes. (cherry picked from commit 3407fb3f7f93e4a372393ab81c7a985a99867c50) Co-authored-by: Tim Besard Co-authored-by: Valentin Churavy --- src/aotcompile.cpp | 48 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/src/aotcompile.cpp b/src/aotcompile.cpp index 1c5ccbebcb0a7..4d21e307586dc 100644 --- a/src/aotcompile.cpp +++ b/src/aotcompile.cpp @@ -20,6 +20,8 @@ #include #include #include +#include +#include #include #include #include @@ -31,6 +33,9 @@ #include #include #include +#include +#include +#include #if defined(USE_POLLY) #include #include @@ -431,6 +436,23 @@ static void reportWriterError(const ErrorInfoBase &E) jl_safe_printf("ERROR: failed to emit output file %s\n", err.c_str()); } +static void injectCRTAlias(Module &M, StringRef name, StringRef alias, FunctionType *FT) +{ + Function *target = M.getFunction(alias); + if (!target) { + target = Function::Create(FT, Function::ExternalLinkage, alias, M); + } + Function *interposer = Function::Create(FT, Function::WeakAnyLinkage, name, M); + appendToCompilerUsed(M, {interposer}); + + llvm::IRBuilder<> builder(BasicBlock::Create(M.getContext(), "top", interposer)); + SmallVector CallArgs; + for (auto &arg : interposer->args()) + CallArgs.push_back(&arg); + auto val = builder.CreateCall(target, CallArgs); + builder.CreateRet(val); +} + // takes the running content that has collected in the shadow module and dump it to disk // this builds the object file portion of the sysimage files for fast startup @@ -475,7 +497,7 @@ void jl_dump_native_impl(void *native_code, CodeGenOpt::Aggressive // -O3 TODO: respect command -O0 flag? )); - legacy::PassManager PM; + legacy::PassManager PM, postopt; addTargetPasses(&PM, TM.get()); // set up optimization passes @@ -500,12 +522,12 @@ void jl_dump_native_impl(void *native_code, addMachinePasses(&PM, TM.get(), jl_options.opt_level); } if (bc_fname) - PM.add(createBitcodeWriterPass(bc_OS)); + postopt.add(createBitcodeWriterPass(bc_OS)); if (obj_fname) - if (TM->addPassesToEmitFile(PM, obj_OS, nullptr, CGFT_ObjectFile, false)) + if (TM->addPassesToEmitFile(postopt, obj_OS, nullptr, CGFT_ObjectFile, false)) jl_safe_printf("ERROR: target does not support generation of object files\n"); if (asm_fname) - if (TM->addPassesToEmitFile(PM, asm_OS, nullptr, CGFT_AssemblyFile, false)) + if (TM->addPassesToEmitFile(postopt, asm_OS, nullptr, CGFT_AssemblyFile, false)) jl_safe_printf("ERROR: target does not support generation of object files\n"); // Reset the target triple to make sure it matches the new target machine @@ -539,6 +561,24 @@ void jl_dump_native_impl(void *native_code, // do the actual work auto add_output = [&] (Module &M, StringRef unopt_bc_Name, StringRef bc_Name, StringRef obj_Name, StringRef asm_Name) { PM.run(M); + + // We would like to emit an alias or an weakref alias to redirect these symbols + // but LLVM doesn't let us emit a GlobalAlias to a declaration... + // So for now we inject a definition of these functions that calls our runtime + // functions. We do so after optimization to avoid cloning these functions. + injectCRTAlias(M, "__gnu_h2f_ieee", "julia__gnu_h2f_ieee", + FunctionType::get(Type::getFloatTy(Context), { Type::getHalfTy(Context) }, false)); + injectCRTAlias(M, "__extendhfsf2", "julia__gnu_h2f_ieee", + FunctionType::get(Type::getFloatTy(Context), { Type::getHalfTy(Context) }, false)); + injectCRTAlias(M, "__gnu_f2h_ieee", "julia__gnu_f2h_ieee", + FunctionType::get(Type::getHalfTy(Context), { Type::getFloatTy(Context) }, false)); + injectCRTAlias(M, "__truncsfhf2", "julia__gnu_f2h_ieee", + FunctionType::get(Type::getHalfTy(Context), { Type::getFloatTy(Context) }, false)); + injectCRTAlias(M, "__truncdfhf2", "julia__truncdfhf2", + FunctionType::get(Type::getHalfTy(Context), { Type::getDoubleTy(Context) }, false)); + + postopt.run(M); + if (unopt_bc_fname) emit_result(unopt_bc_Archive, unopt_bc_Buffer, unopt_bc_Name, outputs); if (bc_fname) From 4b5ea08749b5b4b53d0882676496df39ea496046 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Mon, 25 Apr 2022 11:50:53 +0900 Subject: [PATCH 268/369] improve `cat` inferrability (#45028) Make `cat` inferrable even if its arguments are not fully constant: ```julia julia> r = rand(Float32, 56, 56, 64, 1); julia> f(r) = cat(r, r, dims=(3,)) f (generic function with 1 method) julia> @inferred f(r); julia> last(@code_typed f(r)) Array{Float32, 4} ``` After descending into its call graph, I found that constant propagation is prohibited at `cat_t(::Type{T}, X...; dims)` due to the method instance heuristic, i.e. its body is considered to be too complex for successful inlining although it's explicitly annotated as `@inline`. But for this case, the constant propagation is greatly helpful both for abstract interpretation and optimization since it can improve the return type inference. Since it is not an easy task to improve the method instance heuristic, which is our primary logic for constant propagation, this commit does a quick fix by helping inference with the `@constprop` annotation. There is another issue that currently there is no good way to properly apply `@constprop`/`@inline` effects to a keyword function (as a note, this is a general issue of macro annotations on a method definition). So this commit also changes some internal helper functions of `cat` so that now they are not keyword ones: the changes are also necessary for the `@inline` annotation on `cat_t` to be effective to trick the method instance heuristic. (cherry picked from commit 65b9be408674bd6b08ea302571b1ac0f52b7a9f7) --- base/abstractarray.jl | 33 +++++++++++++---------------- stdlib/LinearAlgebra/src/special.jl | 4 ++-- test/abstractarray.jl | 4 ++++ test/ambiguous.jl | 15 +++---------- 4 files changed, 24 insertions(+), 32 deletions(-) diff --git a/base/abstractarray.jl b/base/abstractarray.jl index 49aec27cb0a58..97c675b90e6d9 100644 --- a/base/abstractarray.jl +++ b/base/abstractarray.jl @@ -1716,13 +1716,7 @@ end _cs(d, a, b) = (a == b ? a : throw(DimensionMismatch( "mismatch in dimension $d (expected $a got $b)"))) -function dims2cat(::Val{dims}) where dims - if any(≤(0), dims) - throw(ArgumentError("All cat dimensions must be positive integers, but got $dims")) - end - ntuple(in(dims), maximum(dims)) -end - +dims2cat(::Val{dims}) where dims = dims2cat(dims) function dims2cat(dims) if any(≤(0), dims) throw(ArgumentError("All cat dimensions must be positive integers, but got $dims")) @@ -1730,9 +1724,8 @@ function dims2cat(dims) ntuple(in(dims), maximum(dims)) end -_cat(dims, X...) = cat_t(promote_eltypeof(X...), X...; dims=dims) +_cat(dims, X...) = _cat_t(dims, promote_eltypeof(X...), X...) -@inline cat_t(::Type{T}, X...; dims) where {T} = _cat_t(dims, T, X...) @inline function _cat_t(dims, ::Type{T}, X...) where {T} catdims = dims2cat(dims) shape = cat_size_shape(catdims, X...) @@ -1742,6 +1735,9 @@ _cat(dims, X...) = cat_t(promote_eltypeof(X...), X...; dims=dims) end return __cat(A, shape, catdims, X...) end +# this version of `cat_t` is not very kind for inference and so its usage should be avoided, +# nevertheless it is here just for compat after https://github.com/JuliaLang/julia/pull/45028 +@inline cat_t(::Type{T}, X...; dims) where {T} = _cat_t(dims, T, X...) # Why isn't this called `__cat!`? __cat(A, shape, catdims, X...) = __cat_offset!(A, shape, catdims, ntuple(zero, length(shape)), X...) @@ -1880,8 +1876,8 @@ julia> reduce(hcat, vs) """ hcat(X...) = cat(X...; dims=Val(2)) -typed_vcat(::Type{T}, X...) where T = cat_t(T, X...; dims=Val(1)) -typed_hcat(::Type{T}, X...) where T = cat_t(T, X...; dims=Val(2)) +typed_vcat(::Type{T}, X...) where T = _cat_t(Val(1), T, X...) +typed_hcat(::Type{T}, X...) where T = _cat_t(Val(2), T, X...) """ cat(A...; dims) @@ -1917,7 +1913,8 @@ julia> cat(true, trues(2,2), trues(4)', dims=(1,2)) ``` """ @inline cat(A...; dims) = _cat(dims, A...) -_cat(catdims, A::AbstractArray{T}...) where {T} = cat_t(T, A...; dims=catdims) +# `@constprop :aggressive` allows `catdims` to be propagated as constant improving return type inference +@constprop :aggressive _cat(catdims, A::AbstractArray{T}...) where {T} = _cat_t(catdims, T, A...) # The specializations for 1 and 2 inputs are important # especially when running with --inline=no, see #11158 @@ -1928,12 +1925,12 @@ hcat(A::AbstractArray) = cat(A; dims=Val(2)) hcat(A::AbstractArray, B::AbstractArray) = cat(A, B; dims=Val(2)) hcat(A::AbstractArray...) = cat(A...; dims=Val(2)) -typed_vcat(T::Type, A::AbstractArray) = cat_t(T, A; dims=Val(1)) -typed_vcat(T::Type, A::AbstractArray, B::AbstractArray) = cat_t(T, A, B; dims=Val(1)) -typed_vcat(T::Type, A::AbstractArray...) = cat_t(T, A...; dims=Val(1)) -typed_hcat(T::Type, A::AbstractArray) = cat_t(T, A; dims=Val(2)) -typed_hcat(T::Type, A::AbstractArray, B::AbstractArray) = cat_t(T, A, B; dims=Val(2)) -typed_hcat(T::Type, A::AbstractArray...) = cat_t(T, A...; dims=Val(2)) +typed_vcat(T::Type, A::AbstractArray) = _cat_t(Val(1), T, A) +typed_vcat(T::Type, A::AbstractArray, B::AbstractArray) = _cat_t(Val(1), T, A, B) +typed_vcat(T::Type, A::AbstractArray...) = _cat_t(Val(1), T, A...) +typed_hcat(T::Type, A::AbstractArray) = _cat_t(Val(2), T, A) +typed_hcat(T::Type, A::AbstractArray, B::AbstractArray) = _cat_t(Val(2), T, A, B) +typed_hcat(T::Type, A::AbstractArray...) = _cat_t(Val(2), T, A...) # 2d horizontal and vertical concatenation diff --git a/stdlib/LinearAlgebra/src/special.jl b/stdlib/LinearAlgebra/src/special.jl index beac0c524f2f4..1ead4826127c2 100644 --- a/stdlib/LinearAlgebra/src/special.jl +++ b/stdlib/LinearAlgebra/src/special.jl @@ -414,14 +414,14 @@ const _TypedDenseConcatGroup{T} = Union{Vector{T}, Adjoint{T,Vector{T}}, Transpo promote_to_array_type(::Tuple{Vararg{Union{_DenseConcatGroup,UniformScaling}}}) = Matrix -Base._cat(dims, xs::_DenseConcatGroup...) = Base.cat_t(promote_eltype(xs...), xs...; dims=dims) +Base._cat(dims, xs::_DenseConcatGroup...) = Base._cat_t(dims, promote_eltype(xs...), xs...) vcat(A::Vector...) = Base.typed_vcat(promote_eltype(A...), A...) vcat(A::_DenseConcatGroup...) = Base.typed_vcat(promote_eltype(A...), A...) hcat(A::Vector...) = Base.typed_hcat(promote_eltype(A...), A...) hcat(A::_DenseConcatGroup...) = Base.typed_hcat(promote_eltype(A...), A...) hvcat(rows::Tuple{Vararg{Int}}, xs::_DenseConcatGroup...) = Base.typed_hvcat(promote_eltype(xs...), rows, xs...) # For performance, specially handle the case where the matrices/vectors have homogeneous eltype -Base._cat(dims, xs::_TypedDenseConcatGroup{T}...) where {T} = Base.cat_t(T, xs...; dims=dims) +Base._cat(dims, xs::_TypedDenseConcatGroup{T}...) where {T} = Base._cat_t(dims, T, xs...) vcat(A::_TypedDenseConcatGroup{T}...) where {T} = Base.typed_vcat(T, A...) hcat(A::_TypedDenseConcatGroup{T}...) where {T} = Base.typed_hcat(T, A...) hvcat(rows::Tuple{Vararg{Int}}, xs::_TypedDenseConcatGroup{T}...) where {T} = Base.typed_hvcat(T, rows, xs...) diff --git a/test/abstractarray.jl b/test/abstractarray.jl index c811f0d11176f..f504af8a08247 100644 --- a/test/abstractarray.jl +++ b/test/abstractarray.jl @@ -733,6 +733,10 @@ function test_cat(::Type{TestAbstractArray}) cat3v(As) = cat(As...; dims=Val(3)) @test @inferred(cat3v(As)) == zeros(2, 2, 2) @test @inferred(cat(As...; dims=Val((1,2)))) == zeros(4, 4) + + r = rand(Float32, 56, 56, 64, 1); + f(r) = cat(r, r, dims=(3,)) + @inferred f(r); end function test_ind2sub(::Type{TestAbstractArray}) diff --git a/test/ambiguous.jl b/test/ambiguous.jl index e7b3b13fba0ff..8d8c3efab53b9 100644 --- a/test/ambiguous.jl +++ b/test/ambiguous.jl @@ -172,20 +172,11 @@ using LinearAlgebra, SparseArrays, SuiteSparse # not using isempty so this prints more information when it fails @testset "detect_ambiguities" begin let ambig = Set{Any}(((m1.sig, m2.sig) for (m1, m2) in detect_ambiguities(Core, Base; recursive=true, ambiguous_bottom=false, allowed_undefineds))) - @test isempty(ambig) - expect = [] good = true - while !isempty(ambig) - sigs = pop!(ambig) - i = findfirst(==(sigs), expect) - if i === nothing - println(stderr, "push!(expect, (", sigs[1], ", ", sigs[2], "))") - good = false - continue - end - deleteat!(expect, i) + for (sig1, sig2) in ambig + @test sig1 === sig2 # print this ambiguity + good = false end - @test isempty(expect) @test good end From 5cd84443d2d56cd12079bd0ad917cbaf2d059c3c Mon Sep 17 00:00:00 2001 From: N5N3 <2642243996@qq.com> Date: Tue, 26 Jul 2022 06:34:03 +0800 Subject: [PATCH 269/369] `copyto!` fix for `BitArray`/`AbstractArray`, fixes #25968 (#46161) 1. map `copyto!(::BitArray, n1, ::BitArray, n2, l)` to `Base.unsafe_copyto!` 2. add missing unaliasing in `copyto!` for `AbstractArray` (cherry picked from commit 0ea2b2d2d724a54f8531908e85857e2f5b72dc4a) --- base/abstractarray.jl | 15 ++++++++------- base/bitarray.jl | 5 +++-- test/bitarray.jl | 9 +++++---- test/copy.jl | 7 +++++++ 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/base/abstractarray.jl b/base/abstractarray.jl index 97c675b90e6d9..a27a9cd7271b5 100644 --- a/base/abstractarray.jl +++ b/base/abstractarray.jl @@ -879,13 +879,12 @@ See also [`copyto!`](@ref). is available from the `Future` standard library as `Future.copy!`. """ function copy!(dst::AbstractVector, src::AbstractVector) + firstindex(dst) == firstindex(src) || throw(ArgumentError( + "vectors must have the same offset for copy! (consider using `copyto!`)")) if length(dst) != length(src) resize!(dst, length(src)) end - for i in eachindex(dst, src) - @inbounds dst[i] = src[i] - end - dst + copyto!(dst, src) end function copy!(dst::AbstractArray, src::AbstractArray) @@ -1084,8 +1083,9 @@ function copyto!(dest::AbstractArray, dstart::Integer, destinds, srcinds = LinearIndices(dest), LinearIndices(src) (checkbounds(Bool, destinds, dstart) && checkbounds(Bool, destinds, dstart+n-1)) || throw(BoundsError(dest, dstart:dstart+n-1)) (checkbounds(Bool, srcinds, sstart) && checkbounds(Bool, srcinds, sstart+n-1)) || throw(BoundsError(src, sstart:sstart+n-1)) - @inbounds for i = 0:(n-1) - dest[dstart+i] = src[sstart+i] + src′ = unalias(dest, src) + @inbounds for i = 0:n-1 + dest[dstart+i] = src′[sstart+i] end return dest end @@ -1107,11 +1107,12 @@ function copyto!(B::AbstractVecOrMat{R}, ir_dest::AbstractRange{Int}, jr_dest::A end @boundscheck checkbounds(B, ir_dest, jr_dest) @boundscheck checkbounds(A, ir_src, jr_src) + A′ = unalias(B, A) jdest = first(jr_dest) for jsrc in jr_src idest = first(ir_dest) for isrc in ir_src - @inbounds B[idest,jdest] = A[isrc,jsrc] + @inbounds B[idest,jdest] = A′[isrc,jsrc] idest += step(ir_dest) end jdest += step(jr_dest) diff --git a/base/bitarray.jl b/base/bitarray.jl index 7dd337c15867f..b8a60c1afd35d 100644 --- a/base/bitarray.jl +++ b/base/bitarray.jl @@ -458,10 +458,11 @@ function unsafe_copyto!(dest::BitArray, doffs::Integer, src::Union{BitArray,Arra return dest end -copyto!(dest::BitArray, doffs::Integer, src::Array, soffs::Integer, n::Integer) = +copyto!(dest::BitArray, doffs::Integer, src::Union{BitArray,Array}, soffs::Integer, n::Integer) = _copyto_int!(dest, Int(doffs), src, Int(soffs), Int(n)) -function _copyto_int!(dest::BitArray, doffs::Int, src::Array, soffs::Int, n::Int) +function _copyto_int!(dest::BitArray, doffs::Int, src::Union{BitArray,Array}, soffs::Int, n::Int) n == 0 && return dest + n < 0 && throw(ArgumentError("Number of elements to copy must be nonnegative.")) soffs < 1 && throw(BoundsError(src, soffs)) doffs < 1 && throw(BoundsError(dest, doffs)) soffs+n-1 > length(src) && throw(BoundsError(src, length(src)+1)) diff --git a/test/bitarray.jl b/test/bitarray.jl index 2add644cb1caa..3ac9f655dffcc 100644 --- a/test/bitarray.jl +++ b/test/bitarray.jl @@ -15,12 +15,11 @@ bitcheck(x) = true bcast_setindex!(b, x, I...) = (b[I...] .= x; b) function check_bitop_call(ret_type, func, args...; kwargs...) - r1 = func(args...; kwargs...) r2 = func(map(x->(isa(x, BitArray) ? Array(x) : x), args)...; kwargs...) - ret_type ≢ nothing && !isa(r1, ret_type) && @show ret_type, typeof(r1) - ret_type ≢ nothing && @test isa(r1, ret_type) + r1 = func(args...; kwargs...) + ret_type ≢ nothing && (@test isa(r1, ret_type) || @show ret_type, typeof(r1)) @test tc(r1, r2) - @test isequal(r1, ret_type ≡ nothing ? r2 : r2) + @test isequal(r1, r2) @test bitcheck(r1) end macro check_bit_operation(ex, ret_type) @@ -499,12 +498,14 @@ timesofar("constructors") end end + self_copyto!(a, n1, n2, l) = copyto!(a, n1, a, n2, l) for p1 = [rand(1:v1) 1 63 64 65 191 192 193] for p2 = [rand(1:v1) 1 63 64 65 191 192 193] for n = 0 : min(v1 - p1 + 1, v1 - p2 + 1) b1 = bitrand(v1) b2 = bitrand(v1) @check_bit_operation copyto!(b1, p1, b2, p2, n) BitVector + @check_bit_operation self_copyto!(b1, p1, p2, n) BitVector end end end diff --git a/test/copy.jl b/test/copy.jl index 04fda36728e62..c4fcff40f2b3f 100644 --- a/test/copy.jl +++ b/test/copy.jl @@ -245,3 +245,10 @@ end @testset "deepcopy_internal arrays" begin @test (@inferred Base.deepcopy_internal(zeros(), IdDict())) == zeros() end + +@testset "`copyto!`'s unaliasing" begin + a = view([1:3;], :) + @test copyto!(a, 2, a, 1, 2) == [1;1:2;] + a = [1:3;] + @test copyto!(a, 2:3, 1:1, a, 1:2, 1:1) == [1;1:2;] +end From 2415a1487e6c73c397460b98667421fd82b52ab5 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Fri, 29 Jul 2022 20:01:39 -0400 Subject: [PATCH 270/369] dump: ensure we generate the whole backedge graph (#46171) The edge-restore algorithm here is pretty bad now, but this should hopefully fix #45444 (cherry picked from commit 6b51780a47b9dfe44462a1656d353ded2c960d38) --- src/dump.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/dump.c b/src/dump.c index f04a6b27d8099..44f6262f37d5c 100644 --- a/src/dump.c +++ b/src/dump.c @@ -257,6 +257,7 @@ static int has_backedge_to_worklist(jl_method_instance_t *mi, htable_t *visited) if (*bp != HT_NOTFOUND) return (char*)*bp - (char*)HT_NOTFOUND - 1; *bp = (void*)((char*)HT_NOTFOUND + 1); // preliminarily mark as "not found" + // TODO: this algorithm deals with cycles incorrectly jl_module_t *mod = mi->def.module; if (jl_is_method(mod)) mod = ((jl_method_t*)mod)->module; @@ -1122,7 +1123,7 @@ static void collect_backedges(jl_method_instance_t *callee) JL_GC_DISABLED // - if the method is owned by a worklist module, add it to the list of things to be // fully serialized // - otherwise (i.e., if it's an external method), check all of its specializations. -// Collect backedges from those that are not being fully serialized. +// Collect all external backedges (may be needed later when we invert this list). static int jl_collect_methcache_from_mod(jl_typemap_entry_t *ml, void *closure) JL_GC_DISABLED { jl_array_t *s = (jl_array_t*)closure; @@ -1136,7 +1137,7 @@ static int jl_collect_methcache_from_mod(jl_typemap_entry_t *ml, void *closure) size_t i, l = jl_svec_len(specializations); for (i = 0; i < l; i++) { jl_method_instance_t *callee = (jl_method_instance_t*)jl_svecref(specializations, i); - if ((jl_value_t*)callee != jl_nothing && !method_instance_in_queue(callee)) + if ((jl_value_t*)callee != jl_nothing) collect_backedges(callee); } } @@ -1199,6 +1200,8 @@ static void jl_collect_extext_methods_from_mod(jl_array_t *s, jl_module_t *m) JL // flatten the backedge map reachable from caller into callees static void jl_collect_backedges_to(jl_method_instance_t *caller, htable_t *all_callees) JL_GC_DISABLED { + if (module_in_worklist(caller->def.method->module) || method_instance_in_queue(caller)) + return; jl_array_t **pcallees = (jl_array_t**)ptrhash_bp(&edges_map, (void*)caller), *callees = *pcallees; if (callees != HT_NOTFOUND) { @@ -1227,7 +1230,10 @@ static void jl_collect_backedges( /* edges */ jl_array_t *s, /* ext_targets */ j for (i = 0; i < edges_map.size; i += 2) { jl_method_instance_t *caller = (jl_method_instance_t*)table[i]; jl_array_t *callees = (jl_array_t*)table[i + 1]; - if (callees != HT_NOTFOUND && (module_in_worklist(caller->def.method->module) || method_instance_in_queue(caller))) { + if (callees == HT_NOTFOUND) + continue; + assert(jl_is_method_instance(caller) && jl_is_method(caller->def.method)); + if (module_in_worklist(caller->def.method->module) || method_instance_in_queue(caller)) { size_t i, l = jl_array_len(callees); for (i = 0; i < l; i++) { jl_value_t *c = jl_array_ptr_ref(callees, i); From 4fa7980e065d50cc4e92e157d3b89f6b1fa08be7 Mon Sep 17 00:00:00 2001 From: Gautam Mishra Date: Mon, 25 Jul 2022 03:46:01 +0530 Subject: [PATCH 271/369] Fix rem2pi for NaN inputs, fixes #32888. (#36420) (cherry picked from commit 665b03e28248e8b6b5d4492887a9621e8107e522) --- base/math.jl | 8 ++++++++ test/numbers.jl | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/base/math.jl b/base/math.jl index 47f9512d4efff..681cd07453def 100644 --- a/base/math.jl +++ b/base/math.jl @@ -1131,6 +1131,8 @@ julia> rem2pi(7pi/4, RoundDown) """ function rem2pi end function rem2pi(x::Float64, ::RoundingMode{:Nearest}) + isnan(x) && return NaN + abs(x) < pi && return x n,y = rem_pio2_kernel(x) @@ -1154,6 +1156,8 @@ function rem2pi(x::Float64, ::RoundingMode{:Nearest}) end end function rem2pi(x::Float64, ::RoundingMode{:ToZero}) + isnan(x) && return NaN + ax = abs(x) ax <= 2*Float64(pi,RoundDown) && return x @@ -1179,6 +1183,8 @@ function rem2pi(x::Float64, ::RoundingMode{:ToZero}) copysign(z,x) end function rem2pi(x::Float64, ::RoundingMode{:Down}) + isnan(x) && return NaN + if x < pi4o2_h if x >= 0 return x @@ -1208,6 +1214,8 @@ function rem2pi(x::Float64, ::RoundingMode{:Down}) end end function rem2pi(x::Float64, ::RoundingMode{:Up}) + isnan(x) && return NaN + if x > -pi4o2_h if x <= 0 return x diff --git a/test/numbers.jl b/test/numbers.jl index 38c7c5c9b9e13..7520fbf3a2b2f 100644 --- a/test/numbers.jl +++ b/test/numbers.jl @@ -2611,6 +2611,13 @@ end @test rem2pi(T(-8), RoundUp) ≈ -8+2pi end +@testset "PR #36420 $T" for T in (Float16, Float32, Float64) + @test rem2pi(T(NaN), RoundToZero) === T(NaN) + @test rem2pi(T(NaN), RoundNearest) === T(NaN) + @test rem2pi(T(NaN), RoundDown) === T(NaN) + @test rem2pi(T(NaN), RoundUp) === T(NaN) +end + import Base.^ struct PR20530; end struct PR20889; x; end From 87d89f7af625b2596f30c40f4d5e8e32d73c7443 Mon Sep 17 00:00:00 2001 From: Oscar Smith Date: Mon, 25 Jul 2022 15:21:43 -0400 Subject: [PATCH 272/369] fix rem2pi for non-finite arguments (#46163) (cherry picked from commit 73c1eeba661f5482ef84a8e0f3e8f535c8cb13d6) --- base/math.jl | 8 ++++---- test/numbers.jl | 10 ++++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/base/math.jl b/base/math.jl index 681cd07453def..1f194f73ca7f9 100644 --- a/base/math.jl +++ b/base/math.jl @@ -1131,7 +1131,7 @@ julia> rem2pi(7pi/4, RoundDown) """ function rem2pi end function rem2pi(x::Float64, ::RoundingMode{:Nearest}) - isnan(x) && return NaN + isfinite(x) || return NaN abs(x) < pi && return x @@ -1156,7 +1156,7 @@ function rem2pi(x::Float64, ::RoundingMode{:Nearest}) end end function rem2pi(x::Float64, ::RoundingMode{:ToZero}) - isnan(x) && return NaN + isfinite(x) || return NaN ax = abs(x) ax <= 2*Float64(pi,RoundDown) && return x @@ -1183,7 +1183,7 @@ function rem2pi(x::Float64, ::RoundingMode{:ToZero}) copysign(z,x) end function rem2pi(x::Float64, ::RoundingMode{:Down}) - isnan(x) && return NaN + isfinite(x) || return NaN if x < pi4o2_h if x >= 0 @@ -1214,7 +1214,7 @@ function rem2pi(x::Float64, ::RoundingMode{:Down}) end end function rem2pi(x::Float64, ::RoundingMode{:Up}) - isnan(x) && return NaN + isfinite(x) || return NaN if x > -pi4o2_h if x <= 0 diff --git a/test/numbers.jl b/test/numbers.jl index 7520fbf3a2b2f..55729ca3d3b30 100644 --- a/test/numbers.jl +++ b/test/numbers.jl @@ -2612,10 +2612,12 @@ end end @testset "PR #36420 $T" for T in (Float16, Float32, Float64) - @test rem2pi(T(NaN), RoundToZero) === T(NaN) - @test rem2pi(T(NaN), RoundNearest) === T(NaN) - @test rem2pi(T(NaN), RoundDown) === T(NaN) - @test rem2pi(T(NaN), RoundUp) === T(NaN) + for r in (RoundToZero, RoundNearest, RoundDown, RoundUp) + for x in (Inf, -Inf, NaN, -NaN) + @test isnan(rem2pi(T(x), r)) + @test rem2pi(T(x), r) isa T + end + end end import Base.^ From 3e4646d33be63d762c549c87e177c539c07e4100 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Fri, 22 Jul 2022 00:21:33 +0100 Subject: [PATCH 273/369] [LinearAlgebra] Support more env variables to set OpenBLAS threads (#46118) (cherry picked from commit 6009ae9ca25d7c63c8a449a83722b8d93849a29f) --- stdlib/LinearAlgebra/src/LinearAlgebra.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stdlib/LinearAlgebra/src/LinearAlgebra.jl b/stdlib/LinearAlgebra/src/LinearAlgebra.jl index 86e07e118c708..9e1e75126274b 100644 --- a/stdlib/LinearAlgebra/src/LinearAlgebra.jl +++ b/stdlib/LinearAlgebra/src/LinearAlgebra.jl @@ -582,7 +582,8 @@ function __init__() # register a hook to disable BLAS threading Base.at_disable_library_threading(() -> BLAS.set_num_threads(1)) - if !haskey(ENV, "OPENBLAS_NUM_THREADS") + # https://github.com/xianyi/OpenBLAS/blob/c43ec53bdd00d9423fc609d7b7ecb35e7bf41b85/README.md#setting-the-number-of-threads-using-environment-variables + if !haskey(ENV, "OPENBLAS_NUM_THREADS") && !haskey(ENV, "GOTO_NUM_THREADS") && !haskey(ENV, "OMP_NUM_THREADS") @static if Sys.isapple() && Base.BinaryPlatforms.arch(Base.BinaryPlatforms.HostPlatform()) == "aarch64" BLAS.set_num_threads(max(1, Sys.CPU_THREADS)) else From 50bbad7ecdf135a3ad67737d3e9a69550e6af93a Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Sat, 6 Aug 2022 02:27:20 -0400 Subject: [PATCH 274/369] Lazily initialize Profile buffer (#46239) (cherry picked from commit 72473aecea477b3d9e01160ed0e9aa822657934f) --- src/signal-handling.c | 136 ++++++++++++++++---------------- src/signals-unix.c | 8 ++ stdlib/Profile/src/Profile.jl | 39 +++++++-- stdlib/Profile/test/runtests.jl | 2 + 4 files changed, 111 insertions(+), 74 deletions(-) diff --git a/src/signal-handling.c b/src/signal-handling.c index acaa934397485..290731a6efbb6 100644 --- a/src/signal-handling.c +++ b/src/signal-handling.c @@ -35,6 +35,74 @@ void jl_lock_profile(void); void jl_unlock_profile(void); void jl_shuffle_int_array_inplace(volatile uint64_t *carray, size_t size, uint64_t *seed); +/////////////////////// +// Utility functions // +/////////////////////// +JL_DLLEXPORT int jl_profile_init(size_t maxsize, uint64_t delay_nsec) +{ + bt_size_max = maxsize; + nsecprof = delay_nsec; + if (bt_data_prof != NULL) + free((void*)bt_data_prof); + if (profile_round_robin_thread_order == NULL) { + // NOTE: We currently only allocate this once, since jl_n_threads cannot change + // during execution of a julia process. If/when this invariant changes in the + // future, this will have to be adjusted. + profile_round_robin_thread_order = (uint64_t*) calloc(jl_n_threads, sizeof(uint64_t)); + for (int i = 0; i < jl_n_threads; i++) { + profile_round_robin_thread_order[i] = i; + } + } + profile_cong_rng_seed = jl_rand(); + unbias_cong(jl_n_threads, &profile_cong_rng_unbias); + bt_data_prof = (jl_bt_element_t*) calloc(maxsize, sizeof(jl_bt_element_t)); + if (bt_data_prof == NULL && maxsize > 0) + return -1; + bt_size_cur = 0; + return 0; +} + +void jl_shuffle_int_array_inplace(volatile uint64_t *carray, size_t size, uint64_t *seed) { + // The "modern Fisher–Yates shuffle" - O(n) algorithm + // https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm + for (size_t i = size - 1; i >= 1; --i) { + size_t j = cong(i, profile_cong_rng_unbias, seed); + uint64_t tmp = carray[j]; + carray[j] = carray[i]; + carray[i] = tmp; + } +} + +JL_DLLEXPORT uint8_t *jl_profile_get_data(void) +{ + return (uint8_t*) bt_data_prof; +} + +JL_DLLEXPORT size_t jl_profile_len_data(void) +{ + return bt_size_cur; +} + +JL_DLLEXPORT size_t jl_profile_maxlen_data(void) +{ + return bt_size_max; +} + +JL_DLLEXPORT uint64_t jl_profile_delay_nsec(void) +{ + return nsecprof; +} + +JL_DLLEXPORT void jl_profile_clear_data(void) +{ + bt_size_cur = 0; +} + +JL_DLLEXPORT int jl_profile_is_running(void) +{ + return running; +} + JL_DLLEXPORT int jl_profile_is_buffer_full(void) { // declare buffer full if there isn't enough room to take samples across all threads @@ -323,74 +391,6 @@ void jl_critical_error(int sig, bt_context_t *context, jl_task_t *ct) jl_gc_debug_critical_error(); } -/////////////////////// -// Utility functions // -/////////////////////// -JL_DLLEXPORT int jl_profile_init(size_t maxsize, uint64_t delay_nsec) -{ - bt_size_max = maxsize; - nsecprof = delay_nsec; - if (bt_data_prof != NULL) - free((void*)bt_data_prof); - if (profile_round_robin_thread_order == NULL) { - // NOTE: We currently only allocate this once, since jl_n_threads cannot change - // during execution of a julia process. If/when this invariant changes in the - // future, this will have to be adjusted. - profile_round_robin_thread_order = (uint64_t*) calloc(jl_n_threads, sizeof(uint64_t)); - for (int i = 0; i < jl_n_threads; i++) { - profile_round_robin_thread_order[i] = i; - } - } - profile_cong_rng_seed = jl_rand(); - unbias_cong(jl_n_threads, &profile_cong_rng_unbias); - bt_data_prof = (jl_bt_element_t*) calloc(maxsize, sizeof(jl_bt_element_t)); - if (bt_data_prof == NULL && maxsize > 0) - return -1; - bt_size_cur = 0; - return 0; -} - -void jl_shuffle_int_array_inplace(volatile uint64_t *carray, size_t size, uint64_t *seed) { - // The "modern Fisher–Yates shuffle" - O(n) algorithm - // https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm - for (size_t i = size - 1; i >= 1; --i) { - size_t j = cong(i, profile_cong_rng_unbias, seed); - uint64_t tmp = carray[j]; - carray[j] = carray[i]; - carray[i] = tmp; - } -} - -JL_DLLEXPORT uint8_t *jl_profile_get_data(void) -{ - return (uint8_t*) bt_data_prof; -} - -JL_DLLEXPORT size_t jl_profile_len_data(void) -{ - return bt_size_cur; -} - -JL_DLLEXPORT size_t jl_profile_maxlen_data(void) -{ - return bt_size_max; -} - -JL_DLLEXPORT uint64_t jl_profile_delay_nsec(void) -{ - return nsecprof; -} - -JL_DLLEXPORT void jl_profile_clear_data(void) -{ - bt_size_cur = 0; -} - -JL_DLLEXPORT int jl_profile_is_running(void) -{ - return running; -} - #ifdef __cplusplus } #endif diff --git a/src/signals-unix.c b/src/signals-unix.c index ca624c765303f..5dd414c1a9e15 100644 --- a/src/signals-unix.c +++ b/src/signals-unix.c @@ -673,6 +673,14 @@ void trigger_profile_peek(void) jl_safe_printf("\n======================================================================================\n"); jl_safe_printf("Information request received. A stacktrace will print followed by a %.1f second profile\n", profile_peek_duration); jl_safe_printf("======================================================================================\n"); + if (bt_size_max == 0){ + // If the buffer hasn't been initialized, initialize with default size + // Keep these values synchronized with Profile.default_init() + if (jl_profile_init(10000000 * jl_n_threads, 1000000) == -1){ + jl_safe_printf("ERROR: could not initialize the profile buffer"); + return; + } + } bt_size_cur = 0; // clear profile buffer if (jl_profile_start_timer() < 0) jl_safe_printf("ERROR: Could not start profile timer\n"); diff --git a/stdlib/Profile/src/Profile.jl b/stdlib/Profile/src/Profile.jl index e24544839fc5f..2a4c33228755c 100644 --- a/stdlib/Profile/src/Profile.jl +++ b/stdlib/Profile/src/Profile.jl @@ -23,10 +23,7 @@ appended to an internal buffer of backtraces. macro profile(ex) return quote try - status = start_timer() - if status < 0 - error(error_codes[status]) - end + start_timer() $(esc(ex)) finally stop_timer() @@ -98,6 +95,11 @@ using keywords or in the order `(n, delay)`. """ function init(; n::Union{Nothing,Integer} = nothing, delay::Union{Nothing,Real} = nothing, limitwarn::Bool = true) n_cur = ccall(:jl_profile_maxlen_data, Csize_t, ()) + if n_cur == 0 && isnothing(n) && isnothing(delay) + # indicates that the buffer hasn't been initialized at all, so set the default + default_init() + n_cur = ccall(:jl_profile_maxlen_data, Csize_t, ()) + end delay_cur = ccall(:jl_profile_delay_nsec, UInt64, ())/10^9 if n === nothing && delay === nothing nthreads = Sys.iswindows() ? 1 : Threads.nthreads() # windows only profiles the main thread @@ -126,7 +128,7 @@ function init(n::Integer, delay::Real; limitwarn::Bool = true) end end -function __init__() +function default_init() # init with default values # Use a max size of 10M profile samples, and fire timer every 1ms # (that should typically give around 100 seconds of record) @@ -136,10 +138,25 @@ function __init__() n = 1_000_000 delay = 0.01 else + # Keep these values synchronized with trigger_profile_peek n = 10_000_000 delay = 0.001 end init(n, delay, limitwarn = false) +end + +# Checks whether the profile buffer has been initialized. If not, initializes it with the default size. +function check_init() + buffer_size = @ccall jl_profile_maxlen_data()::Int + if buffer_size == 0 + default_init() + end +end + +function __init__() + # Note: The profile buffer is no longer initialized during __init__ because Profile is in the sysimage, + # thus __init__ is called every startup. The buffer is lazily initialized the first time `@profile` is + # used, if not manually initialized before that. @static if !Sys.iswindows() # triggering a profile via signals is not implemented on windows PROFILE_PRINT_COND[] = Base.AsyncCondition() @@ -567,7 +584,14 @@ Julia, and examine the resulting `*.mem` files. clear_malloc_data() = ccall(:jl_clear_malloc_data, Cvoid, ()) # C wrappers -start_timer() = ccall(:jl_profile_start_timer, Cint, ()) +function start_timer() + check_init() # if the profile buffer hasn't been initialized, initialize with default size + status = ccall(:jl_profile_start_timer, Cint, ()) + if status < 0 + error(error_codes[status]) + end +end + stop_timer() = ccall(:jl_profile_stop_timer, Cvoid, ()) @@ -599,6 +623,9 @@ By default metadata such as threadid and taskid is included. Set `include_meta` """ function fetch(;include_meta = true, limitwarn = true) maxlen = maxlen_data() + if maxlen == 0 + error("The profiling data buffer is not initialized. A profile has not been requested this session.") + end len = len_data() if limitwarn && is_buffer_full() @warn """The profile data buffer is full; profiling probably terminated diff --git a/stdlib/Profile/test/runtests.jl b/stdlib/Profile/test/runtests.jl index 058158023cd25..2b523ffa44f0e 100644 --- a/stdlib/Profile/test/runtests.jl +++ b/stdlib/Profile/test/runtests.jl @@ -3,6 +3,8 @@ using Test, Profile, Serialization, Logging using Base.StackTraces: StackFrame +@test_throws "The profiling data buffer is not initialized. A profile has not been requested this session." Profile.print() + Profile.clear() Profile.init() From 7853436ccd7aaa1b35b294e046e8acfe5206336a Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Mon, 8 Aug 2022 09:55:07 +0200 Subject: [PATCH 275/369] set VERSION to 1.8.0-rc4 (#46275) --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 1298ad0a15ac8..b2a74f0f4f701 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.8.0-rc3 +1.8.0-rc4 From 5544a0fab7648cfa61fe79cd557a7504a92ec1b5 Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Wed, 17 Aug 2022 15:38:22 +0200 Subject: [PATCH 276/369] set VERSION to 1.8.0 (#46367) --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index b2a74f0f4f701..27f9cd322bb91 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.8.0-rc4 +1.8.0 From 27890c783d400c14dfc57b4caecbda61709c3c96 Mon Sep 17 00:00:00 2001 From: Jishnu Bhattacharya Date: Wed, 17 Aug 2022 13:49:32 +0400 Subject: [PATCH 277/369] leq for reals falls back to le and eq (#46341) (cherry picked from commit ef511c92bfc2e0ee4992ccfa3ca760d0da8016f1) --- base/promotion.jl | 2 +- test/operators.jl | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/base/promotion.jl b/base/promotion.jl index 24d0835a8b94a..8a89ce73d1788 100644 --- a/base/promotion.jl +++ b/base/promotion.jl @@ -476,7 +476,7 @@ xor(x::T, y::T) where {T<:Integer} = no_op_err("xor", T) (==)(x::T, y::T) where {T<:Number} = x === y (< )(x::T, y::T) where {T<:Real} = no_op_err("<" , T) -(<=)(x::T, y::T) where {T<:Real} = no_op_err("<=", T) +(<=)(x::T, y::T) where {T<:Real} = (x == y) | (x < y) rem(x::T, y::T) where {T<:Real} = no_op_err("rem", T) mod(x::T, y::T) where {T<:Real} = no_op_err("mod", T) diff --git a/test/operators.jl b/test/operators.jl index 97edebc0ea6f3..33fb8ad072196 100644 --- a/test/operators.jl +++ b/test/operators.jl @@ -303,3 +303,14 @@ end @test Returns(val)(1) === val @test sprint(show, Returns(1.0)) == "Returns{Float64}(1.0)" end + +@testset "<= (issue #46327)" begin + struct A46327 <: Real end + Base.:(==)(::A46327, ::A46327) = false + Base.:(<)(::A46327, ::A46327) = false + @test !(A46327() <= A46327()) + struct B46327 <: Real end + Base.:(==)(::B46327, ::B46327) = true + Base.:(<)(::B46327, ::B46327) = false + @test B46327() <= B46327() +end From 8ed3bc6fc4cb1654cd45654f60091c5f9521e7fd Mon Sep 17 00:00:00 2001 From: Oscar Smith Date: Mon, 22 Aug 2022 04:12:28 -0400 Subject: [PATCH 278/369] backport #46412 to 1.8 (#46417) --- base/math.jl | 37 +++++++++++++++++++++++-------------- test/math.jl | 29 ++++++++++++++++++++++++++--- 2 files changed, 49 insertions(+), 17 deletions(-) diff --git a/base/math.jl b/base/math.jl index 1f194f73ca7f9..eb69c555d985b 100644 --- a/base/math.jl +++ b/base/math.jl @@ -996,18 +996,22 @@ end # @constprop aggressive to help the compiler see the switch between the integer and float # variants for callers with constant `y` @constprop :aggressive function ^(x::Float64, y::Float64) - yint = unsafe_trunc(Int, y) # Note, this is actually safe since julia freezes the result - y == yint && return x^yint - #numbers greater than 2*inv(eps(T)) must be even, and the pow will overflow - y >= 2*inv(eps()) && return x^(typemax(Int64)-1) - x<0 && y > -4e18 && throw_exp_domainerror(x) # |y| is small enough that y isn't an integer x == 1 && return 1.0 + # Exponents greater than this will always overflow or underflow. + # Note that NaN can pass through this, but that will end up fine. + if !(abs(y)<0x1.8p62) + isnan(y) && return y + y = sign(y)*0x1.8p62 + end + yint = unsafe_trunc(Int64, y) # This is actually safe since julia freezes the result + y == yint && return x^yint + x<0 && throw_exp_domainerror(x) + !isfinite(x) && return x*(y>0 || isnan(x)) + x==0 && return abs(y)*Inf*(!(y>0)) return pow_body(x, y) end @inline function pow_body(x::Float64, y::Float64) - !isfinite(x) && return x*(y>0 || isnan(x)) - x==0 && return abs(y)*Inf*(!(y>0)) logxhi,logxlo = Base.Math._log_ext(x) xyhi, xylo = two_mul(logxhi,y) xylo = muladd(logxlo, y, xylo) @@ -1016,18 +1020,23 @@ end end @constprop :aggressive function ^(x::T, y::T) where T <: Union{Float16, Float32} - yint = unsafe_trunc(Int64, y) # Note, this is actually safe since julia freezes the result + x == 1 && return one(T) + # Exponents greater than this will always overflow or underflow. + # Note that NaN can pass through this, but that will end up fine. + max_exp = T == Float16 ? T(3<<14) : T(0x1.Ap30) + if !(abs(y)= 2*inv(eps(T)) && return x^(typemax(Int64)-1) - x < 0 && y > -4e18 && throw_exp_domainerror(x) # |y| is small enough that y isn't an integer + x < 0 && throw_exp_domainerror(x) + !isfinite(x) && return x*(y>0 || isnan(x)) + x==0 && return abs(y)*T(Inf)*(!(y>0)) return pow_body(x, y) end @inline function pow_body(x::T, y::T) where T <: Union{Float16, Float32} - x == 1 && return one(T) - !isfinite(x) && return x*(y>0 || isnan(x)) - x==0 && return abs(y)*T(Inf)*(!(y>0)) return T(exp2(log2(abs(widen(x))) * y)) end diff --git a/test/math.jl b/test/math.jl index 5daf1ef465509..56d97562ca0ab 100644 --- a/test/math.jl +++ b/test/math.jl @@ -1318,18 +1318,41 @@ end end @testset "pow" begin + # tolerance by type for regular powers + POW_TOLS = Dict(Float16=>[.51, .51, 2.0, 1.5], + Float32=>[.51, .51, 2.0, 1.5], + Float64=>[1.0, 1.5, 2.0, 1.5]) for T in (Float16, Float32, Float64) for x in (0.0, -0.0, 1.0, 10.0, 2.0, Inf, NaN, -Inf, -NaN) for y in (0.0, -0.0, 1.0, -3.0,-10.0 , Inf, NaN, -Inf, -NaN) - got, expected = T(x)^T(y), T(big(x))^T(y) - @test isnan_type(T, got) && isnan_type(T, expected) || (got === expected) + got, expected = T(x)^T(y), T(big(x)^T(y)) + if isnan(expected) + @test isnan_type(T, got) || T.((x,y)) + else + @test got == expected || T.((x,y)) + end end end for _ in 1:2^16 + # note x won't be subnormal here x=rand(T)*100; y=rand(T)*200-100 got, expected = x^y, widen(x)^y if isfinite(eps(T(expected))) - @test abs(expected-got) <= 1.3*eps(T(expected)) || (x,y) + if y == T(-2) # unfortunately x^-2 is less accurate for performance reasons. + @test abs(expected-got) <= POW_TOLS[T][3]*eps(T(expected)) || (x,y) + elseif y == T(3) # unfortunately x^3 is less accurate for performance reasons. + @test abs(expected-got) <= POW_TOLS[T][4]*eps(T(expected)) || (x,y) + else + @test abs(expected-got) <= POW_TOLS[T][1]*eps(T(expected)) || (x,y) + end + end + end + for _ in 1:2^14 + # test subnormal(x), y in -1.2, 1.8 since anything larger just overflows. + x=rand(T)*floatmin(T); y=rand(T)*3-T(1.2) + got, expected = x^y, widen(x)^y + if isfinite(eps(T(expected))) + @test abs(expected-got) <= POW_TOLS[T][2]*eps(T(expected)) || (x,y) end end # test (-x)^y for y larger than typemax(Int) From 5fed861826b3596ab85e5ae90b07ab4be5b3e0e2 Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Wed, 24 Aug 2022 08:37:22 -0700 Subject: [PATCH 279/369] [release-1.8] Consistently use `RUNPATH` in our libraries (#46465) * Consistently use `RUNPATH` in our libraries When loading dependencies on Linux, we can either use `RPATH` or `RUNPATH` as a list of relative paths to search for libraries. The difference, for our purposes, mainly lies within how this interacts with `LD_LIBRARY_PATH`: `RPATH` is searched first, then `LD_LIBRARY_PATH`, then `RUNPATH`. So by using `RUNPATH` here, we are explicitly allowing ourselves to be overridden by `LD_LIBRARY_PATH`. This is fine, as long as we are consistent across our entire library line, however in the `v1.8.0` release, there was an inconsistency, reported in [0]. The inconsistency occured because of the following confluence of factors: - Ancient `ld` builds (such as the one used in our build environment) do not default to using `RUNPATH`, but instead use `RPATH`. - `patchelf`, when it rewrites the RPATH, will default to using `RUNPATH` instead. - We were only using `patchelf` on `libjulia-internal`, not on `libjulia-codegen`, which was newly added in `v1.8`. These three factors together caused us to ship a binary with `RUNPATH` in `libjulia-internal`, but `RPATH` in `libjulia-codegen`, which caused loading to fail in [0] due to first `libjulia-internal` being loaded, (which brought in the external `libstdc++`), then `libjulia-codegen` failed to load (because it found an incompatible `libstdc++`), causing the mysterious compiler error. This PR fixes this twofold; first, when building the libraries in the first place, we pass `--enable-new-dtags` to the linker to encourage it to use `runpath` when possible. This removes the possibility for a missing `patchelf` invocation to break things in this way. Second, we apply `patchelf` properly to `libjulia-codegen` as well. [0] https://github.com/JuliaLang/julia/issues/46409 * fix whitespace Co-authored-by: Kristoffer Carlsson --- Make.inc | 13 ++++++++----- Makefile | 2 ++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Make.inc b/Make.inc index 3fa153c7219c4..e1420dd5bac74 100644 --- a/Make.inc +++ b/Make.inc @@ -1225,6 +1225,9 @@ else NO_WHOLE_ARCHIVE := -Wl,--no-whole-archive endif +# Initialize these once, then add to them in OS-specific blocks +JLIBLDFLAGS := + ifeq ($(OS), Linux) OSLIBS += -Wl,--no-as-needed -ldl -lrt -lpthread -latomic -Wl,--export-dynamic,--as-needed,--no-whole-archive # Detect if ifunc is supported @@ -1238,12 +1241,12 @@ ifneq ($(SANITIZE),1) JLDFLAGS += -Wl,-no-undefined endif ifeq (-Bsymbolic-functions, $(shell $(LD) --help | grep -o -e "-Bsymbolic-functions")) -JLIBLDFLAGS := -Wl,-Bsymbolic-functions +JLIBLDFLAGS += -Wl,-Bsymbolic-functions else -JLIBLDFLAGS := endif -else ifneq ($(OS), Darwin) -JLIBLDFLAGS := +ifeq (--enable-new-dtags, $(shell $(LD) --help | grep -o -e "--enable-new-dtags")) +JLIBLDFLAGS += -Wl,--enable-new-dtags +endif endif ifeq ($(OS), FreeBSD) @@ -1266,7 +1269,7 @@ OSLIBS += -framework CoreFoundation WHOLE_ARCHIVE := -Xlinker -all_load NO_WHOLE_ARCHIVE := HAVE_SSP := 1 -JLIBLDFLAGS := -Wl,-compatibility_version,$(SOMAJOR) -Wl,-current_version,$(JULIA_MAJOR_VERSION).$(JULIA_MINOR_VERSION).$(JULIA_PATCH_VERSION) +JLIBLDFLAGS += -Wl,-compatibility_version,$(SOMAJOR) -Wl,-current_version,$(JULIA_MAJOR_VERSION).$(JULIA_MINOR_VERSION).$(JULIA_PATCH_VERSION) endif ifeq ($(OS), WINNT) diff --git a/Makefile b/Makefile index 952b9a00c1e63..2975d1fa31f7c 100644 --- a/Makefile +++ b/Makefile @@ -365,8 +365,10 @@ endif # Set rpath for libjulia-internal, which is moving from `../lib` to `../lib/julia`. We only need to do this for Linux/FreeBSD ifneq (,$(findstring $(OS),Linux FreeBSD)) $(PATCHELF) --set-rpath '$$ORIGIN:$$ORIGIN/$(reverse_private_libdir_rel)' $(DESTDIR)$(private_libdir)/libjulia-internal.$(SHLIB_EXT) + $(PATCHELF) --set-rpath '$$ORIGIN:$$ORIGIN/$(reverse_private_libdir_rel)' $(DESTDIR)$(private_libdir)/libjulia-codegen.$(SHLIB_EXT) ifeq ($(BUNDLE_DEBUG_LIBS),1) $(PATCHELF) --set-rpath '$$ORIGIN:$$ORIGIN/$(reverse_private_libdir_rel)' $(DESTDIR)$(private_libdir)/libjulia-internal-debug.$(SHLIB_EXT) + $(PATCHELF) --set-rpath '$$ORIGIN:$$ORIGIN/$(reverse_private_libdir_rel)' $(DESTDIR)$(private_libdir)/libjulia-codegen-debug.$(SHLIB_EXT) endif endif From ffe7ea745ca10770b3931964730c90e7e6e71af0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Wed, 9 Mar 2022 19:46:38 +0000 Subject: [PATCH 280/369] [Makefile] Fix codesign of libjulia when installing it on macOS (#44510) * [Makefile] Fix codesign of libjulia when installing it on macOS * Add shell sript for codesigning and use it in Makefile (cherry picked from commit 8076517c979c703ebed3f1ca5494be2eddfdc30f) --- Makefile | 21 +++++++++++---------- contrib/codesign.sh | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 10 deletions(-) create mode 100755 contrib/codesign.sh diff --git a/Makefile b/Makefile index 2975d1fa31f7c..d38311dce720a 100644 --- a/Makefile +++ b/Makefile @@ -376,14 +376,22 @@ endif ifneq ($(LOADER_BUILD_DEP_LIBS),$(LOADER_INSTALL_DEP_LIBS)) # Next, overwrite relative path to libjulia-internal in our loader if $$(LOADER_BUILD_DEP_LIBS) != $$(LOADER_INSTALL_DEP_LIBS) $(call stringreplace,$(DESTDIR)$(shlibdir)/libjulia.$(JL_MAJOR_MINOR_SHLIB_EXT),$(LOADER_BUILD_DEP_LIBS)$$,$(LOADER_INSTALL_DEP_LIBS)) +ifeq ($(OS),Darwin) + # Codesign the libjulia we just modified + $(JULIAHOME)/contrib/codesign.sh "$(MACOS_CODESIGN_IDENTITY)" "$(DESTDIR)$(shlibdir)/libjulia.$(JL_MAJOR_MINOR_SHLIB_EXT)" +endif ifeq ($(BUNDLE_DEBUG_LIBS),1) $(call stringreplace,$(DESTDIR)$(shlibdir)/libjulia-debug.$(JL_MAJOR_MINOR_SHLIB_EXT),$(LOADER_DEBUG_BUILD_DEP_LIBS)$$,$(LOADER_DEBUG_INSTALL_DEP_LIBS)) +ifeq ($(OS),Darwin) + # Codesign the libjulia we just modified + $(JULIAHOME)/contrib/codesign.sh "$(MACOS_CODESIGN_IDENTITY)" "$(DESTDIR)$(shlibdir)/libjulia-debug.$(JL_MAJOR_MINOR_SHLIB_EXT)" +endif endif endif - # On FreeBSD, remove the build's libdir from each library's RPATH ifeq ($(OS),FreeBSD) + # On FreeBSD, remove the build's libdir from each library's RPATH $(JULIAHOME)/contrib/fixup-rpath.sh "$(PATCHELF)" $(DESTDIR)$(libdir) $(build_libdir) $(JULIAHOME)/contrib/fixup-rpath.sh "$(PATCHELF)" $(DESTDIR)$(private_libdir) $(build_libdir) $(JULIAHOME)/contrib/fixup-rpath.sh "$(PATCHELF)" $(DESTDIR)$(bindir) $(build_libdir) @@ -430,16 +438,9 @@ endif ifeq ($(OS), WINNT) cd $(BUILDROOT)/julia-$(JULIA_COMMIT)/bin && rm -f llvm* llc.exe lli.exe opt.exe LTO.dll bugpoint.exe macho-dump.exe endif - # If we're on macOS, and we have a codesigning identity, then codesign the binary-dist tarball! ifeq ($(OS),Darwin) -ifneq ($(MACOS_CODESIGN_IDENTITY),) - echo "Codesigning with identity $(MACOS_CODESIGN_IDENTITY)"; \ - MACHO_FILES=$$(find "$(BUILDROOT)/julia-$(JULIA_COMMIT)" -type f -perm -0111 | cut -d: -f1); \ - for f in $${MACHO_FILES}; do \ - echo "Codesigning $${f}..."; \ - codesign -s "$(MACOS_CODESIGN_IDENTITY)" --option=runtime --entitlements $(JULIAHOME)/contrib/mac/app/Entitlements.plist -vvv --timestamp --deep --force "$${f}"; \ - done -endif + # If we're on macOS, and we have a codesigning identity, then codesign the binary-dist tarball! + $(JULIAHOME)/contrib/codesign.sh "$(MACOS_CODESIGN_IDENTITY)" "$(BUILDROOT)/julia-$(JULIA_COMMIT)" endif cd $(BUILDROOT) && $(TAR) zcvf $(JULIA_BINARYDIST_FILENAME).tar.gz julia-$(JULIA_COMMIT) diff --git a/contrib/codesign.sh b/contrib/codesign.sh new file mode 100755 index 0000000000000..03866c4bb1ac1 --- /dev/null +++ b/contrib/codesign.sh @@ -0,0 +1,38 @@ +#!/bin/sh +# This file is a part of Julia. License is MIT: https://julialang.org/license + +# Codesign binary files for macOS. + +usage() { + echo "Usage: ${0} MACOS_CODESIGN_IDENTITY FILE-OR-DIRECTORY" + exit 0 +} + +# Default codesign identity to `-` if not provided +if [ -z "${1}" ]; then + MACOS_CODESIGN_IDENTITY="-" + ENTITLEMENTS="" +else + MACOS_CODESIGN_IDENTITY="${1}" + ENTITLEMENTS="--entitlements $(dirname "${0}")/mac/app/Entitlements.plist" +fi + +if [ "${#}" -eq 2 ]; then + if [ -f "${2}" ]; then + # Codesign only the given file + MACHO_FILES="${2}" + elif [ -d "${2}" ]; then + # Find all files in the given directory + MACHO_FILES=$(find "${2}" -type f -perm -0111 | cut -d: -f1) + else + usage + fi +else + usage +fi + +echo "Codesigning with identity ${MACOS_CODESIGN_IDENTITY}" +for f in ${MACHO_FILES}; do + echo "Codesigning ${f}..." + codesign -s "${MACOS_CODESIGN_IDENTITY}" --option=runtime ${ENTITLEMENTS} -vvv --timestamp --deep --force "${f}" +done From 21a53fb6032e262d699582f1c292a73cfd845695 Mon Sep 17 00:00:00 2001 From: Morten Piibeleht Date: Fri, 13 May 2022 01:50:59 +1200 Subject: [PATCH 281/369] Change PDF cover font to DejaVu Sans (#45290) (cherry picked from commit c65e56f0279b8ea48556cbc1726fd78937930be4) --- doc/src/assets/custom.sty | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/src/assets/custom.sty b/doc/src/assets/custom.sty index f257d2d3d2174..03e6ff805cd3f 100644 --- a/doc/src/assets/custom.sty +++ b/doc/src/assets/custom.sty @@ -40,6 +40,7 @@ contents={ }}% % ---- Heading font style -\DeclareFixedFont{\MainHeading}{T1}{phv}{b}{n}{1.5cm} -\DeclareFixedFont{\SecondaryHeading}{T1}{phv}{b}{n}{0.8cm} +\usepackage{anyfontsize} +\newcommand{\MainHeading}{\fontspec{DejaVu Sans}\fontsize{40}{40}\selectfont\bfseries} +\newcommand{\SecondaryHeading}{\fontspec{DejaVu Sans}\LARGE} %% cover page END ------------------------------------------------------------- From 72b7511014f07b6902c8063e6f5a52af31109782 Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Tue, 9 Aug 2022 18:41:30 -0400 Subject: [PATCH 282/369] `@kwdef`: handle const and atomic fields (#46276) (cherry picked from commit 70656e214882ccb8744386e2f08db1e1eea46919) --- base/util.jl | 15 +++++++++++++-- test/misc.jl | 31 +++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/base/util.jl b/base/util.jl index df9e29790deb6..e55e834e690d3 100644 --- a/base/util.jl +++ b/base/util.jl @@ -527,7 +527,16 @@ function _kwdef!(blk, params_args, call_args) push!(params_args, ei) push!(call_args, ei) elseif ei isa Expr - if ei.head === :(=) + is_atomic = ei.head === :atomic + ei = is_atomic ? first(ei.args) : ei # strip "@atomic" and add it back later + is_const = ei.head === :const + ei = is_const ? first(ei.args) : ei # strip "const" and add it back later + # Note: `@atomic const ..` isn't valid, but reconstruct it anyway to serve a nice error + if ei isa Symbol + # const var + push!(params_args, ei) + push!(call_args, ei) + elseif ei.head === :(=) lhs = ei.args[1] if lhs isa Symbol # var = defexpr @@ -543,7 +552,9 @@ function _kwdef!(blk, params_args, call_args) defexpr = ei.args[2] # defexpr push!(params_args, Expr(:kw, var, esc(defexpr))) push!(call_args, var) - blk.args[i] = lhs + lhs = is_const ? Expr(:const, lhs) : lhs + lhs = is_atomic ? Expr(:atomic, lhs) : lhs + blk.args[i] = lhs # overrides arg elseif ei.head === :(::) && ei.args[1] isa Symbol # var::Typ var = ei.args[1] diff --git a/test/misc.jl b/test/misc.jl index 9ad9b4e21acac..bda0566650170 100644 --- a/test/misc.jl +++ b/test/misc.jl @@ -1097,6 +1097,37 @@ const outsidevar = 7 end @test TestOutsideVar() == TestOutsideVar(7) +@kwdef mutable struct Test_kwdef_const_atomic + a + b::Int + c::Int = 1 + const d + const e::Int + const f = 1 + const g::Int = 1 + @atomic h::Int +end + +@testset "const and @atomic fields in @kwdef" begin + x = Test_kwdef_const_atomic(a = 1, b = 1, d = 1, e = 1, h = 1) + for f in fieldnames(Test_kwdef_const_atomic) + @test getfield(x, f) == 1 + end + @testset "const fields" begin + @test_throws ErrorException x.d = 2 + @test_throws ErrorException x.e = 2 + @test_throws MethodError x.e = "2" + @test_throws ErrorException x.f = 2 + @test_throws ErrorException x.g = 2 + end + @testset "atomic fields" begin + @test_throws ConcurrencyViolationError x.h = 1 + @atomic x.h = 1 + @test @atomic(x.h) == 1 + @atomic x.h = 2 + @test @atomic(x.h) == 2 + end +end @testset "exports of modules" begin for (_, mod) in Base.loaded_modules From 0be7f577e30f58dceed1dc79a6367a151707e068 Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Wed, 17 Aug 2022 21:46:18 +0200 Subject: [PATCH 283/369] Don't mutate the hashtable with forward edges during final iteration. (#46375) By looking up keys, we possibly grow the hash table, invalidating the iteration we were doing in jl_collect_backedges. First perform a non-mutating check instead, and assert that the hashtable doesn't change during iteration. (cherry picked from commit 0ada892d2a86636fb877bdbc681d5199f35b8ad9) --- src/dump.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/dump.c b/src/dump.c index 44f6262f37d5c..8cb2f901ee45b 100644 --- a/src/dump.c +++ b/src/dump.c @@ -1202,9 +1202,10 @@ static void jl_collect_backedges_to(jl_method_instance_t *caller, htable_t *all_ { if (module_in_worklist(caller->def.method->module) || method_instance_in_queue(caller)) return; - jl_array_t **pcallees = (jl_array_t**)ptrhash_bp(&edges_map, (void*)caller), - *callees = *pcallees; - if (callees != HT_NOTFOUND) { + if (ptrhash_has(&edges_map, caller)) { + jl_array_t **pcallees = (jl_array_t**)ptrhash_bp(&edges_map, (void*)caller), + *callees = *pcallees; + assert(callees != HT_NOTFOUND); *pcallees = (jl_array_t*) HT_NOTFOUND; size_t i, l = jl_array_len(callees); for (i = 0; i < l; i++) { @@ -1227,7 +1228,10 @@ static void jl_collect_backedges( /* edges */ jl_array_t *s, /* ext_targets */ j htable_new(&all_callees, 0); size_t i; void **table = edges_map.table; // edges is caller => callees - for (i = 0; i < edges_map.size; i += 2) { + size_t table_size = edges_map.size; + for (i = 0; i < table_size; i += 2) { + assert(table == edges_map.table && table_size == edges_map.size && + "edges_map changed during iteration"); jl_method_instance_t *caller = (jl_method_instance_t*)table[i]; jl_array_t *callees = (jl_array_t*)table[i + 1]; if (callees == HT_NOTFOUND) From 9b3a2bba31fe4d18d9fa06fac6aaecc2e242d84b Mon Sep 17 00:00:00 2001 From: N5N3 <2642243996@qq.com> Date: Fri, 19 Aug 2022 02:47:43 +0800 Subject: [PATCH 284/369] Fix #41096 and #43082, make sure `env` is restored when typeintersect tries a new Union decision (#46350) * `intersect_all` should always `restore_env`. let `merge_env` track valid `env` change. * Add test. Co-authored-by: Jeff Bezanson (cherry picked from commit 9aabb4c9642c8045164069329a7f70e3aacef17f) --- src/subtype.c | 73 +++++++++++++++++++++++++++++++++---------------- test/subtype.jl | 34 +++++++++++++++++++---- 2 files changed, 78 insertions(+), 29 deletions(-) diff --git a/src/subtype.c b/src/subtype.c index aea5b80a5cadf..c01ee54e683be 100644 --- a/src/subtype.c +++ b/src/subtype.c @@ -200,12 +200,9 @@ static void restore_env(jl_stenv_t *e, jl_value_t *root, jl_savedenv_t *se) JL_N jl_varbinding_t *v = e->vars; int i = 0, j = 0; while (v != NULL) { - if (root) v->lb = jl_svecref(root, i); - i++; - if (root) v->ub = jl_svecref(root, i); - i++; - if (root) v->innervars = (jl_array_t*)jl_svecref(root, i); - i++; + if (root) v->lb = jl_svecref(root, i++); + if (root) v->ub = jl_svecref(root, i++); + if (root) v->innervars = (jl_array_t*)jl_svecref(root, i++); v->occurs_inv = se->buf[j++]; v->occurs_cov = se->buf[j++]; v = v->prev; @@ -2323,6 +2320,11 @@ static jl_value_t *intersect_var(jl_tvar_t *b, jl_value_t *a, jl_stenv_t *e, int JL_GC_POP(); return jl_bottom_type; } + if (jl_is_uniontype(ub) && !jl_is_uniontype(a)) { + bb->ub = ub; + bb->lb = jl_bottom_type; + ub = (jl_value_t*)b; + } } if (ub != (jl_value_t*)b) { if (jl_has_free_typevars(ub)) { @@ -3166,26 +3168,50 @@ static jl_value_t *intersect(jl_value_t *x, jl_value_t *y, jl_stenv_t *e, int pa return jl_bottom_type; } +static int merge_env(jl_stenv_t *e, jl_value_t **root, jl_savedenv_t *se, int count) +{ + if (!count) { + save_env(e, root, se); + return 1; + } + int n = 0; + jl_varbinding_t *v = e->vars; + jl_value_t *ub = NULL, *vub = NULL; + JL_GC_PUSH2(&ub, &vub); + while (v != NULL) { + if (v->ub != v->var->ub || v->lb != v->var->lb) { + jl_value_t *lb = jl_svecref(*root, n); + if (v->lb != lb) + jl_svecset(*root, n, lb ? jl_bottom_type : v->lb); + ub = jl_svecref(*root, n+1); + vub = v->ub; + if (vub != ub) + jl_svecset(*root, n+1, ub ? simple_join(ub, vub) : vub); + } + n = n + 3; + v = v->prev; + } + JL_GC_POP(); + return count + 1; +} + static jl_value_t *intersect_all(jl_value_t *x, jl_value_t *y, jl_stenv_t *e) { e->Runions.depth = 0; e->Runions.more = 0; e->Runions.used = 0; jl_value_t **is; - JL_GC_PUSHARGS(is, 3); + JL_GC_PUSHARGS(is, 4); jl_value_t **saved = &is[2]; - jl_savedenv_t se; + jl_value_t **merged = &is[3]; + jl_savedenv_t se, me; save_env(e, saved, &se); int lastset = 0, niter = 0, total_iter = 0; jl_value_t *ii = intersect(x, y, e, 0); is[0] = ii; // root - if (ii == jl_bottom_type) { - restore_env(e, *saved, &se); - } - else { - free_env(&se); - save_env(e, saved, &se); - } + if (is[0] != jl_bottom_type) + niter = merge_env(e, merged, &me, niter); + restore_env(e, *saved, &se); while (e->Runions.more) { if (e->emptiness_only && ii != jl_bottom_type) break; @@ -3199,13 +3225,9 @@ static jl_value_t *intersect_all(jl_value_t *x, jl_value_t *y, jl_stenv_t *e) is[0] = ii; is[1] = intersect(x, y, e, 0); - if (is[1] == jl_bottom_type) { - restore_env(e, *saved, &se); - } - else { - free_env(&se); - save_env(e, saved, &se); - } + if (is[1] != jl_bottom_type) + niter = merge_env(e, merged, &me, niter); + restore_env(e, *saved, &se); if (is[0] == jl_bottom_type) ii = is[1]; else if (is[1] == jl_bottom_type) @@ -3213,14 +3235,17 @@ static jl_value_t *intersect_all(jl_value_t *x, jl_value_t *y, jl_stenv_t *e) else { // TODO: the repeated subtype checks in here can get expensive ii = jl_type_union(is, 2); - niter++; } total_iter++; - if (niter > 3 || total_iter > 400000) { + if (niter > 4 || total_iter > 400000) { ii = y; break; } } + if (niter){ + restore_env(e, *merged, &me); + free_env(&me); + } free_env(&se); JL_GC_POP(); return ii; diff --git a/test/subtype.jl b/test/subtype.jl index b17f502bc2e00..70c8c0cb354b6 100644 --- a/test/subtype.jl +++ b/test/subtype.jl @@ -1928,12 +1928,24 @@ let A = Tuple{Ref{T}, Vararg{T}} where T, B = Tuple{Ref{U}, Union{Ref{S}, Ref{U}, Int}, Union{Ref{S}, S}} where S where U, C = Tuple{Ref{U}, Union{Ref{S}, Ref{U}, Ref{W}}, Union{Ref{S}, W, V}} where V<:AbstractArray where W where S where U I = typeintersect(A, B) + Ts = (Tuple{Ref{Int}, Int, Int}, Tuple{Ref{Ref{Int}}, Ref{Int}, Ref{Int}}) @test I != Union{} @test I <: A - @test I <: B - # avoid stack overflow + @test_broken I <: B + for T in Ts + if T <: A && T <: B + @test T <: I + end + end J = typeintersect(A, C) - @test_broken J != Union{} + @test J != Union{} + @test J <: A + @test_broken J <: C + for T in Ts + if T <: A && T <: C + @test T <: J + end + end end let A = Tuple{Dict{I,T}, I, T} where T where I, @@ -1964,8 +1976,9 @@ let A = Tuple{Any, Type{Ref{_A}} where _A}, B = Tuple{Type{T}, Type{<:Union{Ref{T}, T}}} where T, I = typeintersect(A, B) @test I != Union{} - # TODO: this intersection result is still too narrow - @test_broken Tuple{Type{Ref{Integer}}, Type{Ref{Integer}}} <: I + @test Tuple{Type{Ref{Integer}}, Type{Ref{Integer}}} <: I + # TODO: this intersection result seems too wide (I == B) ? + @test_broken !<:(Tuple{Type{Int}, Type{Int}}, I) end @testintersect(Tuple{Type{T}, T} where T<:(Tuple{Vararg{_A, _B}} where _B where _A), @@ -1996,3 +2009,14 @@ let T = TypeVar(:T, Real), @test !(UnionAll(T, UnionAll(V, UnionAll(T, Type{Pair{T, V}}))) <: UnionAll(T, UnionAll(V, Type{Pair{T, V}}))) @test !(UnionAll(T, UnionAll(V, UnionAll(T, S))) <: UnionAll(T, UnionAll(V, S))) end + +# issue #41096 +let C = Val{Val{B}} where {B} + @testintersect(Val{<:Union{Missing, Val{false}, Val{true}}}, C, Val{<:Union{Val{true}, Val{false}}}) + @testintersect(Val{<:Union{Nothing, Val{true}, Val{false}}}, C, Val{<:Union{Val{true}, Val{false}}}) + @testintersect(Val{<:Union{Nothing, Val{false}}}, C, Val{Val{false}}) +end + +#issue #43082 +struct X43082{A, I, B<:Union{Ref{I},I}}; end +@testintersect(Tuple{X43082{T}, Int} where T, Tuple{X43082{Int}, Any}, Tuple{X43082{Int}, Int}) From 5842378db9f6bf71a657656c93826a1da18acfe6 Mon Sep 17 00:00:00 2001 From: Mason Protter Date: Mon, 22 Aug 2022 04:08:05 -0600 Subject: [PATCH 285/369] Fix `@time` compat description (#46416) (cherry picked from commit e0056c8d3087827b7c8e2b0648deeb8dc531da5f) --- base/timing.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/base/timing.jl b/base/timing.jl index a72f2980ca3b8..f924382a37a47 100644 --- a/base/timing.jl +++ b/base/timing.jl @@ -218,8 +218,7 @@ See also [`@showtime`](@ref), [`@timev`](@ref), [`@timed`](@ref), [`@elapsed`](@ !!! compat "Julia 1.8" The option to add a description was introduced in Julia 1.8. -!!! compat "Julia 1.9" - Recompilation time being shown separately from compilation time was introduced in Julia 1.9 + Recompilation time being shown separately from compilation time was introduced in Julia 1.8 ```julia-repl julia> x = rand(10,10); From bc457f682ce517c38fa31df48d8d3c13dccd221b Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Mon, 22 Aug 2022 10:34:14 -0400 Subject: [PATCH 286/369] Fix `deepcopy` for `Base.GenericCondition` (#46406) (cherry picked from commit 99e8953c0fcb626d643207650381f1e3fbff76e2) --- base/deepcopy.jl | 2 +- test/copy.jl | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/base/deepcopy.jl b/base/deepcopy.jl index 317d999004c42..74c9d2b49c123 100644 --- a/base/deepcopy.jl +++ b/base/deepcopy.jl @@ -140,7 +140,7 @@ function deepcopy_internal(x::GenericCondition, stackdict::IdDict) if haskey(stackdict, x) return stackdict[x] end - y = typeof(x)(deepcopy_internal(x.lock)) + y = typeof(x)(deepcopy_internal(x.lock, stackdict)) stackdict[x] = y return y end diff --git a/test/copy.jl b/test/copy.jl index c4fcff40f2b3f..633beee5f2af3 100644 --- a/test/copy.jl +++ b/test/copy.jl @@ -252,3 +252,19 @@ end a = [1:3;] @test copyto!(a, 2:3, 1:1, a, 1:2, 1:1) == [1;1:2;] end + +@testset "`deepcopy` a `GenericCondition`" begin + a = Base.GenericCondition(ReentrantLock()) + @test !islocked(a.lock) + lock(a.lock) + @test islocked(a.lock) + b = deepcopy(a) + @test typeof(a) === typeof(b) + @test a != b + @test a !== b + @test typeof(a.lock) === typeof(b.lock) + @test a.lock != b.lock + @test a.lock !== b.lock + @test islocked(a.lock) + @test !islocked(b.lock) +end From 08308233dfc07b2719b809cc0eb95b6a4e23e9b1 Mon Sep 17 00:00:00 2001 From: Daniel Karrasch Date: Mon, 22 Aug 2022 17:53:08 +0200 Subject: [PATCH 287/369] Fix multiplication of `AbstractQ`s (#46237) (cherry picked from commit 947c908a95ea389e2586cbc44a695ebb70a9fae0) --- stdlib/LinearAlgebra/src/qr.jl | 4 ++-- stdlib/LinearAlgebra/src/special.jl | 8 +++---- stdlib/LinearAlgebra/test/special.jl | 33 +++++++++++++++++++--------- 3 files changed, 29 insertions(+), 16 deletions(-) diff --git a/stdlib/LinearAlgebra/src/qr.jl b/stdlib/LinearAlgebra/src/qr.jl index 1d6fb0ecda0bc..c415b151bf363 100644 --- a/stdlib/LinearAlgebra/src/qr.jl +++ b/stdlib/LinearAlgebra/src/qr.jl @@ -380,9 +380,9 @@ norm solution. Multiplication with respect to either full/square or non-full/square `Q` is allowed, i.e. both `F.Q*F.R` and `F.Q*A` are supported. A `Q` matrix can be converted into a regular matrix with -[`Matrix`](@ref). This operation returns the "thin" Q factor, i.e., if `A` is `m`×`n` with `m>=n`, then +[`Matrix`](@ref). This operation returns the "thin" Q factor, i.e., if `A` is `m`×`n` with `m>=n`, then `Matrix(F.Q)` yields an `m`×`n` matrix with orthonormal columns. To retrieve the "full" Q factor, an -`m`×`m` orthogonal matrix, use `F.Q*Matrix(I,m,m)`. If `m<=n`, then `Matrix(F.Q)` yields an `m`×`m` +`m`×`m` orthogonal matrix, use `F.Q*I`. If `m<=n`, then `Matrix(F.Q)` yields an `m`×`m` orthogonal matrix. The block size for QR decomposition can be specified by keyword argument diff --git a/stdlib/LinearAlgebra/src/special.jl b/stdlib/LinearAlgebra/src/special.jl index 1ead4826127c2..ad62fea13eadc 100644 --- a/stdlib/LinearAlgebra/src/special.jl +++ b/stdlib/LinearAlgebra/src/special.jl @@ -347,10 +347,10 @@ end *(A::Diagonal, Q::AbstractQ) = _qrmul(A, Q) *(A::Diagonal, Q::Adjoint{<:Any,<:AbstractQ}) = _qrmul(A, Q) -*(Q::AbstractQ, B::AbstractQ) = _qlmul(Q, B) -*(Q::Adjoint{<:Any,<:AbstractQ}, B::AbstractQ) = _qrmul(Q, B) -*(Q::AbstractQ, B::Adjoint{<:Any,<:AbstractQ}) = _qlmul(Q, B) -*(Q::Adjoint{<:Any,<:AbstractQ}, B::Adjoint{<:Any,<:AbstractQ}) = _qrmul(Q, B) +*(Q::AbstractQ, B::AbstractQ) = Q * (B * I) +*(Q::Adjoint{<:Any,<:AbstractQ}, B::AbstractQ) = Q * (B * I) +*(Q::AbstractQ, B::Adjoint{<:Any,<:AbstractQ}) = Q * (B * I) +*(Q::Adjoint{<:Any,<:AbstractQ}, B::Adjoint{<:Any,<:AbstractQ}) = Q * (B * I) # fill[stored]! methods fillstored!(A::Diagonal, x) = (fill!(A.diag, x); A) diff --git a/stdlib/LinearAlgebra/test/special.jl b/stdlib/LinearAlgebra/test/special.jl index 277c51bb9f7bb..ad2bda61d1d17 100644 --- a/stdlib/LinearAlgebra/test/special.jl +++ b/stdlib/LinearAlgebra/test/special.jl @@ -215,16 +215,29 @@ end atri = typ(a) matri = Matrix(atri) b = rand(n,n) - qrb = qr(b, ColumnNorm()) - @test atri * qrb.Q ≈ matri * qrb.Q ≈ rmul!(copy(atri), qrb.Q) - @test atri * qrb.Q' ≈ matri * qrb.Q' ≈ rmul!(copy(atri), qrb.Q') - @test qrb.Q * atri ≈ qrb.Q * matri ≈ lmul!(qrb.Q, copy(atri)) - @test qrb.Q' * atri ≈ qrb.Q' * matri ≈ lmul!(qrb.Q', copy(atri)) - qrb = qr(b, NoPivot()) - @test atri * qrb.Q ≈ matri * qrb.Q ≈ rmul!(copy(atri), qrb.Q) - @test atri * qrb.Q' ≈ matri * qrb.Q' ≈ rmul!(copy(atri), qrb.Q') - @test qrb.Q * atri ≈ qrb.Q * matri ≈ lmul!(qrb.Q, copy(atri)) - @test qrb.Q' * atri ≈ qrb.Q' * matri ≈ lmul!(qrb.Q', copy(atri)) + for pivot in (ColumnNorm(), NoPivot()) + qrb = qr(b, pivot) + @test atri * qrb.Q ≈ matri * qrb.Q ≈ rmul!(copy(atri), qrb.Q) + @test atri * qrb.Q' ≈ matri * qrb.Q' ≈ rmul!(copy(atri), qrb.Q') + @test qrb.Q * atri ≈ qrb.Q * matri ≈ lmul!(qrb.Q, copy(atri)) + @test qrb.Q' * atri ≈ qrb.Q' * matri ≈ lmul!(qrb.Q', copy(atri)) + end + end +end + +@testset "Multiplication of Qs" begin + for pivot in (ColumnNorm(), NoPivot()), A in (rand(5, 3), rand(5, 5), rand(3, 5)) + Q = qr(A, pivot).Q + m = size(A, 1) + C = Matrix{Float64}(undef, (m, m)) + @test Q*Q ≈ (Q*I) * (Q*I) ≈ mul!(C, Q, Q) + @test size(Q*Q) == (m, m) + @test Q'Q ≈ (Q'*I) * (Q*I) ≈ mul!(C, Q', Q) + @test size(Q'Q) == (m, m) + @test Q*Q' ≈ (Q*I) * (Q'*I) ≈ mul!(C, Q, Q') + @test size(Q*Q') == (m, m) + @test Q'Q' ≈ (Q'*I) * (Q'*I) ≈ mul!(C, Q', Q') + @test size(Q'Q') == (m, m) end end From 0aa520139f9bcf3cd202db81548c15515e6e1142 Mon Sep 17 00:00:00 2001 From: Daniel Karrasch Date: Thu, 25 Aug 2022 08:54:34 +0200 Subject: [PATCH 288/369] Fix 3-arg `dot` for 1x1 structured matrices (#46473) (cherry picked from commit c3d500984fd7e31db9096d7a59093039fd4f0009) --- stdlib/LinearAlgebra/src/bidiag.jl | 11 +++--- stdlib/LinearAlgebra/src/tridiag.jl | 56 +++++++++++++++------------- stdlib/LinearAlgebra/test/bidiag.jl | 14 +++---- stdlib/LinearAlgebra/test/tridiag.jl | 6 ++- 4 files changed, 49 insertions(+), 38 deletions(-) diff --git a/stdlib/LinearAlgebra/src/bidiag.jl b/stdlib/LinearAlgebra/src/bidiag.jl index 317ed15af770c..fb29f9ae595b9 100644 --- a/stdlib/LinearAlgebra/src/bidiag.jl +++ b/stdlib/LinearAlgebra/src/bidiag.jl @@ -702,14 +702,15 @@ function dot(x::AbstractVector, B::Bidiagonal, y::AbstractVector) require_one_based_indexing(x, y) nx, ny = length(x), length(y) (nx == size(B, 1) == ny) || throw(DimensionMismatch()) - if iszero(nx) - return dot(zero(eltype(x)), zero(eltype(B)), zero(eltype(y))) + if nx ≤ 1 + nx == 0 && return dot(zero(eltype(x)), zero(eltype(B)), zero(eltype(y))) + return dot(x[1], B.dv[1], y[1]) end ev, dv = B.ev, B.dv - if B.uplo == 'U' + @inbounds if B.uplo == 'U' x₀ = x[1] r = dot(x[1], dv[1], y[1]) - @inbounds for j in 2:nx-1 + for j in 2:nx-1 x₋, x₀ = x₀, x[j] r += dot(adjoint(ev[j-1])*x₋ + adjoint(dv[j])*x₀, y[j]) end @@ -719,7 +720,7 @@ function dot(x::AbstractVector, B::Bidiagonal, y::AbstractVector) x₀ = x[1] x₊ = x[2] r = dot(adjoint(dv[1])*x₀ + adjoint(ev[1])*x₊, y[1]) - @inbounds for j in 2:nx-1 + for j in 2:nx-1 x₀, x₊ = x₊, x[j+1] r += dot(adjoint(dv[j])*x₀ + adjoint(ev[j])*x₊, y[j]) end diff --git a/stdlib/LinearAlgebra/src/tridiag.jl b/stdlib/LinearAlgebra/src/tridiag.jl index e5c31856d3f0a..d6b44d85e68e9 100644 --- a/stdlib/LinearAlgebra/src/tridiag.jl +++ b/stdlib/LinearAlgebra/src/tridiag.jl @@ -256,21 +256,24 @@ end function dot(x::AbstractVector, S::SymTridiagonal, y::AbstractVector) require_one_based_indexing(x, y) nx, ny = length(x), length(y) - (nx == size(S, 1) == ny) || throw(DimensionMismatch()) - if iszero(nx) - return dot(zero(eltype(x)), zero(eltype(S)), zero(eltype(y))) + (nx == size(S, 1) == ny) || throw(DimensionMismatch("dot")) + if nx ≤ 1 + nx == 0 && return dot(zero(eltype(x)), zero(eltype(S)), zero(eltype(y))) + return dot(x[1], S.dv[1], y[1]) end dv, ev = S.dv, S.ev - x₀ = x[1] - x₊ = x[2] - sub = transpose(ev[1]) - r = dot(adjoint(dv[1])*x₀ + adjoint(sub)*x₊, y[1]) - @inbounds for j in 2:nx-1 - x₋, x₀, x₊ = x₀, x₊, x[j+1] - sup, sub = transpose(sub), transpose(ev[j]) - r += dot(adjoint(sup)*x₋ + adjoint(dv[j])*x₀ + adjoint(sub)*x₊, y[j]) - end - r += dot(adjoint(transpose(sub))*x₀ + adjoint(dv[nx])*x₊, y[nx]) + @inbounds begin + x₀ = x[1] + x₊ = x[2] + sub = transpose(ev[1]) + r = dot(adjoint(dv[1])*x₀ + adjoint(sub)*x₊, y[1]) + for j in 2:nx-1 + x₋, x₀, x₊ = x₀, x₊, x[j+1] + sup, sub = transpose(sub), transpose(ev[j]) + r += dot(adjoint(sup)*x₋ + adjoint(dv[j])*x₀ + adjoint(sub)*x₊, y[j]) + end + r += dot(adjoint(transpose(sub))*x₀ + adjoint(dv[nx])*x₊, y[nx]) + end return r end @@ -841,18 +844,21 @@ function dot(x::AbstractVector, A::Tridiagonal, y::AbstractVector) require_one_based_indexing(x, y) nx, ny = length(x), length(y) (nx == size(A, 1) == ny) || throw(DimensionMismatch()) - if iszero(nx) - return dot(zero(eltype(x)), zero(eltype(A)), zero(eltype(y))) - end - x₀ = x[1] - x₊ = x[2] - dl, d, du = A.dl, A.d, A.du - r = dot(adjoint(d[1])*x₀ + adjoint(dl[1])*x₊, y[1]) - @inbounds for j in 2:nx-1 - x₋, x₀, x₊ = x₀, x₊, x[j+1] - r += dot(adjoint(du[j-1])*x₋ + adjoint(d[j])*x₀ + adjoint(dl[j])*x₊, y[j]) - end - r += dot(adjoint(du[nx-1])*x₀ + adjoint(d[nx])*x₊, y[nx]) + if nx ≤ 1 + nx == 0 && return dot(zero(eltype(x)), zero(eltype(A)), zero(eltype(y))) + return dot(x[1], A.d[1], y[1]) + end + @inbounds begin + x₀ = x[1] + x₊ = x[2] + dl, d, du = A.dl, A.d, A.du + r = dot(adjoint(d[1])*x₀ + adjoint(dl[1])*x₊, y[1]) + for j in 2:nx-1 + x₋, x₀, x₊ = x₀, x₊, x[j+1] + r += dot(adjoint(du[j-1])*x₋ + adjoint(d[j])*x₀ + adjoint(dl[j])*x₊, y[j]) + end + r += dot(adjoint(du[nx-1])*x₀ + adjoint(d[nx])*x₊, y[nx]) + end return r end diff --git a/stdlib/LinearAlgebra/test/bidiag.jl b/stdlib/LinearAlgebra/test/bidiag.jl index 422984d84eb6b..c711bf3e1e1c1 100644 --- a/stdlib/LinearAlgebra/test/bidiag.jl +++ b/stdlib/LinearAlgebra/test/bidiag.jl @@ -623,14 +623,14 @@ end end @testset "generalized dot" begin - for elty in (Float64, ComplexF64) - dv = randn(elty, 5) - ev = randn(elty, 4) - x = randn(elty, 5) - y = randn(elty, 5) + for elty in (Float64, ComplexF64), n in (5, 1) + dv = randn(elty, n) + ev = randn(elty, n-1) + x = randn(elty, n) + y = randn(elty, n) for uplo in (:U, :L) B = Bidiagonal(dv, ev, uplo) - @test dot(x, B, y) ≈ dot(B'x, y) ≈ dot(x, Matrix(B), y) + @test dot(x, B, y) ≈ dot(B'x, y) ≈ dot(x, B*y) ≈ dot(x, Matrix(B), y) end dv = Vector{elty}(undef, 0) ev = Vector{elty}(undef, 0) @@ -638,7 +638,7 @@ end y = Vector{elty}(undef, 0) for uplo in (:U, :L) B = Bidiagonal(dv, ev, uplo) - @test dot(x, B, y) ≈ dot(zero(elty), zero(elty), zero(elty)) + @test dot(x, B, y) === zero(elty) end end end diff --git a/stdlib/LinearAlgebra/test/tridiag.jl b/stdlib/LinearAlgebra/test/tridiag.jl index ecdf6b416baa5..0698a583c8d45 100644 --- a/stdlib/LinearAlgebra/test/tridiag.jl +++ b/stdlib/LinearAlgebra/test/tridiag.jl @@ -434,7 +434,11 @@ end @testset "generalized dot" begin x = fill(convert(elty, 1), n) y = fill(convert(elty, 1), n) - @test dot(x, A, y) ≈ dot(A'x, y) + @test dot(x, A, y) ≈ dot(A'x, y) ≈ dot(x, A*y) + @test dot([1], SymTridiagonal([1], Int[]), [1]) == 1 + @test dot([1], Tridiagonal(Int[], [1], Int[]), [1]) == 1 + @test dot(Int[], SymTridiagonal(Int[], Int[]), Int[]) === 0 + @test dot(Int[], Tridiagonal(Int[], Int[], Int[]), Int[]) === 0 end end end From 3053b47b327e63d70b9793906044aa0093554e87 Mon Sep 17 00:00:00 2001 From: Oscar Smith Date: Mon, 22 Aug 2022 04:13:00 -0400 Subject: [PATCH 289/369] `@noinline` `exp` by default. (#46359) also remove a bunch of `@inline` from when I didn't trust the compiler to do reasonable things. (cherry picked from commit 445586d55d416f2269a3adaccea494759b77e0cc) --- base/special/exp.jl | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/base/special/exp.jl b/base/special/exp.jl index 00a9c0c2d19c6..e955d182f29d3 100644 --- a/base/special/exp.jl +++ b/base/special/exp.jl @@ -70,31 +70,30 @@ LogB(::Val{:ℯ}, ::Type{Float16}) = -0.6931472f0 LogB(::Val{10}, ::Type{Float16}) = -0.30103f0 # Range reduced kernels -@inline function expm1b_kernel(::Val{2}, x::Float64) +function expm1b_kernel(::Val{2}, x::Float64) return x * evalpoly(x, (0.6931471805599393, 0.24022650695910058, 0.05550411502333161, 0.009618129548366803)) end -@inline function expm1b_kernel(::Val{:ℯ}, x::Float64) +function expm1b_kernel(::Val{:ℯ}, x::Float64) return x * evalpoly(x, (0.9999999999999912, 0.4999999999999997, 0.1666666857598779, 0.04166666857598777)) end - -@inline function expm1b_kernel(::Val{10}, x::Float64) +function expm1b_kernel(::Val{10}, x::Float64) return x * evalpoly(x, (2.3025850929940255, 2.6509490552391974, 2.034678825384765, 1.1712552025835192)) end -@inline function expb_kernel(::Val{2}, x::Float32) +function expb_kernel(::Val{2}, x::Float32) return evalpoly(x, (1.0f0, 0.6931472f0, 0.2402265f0, 0.05550411f0, 0.009618025f0, 0.0013333423f0, 0.00015469732f0, 1.5316464f-5)) end -@inline function expb_kernel(::Val{:ℯ}, x::Float32) +function expb_kernel(::Val{:ℯ}, x::Float32) return evalpoly(x, (1.0f0, 1.0f0, 0.5f0, 0.16666667f0, 0.041666217f0, 0.008333249f0, 0.001394858f0, 0.00019924171f0)) end -@inline function expb_kernel(::Val{10}, x::Float32) +function expb_kernel(::Val{10}, x::Float32) return evalpoly(x, (1.0f0, 2.3025851f0, 2.650949f0, 2.0346787f0, 1.1712426f0, 0.53937745f0, 0.20788547f0, 0.06837386f0)) @@ -178,7 +177,7 @@ const J_TABLE = (0x0000000000000000, 0xaac00b1afa5abcbe, 0x9b60163da9fb3335, 0xa # XXX we want to mark :consistent-cy here so that this function can be concrete-folded, # because the effect analysis currently can't prove it in the presence of `@inbounds` or # `:boundscheck`, but still the access to `J_TABLE` is really safe here -Base.@assume_effects :consistent @inline function table_unpack(ind::Int32) +@noinline Base.@assume_effects :consistent @inline function table_unpack(ind::Int32) ind = ind & 255 + 1 # 255 == length(J_TABLE) - 1 j = @inbounds J_TABLE[ind] jU = reinterpret(Float64, JU_CONST | (j&JU_MASK)) @@ -224,7 +223,7 @@ end if k <= -53 # The UInt64 forces promotion. (Only matters for 32 bit systems.) twopk = (k + UInt64(53)) << 52 - return reinterpret(T, twopk + reinterpret(UInt64, small_part))*(2.0^-53) + return reinterpret(T, twopk + reinterpret(UInt64, small_part))*0x1p-53 end #k == 1024 && return (small_part * 2.0) * 2.0^1023 end @@ -249,7 +248,7 @@ end if k <= -53 # The UInt64 forces promotion. (Only matters for 32 bit systems.) twopk = (k + UInt64(53)) << 52 - return reinterpret(T, twopk + reinterpret(UInt64, small_part))*(2.0^-53) + return reinterpret(T, twopk + reinterpret(UInt64, small_part))*0x1p-53 end #k == 1024 && return (small_part * 2.0) * 2.0^1023 end @@ -324,8 +323,8 @@ for (func, fast_func, base) in ((:exp2, :exp2_fast, Val(2)), (:exp, :exp_fast, Val(:ℯ)), (:exp10, :exp10_fast, Val(10))) @eval begin - $func(x::Union{Float16,Float32,Float64}) = exp_impl(x, $base) - $fast_func(x::Union{Float32,Float64}) = exp_impl_fast(x, $base) + @noinline $func(x::Union{Float16,Float32,Float64}) = exp_impl(x, $base) + @noinline $fast_func(x::Union{Float32,Float64}) = exp_impl_fast(x, $base) end end From ad8ca942211e58f792287f8c8a785294e0e4adea Mon Sep 17 00:00:00 2001 From: Martin Holters Date: Thu, 18 Aug 2022 21:24:27 +0200 Subject: [PATCH 290/369] Handle `PhiNode` with `edge==0` (#46388) (cherry picked from commit fd66c303cc3f6e80f5b1d42837fa9f5cae927a06) --- base/compiler/ssair/legacy.jl | 2 +- test/compiler/inference.jl | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/base/compiler/ssair/legacy.jl b/base/compiler/ssair/legacy.jl index 3d91646fa05f7..15038f609c5f1 100644 --- a/base/compiler/ssair/legacy.jl +++ b/base/compiler/ssair/legacy.jl @@ -58,7 +58,7 @@ function replace_code_newstyle!(ci::CodeInfo, ir::IRCode, nargs::Int) elseif isa(stmt, GotoIfNot) stmt = GotoIfNot(stmt.cond, first(ir.cfg.blocks[stmt.dest].stmts)) elseif isa(stmt, PhiNode) - stmt = PhiNode(Int32[last(ir.cfg.blocks[edge].stmts) for edge in stmt.edges], stmt.values) + stmt = PhiNode(Int32[edge == 0 ? 0 : last(ir.cfg.blocks[edge].stmts) for edge in stmt.edges], stmt.values) elseif isa(stmt, Expr) && stmt.head === :enter stmt.args[1] = first(ir.cfg.blocks[stmt.args[1]::Int].stmts) end diff --git a/test/compiler/inference.jl b/test/compiler/inference.jl index 8ea3a55030fe3..70a720e53f209 100644 --- a/test/compiler/inference.jl +++ b/test/compiler/inference.jl @@ -4062,3 +4062,15 @@ end let t = Core.Compiler.tuple_tfunc(Any[Core.Const(42), Vararg{Any}]) @test Core.Compiler.issimplertype(t, t) end + +# issue #45600 +@test only(code_typed() do + while true + x = try finally end + end +end)[2] == Union{} +@test only(code_typed() do + while true + @time 1 + end +end)[2] == Union{} From 29c76db65ca8e017723332c8cb12e14e2d5c1a33 Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Tue, 16 Aug 2022 17:29:52 -0400 Subject: [PATCH 291/369] Properly declare alloca alignment (#46368) Turns out when you declare an alloca alignment, it also rounds up the allocated size. Replaces #46322 and #46260 and fixes the same issue. (cherry picked from commit e358a17aa806541b23842fd0ef06bacf50491b75) --- src/codegen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/codegen.cpp b/src/codegen.cpp index cfd0e7154ce68..79b40513f453c 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -6709,7 +6709,7 @@ static std::pair, jl_llvm_functions_t> Type *vtype = julia_type_to_llvm(ctx, jt, &isboxed); assert(!isboxed); assert(!type_is_ghost(vtype) && "constants should already be handled"); - Value *lv = new AllocaInst(vtype, 0, jl_symbol_name(s), /*InsertBefore*/ctx.pgcstack); + Value *lv = new AllocaInst(vtype, 0, NULL, Align(jl_datatype_align(jt)), jl_symbol_name(s), /*InsertBefore*/ctx.pgcstack); if (CountTrackedPointers(vtype).count) { StoreInst *SI = new StoreInst(Constant::getNullValue(vtype), lv, false, Align(sizeof(void*))); SI->insertAfter(ctx.pgcstack); From a2395897b6315eb604e898a6932119d68f5dd471 Mon Sep 17 00:00:00 2001 From: Oscar Smith Date: Fri, 26 Aug 2022 05:11:05 -0400 Subject: [PATCH 292/369] fix bug when error is infinite (#46436) (cherry picked from commit c491e7912603facb0adfc04592c88b17d3e281c2) --- base/math.jl | 4 ++-- test/math.jl | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/base/math.jl b/base/math.jl index eb69c555d985b..3b5465bc86e19 100644 --- a/base/math.jl +++ b/base/math.jl @@ -1068,8 +1068,8 @@ end xnlo += err n >>>= 1 end - !isfinite(x) && return x*y - return muladd(x, y, muladd(y, xnlo, x*ynlo)) + err = muladd(y, xnlo, x*ynlo) + return ifelse(isfinite(x) & isfinite(err), muladd(x, y, err), x*y) end function ^(x::Float32, n::Integer) diff --git a/test/math.jl b/test/math.jl index 56d97562ca0ab..1946e73829eb6 100644 --- a/test/math.jl +++ b/test/math.jl @@ -1362,6 +1362,7 @@ end end # test for large negative exponent where error compensation matters @test 0.9999999955206014^-1.0e8 == 1.565084574870928 + @test 3e18^20 == Inf end # Test that sqrt behaves correctly and doesn't exhibit fp80 double rounding. From 99b466b6727ae4d4c3013fa8cf69c422fc9172e9 Mon Sep 17 00:00:00 2001 From: Akira Kyle Date: Fri, 26 Aug 2022 10:49:43 -0600 Subject: [PATCH 293/369] Fix ordering of headers so `#define _GNU_SOURCE` comes first (#46183) Co-authored-by: Kristoffer Carlsson (cherry picked from commit 3b81696a88abd778660fdda282328bce45974e21) --- cli/loader.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/loader.h b/cli/loader.h index 2d0b977f7142f..0620113048efe 100644 --- a/cli/loader.h +++ b/cli/loader.h @@ -22,8 +22,6 @@ #define realloc loader_realloc #endif -#include - #ifdef _OS_WINDOWS_ #define WIN32_LEAN_AND_MEAN @@ -49,6 +47,8 @@ #endif +#include + // Borrow definition from `support/dtypes.h` #ifdef _OS_WINDOWS_ # ifdef LIBRARY_EXPORTS From c65611aefeb6068c727bb73450812db97cf4a58e Mon Sep 17 00:00:00 2001 From: "Y. Yang" Date: Mon, 29 Aug 2022 15:27:51 +0800 Subject: [PATCH 294/369] Fix union!(s::BitSet, r::AbstractUnitRange{<:Integer}) when two ranges do not overlap. (#45578) * Fix union!(s::BitSet, r::AbstractUnitRange{<:Integer}) when two ranges do not overlap. Resizing of BitSet should be filled with 0 by default. (cherry picked from commit 5e8e0a51908ae3050890e870c69aa1fdbb2e3761) --- base/bitset.jl | 14 ++------------ test/bitset.jl | 9 +++++++++ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/base/bitset.jl b/base/bitset.jl index 0abd9d4b782d2..22ff177695349 100644 --- a/base/bitset.jl +++ b/base/bitset.jl @@ -137,20 +137,10 @@ function union!(s::BitSet, r::AbstractUnitRange{<:Integer}) # grow s.bits as necessary if diffb >= len - _growend!(s.bits, diffb - len + 1) - # we set only some values to CHK0, those which will not be - # fully overwritten (i.e. only or'ed with `|`) - s.bits[end] = CHK0 # end == diffb + 1 - if diffa >= len - s.bits[diffa + 1] = CHK0 - end + _growend0!(s.bits, diffb - len + 1) end if diffa < 0 - _growbeg!(s.bits, -diffa) - s.bits[1] = CHK0 - if diffb < 0 - s.bits[diffb - diffa + 1] = CHK0 - end + _growbeg0!(s.bits, -diffa) s.offset = cidxa # s.offset += diffa diffb -= diffa diffa = 0 diff --git a/test/bitset.jl b/test/bitset.jl index 1919da4f3702a..6c7947ebc37af 100644 --- a/test/bitset.jl +++ b/test/bitset.jl @@ -351,3 +351,12 @@ end # union! with an empty range doesn't modify the BitSet @test union!(x, b:a) == y end + +@testset "union!(::BitSet, ::AbstractUnitRange) when two ranges do not overlap" begin + # see #45574 + a, b = rand(-10000:-5000), rand(5000:10000) + c, d = minmax(rand(20000:30000, 2)...) + @test length(union!(BitSet(a:b), c:d)) == length(a:b) + length(c:d) + c, d = minmax(rand(-30000:-20000, 2)...) + @test length(union!(BitSet(a:b), c:d)) == length(a:b) + length(c:d) +end From 5d03fcd948ad862458f2b7b09cc97ad66c08ac1f Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki Date: Mon, 29 Aug 2022 21:04:18 +0900 Subject: [PATCH 295/369] inference: revive `CachedMethodTable` mechanism `CachedMethodTable` was removed within #44240 as we couldn't confirm any performance improvement then. However it turns out the optimization was critical in some real world cases (e.g. #46492), so this commit revives the mechanism with the following tweaks that should make it more effective: - create method table cache per inference (rather than per local inference on a function call as on the previous implementation) - only use cache mechanism for abstract types (since we already cache lookup result at the next level as for concrete types) As a result, the following snippet reported at #46492 recovers the compilation performance: ```julia using ControlSystems a_2 = [-5 -3; 2 -9] C_212 = ss(a_2, [1; 2], [1 0; 0 1], [0; 0]) @time norm(C_212) ``` > on master ``` julia> @time norm(C_212) 364.489044 seconds (724.44 M allocations: 92.524 GiB, 6.01% gc time, 100.00% compilation time) 0.5345224838248489 ``` > on this commit ``` julia> @time norm(C_212) 26.539016 seconds (62.09 M allocations: 5.537 GiB, 5.55% gc time, 100.00% compilation time) 0.5345224838248489 ``` (cherry picked from commit 844574411fc77f5de1528a2ab30b9457238959cf) --- base/compiler/abstractinterpretation.jl | 4 +- base/compiler/compiler.jl | 2 +- base/compiler/methodtable.jl | 80 ++++++++++++++++++------- base/compiler/types.jl | 19 +++--- 4 files changed, 68 insertions(+), 37 deletions(-) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index 5c1133b4d40ec..98bcfa4f18661 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -282,7 +282,7 @@ function find_matching_methods(argtypes::Vector{Any}, @nospecialize(atype), meth if result === missing return FailedMethodMatch("For one of the union split cases, too many methods matched") end - matches, overlayed = result + (; matches, overlayed) = result nonoverlayed &= !overlayed push!(infos, MethodMatchInfo(matches)) for m in matches @@ -323,7 +323,7 @@ function find_matching_methods(argtypes::Vector{Any}, @nospecialize(atype), meth # (assume this will always be true, so we don't compute / update valid age in this case) return FailedMethodMatch("Too many methods matched") end - matches, overlayed = result + (; matches, overlayed) = result fullmatch = _any(match->(match::MethodMatch).fully_covers, matches) return MethodMatches(matches.matches, MethodMatchInfo(matches), diff --git a/base/compiler/compiler.jl b/base/compiler/compiler.jl index 6991e2d38437b..ed88e8c22178f 100644 --- a/base/compiler/compiler.jl +++ b/base/compiler/compiler.jl @@ -123,10 +123,10 @@ something(x::Any, y...) = x ############ include("compiler/cicache.jl") +include("compiler/methodtable.jl") include("compiler/types.jl") include("compiler/utilities.jl") include("compiler/validation.jl") -include("compiler/methodtable.jl") include("compiler/inferenceresult.jl") include("compiler/inferencestate.jl") diff --git a/base/compiler/methodtable.jl b/base/compiler/methodtable.jl index 7aa686009c1af..8b3968332e2e8 100644 --- a/base/compiler/methodtable.jl +++ b/base/compiler/methodtable.jl @@ -2,6 +2,27 @@ abstract type MethodTableView; end +struct MethodLookupResult + # Really Vector{Core.MethodMatch}, but it's easier to represent this as + # and work with Vector{Any} on the C side. + matches::Vector{Any} + valid_worlds::WorldRange + ambig::Bool +end +length(result::MethodLookupResult) = length(result.matches) +function iterate(result::MethodLookupResult, args...) + r = iterate(result.matches, args...) + r === nothing && return nothing + match, state = r + return (match::MethodMatch, state) +end +getindex(result::MethodLookupResult, idx::Int) = getindex(result.matches, idx)::MethodMatch + +struct MethodMatchResult + matches::MethodLookupResult + overlayed::Bool +end + """ struct InternalMethodTable <: MethodTableView @@ -23,25 +44,21 @@ struct OverlayMethodTable <: MethodTableView mt::Core.MethodTable end -struct MethodLookupResult - # Really Vector{Core.MethodMatch}, but it's easier to represent this as - # and work with Vector{Any} on the C side. - matches::Vector{Any} - valid_worlds::WorldRange - ambig::Bool -end -length(result::MethodLookupResult) = length(result.matches) -function iterate(result::MethodLookupResult, args...) - r = iterate(result.matches, args...) - r === nothing && return nothing - match, state = r - return (match::MethodMatch, state) +""" + struct CachedMethodTable <: MethodTableView + +Overlays another method table view with an additional local fast path cache that +can respond to repeated, identical queries faster than the original method table. +""" +struct CachedMethodTable{T} <: MethodTableView + cache::IdDict{Any, Union{Missing, MethodMatchResult}} + table::T end -getindex(result::MethodLookupResult, idx::Int) = getindex(result.matches, idx)::MethodMatch +CachedMethodTable(table::T) where T = CachedMethodTable{T}(IdDict{Any, Union{Missing, MethodMatchResult}}(), table) """ findall(sig::Type, view::MethodTableView; limit::Int=typemax(Int)) -> - (matches::MethodLookupResult, overlayed::Bool) or missing + MethodMatchResult(matches::MethodLookupResult, overlayed::Bool) or missing Find all methods in the given method table `view` that are applicable to the given signature `sig`. If no applicable methods are found, an empty result is returned. @@ -51,7 +68,7 @@ If the number of applicable methods exceeded the specified limit, `missing` is r function findall(@nospecialize(sig::Type), table::InternalMethodTable; limit::Int=Int(typemax(Int32))) result = _findall(sig, nothing, table.world, limit) result === missing && return missing - return result, false + return MethodMatchResult(result, false) end function findall(@nospecialize(sig::Type), table::OverlayMethodTable; limit::Int=Int(typemax(Int32))) @@ -60,18 +77,20 @@ function findall(@nospecialize(sig::Type), table::OverlayMethodTable; limit::Int nr = length(result) if nr ≥ 1 && result[nr].fully_covers # no need to fall back to the internal method table - return result, true + return MethodMatchResult(result, true) end # fall back to the internal method table fallback_result = _findall(sig, nothing, table.world, limit) fallback_result === missing && return missing # merge the fallback match results with the internal method table - return MethodLookupResult( - vcat(result.matches, fallback_result.matches), - WorldRange( - max(result.valid_worlds.min_world, fallback_result.valid_worlds.min_world), - min(result.valid_worlds.max_world, fallback_result.valid_worlds.max_world)), - result.ambig | fallback_result.ambig), !isempty(result) + return MethodMatchResult( + MethodLookupResult( + vcat(result.matches, fallback_result.matches), + WorldRange( + max(result.valid_worlds.min_world, fallback_result.valid_worlds.min_world), + min(result.valid_worlds.max_world, fallback_result.valid_worlds.max_world)), + result.ambig | fallback_result.ambig), + !isempty(result)) end function _findall(@nospecialize(sig::Type), mt::Union{Nothing,Core.MethodTable}, world::UInt, limit::Int) @@ -85,6 +104,17 @@ function _findall(@nospecialize(sig::Type), mt::Union{Nothing,Core.MethodTable}, return MethodLookupResult(ms::Vector{Any}, WorldRange(_min_val[], _max_val[]), _ambig[] != 0) end +function findall(@nospecialize(sig::Type), table::CachedMethodTable; limit::Int=typemax(Int)) + if isconcretetype(sig) + # as for concrete types, we cache result at on the next level + return findall(sig, table.table; limit) + end + box = Core.Box(sig) + return get!(table.cache, sig) do + findall(box.contents, table.table; limit) + end +end + """ findsup(sig::Type, view::MethodTableView) -> (match::MethodMatch, valid_worlds::WorldRange, overlayed::Bool) or nothing @@ -129,6 +159,10 @@ function _findsup(@nospecialize(sig::Type), mt::Union{Nothing,Core.MethodTable}, return match, valid_worlds end +# This query is not cached +findsup(@nospecialize(sig::Type), table::CachedMethodTable) = findsup(sig, table.table) + isoverlayed(::MethodTableView) = error("unsatisfied MethodTableView interface") isoverlayed(::InternalMethodTable) = false isoverlayed(::OverlayMethodTable) = true +isoverlayed(mt::CachedMethodTable) = isoverlayed(mt.table) diff --git a/base/compiler/types.jl b/base/compiler/types.jl index a0884bd86d1d3..3652a15c3e7bd 100644 --- a/base/compiler/types.jl +++ b/base/compiler/types.jl @@ -318,6 +318,8 @@ struct NativeInterpreter <: AbstractInterpreter cache::Vector{InferenceResult} # The world age we're working inside of world::UInt + # method table to lookup for during inference on this world age + method_table::CachedMethodTable{InternalMethodTable} # Parameters for inference and optimization inf_params::InferenceParams @@ -327,27 +329,21 @@ struct NativeInterpreter <: AbstractInterpreter inf_params = InferenceParams(), opt_params = OptimizationParams(), ) + cache = Vector{InferenceResult}() # Initially empty cache + # Sometimes the caller is lazy and passes typemax(UInt). # we cap it to the current world age if world == typemax(UInt) world = get_world_counter() end + method_table = CachedMethodTable(InternalMethodTable(world)) + # If they didn't pass typemax(UInt) but passed something more subtly # incorrect, fail out loudly. @assert world <= get_world_counter() - return new( - # Initially empty cache - Vector{InferenceResult}(), - - # world age counter - world, - - # parameters for inference and optimization - inf_params, - opt_params, - ) + return new(cache, world, method_table, inf_params, opt_params) end end @@ -396,6 +392,7 @@ External `AbstractInterpreter` can optionally return `OverlayMethodTable` here to incorporate customized dispatches for the overridden methods. """ method_table(interp::AbstractInterpreter) = InternalMethodTable(get_world_counter(interp)) +method_table(interp::NativeInterpreter) = interp.method_table """ By default `AbstractInterpreter` implements the following inference bail out logic: From bb94590a554a6008a8786aa799e821de228d42a5 Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Fri, 26 Aug 2022 15:37:16 +0200 Subject: [PATCH 296/369] fix invalidations in logging (#46481) (cherry picked from commit ce6e9ee74f7c04f3190d8a4fd29ccd4fc5e705a3) --- base/logging.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/logging.jl b/base/logging.jl index 1b8e5e0f54192..db7ddf37c676d 100644 --- a/base/logging.jl +++ b/base/logging.jl @@ -669,7 +669,7 @@ function handle_message(logger::SimpleLogger, level::LogLevel, message, _module, end buf = IOBuffer() stream = logger.stream - if !isopen(stream) + if !(isopen(stream)::Bool) stream = stderr end iob = IOContext(buf, stream) From 8bc5c9a0695c79f79b4a2c3babb760f84229359e Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Fri, 26 Aug 2022 15:38:28 +0200 Subject: [PATCH 297/369] fix type instability/invalidations from `nextind` (#46489) (cherry picked from commit 98e1b13a7db5aa1d05b9a48085993375cf2298d0) --- base/strings/util.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/strings/util.jl b/base/strings/util.jl index 91686f330849b..ee58c2df095e3 100644 --- a/base/strings/util.jl +++ b/base/strings/util.jl @@ -533,7 +533,7 @@ function iterate(iter::SplitIterator, (i, k, n)=(firstindex(iter.str), firstinde r = findnext(iter.splitter, iter.str, k)::Union{Nothing,Int,UnitRange{Int}} while r !== nothing && n != iter.limit - 1 && first(r) <= ncodeunits(iter.str) j, k = first(r), nextind(iter.str, last(r))::Int - k_ = k <= j ? nextind(iter.str, j) : k + k_ = k <= j ? nextind(iter.str, j)::Int : k if i < k substr = @inbounds SubString(iter.str, i, prevind(iter.str, j)::Int) (iter.keepempty || i < j) && return (substr, (k, k_, n + 1)) From 9db7f8576429b3c89396184dd1a8f55147ed823f Mon Sep 17 00:00:00 2001 From: Morten Piibeleht Date: Mon, 29 Aug 2022 21:02:18 +1200 Subject: [PATCH 298/369] Use Documenter 0.27.23 (#46516) (cherry picked from commit b64743b30da8b1fa324a24daa3539bbebf528d69) --- doc/Manifest.toml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/Manifest.toml b/doc/Manifest.toml index a1fc86f2e779b..9992d7b18ced2 100644 --- a/doc/Manifest.toml +++ b/doc/Manifest.toml @@ -18,15 +18,15 @@ uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" [[deps.DocStringExtensions]] deps = ["LibGit2"] -git-tree-sha1 = "b19534d1895d702889b219c382a6e18010797f0b" +git-tree-sha1 = "5158c2b41018c5f7eb1470d558127ac274eca0c9" uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" -version = "0.8.6" +version = "0.9.1" [[deps.Documenter]] deps = ["ANSIColoredPrinters", "Base64", "Dates", "DocStringExtensions", "IOCapture", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"] -git-tree-sha1 = "e4967ebb9dce1328d582200b03bcc44c69372312" +git-tree-sha1 = "6030186b00a38e9d0434518627426570aac2ef95" uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4" -version = "0.27.20" +version = "0.27.23" [[deps.IOCapture]] deps = ["Logging", "Random"] @@ -63,9 +63,9 @@ uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" [[deps.Parsers]] deps = ["Dates"] -git-tree-sha1 = "0044b23da09b5608b4ecacb4e5e6c6332f833a7e" +git-tree-sha1 = "3d5bf43e3e8b412656404ed9466f1dcbf7c50269" uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" -version = "2.3.2" +version = "2.4.0" [[deps.Printf]] deps = ["Unicode"] From a462c5ab3d414a6c52fcbc70f45dfa7f21665451 Mon Sep 17 00:00:00 2001 From: Jakob Nybo Nissen Date: Mon, 29 Aug 2022 11:16:56 +0200 Subject: [PATCH 299/369] Docs: Remove static scheduling warning (#46519) The docs on multithreading still warns that the default scheduler for @threads uses static scheduling. However, since #44136, dynamic scheduling has been the default. This commit removes the warning. (cherry picked from commit 72222d6dbaf7fd726b38bc3b6baddd51032d1cca) --- doc/src/manual/multi-threading.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/doc/src/manual/multi-threading.md b/doc/src/manual/multi-threading.md index 14d42013ae2ff..55140c8938b8a 100644 --- a/doc/src/manual/multi-threading.md +++ b/doc/src/manual/multi-threading.md @@ -307,9 +307,6 @@ threads in Julia: multiple threads where at least one thread modifies the collection (common examples include `push!` on arrays, or inserting items into a `Dict`). - * `@threads` currently uses a static schedule, using all threads and assigning - equal iteration counts to each. In the future the default schedule is likely - to change to be dynamic. * The schedule used by `@spawn` is nondeterministic and should not be relied on. * Compute-bound, non-memory-allocating tasks can prevent garbage collection from running in other threads that are allocating memory. In these cases it may From 598b0190a716cafbdf6ea2a184bca1fb2c84d1ab Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Mon, 29 Aug 2022 17:49:08 +0200 Subject: [PATCH 300/369] fix invalidations for Dicts from Static.jl (#46490) (cherry picked from commit 5c5af1fffd1bd0a9124415689a4664ab934e79f1) --- base/dict.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/dict.jl b/base/dict.jl index 220840ed0e5ea..a8dc20763c73e 100644 --- a/base/dict.jl +++ b/base/dict.jl @@ -372,7 +372,7 @@ end function setindex!(h::Dict{K,V}, v0, key0) where V where K key = convert(K, key0) - if !isequal(key, key0) + if !(isequal(key, key0)::Bool) throw(ArgumentError("$(limitrepr(key0)) is not a valid key for type $K")) end setindex!(h, v0, key) From 9787fa54bb9c0e5aaf8905166a8103b6b033e609 Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Mon, 29 Aug 2022 18:02:25 +0200 Subject: [PATCH 301/369] fix invalidations of REPL from HDF5.jl (#46486) (cherry picked from commit 431071bd4ec320d1b51481cd0aa0a8aa7bdc88c8) --- stdlib/REPL/src/LineEdit.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/REPL/src/LineEdit.jl b/stdlib/REPL/src/LineEdit.jl index e3daa4677f077..f48cf27c8edd8 100644 --- a/stdlib/REPL/src/LineEdit.jl +++ b/stdlib/REPL/src/LineEdit.jl @@ -1380,7 +1380,7 @@ end end # returns the width of the written prompt -function write_prompt(terminal, s::Union{AbstractString,Function}, color::Bool) +function write_prompt(terminal::AbstractTerminal, s::Union{AbstractString,Function}, color::Bool) @static Sys.iswindows() && _reset_console_mode() promptstr = prompt_string(s)::String write(terminal, promptstr) From 0d42d02d2d1076bba8f09fd47f0c978ce54df484 Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Mon, 29 Aug 2022 21:21:59 +0200 Subject: [PATCH 302/369] fix invalidations in sort! from Static.jl (#46491) (cherry picked from commit 1fae1b98b042f0dde6910cc931d94ba1d35ca527) --- base/sort.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/sort.jl b/base/sort.jl index 307a515dad050..b9c22e396db2c 100644 --- a/base/sort.jl +++ b/base/sort.jl @@ -501,7 +501,7 @@ function sort!(v::AbstractVector, lo::Integer, hi::Integer, ::InsertionSortAlg, x = v[i] while j > lo y = v[j-1] - if !lt(o, x, y) + if !(lt(o, x, y)::Bool) break end v[j] = y From 9efb6c436edb003407982d8b549d8dd411387f9c Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Tue, 30 Aug 2022 11:51:11 +0200 Subject: [PATCH 303/369] fix invalidations in REPLCompletions from Static.jl (#46494) (cherry picked from commit 99340fec8d7bff148473fc2345b0687746093f2b) --- stdlib/REPL/src/REPLCompletions.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/REPL/src/REPLCompletions.jl b/stdlib/REPL/src/REPLCompletions.jl index 162d1184d18c3..07b904c6abb84 100644 --- a/stdlib/REPL/src/REPLCompletions.jl +++ b/stdlib/REPL/src/REPLCompletions.jl @@ -418,9 +418,9 @@ function get_value(sym::Expr, fn) end sym.head !== :. && return (nothing, false) for ex in sym.args - ex, found = get_value(ex, fn) + ex, found = get_value(ex, fn)::Tuple{Any, Bool} !found && return (nothing, false) - fn, found = get_value(ex, fn) + fn, found = get_value(ex, fn)::Tuple{Any, Bool} !found && return (nothing, false) end return (fn, true) From 98efbdf95475159337aa91f2a6b580ad276b5d69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=90=86=E5=BF=B5=E5=9C=88?= <73381027+Rratic@users.noreply.github.com> Date: Tue, 30 Aug 2022 21:29:03 +0800 Subject: [PATCH 304/369] Enhance `StringIndexError` display (correct escaping) (#46039) (cherry picked from commit 1715110da6a9f7a1f1774281e5bbb8d953c3ba60) --- base/strings/string.jl | 6 ++++-- test/strings/basic.jl | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/base/strings/string.jl b/base/strings/string.jl index c37e36594119e..17e05a93b7dc4 100644 --- a/base/strings/string.jl +++ b/base/strings/string.jl @@ -17,10 +17,12 @@ function Base.showerror(io::IO, exc::StringIndexError) if firstindex(s) <= exc.index <= ncodeunits(s) iprev = thisind(s, exc.index) inext = nextind(s, iprev) + escprev = escape_string(s[iprev:iprev]) if inext <= ncodeunits(s) - print(io, ", valid nearby indices [$iprev]=>'$(s[iprev])', [$inext]=>'$(s[inext])'") + escnext = escape_string(s[inext:inext]) + print(io, ", valid nearby indices [$iprev]=>'$escprev', [$inext]=>'$escnext'") else - print(io, ", valid nearby index [$iprev]=>'$(s[iprev])'") + print(io, ", valid nearby index [$iprev]=>'$escprev'") end end end diff --git a/test/strings/basic.jl b/test/strings/basic.jl index b20c18e636db7..547a006cb7bd6 100644 --- a/test/strings/basic.jl +++ b/test/strings/basic.jl @@ -723,6 +723,11 @@ end @test_throws ArgumentError "abc"[BitArray([true, false, true])] end +@testset "issue #46039 enhance StringIndexError display" begin + @test sprint(showerror, StringIndexError("αn", 2)) == "StringIndexError: invalid index [2], valid nearby indices [1]=>'α', [3]=>'n'" + @test sprint(showerror, StringIndexError("α\n", 2)) == "StringIndexError: invalid index [2], valid nearby indices [1]=>'α', [3]=>'\\n'" +end + @testset "concatenation" begin @test "ab" * "cd" == "abcd" @test 'a' * "bc" == "abc" From 8421c03ce3b0e597c6573a728732fff939d6eb4b Mon Sep 17 00:00:00 2001 From: N5N3 <2642243996@qq.com> Date: Wed, 29 Jun 2022 01:30:12 +0800 Subject: [PATCH 305/369] Improve `foldl`'s stability on nested Iterators (#45789) * Make `Fix1(f, Int)` inference-stable * split `_xfadjoint` into `_xfadjoint_unwrap` and `_xfadjoint_wrap` * Improve `(c::ComposedFunction)(x...)`'s inferability * and fuse it in `Base._xfadjoint`. * define a `Typeof` operator that will partly work around internal type-system bugs Closes #45715 (cherry picked from commit d58289c09c199e01418d0a5c478809b3f6a13fbd) --- base/operators.jl | 27 +++++++++++++++++++++------ base/reduce.jl | 30 +++++++++++++++++++----------- test/operators.jl | 12 ++++++++++++ test/reduce.jl | 13 +++++++++++++ 4 files changed, 65 insertions(+), 17 deletions(-) diff --git a/base/operators.jl b/base/operators.jl index 9949f60bd597c..e42699062f016 100644 --- a/base/operators.jl +++ b/base/operators.jl @@ -910,6 +910,9 @@ julia> [1:5;] |> (x->x.^2) |> sum |> inv """ |>(x, f) = f(x) +_stable_typeof(x) = typeof(x) +_stable_typeof(::Type{T}) where {T} = @isdefined(T) ? Type{T} : DataType + """ f = Returns(value) @@ -936,7 +939,7 @@ julia> f.value struct Returns{V} <: Function value::V Returns{V}(value) where {V} = new{V}(value) - Returns(value) = new{Core.Typeof(value)}(value) + Returns(value) = new{_stable_typeof(value)}(value) end (obj::Returns)(args...; kw...) = obj.value @@ -1027,7 +1030,19 @@ struct ComposedFunction{O,I} <: Function ComposedFunction(outer, inner) = new{Core.Typeof(outer),Core.Typeof(inner)}(outer, inner) end -(c::ComposedFunction)(x...; kw...) = c.outer(c.inner(x...; kw...)) +function (c::ComposedFunction)(x...; kw...) + fs = unwrap_composed(c) + call_composed(fs[1](x...; kw...), tail(fs)...) +end +unwrap_composed(c::ComposedFunction) = (unwrap_composed(c.inner)..., unwrap_composed(c.outer)...) +unwrap_composed(c) = (maybeconstructor(c),) +call_composed(x, f, fs...) = (@inline; call_composed(f(x), fs...)) +call_composed(x, f) = f(x) + +struct Constructor{F} <: Function end +(::Constructor{F})(args...; kw...) where {F} = (@inline; F(args...; kw...)) +maybeconstructor(::Type{F}) where {F} = Constructor{F}() +maybeconstructor(f) = f ∘(f) = f ∘(f, g) = ComposedFunction(f, g) @@ -1074,8 +1089,8 @@ struct Fix1{F,T} <: Function f::F x::T - Fix1(f::F, x::T) where {F,T} = new{F,T}(f, x) - Fix1(f::Type{F}, x::T) where {F,T} = new{Type{F},T}(f, x) + Fix1(f::F, x) where {F} = new{F,_stable_typeof(x)}(f, x) + Fix1(f::Type{F}, x) where {F} = new{Type{F},_stable_typeof(x)}(f, x) end (f::Fix1)(y) = f.f(f.x, y) @@ -1091,8 +1106,8 @@ struct Fix2{F,T} <: Function f::F x::T - Fix2(f::F, x::T) where {F,T} = new{F,T}(f, x) - Fix2(f::Type{F}, x::T) where {F,T} = new{Type{F},T}(f, x) + Fix2(f::F, x) where {F} = new{F,_stable_typeof(x)}(f, x) + Fix2(f::Type{F}, x) where {F} = new{Type{F},_stable_typeof(x)}(f, x) end (f::Fix2)(y) = f.f(y, f.x) diff --git a/base/reduce.jl b/base/reduce.jl index 13e1b69c79ede..587e34105d99e 100644 --- a/base/reduce.jl +++ b/base/reduce.jl @@ -140,17 +140,25 @@ what is returned is `itr′` and op′ = (xfₙ ∘ ... ∘ xf₂ ∘ xf₁)(op) """ -_xfadjoint(op, itr) = (op, itr) -_xfadjoint(op, itr::Generator) = - if itr.f === identity - _xfadjoint(op, itr.iter) - else - _xfadjoint(MappingRF(itr.f, op), itr.iter) - end -_xfadjoint(op, itr::Filter) = - _xfadjoint(FilteringRF(itr.flt, op), itr.itr) -_xfadjoint(op, itr::Flatten) = - _xfadjoint(FlatteningRF(op), itr.it) +function _xfadjoint(op, itr) + itr′, wrap = _xfadjoint_unwrap(itr) + wrap(op), itr′ +end + +_xfadjoint_unwrap(itr) = itr, identity +function _xfadjoint_unwrap(itr::Generator) + itr′, wrap = _xfadjoint_unwrap(itr.iter) + itr.f === identity && return itr′, wrap + return itr′, wrap ∘ Fix1(MappingRF, itr.f) +end +function _xfadjoint_unwrap(itr::Filter) + itr′, wrap = _xfadjoint_unwrap(itr.itr) + return itr′, wrap ∘ Fix1(FilteringRF, itr.flt) +end +function _xfadjoint_unwrap(itr::Flatten) + itr′, wrap = _xfadjoint_unwrap(itr.it) + return itr′, wrap ∘ FlatteningRF +end """ mapfoldl(f, op, itr; [init]) diff --git a/test/operators.jl b/test/operators.jl index 33fb8ad072196..1c5d2d33bf0f8 100644 --- a/test/operators.jl +++ b/test/operators.jl @@ -175,6 +175,15 @@ Base.promote_rule(::Type{T19714}, ::Type{Int}) = T19714 end +@testset "Nested ComposedFunction's stability" begin + f(x) = (1, 1, x...) + g = (f ∘ (f ∘ f)) ∘ (f ∘ f ∘ f) + @test (@inferred (g∘g)(1)) == ntuple(Returns(1), 25) + @test (@inferred g(1)) == ntuple(Returns(1), 13) + h = (-) ∘ (-) ∘ (-) ∘ (-) ∘ (-) ∘ (-) ∘ sum + @test (@inferred h((1, 2, 3); init = 0.0)) == 6.0 +end + @testset "function negation" begin str = randstring(20) @test filter(!isuppercase, str) == replace(str, r"[A-Z]" => "") @@ -302,6 +311,9 @@ end val = [1,2,3] @test Returns(val)(1) === val @test sprint(show, Returns(1.0)) == "Returns{Float64}(1.0)" + + illtype = Vector{Core._typevar(:T, Union{}, Any)} + @test Returns(illtype) == Returns{DataType}(illtype) end @testset "<= (issue #46327)" begin diff --git a/test/reduce.jl b/test/reduce.jl index 0e1568b0af901..4bd0916c1702e 100644 --- a/test/reduce.jl +++ b/test/reduce.jl @@ -677,3 +677,16 @@ end @test mapreduce(+, +, oa, oa) == 2len end end + +# issue #45748 +@testset "foldl's stability for nested Iterators" begin + a = Iterators.flatten((1:3, 1:3)) + b = (2i for i in a if i > 0) + c = Base.Generator(Float64, b) + d = (sin(i) for i in c if i > 0) + @test @inferred(sum(d)) == sum(collect(d)) + @test @inferred(extrema(d)) == extrema(collect(d)) + @test @inferred(maximum(c)) == maximum(collect(c)) + @test @inferred(prod(b)) == prod(collect(b)) + @test @inferred(minimum(a)) == minimum(collect(a)) +end From b10b1dd99d1bffe85f66a7dc59b95dbf6191aa72 Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Tue, 30 Aug 2022 20:11:07 +0200 Subject: [PATCH 306/369] avoid one invalidation of `isinf` when loading Static.jl (#46493) (cherry picked from commit c2a1650fe90dd4966a56a6ebdceeabef49780527) --- stdlib/TOML/src/print.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/TOML/src/print.jl b/stdlib/TOML/src/print.jl index 059414152f727..46c5ecc357fbd 100644 --- a/stdlib/TOML/src/print.jl +++ b/stdlib/TOML/src/print.jl @@ -78,7 +78,7 @@ printvalue(f::MbyFunc, io::IO, value::Integer; _...) = Base.print(io, Int64(value)) # TOML specifies 64-bit signed long range for integer printvalue(f::MbyFunc, io::IO, value::AbstractFloat; _...) = Base.print(io, isnan(value) ? "nan" : - isinf(value) ? string(value > 0 ? "+" : "-", "inf") : + !(isfinite(value)::Bool) ? string(value > 0 ? "+" : "-", "inf") : Float64(value)) # TOML specifies IEEE 754 binary64 for float function printvalue(f::MbyFunc, io::IO, value::AbstractString; _...) Base.print(io, "\"") From f2ed5c33e1d5ae59ef709249e7f8e204d5572888 Mon Sep 17 00:00:00 2001 From: Kristoffer Date: Tue, 30 Aug 2022 22:21:39 +0200 Subject: [PATCH 307/369] bump to latest Pkg release-1.8 --- .../Pkg-03e3bad8ef894f5a8b0edcfb00e4025173652b2b.tar.gz/md5 | 1 + .../Pkg-03e3bad8ef894f5a8b0edcfb00e4025173652b2b.tar.gz/sha512 | 1 + .../Pkg-63f4405d17e11decd2e5eb786cc491322b68c58c.tar.gz/md5 | 1 - .../Pkg-63f4405d17e11decd2e5eb786cc491322b68c58c.tar.gz/sha512 | 1 - stdlib/Pkg.version | 2 +- 5 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 deps/checksums/Pkg-03e3bad8ef894f5a8b0edcfb00e4025173652b2b.tar.gz/md5 create mode 100644 deps/checksums/Pkg-03e3bad8ef894f5a8b0edcfb00e4025173652b2b.tar.gz/sha512 delete mode 100644 deps/checksums/Pkg-63f4405d17e11decd2e5eb786cc491322b68c58c.tar.gz/md5 delete mode 100644 deps/checksums/Pkg-63f4405d17e11decd2e5eb786cc491322b68c58c.tar.gz/sha512 diff --git a/deps/checksums/Pkg-03e3bad8ef894f5a8b0edcfb00e4025173652b2b.tar.gz/md5 b/deps/checksums/Pkg-03e3bad8ef894f5a8b0edcfb00e4025173652b2b.tar.gz/md5 new file mode 100644 index 0000000000000..5d95a7b01b6c7 --- /dev/null +++ b/deps/checksums/Pkg-03e3bad8ef894f5a8b0edcfb00e4025173652b2b.tar.gz/md5 @@ -0,0 +1 @@ +682606d3308f82eaca8c33fe1f0bd083 diff --git a/deps/checksums/Pkg-03e3bad8ef894f5a8b0edcfb00e4025173652b2b.tar.gz/sha512 b/deps/checksums/Pkg-03e3bad8ef894f5a8b0edcfb00e4025173652b2b.tar.gz/sha512 new file mode 100644 index 0000000000000..c4f3205f38150 --- /dev/null +++ b/deps/checksums/Pkg-03e3bad8ef894f5a8b0edcfb00e4025173652b2b.tar.gz/sha512 @@ -0,0 +1 @@ +9de41dced83f007cc425acde3ca1a8646d30dceb8f071381820fac0f5bf57ed58fe1aed0be09317084c5b8abb7a415921f2f22c9517dd610748de53cd5046baa diff --git a/deps/checksums/Pkg-63f4405d17e11decd2e5eb786cc491322b68c58c.tar.gz/md5 b/deps/checksums/Pkg-63f4405d17e11decd2e5eb786cc491322b68c58c.tar.gz/md5 deleted file mode 100644 index 267a11ce9e392..0000000000000 --- a/deps/checksums/Pkg-63f4405d17e11decd2e5eb786cc491322b68c58c.tar.gz/md5 +++ /dev/null @@ -1 +0,0 @@ -eb99c4458db02049e01122431211678a diff --git a/deps/checksums/Pkg-63f4405d17e11decd2e5eb786cc491322b68c58c.tar.gz/sha512 b/deps/checksums/Pkg-63f4405d17e11decd2e5eb786cc491322b68c58c.tar.gz/sha512 deleted file mode 100644 index de1835da35995..0000000000000 --- a/deps/checksums/Pkg-63f4405d17e11decd2e5eb786cc491322b68c58c.tar.gz/sha512 +++ /dev/null @@ -1 +0,0 @@ -57fe5f9d897ff82ba64c6e4d8f102a2fc5d689340b41993c4f2cab3af0f516427d5e3696e0db75cedc49866ef19d4c87194e175f2a51391e1ae76546b10e997d diff --git a/stdlib/Pkg.version b/stdlib/Pkg.version index 464e7fd2c45a4..cba86fbb03674 100644 --- a/stdlib/Pkg.version +++ b/stdlib/Pkg.version @@ -1,4 +1,4 @@ PKG_BRANCH = release-1.8 -PKG_SHA1 = 63f4405d17e11decd2e5eb786cc491322b68c58c +PKG_SHA1 = 03e3bad8ef894f5a8b0edcfb00e4025173652b2b PKG_GIT_URL := https://github.com/JuliaLang/Pkg.jl.git PKG_TAR_URL = https://api.github.com/repos/JuliaLang/Pkg.jl/tarball/$1 From d68417f008a68dbacc26458ce2c1f537fecc620c Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Wed, 31 Aug 2022 11:30:54 +0200 Subject: [PATCH 308/369] fix invalidations in REPL LineEdit.jl from Static.jl (#46548) * fix invalidations in REPL LineEdit.jl from Static.jl (cherry picked from commit 99d8c7b16acd393dd8d786416174653cebbd7d3b) --- stdlib/REPL/src/LineEdit.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/REPL/src/LineEdit.jl b/stdlib/REPL/src/LineEdit.jl index f48cf27c8edd8..a8beb58b4eb92 100644 --- a/stdlib/REPL/src/LineEdit.jl +++ b/stdlib/REPL/src/LineEdit.jl @@ -1438,7 +1438,7 @@ function normalize_keys(keymap::Union{Dict{Char,Any},AnyDict}) return ret end -function add_nested_key!(keymap::Dict, key::Union{String, Char}, value; override = false) +function add_nested_key!(keymap::Dict{Char, Any}, key::Union{String, Char}, value; override::Bool = false) y = iterate(key) while y !== nothing c, i = y @@ -1453,7 +1453,7 @@ function add_nested_key!(keymap::Dict, key::Union{String, Char}, value; override elseif !(c in keys(keymap) && isa(keymap[c], Dict)) keymap[c] = Dict{Char,Any}() end - keymap = keymap[c] + keymap = keymap[c]::Dict{Char, Any} end end From 173f33630ea9d53a8c90a8b2344e74af7cb12166 Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Wed, 31 Aug 2022 14:04:37 +0200 Subject: [PATCH 309/369] fix another invalidation from Static.jl (#46546) This is a follow-up to https://github.com/JuliaLang/julia/pull/46481. I suggest the labels `latency` and `backport-1.8`. (cherry picked from commit f1f5d590df26bd856db0f5ce5590b2975ca6ab84) --- stdlib/Logging/src/ConsoleLogger.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/Logging/src/ConsoleLogger.jl b/stdlib/Logging/src/ConsoleLogger.jl index 86e3d587eb452..3d283e7a33456 100644 --- a/stdlib/Logging/src/ConsoleLogger.jl +++ b/stdlib/Logging/src/ConsoleLogger.jl @@ -118,7 +118,7 @@ function handle_message(logger::ConsoleLogger, level::LogLevel, message, _module # split into lines. msglines = [(indent=0, msg=l) for l in split(chomp(convert(String, string(message))::String), '\n')] stream = logger.stream - if !isopen(stream) + if !(isopen(stream)::Bool) stream = stderr end dsize = displaysize(stream)::Tuple{Int,Int} From afb6c60d69a38e8a2442a0c7e87c47b8880ad294 Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Tue, 6 Sep 2022 17:09:57 +0200 Subject: [PATCH 310/369] set VERSION to 1.8.1 (#46638) --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 27f9cd322bb91..a8fdfda1c7824 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.8.0 +1.8.1 From d174fd434ca823b4e850ac38d57433db57f340c9 Mon Sep 17 00:00:00 2001 From: Morten Piibeleht Date: Fri, 15 Jul 2022 03:51:07 +1200 Subject: [PATCH 311/369] docs: print extra information when deploying (#46030) (cherry picked from commit b3b229e2be9bb661ed0dbff525c7a9f20a7f4785) --- doc/make.jl | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/doc/make.jl b/doc/make.jl index 1094736fffd02..f717f85f04e84 100644 --- a/doc/make.jl +++ b/doc/make.jl @@ -343,7 +343,10 @@ struct BuildBotConfig <: Documenter.DeployConfig end Documenter.authentication_method(::BuildBotConfig) = Documenter.HTTPS Documenter.authenticated_repo_url(::BuildBotConfig) = "https://github.com/JuliaLang/docs.julialang.org.git" function Documenter.deploy_folder(::BuildBotConfig; devurl, repo, branch, kwargs...) - haskey(ENV, "DOCUMENTER_KEY") || return Documenter.DeployDecision(; all_ok=false) + if !haskey(ENV, "DOCUMENTER_KEY") + @info "Unable to deploy the documentation: DOCUMENTER_KEY missing" + return Documenter.DeployDecision(; all_ok=false) + end if Base.GIT_VERSION_INFO.tagged_commit # Strip extra pre-release info (1.5.0-rc2.0 -> 1.5.0-rc2) ver = VersionNumber(VERSION.major, VERSION.minor, VERSION.patch, @@ -353,6 +356,11 @@ function Documenter.deploy_folder(::BuildBotConfig; devurl, repo, branch, kwargs elseif Base.GIT_VERSION_INFO.branch == "master" return Documenter.DeployDecision(; all_ok=true, repo, branch, subfolder=devurl) end + @info """ + Unable to deploy the documentation: invalid GIT_VERSION_INFO + GIT_VERSION_INFO.tagged_commit: $(Base.GIT_VERSION_INFO.tagged_commit) + GIT_VERSION_INFO.branch: $(Base.GIT_VERSION_INFO.branch) + """ return Documenter.DeployDecision(; all_ok=false) end @@ -380,12 +388,16 @@ function Documenter.Writers.HTMLWriter.expand_versions(dir::String, v::Versions) return Documenter.Writers.HTMLWriter.expand_versions(dir, v.versions) end -deploydocs( - repo = "github.com/JuliaLang/docs.julialang.org.git", - deploy_config = BuildBotConfig(), - target = joinpath(buildroot, "doc", "_build", "html", "en"), - dirname = "en", - devurl = devurl, - versions = Versions(["v#.#", devurl => devurl]), - archive = get(ENV, "DOCUMENTER_ARCHIVE", nothing), -) +if "deploy" in ARGS + deploydocs( + repo = "github.com/JuliaLang/docs.julialang.org.git", + deploy_config = BuildBotConfig(), + target = joinpath(buildroot, "doc", "_build", "html", "en"), + dirname = "en", + devurl = devurl, + versions = Versions(["v#.#", devurl => devurl]), + archive = get(ENV, "DOCUMENTER_ARCHIVE", nothing), + ) +else + @info "Skipping deployment ('deploy' not passed)" +end From f21aea0c45303521c8827fad17173cae679f8720 Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Wed, 31 Aug 2022 14:06:18 +0200 Subject: [PATCH 312/369] Improve type stability of `platforms_match(::AbstractPlatform, ::AbstractPlatform)` (#46547) This improvement prevents invalidations in binaryplatforms.jl when loading Static.jl. (cherry picked from commit 25a07bf97b5b26ecb80bff0d687e9decd45912b7) --- base/binaryplatforms.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/binaryplatforms.jl b/base/binaryplatforms.jl index e2dda00bf58e7..d70cca9c48e39 100644 --- a/base/binaryplatforms.jl +++ b/base/binaryplatforms.jl @@ -1027,7 +1027,7 @@ function platforms_match(a::AbstractPlatform, b::AbstractPlatform) # Call the comparator, passing in which objects requested this comparison (one, the other, or both) # For some comparators this doesn't matter, but for non-symmetrical comparisons, it does. - if !comparator(ak, bk, a_comp == comparator, b_comp == comparator) + if !(comparator(ak, bk, a_comp == comparator, b_comp == comparator)::Bool) return false end end From 89facae94e9010967d57738076c7fb490b4d1970 Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Wed, 31 Aug 2022 14:08:55 +0200 Subject: [PATCH 313/369] Improve inference in REPL LineEdit.jl `getEntry` (#46550) This prevents invalidations from loading Static.jl (cherry picked from commit adc72d106520bbe9ac1e5363649ff690465c6ce6) --- stdlib/REPL/src/LineEdit.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/REPL/src/LineEdit.jl b/stdlib/REPL/src/LineEdit.jl index a8beb58b4eb92..3854a81ee0bcb 100644 --- a/stdlib/REPL/src/LineEdit.jl +++ b/stdlib/REPL/src/LineEdit.jl @@ -1598,7 +1598,7 @@ end function getEntry(keymap::Dict{Char,Any},key::Union{String,Char}) v = keymap for c in key - if !haskey(v,c) + if !(haskey(v,c)::Bool) return nothing end v = v[c] From 53a7c00d77e488d35dbcdbae6db6760375508633 Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Wed, 31 Aug 2022 14:12:01 +0200 Subject: [PATCH 314/369] Improve inferrability of `open(f, cmd, ...)` (#46551) This fixes invalidations from loading Static.jl (cherry picked from commit 7537cb3990355d3c08f2f15b82e4bf54ecac3e0f) --- base/process.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/process.jl b/base/process.jl index 016c495a76a8b..719d1d5436ada 100644 --- a/base/process.jl +++ b/base/process.jl @@ -430,7 +430,7 @@ function open(f::Function, cmds::AbstractCmd, args...; kwargs...) rethrow() end close(P.in) - if !eof(P.out) + if !(eof(P.out)::Bool) waitkill(P) throw(_UVError("open(do)", UV_EPIPE)) end From 056e2607d38bc94755b41326de0f20efb049665b Mon Sep 17 00:00:00 2001 From: Morten Piibeleht Date: Mon, 5 Sep 2022 14:33:33 +1200 Subject: [PATCH 315/369] Deploy release-* branch docs too (#46618) (cherry picked from commit c8e18103c095a19999ff7b18a04d0069cc757bfc) --- doc/make.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/make.jl b/doc/make.jl index f717f85f04e84..5b5976348d35d 100644 --- a/doc/make.jl +++ b/doc/make.jl @@ -347,6 +347,7 @@ function Documenter.deploy_folder(::BuildBotConfig; devurl, repo, branch, kwargs @info "Unable to deploy the documentation: DOCUMENTER_KEY missing" return Documenter.DeployDecision(; all_ok=false) end + release = match(r"release-([0-9]+\.[0-9]+)", Base.GIT_VERSION_INFO.branch) if Base.GIT_VERSION_INFO.tagged_commit # Strip extra pre-release info (1.5.0-rc2.0 -> 1.5.0-rc2) ver = VersionNumber(VERSION.major, VERSION.minor, VERSION.patch, @@ -355,6 +356,10 @@ function Documenter.deploy_folder(::BuildBotConfig; devurl, repo, branch, kwargs return Documenter.DeployDecision(; all_ok=true, repo, branch, subfolder) elseif Base.GIT_VERSION_INFO.branch == "master" return Documenter.DeployDecision(; all_ok=true, repo, branch, subfolder=devurl) + elseif !isnothing(release) + # If this is a non-tag build from a release-* branch, we deploy them as dev docs into the + # appropriate vX.Y-dev subdirectory. + return Documenter.DeployDecision(; all_ok=true, repo, branch, subfolder="v$(release[1])-dev") end @info """ Unable to deploy the documentation: invalid GIT_VERSION_INFO From 3761fd3fff8fc414375215457dd300891d1e69a6 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Tue, 6 Sep 2022 12:31:39 -0400 Subject: [PATCH 316/369] add warning for function declaration with undefined static parameter (#46608) Refs #27813 (does not fix it) (cherry picked from commit cfec1731d123868ca2b755f27a9e7bd3aca4060c) --- src/method.c | 61 ++++++++++++++---------- stdlib/LinearAlgebra/src/bunchkaufman.jl | 2 +- 2 files changed, 38 insertions(+), 25 deletions(-) diff --git a/src/method.c b/src/method.c index 7325670bd76a4..6cb6e9114b04d 100644 --- a/src/method.c +++ b/src/method.c @@ -906,12 +906,6 @@ JL_DLLEXPORT jl_method_t* jl_method_def(jl_svec_t *argdata, size_t i, na = jl_svec_len(atypes); argtype = (jl_value_t*)jl_apply_tuple_type(atypes); - for (i = jl_svec_len(tvars); i > 0; i--) { - jl_value_t *tv = jl_svecref(tvars, i - 1); - if (!jl_is_typevar(tv)) - jl_type_error("method signature", (jl_value_t*)jl_tvar_type, tv); - argtype = jl_new_struct(jl_unionall_type, tv, argtype); - } jl_methtable_t *external_mt = mt; if (!mt) @@ -921,6 +915,12 @@ JL_DLLEXPORT jl_method_t* jl_method_def(jl_svec_t *argdata, if (mt->frozen) jl_error("cannot add methods to a builtin function"); + assert(jl_is_linenode(functionloc)); + jl_sym_t *file = (jl_sym_t*)jl_linenode_file(functionloc); + if (!jl_is_symbol(file)) + file = jl_empty_sym; + int32_t line = jl_linenode_line(functionloc); + // TODO: derive our debug name from the syntax instead of the type name = mt->name; if (mt == jl_type_type_mt || mt == jl_nonfunction_mt || external_mt) { @@ -937,6 +937,29 @@ JL_DLLEXPORT jl_method_t* jl_method_def(jl_svec_t *argdata, } } } + + for (i = jl_svec_len(tvars); i > 0; i--) { + jl_value_t *tv = jl_svecref(tvars, i - 1); + if (!jl_is_typevar(tv)) + jl_type_error("method signature", (jl_value_t*)jl_tvar_type, tv); + if (!jl_has_typevar(argtype, (jl_tvar_t*)tv)) // deprecate this to an error in v2 + jl_printf(JL_STDERR, + "WARNING: method definition for %s at %s:%d declares type variable %s but does not use it.\n", + jl_symbol_name(name), + jl_symbol_name(file), + line, + jl_symbol_name(((jl_tvar_t*)tv)->name)); + argtype = jl_new_struct(jl_unionall_type, tv, argtype); + } + if (jl_has_free_typevars(argtype)) { + jl_exceptionf(jl_argumenterror_type, + "method definition for %s at %s:%d has free type variables", + jl_symbol_name(name), + jl_symbol_name(file), + line); + } + + if (!jl_is_code_info(f)) { // this occurs when there is a closure being added to an out-of-scope function // the user should only do this at the toplevel @@ -951,20 +974,10 @@ JL_DLLEXPORT jl_method_t* jl_method_def(jl_svec_t *argdata, m->name = name; m->isva = isva; m->nargs = nargs; - assert(jl_is_linenode(functionloc)); - jl_value_t *file = jl_linenode_file(functionloc); - m->file = jl_is_symbol(file) ? (jl_sym_t*)file : jl_empty_sym; - m->line = jl_linenode_line(functionloc); + m->file = file; + m->line = line; jl_method_set_source(m, f); - if (jl_has_free_typevars(argtype)) { - jl_exceptionf(jl_argumenterror_type, - "method definition for %s at %s:%d has free type variables", - jl_symbol_name(name), - jl_symbol_name(m->file), - m->line); - } - for (i = 0; i < na; i++) { jl_value_t *elt = jl_svecref(atypes, i); if (!jl_is_type(elt) && !jl_is_typevar(elt) && !jl_is_vararg(elt)) { @@ -974,22 +987,22 @@ JL_DLLEXPORT jl_method_t* jl_method_def(jl_svec_t *argdata, "invalid type for argument number %d in method definition for %s at %s:%d", i, jl_symbol_name(name), - jl_symbol_name(m->file), - m->line); + jl_symbol_name(file), + line); else jl_exceptionf(jl_argumenterror_type, "invalid type for argument %s in method definition for %s at %s:%d", jl_symbol_name(argname), jl_symbol_name(name), - jl_symbol_name(m->file), - m->line); + jl_symbol_name(file), + line); } if (jl_is_vararg(elt) && i < na-1) jl_exceptionf(jl_argumenterror_type, "Vararg on non-final argument in method definition for %s at %s:%d", jl_symbol_name(name), - jl_symbol_name(m->file), - m->line); + jl_symbol_name(file), + line); } #ifdef RECORD_METHOD_ORDER diff --git a/stdlib/LinearAlgebra/src/bunchkaufman.jl b/stdlib/LinearAlgebra/src/bunchkaufman.jl index 8de71109082d0..0bfa42ab483eb 100644 --- a/stdlib/LinearAlgebra/src/bunchkaufman.jl +++ b/stdlib/LinearAlgebra/src/bunchkaufman.jl @@ -80,7 +80,7 @@ BunchKaufman(A::AbstractMatrix{T}, ipiv::AbstractVector{<:Integer}, uplo::Abstra symmetric::Bool, rook::Bool, info::BlasInt) where {T} = BunchKaufman{T,typeof(A),typeof(ipiv)}(A, ipiv, uplo, symmetric, rook, info) # backwards-compatible constructors (remove with Julia 2.0) -@deprecate(BunchKaufman(LD, ipiv, uplo, symmetric, rook, info) where {T,S}, +@deprecate(BunchKaufman{T,S}(LD, ipiv, uplo, symmetric, rook, info) where {T,S}, BunchKaufman{T,S,typeof(ipiv)}(LD, ipiv, uplo, symmetric, rook, info), false) # iteration for destructuring into components From e0a820e4d6557a8ca87707a6c96c189826871eab Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Fri, 2 Sep 2022 12:27:18 -0400 Subject: [PATCH 317/369] avoid inferring when compilation signature differs from call site sig (#46581) Added in #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 #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) ``` --- base/compiler/abstractinterpretation.jl | 38 ++++++++++++++----------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index 98bcfa4f18661..42a1badcc8e47 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -111,7 +111,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), result = abstract_call_method(interp, method, sig_n, svec(), multiple_matches, sv) rt = result.rt edge = result.edge - edge !== nothing && push!(edges, edge) + edge === nothing || push!(edges, edge) this_argtypes = isa(matches, MethodMatches) ? argtypes : matches.applicable_argtypes[i] this_arginfo = ArgInfo(fargs, this_argtypes) const_call_result = abstract_call_method_with_const_args(interp, result, @@ -136,25 +136,11 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), this_conditional = ignorelimited(this_rt) this_rt = widenwrappedconditional(this_rt) else - if infer_compilation_signature(interp) - # Also infer the compilation signature for this method, so it's available - # to the compiler in case it ends up needing it (which is likely). - csig = get_compileable_sig(method, sig, match.sparams) - if csig !== nothing && csig !== sig - # The result of this inference is not directly used, so temporarily empty - # the use set for the current SSA value. - saved_uses = sv.ssavalue_uses[sv.currpc] - sv.ssavalue_uses[sv.currpc] = empty_bitset - abstract_call_method(interp, method, csig, match.sparams, multiple_matches, sv) - sv.ssavalue_uses[sv.currpc] = saved_uses - end - end - result = abstract_call_method(interp, method, sig, match.sparams, multiple_matches, sv) this_conditional = ignorelimited(result.rt) this_rt = widenwrappedconditional(result.rt) edge = result.edge - edge !== nothing && push!(edges, edge) + edge === nothing || push!(edges, edge) # try constant propagation with argtypes for this match # this is in preparation for inlining, or improving the return result this_argtypes = isa(matches, MethodMatches) ? argtypes : matches.applicable_argtypes[i] @@ -214,6 +200,26 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f), rettype = from_interprocedural!(rettype, sv, arginfo, conditionals) + # Also considering inferring the compilation signature for this method, so + # it is available to the compiler in case it ends up needing it. + if infer_compilation_signature(interp) && 1 == seen == napplicable && rettype !== Any && rettype !== Union{} && !is_removable_if_unused(all_effects) + match = applicable[1]::MethodMatch + method = match.method + sig = match.spec_types + mi = specialize_method(match; preexisting=true) + if mi !== nothing && !const_prop_methodinstance_heuristic(interp, match, mi::MethodInstance, arginfo, sv) + csig = get_compileable_sig(method, sig, match.sparams) + if csig !== nothing && csig !== sig + # The result of this inference is not directly used, so temporarily empty + # the use set for the current SSA value. + saved_uses = sv.ssavalue_uses[sv.currpc] + sv.ssavalue_uses[sv.currpc] = empty_bitset + abstract_call_method(interp, method, csig, match.sparams, multiple_matches, sv) + sv.ssavalue_uses[sv.currpc] = saved_uses + end + end + end + if call_result_unused(sv) && !(rettype === Bottom) add_remark!(interp, sv, "Call result type was widened because the return value is unused") # We're mainly only here because the optimizer might want this code, From 16a7aacbae0ce4b2f2eb70667cd153ac8fd2255c Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Tue, 13 Sep 2022 06:57:07 -0400 Subject: [PATCH 318/369] For Julia 1.8.x, `Tar` should track the `release-1.10` branch of the `JuliaIO/Tar.jl` repo (not the `master` branch of the `JuliaIO/Tar.jl` repo) (#46733) --- stdlib/Tar.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/Tar.version b/stdlib/Tar.version index b7ee00e5a2666..0d97a0ef4054e 100644 --- a/stdlib/Tar.version +++ b/stdlib/Tar.version @@ -1,4 +1,4 @@ -TAR_BRANCH = master +TAR_BRANCH = release-1.10 TAR_SHA1 = 0f8a73d5cd4b0c8f1f3c36799c96e9515e9dc595 TAR_GIT_URL := https://github.com/JuliaIO/Tar.jl.git TAR_TAR_URL = https://api.github.com/repos/JuliaIO/Tar.jl/tarball/$1 From 9f2d553b1beb54c47da3ff941eff69691130e135 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Wed, 14 Sep 2022 14:17:51 +0900 Subject: [PATCH 319/369] inference: concretize `invoke` callsite correctly (#46743) 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 ``` --- base/compiler/abstractinterpretation.jl | 34 +++++++++++++++++-------- base/compiler/ssair/inlining.jl | 5 ++++ test/compiler/inference.jl | 21 +++++++++++++++ 3 files changed, 50 insertions(+), 10 deletions(-) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index 42a1badcc8e47..fae3def38c34d 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -771,13 +771,25 @@ function collect_const_args((; argtypes)::ArgInfo) isa(a, Const) ? a.val : isconstType(a) ? (a::DataType).parameters[1] : (a::DataType).instance - end for i in 2:length(argtypes) ] + end for i = 2:length(argtypes) ] +end + +struct InvokeCall + types # ::Type + lookupsig # ::Type + InvokeCall(@nospecialize(types), @nospecialize(lookupsig)) = new(types, lookupsig) end function concrete_eval_call(interp::AbstractInterpreter, - @nospecialize(f), result::MethodCallResult, arginfo::ArgInfo, sv::InferenceState) + @nospecialize(f), result::MethodCallResult, arginfo::ArgInfo, sv::InferenceState, + invokecall::Union{Nothing,InvokeCall}=nothing) concrete_eval_eligible(interp, f, result, arginfo, sv) || return nothing args = collect_const_args(arginfo) + if invokecall !== nothing + # this call should be `invoke`d, rewrite `args` back now + pushfirst!(args, f, invokecall.types) + f = invoke + end world = get_world_counter(interp) value = try Core._call_in_world_total(world, f, args...) @@ -817,13 +829,13 @@ struct ConstCallResults new(rt, const_result, effects) end -function abstract_call_method_with_const_args(interp::AbstractInterpreter, result::MethodCallResult, - @nospecialize(f), arginfo::ArgInfo, match::MethodMatch, - sv::InferenceState) +function abstract_call_method_with_const_args(interp::AbstractInterpreter, + result::MethodCallResult, @nospecialize(f), arginfo::ArgInfo, match::MethodMatch, + sv::InferenceState, invokecall::Union{Nothing,InvokeCall}=nothing) if !const_prop_enabled(interp, sv, match) return nothing end - val = concrete_eval_call(interp, f, result, arginfo, sv) + val = concrete_eval_call(interp, f, result, arginfo, sv, invokecall) if val !== nothing add_backedge!(result.edge, sv) return val @@ -1553,10 +1565,10 @@ function abstract_invoke(interp::AbstractInterpreter, (; fargs, argtypes)::ArgIn nargtype isa DataType || return CallMeta(Any, Effects(), false) # other cases are not implemented below isdispatchelem(ft) || return CallMeta(Any, Effects(), false) # check that we might not have a subtype of `ft` at runtime, before doing supertype lookup below ft = ft::DataType - types = rewrap_unionall(Tuple{ft, unwrap_unionall(types).parameters...}, types)::Type + lookupsig = rewrap_unionall(Tuple{ft, unwrap_unionall(types).parameters...}, types)::Type nargtype = Tuple{ft, nargtype.parameters...} argtype = Tuple{ft, argtype.parameters...} - match, valid_worlds, overlayed = findsup(types, method_table(interp)) + match, valid_worlds, overlayed = findsup(lookupsig, method_table(interp)) match === nothing && return CallMeta(Any, Effects(), false) update_valid_age!(sv, valid_worlds) method = match.method @@ -1575,8 +1587,10 @@ function abstract_invoke(interp::AbstractInterpreter, (; fargs, argtypes)::ArgIn # t, a = ti.parameters[i], argtypes′[i] # argtypes′[i] = t ⊑ a ? t : a # end - const_call_result = abstract_call_method_with_const_args(interp, result, - overlayed ? nothing : singleton_type(ft′), arginfo, match, sv) + f = overlayed ? nothing : singleton_type(ft′) + invokecall = InvokeCall(types, lookupsig) + const_call_result = abstract_call_method_with_const_args(interp, + result, f, arginfo, match, sv, invokecall) const_result = nothing if const_call_result !== nothing if const_call_result.rt ⊑ rt diff --git a/base/compiler/ssair/inlining.jl b/base/compiler/ssair/inlining.jl index e51581e62569d..70e7038bbb8cc 100644 --- a/base/compiler/ssair/inlining.jl +++ b/base/compiler/ssair/inlining.jl @@ -1066,6 +1066,11 @@ function inline_invoke!( return nothing end +function invoke_signature(invokesig::Vector{Any}) + ft, argtyps = widenconst(invokesig[2]), instanceof_tfunc(widenconst(invokesig[3]))[1] + return rewrap_unionall(Tuple{ft, unwrap_unionall(argtyps).parameters...}, argtyps) +end + function narrow_opaque_closure!(ir::IRCode, stmt::Expr, @nospecialize(info), state::InliningState) if isa(info, OpaqueClosureCreateInfo) lbt = argextype(stmt.args[2], ir) diff --git a/test/compiler/inference.jl b/test/compiler/inference.jl index 70a720e53f209..00470aaccf248 100644 --- a/test/compiler/inference.jl +++ b/test/compiler/inference.jl @@ -4074,3 +4074,24 @@ end)[2] == Union{} @time 1 end end)[2] == Union{} + +invoke_concretized1(a::Int) = a > 0 ? :int : nothing +invoke_concretized1(a::Integer) = a > 0 ? "integer" : nothing +# check if `invoke(invoke_concretized1, Tuple{Integer}, ::Int)` is foldable +@test Base.infer_effects((Int,)) do a + Base.@invoke invoke_concretized1(a::Integer) +end |> Core.Compiler.is_foldable +@test Base.return_types() do + Base.@invoke invoke_concretized1(42::Integer) +end |> only === String + +invoke_concretized2(a::Int) = a > 0 ? :int : nothing +invoke_concretized2(a::Integer) = a > 0 ? :integer : nothing +# check if `invoke(invoke_concretized2, Tuple{Integer}, ::Int)` is foldable +@test Base.infer_effects((Int,)) do a + Base.@invoke invoke_concretized2(a::Integer) +end |> Core.Compiler.is_foldable +@test let + Base.Experimental.@force_compile + Base.@invoke invoke_concretized2(42::Integer) +end === :integer From 6e4cf2903fab6cfd12165c547660e7ab1a5b6be0 Mon Sep 17 00:00:00 2001 From: Oscar Smith Date: Wed, 14 Sep 2022 20:07:05 -0400 Subject: [PATCH 320/369] Remove contradictory inline annotations (#46767) 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. --- base/special/exp.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/special/exp.jl b/base/special/exp.jl index e955d182f29d3..cc4c8eee3323d 100644 --- a/base/special/exp.jl +++ b/base/special/exp.jl @@ -177,7 +177,7 @@ const J_TABLE = (0x0000000000000000, 0xaac00b1afa5abcbe, 0x9b60163da9fb3335, 0xa # XXX we want to mark :consistent-cy here so that this function can be concrete-folded, # because the effect analysis currently can't prove it in the presence of `@inbounds` or # `:boundscheck`, but still the access to `J_TABLE` is really safe here -@noinline Base.@assume_effects :consistent @inline function table_unpack(ind::Int32) +Base.@assume_effects :consistent function table_unpack(ind::Int32) ind = ind & 255 + 1 # 255 == length(J_TABLE) - 1 j = @inbounds J_TABLE[ind] jU = reinterpret(Float64, JU_CONST | (j&JU_MASK)) From a233e3e4ac95dae415e493ad6ba6d386edc94559 Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Thu, 15 Sep 2022 17:51:45 +0200 Subject: [PATCH 321/369] bump the Tar stdlib from 0f8a73d to c9e7185 for Julia 1.8 (#46758) --- .../Tar-0f8a73d5cd4b0c8f1f3c36799c96e9515e9dc595.tar.gz/md5 | 1 - .../Tar-0f8a73d5cd4b0c8f1f3c36799c96e9515e9dc595.tar.gz/sha512 | 1 - .../Tar-c9e71856688bffacda56e1e2926a741bbb6e4784.tar.gz/md5 | 1 + .../Tar-c9e71856688bffacda56e1e2926a741bbb6e4784.tar.gz/sha512 | 1 + stdlib/Tar.version | 2 +- 5 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 deps/checksums/Tar-0f8a73d5cd4b0c8f1f3c36799c96e9515e9dc595.tar.gz/md5 delete mode 100644 deps/checksums/Tar-0f8a73d5cd4b0c8f1f3c36799c96e9515e9dc595.tar.gz/sha512 create mode 100644 deps/checksums/Tar-c9e71856688bffacda56e1e2926a741bbb6e4784.tar.gz/md5 create mode 100644 deps/checksums/Tar-c9e71856688bffacda56e1e2926a741bbb6e4784.tar.gz/sha512 diff --git a/deps/checksums/Tar-0f8a73d5cd4b0c8f1f3c36799c96e9515e9dc595.tar.gz/md5 b/deps/checksums/Tar-0f8a73d5cd4b0c8f1f3c36799c96e9515e9dc595.tar.gz/md5 deleted file mode 100644 index 60ff3e45e5336..0000000000000 --- a/deps/checksums/Tar-0f8a73d5cd4b0c8f1f3c36799c96e9515e9dc595.tar.gz/md5 +++ /dev/null @@ -1 +0,0 @@ -faf67b4fe8308fc6f9d7ed9bfbd855a9 diff --git a/deps/checksums/Tar-0f8a73d5cd4b0c8f1f3c36799c96e9515e9dc595.tar.gz/sha512 b/deps/checksums/Tar-0f8a73d5cd4b0c8f1f3c36799c96e9515e9dc595.tar.gz/sha512 deleted file mode 100644 index b2e786c204e70..0000000000000 --- a/deps/checksums/Tar-0f8a73d5cd4b0c8f1f3c36799c96e9515e9dc595.tar.gz/sha512 +++ /dev/null @@ -1 +0,0 @@ -d97bd68d6d651ec13f399f9124cc0abba7092532b467fdcbb9c886f5f3d121e79392bfce7c6e631178ff175131360415a98645661da0f9c83f27db50691ce133 diff --git a/deps/checksums/Tar-c9e71856688bffacda56e1e2926a741bbb6e4784.tar.gz/md5 b/deps/checksums/Tar-c9e71856688bffacda56e1e2926a741bbb6e4784.tar.gz/md5 new file mode 100644 index 0000000000000..bddd86b3a714c --- /dev/null +++ b/deps/checksums/Tar-c9e71856688bffacda56e1e2926a741bbb6e4784.tar.gz/md5 @@ -0,0 +1 @@ +47f02b8f77000fc3aa53c48fadc07f58 diff --git a/deps/checksums/Tar-c9e71856688bffacda56e1e2926a741bbb6e4784.tar.gz/sha512 b/deps/checksums/Tar-c9e71856688bffacda56e1e2926a741bbb6e4784.tar.gz/sha512 new file mode 100644 index 0000000000000..bc3e07d23b5a9 --- /dev/null +++ b/deps/checksums/Tar-c9e71856688bffacda56e1e2926a741bbb6e4784.tar.gz/sha512 @@ -0,0 +1 @@ +0aa074c752083c7c1357060c34e161356fcbe9bc27a2dd9bf1c5f0f51fe7bf2ea1b6dc2227c873a2605fa28332e98ff1fb1077f7870dc3e944590e47e38b7f6b diff --git a/stdlib/Tar.version b/stdlib/Tar.version index 0d97a0ef4054e..6039b8428736e 100644 --- a/stdlib/Tar.version +++ b/stdlib/Tar.version @@ -1,4 +1,4 @@ TAR_BRANCH = release-1.10 -TAR_SHA1 = 0f8a73d5cd4b0c8f1f3c36799c96e9515e9dc595 +TAR_SHA1 = c9e71856688bffacda56e1e2926a741bbb6e4784 TAR_GIT_URL := https://github.com/JuliaIO/Tar.jl.git TAR_TAR_URL = https://api.github.com/repos/JuliaIO/Tar.jl/tarball/$1 From 237c92d30e369de4152cd26c04ea79818cd0e012 Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Tue, 6 Sep 2022 20:38:21 +0200 Subject: [PATCH 322/369] Improve dispatch of `findall(testf::F, A::AbstractArray)` (#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 31d4c22f29e9dfa7cbe7d3c4f5212c44c5df7baf) --- base/array.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/array.jl b/base/array.jl index baef032f96b3f..be9eda37a2396 100644 --- a/base/array.jl +++ b/base/array.jl @@ -2308,7 +2308,7 @@ findall(testf::Function, A) = collect(first(p) for p in pairs(A) if testf(last(p # Broadcasting is much faster for small testf, and computing # integer indices from logical index using findall has a negligible cost -findall(testf::Function, A::AbstractArray) = findall(testf.(A)) +findall(testf::F, A::AbstractArray) where {F<:Function} = findall(testf.(A)) """ findall(A) From 3fa80734ba8289bf4ae2cc2a9f1be8f11169e999 Mon Sep 17 00:00:00 2001 From: Rafael Fourquet Date: Wed, 7 Sep 2022 23:24:20 +0200 Subject: [PATCH 323/369] fix issue #46665, `prod(::Array{BigInt})` (#46667) 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 f7b4ebece6ec76289065c523bbc3a2856d3263ae) --- base/gmp.jl | 8 ++++++-- test/gmp.jl | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/base/gmp.jl b/base/gmp.jl index 435a0a0954ce9..59ab162429e87 100644 --- a/base/gmp.jl +++ b/base/gmp.jl @@ -667,8 +667,12 @@ function prod(arr::AbstractArray{BigInt}) # to account for the rounding to limbs in MPZ.mul! # (BITS_PER_LIMB-1 would typically be enough, to which we add # 1 for the initial multiplication by init=1 in foldl) - nbits = GC.@preserve arr sum(arr; init=BITS_PER_LIMB) do x - abs(x.size) * BITS_PER_LIMB - leading_zeros(unsafe_load(x.d)) + nbits = BITS_PER_LIMB + for x in arr + iszero(x) && return zero(BigInt) + xsize = abs(x.size) + lz = GC.@preserve x leading_zeros(unsafe_load(x.d, xsize)) + nbits += xsize * BITS_PER_LIMB - lz end init = BigInt(; nbits) MPZ.set_si!(init, 1) diff --git a/test/gmp.jl b/test/gmp.jl index 2eb1e9faf47da..1d30925071b9a 100644 --- a/test/gmp.jl +++ b/test/gmp.jl @@ -227,6 +227,7 @@ let a, b @test 0 == sum(BigInt[]) isa BigInt @test prod(b) == foldl(*, b) @test 1 == prod(BigInt[]) isa BigInt + @test prod(BigInt[0, 0, 0]) == 0 # issue #46665 end @testset "Iterated arithmetic" begin From 2aaded9ced5a29e728e26004cfd2ecd81d41ca81 Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Sun, 11 Sep 2022 14:50:28 +0200 Subject: [PATCH 324/369] fix invalidations from loading ArrayInterface.jl (#46673) * improve inferrability of `NamedTuple{names}(nt::NamedTuple) where {names}` * improve inferrability of `recursive_dotcalls!(ex, args, i=1)` (cherry picked from commit 5d9807ddefc147f6f005a3fe8b66011b2c7af7a5) --- base/namedtuple.jl | 3 ++- stdlib/InteractiveUtils/src/macros.jl | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/base/namedtuple.jl b/base/namedtuple.jl index 050d460f24724..5732dcd061b74 100644 --- a/base/namedtuple.jl +++ b/base/namedtuple.jl @@ -111,7 +111,8 @@ function NamedTuple{names}(nt::NamedTuple) where {names} types = Tuple{(fieldtype(nt, idx[n]) for n in 1:length(idx))...} Expr(:new, :(NamedTuple{names, $types}), Any[ :(getfield(nt, $(idx[n]))) for n in 1:length(idx) ]...) else - types = Tuple{(fieldtype(typeof(nt), names[n]) for n in 1:length(names))...} + length_names = length(names)::Integer + types = Tuple{(fieldtype(typeof(nt), names[n]) for n in 1:length_names)...} NamedTuple{names, types}(map(Fix1(getfield, nt), names)) end end diff --git a/stdlib/InteractiveUtils/src/macros.jl b/stdlib/InteractiveUtils/src/macros.jl index 7c4ce6f0dd588..d9dcff57257c9 100644 --- a/stdlib/InteractiveUtils/src/macros.jl +++ b/stdlib/InteractiveUtils/src/macros.jl @@ -24,7 +24,8 @@ function recursive_dotcalls!(ex, args, i=1) end end (start, branches) = ex.head === :. ? (1, ex.args[2].args) : (2, ex.args) - for j in start:length(branches) + length_branches = length(branches)::Integer + for j in start:length_branches branch, i = recursive_dotcalls!(branches[j], args, i) branches[j] = branch end From 3d8b92f8205d5f06f6d4621c304d8f8f6a5a6d26 Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Tue, 13 Sep 2022 14:08:51 +0200 Subject: [PATCH 325/369] improve type stability of `lt(p::Perm, a::Integer, b::Integer)` (#46732) This fixes a few hundred invalidations when loading Static/jl/ArrayInterface.jl. (cherry picked from commit 70bfa3fe09cd127f4a84bcb9b4709102477d8d30) --- base/ordering.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/ordering.jl b/base/ordering.jl index e49102159c962..d0c9cb99f9c72 100644 --- a/base/ordering.jl +++ b/base/ordering.jl @@ -122,7 +122,7 @@ lt(o::Lt, a, b) = o.lt(a,b) @propagate_inbounds function lt(p::Perm, a::Integer, b::Integer) da = p.data[a] db = p.data[b] - lt(p.order, da, db) | (!lt(p.order, db, da) & (a < b)) + (lt(p.order, da, db)::Bool) | (!(lt(p.order, db, da)::Bool) & (a < b)) end _ord(lt::typeof(isless), by::typeof(identity), order::Ordering) = order From 9d593ced4b38f6c64412ca4176e9874f20e27a8a Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Wed, 14 Sep 2022 15:19:42 +0200 Subject: [PATCH 326/369] improve type stability of `process_overrides(artifact_dict::Dict, pkk_uuid::Base.UUID)` (#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 b4af0e5ebb452c61d6b26780015dbab2636feefe) --- stdlib/Artifacts/src/Artifacts.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/Artifacts/src/Artifacts.jl b/stdlib/Artifacts/src/Artifacts.jl index 724bda22ae531..25d8b254c7cfc 100644 --- a/stdlib/Artifacts/src/Artifacts.jl +++ b/stdlib/Artifacts/src/Artifacts.jl @@ -325,7 +325,7 @@ function process_overrides(artifact_dict::Dict, pkg_uuid::Base.UUID) # override for this UUID, and inserting new overrides for those hashes. overrides = load_overrides() if haskey(overrides[:UUID], pkg_uuid) - pkg_overrides = overrides[:UUID][pkg_uuid] + pkg_overrides = overrides[:UUID][pkg_uuid]::Dict{String, <:Any} for name in keys(artifact_dict) # Skip names that we're not overriding From 85ecb8e121541ba0c6903480b78d562e4808096b Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Thu, 15 Sep 2022 05:17:33 +0200 Subject: [PATCH 327/369] fix invalidations from loading Static.jl (#46761) * 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 9b1780d24e5f15d3ba24c3e09f94647d1d49511d) --- base/sort.jl | 3 ++- stdlib/Printf/src/Printf.jl | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/base/sort.jl b/base/sort.jl index b9c22e396db2c..b538428a8c424 100644 --- a/base/sort.jl +++ b/base/sort.jl @@ -496,7 +496,8 @@ const SMALL_ALGORITHM = InsertionSort const SMALL_THRESHOLD = 20 function sort!(v::AbstractVector, lo::Integer, hi::Integer, ::InsertionSortAlg, o::Ordering) - @inbounds for i = lo+1:hi + lo_plus_1 = (lo + 1)::Integer + @inbounds for i = lo_plus_1:hi j = i x = v[i] while j > lo diff --git a/stdlib/Printf/src/Printf.jl b/stdlib/Printf/src/Printf.jl index 05e1621dcb795..78381cef59cb2 100644 --- a/stdlib/Printf/src/Printf.jl +++ b/stdlib/Printf/src/Printf.jl @@ -242,7 +242,7 @@ end @inline function fmt(buf, pos, arg, spec::Spec{T}) where {T <: Strings} leftalign, hash, width, prec = spec.leftalign, spec.hash, spec.width, spec.precision str = string(arg) - slen = textwidth(str) + (hash ? arg isa AbstractString ? 2 : 1 : 0) + slen = textwidth(str)::Int + (hash ? arg isa AbstractString ? 2 : 1 : 0) op = p = prec == -1 ? slen : min(slen, prec) if !leftalign && width > p for _ = 1:(width - p) From 02af18b753320b1bec03739fa35b5b5567f38d23 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Wed, 17 Aug 2022 10:49:32 -0400 Subject: [PATCH 328/369] improvements to constant values in IR (#45173) - serialize bits values and QuoteNodes in IR encoding Using this instead of the `roots` array avoids scaling problems in functions with many constants. - move roots created by codegen to a single global table, allowing reuse of egal values and keeping method roots lists shorter (cherry picked from commit 425f6ff48ec6716656a30b4ddda3a30ec1d00542) --- src/ccall.cpp | 4 +- src/cgutils.cpp | 4 +- src/codegen.cpp | 110 +++++++++++-------------------------------- src/gc.c | 1 + src/iddict.c | 6 +++ src/init.c | 1 + src/ircode.c | 61 +++++++++++++++--------- src/julia.h | 3 +- src/julia_internal.h | 3 ++ src/staticdata.c | 46 ++++++++++++++++++ 10 files changed, 128 insertions(+), 111 deletions(-) diff --git a/src/ccall.cpp b/src/ccall.cpp index 17f75dfefbc2e..4742130f66629 100644 --- a/src/ccall.cpp +++ b/src/ccall.cpp @@ -1380,7 +1380,7 @@ static jl_cgval_t emit_ccall(jl_codectx_t &ctx, jl_value_t **args, size_t nargs) return jl_cgval_t(ctx.builder.getContext()); } if (rt != args[2] && rt != (jl_value_t*)jl_any_type) - jl_add_method_root(ctx, rt); + rt = jl_ensure_rooted(ctx, rt); function_sig_t sig("ccall", lrt, rt, retboxed, (jl_svec_t*)at, unionall, nreqargs, cc, llvmcall, &ctx.emission_context); @@ -1837,7 +1837,7 @@ jl_cgval_t function_sig_t::emit_a_ccall( jl_svec_len(ctx.linfo->sparam_vals) > 0) { jargty_in_env = jl_instantiate_type_in_env(jargty_in_env, unionall_env, jl_svec_data(ctx.linfo->sparam_vals)); if (jargty_in_env != jargty) - jl_add_method_root(ctx, jargty_in_env); + jargty_in_env = jl_ensure_rooted(ctx, jargty_in_env); } Value *v; diff --git a/src/cgutils.cpp b/src/cgutils.cpp index 7eb2fa11d209d..8f3a4caf7b906 100644 --- a/src/cgutils.cpp +++ b/src/cgutils.cpp @@ -2814,7 +2814,7 @@ static Value *call_with_attrs(jl_codectx_t &ctx, JuliaFunction *intr, Value *v) return Call; } -static void jl_add_method_root(jl_codectx_t &ctx, jl_value_t *val); +static jl_value_t *jl_ensure_rooted(jl_codectx_t &ctx, jl_value_t *val); static Value *as_value(jl_codectx_t &ctx, Type *to, const jl_cgval_t &v) { @@ -2847,7 +2847,7 @@ static Value *_boxed_special(jl_codectx_t &ctx, const jl_cgval_t &vinfo, Type *t if (Constant *c = dyn_cast(vinfo.V)) { jl_value_t *s = static_constant_instance(jl_Module->getDataLayout(), c, jt); if (s) { - jl_add_method_root(ctx, s); + s = jl_ensure_rooted(ctx, s); return track_pjlvalue(ctx, literal_pointer_val(ctx, s)); } } diff --git a/src/codegen.cpp b/src/codegen.cpp index 79b40513f453c..c7aba9a4942cd 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -1271,7 +1271,6 @@ class jl_codectx_t { jl_code_info_t *source = NULL; jl_array_t *code = NULL; size_t world = 0; - jl_array_t *roots = NULL; const char *name = NULL; StringRef file{}; ssize_t *line = NULL; @@ -1313,10 +1312,6 @@ class jl_codectx_t { tbaa_cache.initialize(builder.getContext()); return tbaa_cache; } - - ~jl_codectx_t() { - assert(this->roots == NULL); - } }; GlobalVariable *JuliaVariable::realize(jl_codectx_t &ctx) { @@ -2371,27 +2366,27 @@ static void simple_use_analysis(jl_codectx_t &ctx, jl_value_t *expr) // ---- Get Element Pointer (GEP) instructions within the GC frame ---- -static void jl_add_method_root(jl_codectx_t &ctx, jl_value_t *val) +static jl_value_t *jl_ensure_rooted(jl_codectx_t &ctx, jl_value_t *val) { - if (jl_is_concrete_type(val) || jl_is_bool(val) || jl_is_symbol(val) || val == jl_nothing || - val == (jl_value_t*)jl_any_type || val == (jl_value_t*)jl_bottom_type || val == (jl_value_t*)jl_core_module) - return; - JL_GC_PUSH1(&val); - if (ctx.roots == NULL) { - ctx.roots = jl_alloc_vec_any(1); - jl_array_ptr_set(ctx.roots, 0, val); - } - else { - size_t rlen = jl_array_dim0(ctx.roots); - for (size_t i = 0; i < rlen; i++) { - if (jl_array_ptr_ref(ctx.roots,i) == val) { - JL_GC_POP(); - return; + if (jl_is_globally_rooted(val)) + return val; + jl_method_t *m = ctx.linfo->def.method; + if (jl_is_method(m)) { + // the method might have a root for this already; use it if so + JL_LOCK(&m->writelock); + if (m->roots) { + size_t i, len = jl_array_dim0(m->roots); + for (i = 0; i < len; i++) { + jl_value_t *mval = jl_array_ptr_ref(m->roots, i); + if (mval == val || jl_egal(mval, val)) { + JL_UNLOCK(&m->writelock); + return mval; + } } } - jl_array_ptr_1d_push(ctx.roots, val); + JL_UNLOCK(&m->writelock); } - JL_GC_POP(); + return jl_as_global_root(val); } // --- generating function calls --- @@ -3375,7 +3370,7 @@ static bool emit_builtin_call(jl_codectx_t &ctx, jl_cgval_t *ret, jl_value_t *f, // don't bother codegen constant-folding for toplevel. jl_value_t *ty = static_apply_type(ctx, argv, nargs + 1); if (ty != NULL) { - jl_add_method_root(ctx, ty); + ty = jl_ensure_rooted(ctx, ty); *ret = mark_julia_const(ctx, ty); return true; } @@ -4664,35 +4659,12 @@ static jl_cgval_t emit_expr(jl_codectx_t &ctx, jl_value_t *expr, ssize_t ssaval) return convert_julia_type(ctx, emit_expr(ctx, jl_fieldref_noalloc(expr, 0)), jl_fieldref_noalloc(expr, 1), &skip); } if (!jl_is_expr(expr)) { - int needroot = true; - if (jl_is_quotenode(expr)) { - expr = jl_fieldref_noalloc(expr,0); - } - // numeric literals - if (jl_is_int32(expr)) { - int32_t val = jl_unbox_int32(expr); - if ((uint32_t)(val+512) < 1024) { - // this can be gotten from the box cache - needroot = false; - expr = jl_box_int32(val); - } - } - else if (jl_is_int64(expr)) { - uint64_t val = jl_unbox_uint64(expr); - if ((uint64_t)(val+512) < 1024) { - // this can be gotten from the box cache - needroot = false; - expr = jl_box_int64(val); - } - } - else if (jl_is_uint8(expr)) { - expr = jl_box_uint8(jl_unbox_uint8(expr)); - needroot = false; - } - if (needroot && jl_is_method(ctx.linfo->def.method)) { // toplevel exprs and some integers are already rooted - jl_add_method_root(ctx, expr); - } - return mark_julia_const(ctx, expr); + jl_value_t *val = expr; + if (jl_is_quotenode(expr)) + val = jl_fieldref_noalloc(expr, 0); + if (jl_is_method(ctx.linfo->def.method)) // toplevel exprs are already rooted + val = jl_ensure_rooted(ctx, val); + return mark_julia_const(ctx, val); } jl_expr_t *ex = (jl_expr_t*)expr; @@ -5827,7 +5799,7 @@ static jl_cgval_t emit_cfunction(jl_codectx_t &ctx, jl_value_t *output_type, con return jl_cgval_t(ctx.builder.getContext()); } if (rt != declrt && rt != (jl_value_t*)jl_any_type) - jl_add_method_root(ctx, rt); + rt = jl_ensure_rooted(ctx, rt); function_sig_t sig("cfunction", lrt, rt, retboxed, argt, unionall_env, false, CallingConv::C, false, &ctx.emission_context); assert(sig.fargt.size() + sig.sret == sig.fargt_sig.size()); @@ -5900,7 +5872,7 @@ static jl_cgval_t emit_cfunction(jl_codectx_t &ctx, jl_value_t *output_type, con for (size_t i = 0; i < n; i++) { jl_svecset(fill, i, jl_array_ptr_ref(closure_types, i)); } - jl_add_method_root(ctx, (jl_value_t*)fill); + fill = (jl_svec_t*)jl_ensure_rooted(ctx, (jl_value_t*)fill); } Type *T_htable = ArrayType::get(getSizeTy(ctx.builder.getContext()), sizeof(htable_t) / sizeof(void*)); Value *cache = new GlobalVariable(*jl_Module, T_htable, false, @@ -6119,7 +6091,6 @@ static Function *gen_invoke_wrapper(jl_method_instance_t *lam, jl_value_t *jlret } } ctx.builder.CreateRet(boxed(ctx, retval)); - assert(!ctx.roots); return w; } @@ -6293,7 +6264,7 @@ static std::pair, jl_llvm_functions_t> // step 1. unpack AST and allocate codegen context for this function jl_llvm_functions_t declarations; jl_codectx_t ctx(ctxt, params); - JL_GC_PUSH2(&ctx.code, &ctx.roots); + JL_GC_PUSH1(&ctx.code); ctx.code = src->code; std::map labels; @@ -7700,33 +7671,6 @@ static std::pair, jl_llvm_functions_t> } } - // copy ctx.roots into m->roots - // if we created any new roots during codegen - if (ctx.roots) { - jl_method_t *m = lam->def.method; - JL_LOCK(&m->writelock); - if (m->roots == NULL) { - m->roots = ctx.roots; - jl_gc_wb(m, m->roots); - } - else { - size_t i, ilen = jl_array_dim0(ctx.roots); - size_t j, jlen = jl_array_dim0(m->roots); - for (i = 0; i < ilen; i++) { - jl_value_t *ival = jl_array_ptr_ref(ctx.roots, i); - for (j = 0; j < jlen; j++) { - jl_value_t *jval = jl_array_ptr_ref(m->roots, j); - if (ival == jval) - break; - } - if (j == jlen) // not found - add to array - jl_add_method_root(m, jl_precompile_toplevel_module, ival); - } - } - ctx.roots = NULL; - JL_UNLOCK(&m->writelock); - } - // link the dependent llvmcall modules, but switch their function's linkage to internal // so that they don't conflict when they show up in the execution engine. for (auto &Mod : ctx.llvmcall_modules) { diff --git a/src/gc.c b/src/gc.c index 90db3dea5eabd..f86030f421c2c 100644 --- a/src/gc.c +++ b/src/gc.c @@ -2877,6 +2877,7 @@ static void mark_roots(jl_gc_mark_cache_t *gc_cache, jl_gc_mark_sp_t *sp) gc_mark_queue_obj(gc_cache, sp, jl_emptytuple_type); if (cmpswap_names != NULL) gc_mark_queue_obj(gc_cache, sp, cmpswap_names); + gc_mark_queue_obj(gc_cache, sp, jl_global_roots_table); } // find unmarked objects that need to be finalized from the finalizer list "list". diff --git a/src/iddict.c b/src/iddict.c index e6c9eee44b980..617d2d16176d1 100644 --- a/src/iddict.c +++ b/src/iddict.c @@ -159,6 +159,12 @@ jl_value_t *jl_eqtable_get(jl_array_t *h, jl_value_t *key, jl_value_t *deflt) JL return (bp == NULL) ? deflt : jl_atomic_load_relaxed(bp); } +jl_value_t *jl_eqtable_getkey(jl_array_t *h, jl_value_t *key, jl_value_t *deflt) JL_NOTSAFEPOINT +{ + _Atomic(jl_value_t*) *bp = jl_table_peek_bp(h, key); + return (bp == NULL) ? deflt : jl_atomic_load_relaxed(bp - 1); +} + JL_DLLEXPORT jl_value_t *jl_eqtable_pop(jl_array_t *h, jl_value_t *key, jl_value_t *deflt, int *found) { diff --git a/src/init.c b/src/init.c index 3ea8456479c3e..ab2e0aa1c4123 100644 --- a/src/init.c +++ b/src/init.c @@ -713,6 +713,7 @@ static NOINLINE void _finish_julia_init(JL_IMAGE_SEARCH rel, jl_ptls_t ptls, jl_ jl_restore_system_image(jl_options.image_file); } else { jl_init_types(); + jl_global_roots_table = jl_alloc_vec_any(16); jl_init_codegen(); } diff --git a/src/ircode.c b/src/ircode.c index 73e99f2281491..46056114a1c8d 100644 --- a/src/ircode.c +++ b/src/ircode.c @@ -71,10 +71,31 @@ static void jl_encode_int32(jl_ircode_state *s, int32_t x) } } +static void jl_encode_as_indexed_root(jl_ircode_state *s, jl_value_t *v) +{ + rle_reference rr; + + literal_val_id(&rr, s, v); + int id = rr.index; + assert(id >= 0); + if (rr.key) { + write_uint8(s->s, TAG_RELOC_METHODROOT); + write_int64(s->s, rr.key); + } + if (id < 256) { + write_uint8(s->s, TAG_METHODROOT); + write_uint8(s->s, id); + } + else { + assert(id <= UINT16_MAX); + write_uint8(s->s, TAG_LONG_METHODROOT); + write_uint16(s->s, id); + } +} + static void jl_encode_value_(jl_ircode_state *s, jl_value_t *v, int as_literal) JL_GC_DISABLED { size_t i; - rle_reference rr; if (v == NULL) { write_uint8(s->s, TAG_NULL); @@ -240,6 +261,16 @@ static void jl_encode_value_(jl_ircode_state *s, jl_value_t *v, int as_literal) write_uint8(s->s, TAG_RETURNNODE); jl_encode_value(s, jl_get_nth_field(v, 0)); } + else if (jl_is_quotenode(v)) { + write_uint8(s->s, TAG_QUOTENODE); + jl_value_t *inner = jl_quotenode_value(v); + // we might need to return this exact object at run time, therefore codegen might + // need to reference it as well, so it is more likely useful to give it a root + if (jl_is_expr(inner) || jl_is_phinode(inner) || jl_is_phicnode(inner)) + jl_encode_as_indexed_root(s, inner); + else + jl_encode_value(s, inner); + } else if (jl_typeis(v, jl_int64_type)) { void *data = jl_data_ptr(v); if (*(int64_t*)data >= INT16_MIN && *(int64_t*)data <= INT16_MAX) { @@ -325,28 +356,9 @@ static void jl_encode_value_(jl_ircode_state *s, jl_value_t *v, int as_literal) ios_write(s->s, jl_array_typetagdata(ar), l); } } - else { - if (!as_literal && !(jl_is_uniontype(v) || jl_is_newvarnode(v) || jl_is_tuple(v) || - jl_is_linenode(v) || jl_is_upsilonnode(v) || jl_is_pinode(v) || - jl_is_slot(v) || jl_is_ssavalue(v))) { - literal_val_id(&rr, s, v); - int id = rr.index; - assert(id >= 0); - if (rr.key) { - write_uint8(s->s, TAG_RELOC_METHODROOT); - write_int64(s->s, rr.key); - } - if (id < 256) { - write_uint8(s->s, TAG_METHODROOT); - write_uint8(s->s, id); - } - else { - assert(id <= UINT16_MAX); - write_uint8(s->s, TAG_LONG_METHODROOT); - write_uint16(s->s, id); - } - return; - } + else if (as_literal || jl_is_uniontype(v) || jl_is_newvarnode(v) || jl_is_linenode(v) || + jl_is_upsilonnode(v) || jl_is_pinode(v) || jl_is_slot(v) || jl_is_ssavalue(v) || + (jl_isbits(jl_typeof(v)) && jl_datatype_size(jl_typeof(v)) <= 64)) { jl_datatype_t *t = (jl_datatype_t*)jl_typeof(v); if (t->size <= 255) { write_uint8(s->s, TAG_SHORT_GENERAL); @@ -388,6 +400,9 @@ static void jl_encode_value_(jl_ircode_state *s, jl_value_t *v, int as_literal) if (ptr > last) ios_write(s->s, last, ptr - last); } + else { + jl_encode_as_indexed_root(s, v); + } } static jl_code_info_flags_t code_info_flags(uint8_t pure, uint8_t propagate_inbounds, uint8_t inlineable, uint8_t inferred, uint8_t constprop) diff --git a/src/julia.h b/src/julia.h index 48f89ec7661e3..9cdf124fccaa7 100644 --- a/src/julia.h +++ b/src/julia.h @@ -1270,7 +1270,7 @@ STATIC_INLINE int jl_is_structtype(void *v) JL_NOTSAFEPOINT !jl_is_primitivetype(v)); } -STATIC_INLINE int jl_isbits(void *t) JL_NOTSAFEPOINT // corresponding to isbits() in julia +STATIC_INLINE int jl_isbits(void *t) JL_NOTSAFEPOINT // corresponding to isbitstype() in julia { return (jl_is_datatype(t) && ((jl_datatype_t*)t)->isbitstype); } @@ -1635,6 +1635,7 @@ STATIC_INLINE jl_function_t *jl_get_function(jl_module_t *m, const char *name) // eq hash tables JL_DLLEXPORT jl_array_t *jl_eqtable_put(jl_array_t *h, jl_value_t *key, jl_value_t *val, int *inserted); JL_DLLEXPORT jl_value_t *jl_eqtable_get(jl_array_t *h, jl_value_t *key, jl_value_t *deflt) JL_NOTSAFEPOINT; +jl_value_t *jl_eqtable_getkey(jl_array_t *h, jl_value_t *key, jl_value_t *deflt) JL_NOTSAFEPOINT; // system information JL_DLLEXPORT int jl_errno(void) JL_NOTSAFEPOINT; diff --git a/src/julia_internal.h b/src/julia_internal.h index 98ef613e3be9a..a7e9c0af2ad3d 100644 --- a/src/julia_internal.h +++ b/src/julia_internal.h @@ -664,6 +664,9 @@ JL_DLLEXPORT void jl_binding_deprecation_warning(jl_module_t *m, jl_binding_t *b extern jl_array_t *jl_module_init_order JL_GLOBALLY_ROOTED; extern htable_t jl_current_modules JL_GLOBALLY_ROOTED; extern JL_DLLEXPORT jl_module_t *jl_precompile_toplevel_module JL_GLOBALLY_ROOTED; +extern jl_array_t *jl_global_roots_table JL_GLOBALLY_ROOTED; +JL_DLLEXPORT int jl_is_globally_rooted(jl_value_t *val JL_MAYBE_UNROOTED) JL_NOTSAFEPOINT; +JL_DLLEXPORT jl_value_t *jl_as_global_root(jl_value_t *val JL_MAYBE_UNROOTED); int jl_compile_extern_c(void *llvmmod, void *params, void *sysimg, jl_value_t *declrt, jl_value_t *sigt); jl_opaque_closure_t *jl_new_opaque_closure(jl_tupletype_t *argt, jl_value_t *rt_lb, jl_value_t *rt_ub, diff --git a/src/staticdata.c b/src/staticdata.c index 28a21e9ea7c2b..3decbaaf5430a 100644 --- a/src/staticdata.c +++ b/src/staticdata.c @@ -1812,6 +1812,49 @@ static void jl_set_nroots_sysimg(void) static void jl_init_serializer2(int); static void jl_cleanup_serializer2(void); +jl_array_t *jl_global_roots_table; +static jl_mutex_t global_roots_lock; + +JL_DLLEXPORT int jl_is_globally_rooted(jl_value_t *val JL_MAYBE_UNROOTED) JL_NOTSAFEPOINT +{ + if (jl_is_concrete_type(val) || jl_is_bool(val) || jl_is_symbol(val) || + val == (jl_value_t*)jl_any_type || val == (jl_value_t*)jl_bottom_type || val == (jl_value_t*)jl_core_module) + return 1; + if (val == ((jl_datatype_t*)jl_typeof(val))->instance) + return 1; + return 0; +} + +JL_DLLEXPORT jl_value_t *jl_as_global_root(jl_value_t *val JL_MAYBE_UNROOTED) +{ + if (jl_is_globally_rooted(val)) + return val; + if (jl_is_uint8(val)) + return jl_box_uint8(jl_unbox_uint8(val)); + if (jl_is_int32(val)) { + int32_t n = jl_unbox_int32(val); + if ((uint32_t)(n+512) < 1024) + return jl_box_int32(n); + } + else if (jl_is_int64(val)) { + uint64_t n = jl_unbox_uint64(val); + if ((uint64_t)(n+512) < 1024) + return jl_box_int64(n); + } + JL_GC_PUSH1(&val); + JL_LOCK(&global_roots_lock); + jl_value_t *rval = jl_eqtable_getkey(jl_global_roots_table, val, NULL); + if (rval) { + val = rval; + } + else { + jl_global_roots_table = jl_eqtable_put(jl_global_roots_table, val, jl_nothing, NULL); + } + JL_UNLOCK(&global_roots_lock); + JL_GC_POP(); + return val; +} + static void jl_save_system_image_to_stream(ios_t *f) JL_GC_DISABLED { jl_gc_collect(JL_GC_FULL); @@ -1878,6 +1921,7 @@ static void jl_save_system_image_to_stream(ios_t *f) JL_GC_DISABLED jl_value_t *tag = *tags[i]; jl_serialize_value(&s, tag); } + jl_serialize_value(&s, jl_global_roots_table); jl_serialize_reachable(&s); // step 1.1: check for values only found in the generated code arraylist_t typenames; @@ -1958,6 +2002,7 @@ static void jl_save_system_image_to_stream(ios_t *f) JL_GC_DISABLED jl_value_t *tag = *tags[i]; jl_write_value(&s, tag); } + jl_write_value(&s, jl_global_roots_table); jl_write_value(&s, s.ptls->root_task->tls); write_uint32(f, jl_get_gs_ctr()); write_uint32(f, jl_atomic_load_acquire(&jl_world_counter)); @@ -2084,6 +2129,7 @@ static void jl_restore_system_image_from_stream(ios_t *f) JL_GC_DISABLED jl_value_t **tag = tags[i]; *tag = jl_read_value(&s); } + jl_global_roots_table = (jl_array_t*)jl_read_value(&s); // set typeof extra-special values now that we have the type set by tags above jl_astaggedvalue(jl_current_task)->header = (uintptr_t)jl_task_type | jl_astaggedvalue(jl_current_task)->header; jl_astaggedvalue(jl_nothing)->header = (uintptr_t)jl_nothing_type | jl_astaggedvalue(jl_nothing)->header; From 22d1000f9d049a8ba4a31f5ae7752e8c3ab66b2c Mon Sep 17 00:00:00 2001 From: Denis Barucic Date: Tue, 6 Sep 2022 15:26:07 +0200 Subject: [PATCH 329/369] LibGit2: correct regex for credential helpers (#46597) The previous regex for credential helpers included even the following credential: ``` [credential "helperselector"] selected = manager-core ``` which gets introduced by Git for Windows and fails our assumption about what a credential helper is. The commit also removes a test that mirrors what `credential_helpers` does (otherwise, we would have to maintain the same regex at two places, the definition of `credential_helpers` and the test case). Fixes #45693 (cherry picked from commit ea7420862052d641e0a78dcb45ed889896972bed) --- stdlib/LibGit2/src/gitcredential.jl | 2 +- stdlib/LibGit2/test/libgit2.jl | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/stdlib/LibGit2/src/gitcredential.jl b/stdlib/LibGit2/src/gitcredential.jl index 1b97c29cd933e..acfde02578523 100644 --- a/stdlib/LibGit2/src/gitcredential.jl +++ b/stdlib/LibGit2/src/gitcredential.jl @@ -219,7 +219,7 @@ function credential_helpers(cfg::GitConfig, cred::GitCredential) helpers = GitCredentialHelper[] # https://git-scm.com/docs/gitcredentials#gitcredentials-helper - for entry in GitConfigIter(cfg, r"credential.*\.helper") + for entry in GitConfigIter(cfg, r"credential.*\.helper$") section, url, name, value = split_cfg_entry(entry) @assert name == "helper" diff --git a/stdlib/LibGit2/test/libgit2.jl b/stdlib/LibGit2/test/libgit2.jl index 2a74ed4908dfc..74e23be3afc2b 100644 --- a/stdlib/LibGit2/test/libgit2.jl +++ b/stdlib/LibGit2/test/libgit2.jl @@ -1985,7 +1985,7 @@ mktempdir() do dir @test parse(GitCredentialHelper, "store") == GitCredentialHelper(`git credential-store`) end - @testset "empty helper" begin + @testset "credential helpers" begin config_path = joinpath(dir, config_file) # Note: LibGit2.set! doesn't allow us to set duplicates or ordering @@ -1998,16 +1998,14 @@ mktempdir() do dir [credential] helper = !echo second """) + # Git for Windows uses this config (see issue #45693) + write(fp,""" + [credential "helperselector"] + selected = manager-core + """) end LibGit2.with(LibGit2.GitConfig(config_path, LibGit2.Consts.CONFIG_LEVEL_APP)) do cfg - iter = LibGit2.GitConfigIter(cfg, r"credential.*\.helper") - @test LibGit2.split_cfg_entry.(iter) == [ - ("credential", "", "helper", "!echo first"), - ("credential", "https://mygithost", "helper", ""), - ("credential", "", "helper", "!echo second"), - ] - expected = [ GitCredentialHelper(`echo first`), GitCredentialHelper(`echo second`), From ab67e935f815e377034cd6568a9fb28c5ef68e3e Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Thu, 15 Sep 2022 05:18:52 +0200 Subject: [PATCH 330/369] improve type stability of `tail/front(::NamedTuple)` (#46762) This fixes some invalidations when loading ChainRulesCore.jl. (cherry picked from commit e758982f661acf837f9b7449253f84fa039fb37d) --- base/namedtuple.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/namedtuple.jl b/base/namedtuple.jl index 5732dcd061b74..2157975ba30d1 100644 --- a/base/namedtuple.jl +++ b/base/namedtuple.jl @@ -319,8 +319,8 @@ values(nt::NamedTuple) = Tuple(nt) haskey(nt::NamedTuple, key::Union{Integer, Symbol}) = isdefined(nt, key) get(nt::NamedTuple, key::Union{Integer, Symbol}, default) = haskey(nt, key) ? getfield(nt, key) : default get(f::Callable, nt::NamedTuple, key::Union{Integer, Symbol}) = haskey(nt, key) ? getfield(nt, key) : f() -tail(t::NamedTuple{names}) where names = NamedTuple{tail(names)}(t) -front(t::NamedTuple{names}) where names = NamedTuple{front(names)}(t) +tail(t::NamedTuple{names}) where names = NamedTuple{tail(names::Tuple)}(t) +front(t::NamedTuple{names}) where names = NamedTuple{front(names::Tuple)}(t) @pure function diff_names(an::Tuple{Vararg{Symbol}}, bn::Tuple{Vararg{Symbol}}) @nospecialize an bn From 7955e8a671b919561b5d3dcf773794ff8e326fe4 Mon Sep 17 00:00:00 2001 From: N5N3 <2642243996@qq.com> Date: Thu, 15 Sep 2022 19:43:57 +0800 Subject: [PATCH 331/369] Also merge var with unchanged bounds. (#46757) * Also merge var with unchanged bounds. The current `env` might not be valid if the var's bounds get fixed by another Unions decision. * Replace `v->var->lb` with `simple_meet` * Remove the unneeded NUll check. Co-Authored-By: Jameson Nash (cherry picked from commit 65575428366fa4c93f16c761c676192395484cb3) --- src/subtype.c | 19 ++++++++----------- test/subtype.jl | 11 +++++++++++ 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/subtype.c b/src/subtype.c index c01ee54e683be..1213cd53af2f6 100644 --- a/src/subtype.c +++ b/src/subtype.c @@ -3176,18 +3176,15 @@ static int merge_env(jl_stenv_t *e, jl_value_t **root, jl_savedenv_t *se, int co } int n = 0; jl_varbinding_t *v = e->vars; - jl_value_t *ub = NULL, *vub = NULL; - JL_GC_PUSH2(&ub, &vub); + jl_value_t *b1 = NULL, *b2 = NULL; + JL_GC_PUSH2(&b1, &b2); while (v != NULL) { - if (v->ub != v->var->ub || v->lb != v->var->lb) { - jl_value_t *lb = jl_svecref(*root, n); - if (v->lb != lb) - jl_svecset(*root, n, lb ? jl_bottom_type : v->lb); - ub = jl_svecref(*root, n+1); - vub = v->ub; - if (vub != ub) - jl_svecset(*root, n+1, ub ? simple_join(ub, vub) : vub); - } + b1 = jl_svecref(*root, n); + b2 = v->lb; + jl_svecset(*root, n, simple_meet(b1, b2)); + b1 = jl_svecref(*root, n+1); + b2 = v->ub; + jl_svecset(*root, n+1, simple_join(b1, b2)); n = n + 3; v = v->prev; } diff --git a/test/subtype.jl b/test/subtype.jl index 70c8c0cb354b6..5bb2037d7852b 100644 --- a/test/subtype.jl +++ b/test/subtype.jl @@ -2020,3 +2020,14 @@ end #issue #43082 struct X43082{A, I, B<:Union{Ref{I},I}}; end @testintersect(Tuple{X43082{T}, Int} where T, Tuple{X43082{Int}, Any}, Tuple{X43082{Int}, Int}) + +#issue #46735 +T46735{B<:Real} = Pair{<:Union{B, Val{<:B}}, <:Union{AbstractMatrix{B}, AbstractMatrix{Vector{B}}}} +@testintersect(T46735{B} where {B}, T46735, !Union{}) +@testintersect(T46735{B} where {B<:Integer}, T46735, !Union{}) +S46735{B<:Val, M<:AbstractMatrix} = Tuple{<:Union{B, <:Val{<:B}},M,<:(Union{AbstractMatrix{B}, AbstractMatrix{<:Vector{<:B}}})} +@testintersect(S46735{B} where {B}, S46735, !Union{}) +@testintersect(S46735{B, M} where {B, M}, S46735, !Union{}) +A46735{B<:Val, M<:AbstractMatrix} = Tuple{<:Union{B, <:Val{<:B}},M,Union{AbstractMatrix{B}, AbstractMatrix{<:Vector{<:B}}}} +@testintersect(A46735{B} where {B}, A46735, !Union{}) +@testintersect(A46735{B, M} where {B, M}, A46735, !Union{}) From 83f2ae853439ea581d3c188baef3021261368904 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sat, 9 Apr 2022 19:50:31 -0400 Subject: [PATCH 332/369] CI (`Create Buildbot Statuses`): remove `tester_macos64` from the list (#44918) (cherry picked from commit 3d87815b71f7e1a520a50fcc71b50e7b1c155933) --- .github/workflows/statuses.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/statuses.yml b/.github/workflows/statuses.yml index 16c07f0f040cc..36a694a7c6d20 100644 --- a/.github/workflows/statuses.yml +++ b/.github/workflows/statuses.yml @@ -48,7 +48,6 @@ jobs: - run: | declare -a CONTEXT_LIST=( "buildbot/tester_freebsd64" - "buildbot/tester_macos64" "buildbot/tester_win32" "buildbot/tester_win64" ) From b1e7caccb9a30823c4bd8d061f5ee73bc60557b4 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Thu, 21 Apr 2022 00:59:43 -0400 Subject: [PATCH 333/369] CI (`Create Buildbot Statuses`): remove `tester_linux32` from the list (#45047) (cherry picked from commit 28e1cd9ec06d2381dfd436284fb9fbd4245e2824) From b69fa6a482b0d4ce29611b1535b3709487cdd06a Mon Sep 17 00:00:00 2001 From: Morten Piibeleht Date: Fri, 16 Sep 2022 21:41:22 +1200 Subject: [PATCH 334/369] doc: guard release branch regex with ^...$ (#46647) (cherry picked from commit 174b893eed21ec5e26d2a672b1c790f32669b1cf) --- doc/make.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/make.jl b/doc/make.jl index 5b5976348d35d..9cc463f5a84e4 100644 --- a/doc/make.jl +++ b/doc/make.jl @@ -347,7 +347,7 @@ function Documenter.deploy_folder(::BuildBotConfig; devurl, repo, branch, kwargs @info "Unable to deploy the documentation: DOCUMENTER_KEY missing" return Documenter.DeployDecision(; all_ok=false) end - release = match(r"release-([0-9]+\.[0-9]+)", Base.GIT_VERSION_INFO.branch) + release = match(r"^release-([0-9]+\.[0-9]+)$", Base.GIT_VERSION_INFO.branch) if Base.GIT_VERSION_INFO.tagged_commit # Strip extra pre-release info (1.5.0-rc2.0 -> 1.5.0-rc2) ver = VersionNumber(VERSION.major, VERSION.minor, VERSION.patch, From b6883b0f3b68882cf288da5a2cab807b16e7584e Mon Sep 17 00:00:00 2001 From: Sobhan Mohammadpour Date: Fri, 16 Sep 2022 05:43:59 -0400 Subject: [PATCH 335/369] Fix `mapreduce` on `AdjOrTrans` (#46605) Co-authored-by: Daniel Karrasch Co-authored-by: Daniel Karrasch Co-authored-by: Martin Holters (cherry picked from commit 8c00e17908cd4d84e8366b2d44dc1af432c00d82) --- base/permuteddimsarray.jl | 14 ++++- stdlib/LinearAlgebra/src/LinearAlgebra.jl | 2 + stdlib/LinearAlgebra/src/adjtrans.jl | 44 ++++++++++------ stdlib/LinearAlgebra/test/adjtrans.jl | 64 ++++++++++++++++------- test/arrayops.jl | 6 ++- 5 files changed, 94 insertions(+), 36 deletions(-) diff --git a/base/permuteddimsarray.jl b/base/permuteddimsarray.jl index ea966c44efc38..1c524449850b8 100644 --- a/base/permuteddimsarray.jl +++ b/base/permuteddimsarray.jl @@ -263,11 +263,21 @@ end P end -function Base._mapreduce_dim(f, op, init::Base._InitialValue, A::PermutedDimsArray, dims::Colon) +const CommutativeOps = Union{typeof(+),typeof(Base.add_sum),typeof(min),typeof(max),typeof(Base._extrema_rf),typeof(|),typeof(&)} + +function Base._mapreduce_dim(f, op::CommutativeOps, init::Base._InitialValue, A::PermutedDimsArray, dims::Colon) + Base._mapreduce_dim(f, op, init, parent(A), dims) +end +function Base._mapreduce_dim(f::typeof(identity), op::Union{typeof(Base.mul_prod),typeof(*)}, init::Base._InitialValue, A::PermutedDimsArray{<:Union{Real,Complex}}, dims::Colon) Base._mapreduce_dim(f, op, init, parent(A), dims) end -function Base.mapreducedim!(f, op, B::AbstractArray{T,N}, A::PermutedDimsArray{T,N,perm,iperm}) where {T,N,perm,iperm} +function Base.mapreducedim!(f, op::CommutativeOps, B::AbstractArray{T,N}, A::PermutedDimsArray{S,N,perm,iperm}) where {T,S,N,perm,iperm} + C = PermutedDimsArray{T,N,iperm,perm,typeof(B)}(B) # make the inverse permutation for the output + Base.mapreducedim!(f, op, C, parent(A)) + B +end +function Base.mapreducedim!(f::typeof(identity), op::Union{typeof(Base.mul_prod),typeof(*)}, B::AbstractArray{T,N}, A::PermutedDimsArray{<:Union{Real,Complex},N,perm,iperm}) where {T,N,perm,iperm} C = PermutedDimsArray{T,N,iperm,perm,typeof(B)}(B) # make the inverse permutation for the output Base.mapreducedim!(f, op, C, parent(A)) B diff --git a/stdlib/LinearAlgebra/src/LinearAlgebra.jl b/stdlib/LinearAlgebra/src/LinearAlgebra.jl index 9e1e75126274b..58f87f246a93d 100644 --- a/stdlib/LinearAlgebra/src/LinearAlgebra.jl +++ b/stdlib/LinearAlgebra/src/LinearAlgebra.jl @@ -19,6 +19,8 @@ using Base: IndexLinear, promote_eltype, promote_op, promote_typeof, @propagate_inbounds, @pure, reduce, typed_hvcat, typed_vcat, require_one_based_indexing, splat using Base.Broadcast: Broadcasted, broadcasted +using Base.PermutedDimsArrays: CommutativeOps + import Libdl export diff --git a/stdlib/LinearAlgebra/src/adjtrans.jl b/stdlib/LinearAlgebra/src/adjtrans.jl index b6a4548833eac..fdca270e28aee 100644 --- a/stdlib/LinearAlgebra/src/adjtrans.jl +++ b/stdlib/LinearAlgebra/src/adjtrans.jl @@ -255,22 +255,36 @@ Broadcast.broadcast_preserving_zero_d(f, tvs::Union{Number,TransposeAbsVec}...) ### reductions -# faster to sum the Array than to work through the wrapper -Base._mapreduce_dim(f, op, init::Base._InitialValue, A::Transpose, dims::Colon) = - transpose(Base._mapreduce_dim(_sandwich(transpose, f), _sandwich(transpose, op), init, parent(A), dims)) -Base._mapreduce_dim(f, op, init::Base._InitialValue, A::Adjoint, dims::Colon) = - adjoint(Base._mapreduce_dim(_sandwich(adjoint, f), _sandwich(adjoint, op), init, parent(A), dims)) +# faster to sum the Array than to work through the wrapper (but only in commutative reduction ops as in Base/permuteddimsarray.jl) +Base._mapreduce_dim(f, op::CommutativeOps, init::Base._InitialValue, A::Transpose, dims::Colon) = + Base._mapreduce_dim(f∘transpose, op, init, parent(A), dims) +Base._mapreduce_dim(f, op::CommutativeOps, init::Base._InitialValue, A::Adjoint, dims::Colon) = + Base._mapreduce_dim(f∘adjoint, op, init, parent(A), dims) +# in prod, use fast path only in the commutative case to avoid surprises +Base._mapreduce_dim(f::typeof(identity), op::Union{typeof(*),typeof(Base.mul_prod)}, init::Base._InitialValue, A::Transpose{<:Union{Real,Complex}}, dims::Colon) = + Base._mapreduce_dim(f∘transpose, op, init, parent(A), dims) +Base._mapreduce_dim(f::typeof(identity), op::Union{typeof(*),typeof(Base.mul_prod)}, init::Base._InitialValue, A::Adjoint{<:Union{Real,Complex}}, dims::Colon) = + Base._mapreduce_dim(f∘adjoint, op, init, parent(A), dims) +# count allows for optimization only if the parent array has Bool eltype +Base._count(::typeof(identity), A::Transpose{Bool}, ::Colon, init) = Base._count(identity, parent(A), :, init) +Base._count(::typeof(identity), A::Adjoint{Bool}, ::Colon, init) = Base._count(identity, parent(A), :, init) +Base._any(f, A::Transpose, ::Colon) = Base._any(f∘transpose, parent(A), :) +Base._any(f, A::Adjoint, ::Colon) = Base._any(f∘adjoint, parent(A), :) +Base._all(f, A::Transpose, ::Colon) = Base._all(f∘transpose, parent(A), :) +Base._all(f, A::Adjoint, ::Colon) = Base._all(f∘adjoint, parent(A), :) # sum(A'; dims) -Base.mapreducedim!(f, op, B::AbstractArray, A::TransposeAbsMat) = - transpose(Base.mapreducedim!(_sandwich(transpose, f), _sandwich(transpose, op), transpose(B), parent(A))) -Base.mapreducedim!(f, op, B::AbstractArray, A::AdjointAbsMat) = - adjoint(Base.mapreducedim!(_sandwich(adjoint, f), _sandwich(adjoint, op), adjoint(B), parent(A))) - -_sandwich(adj::Function, fun) = (xs...,) -> adj(fun(map(adj, xs)...)) -for fun in [:identity, :add_sum, :mul_prod] #, :max, :min] - @eval _sandwich(::Function, ::typeof(Base.$fun)) = Base.$fun -end - +Base.mapreducedim!(f, op::CommutativeOps, B::AbstractArray, A::TransposeAbsMat) = + (Base.mapreducedim!(f∘transpose, op, switch_dim12(B), parent(A)); B) +Base.mapreducedim!(f, op::CommutativeOps, B::AbstractArray, A::AdjointAbsMat) = + (Base.mapreducedim!(f∘adjoint, op, switch_dim12(B), parent(A)); B) +Base.mapreducedim!(f::typeof(identity), op::Union{typeof(*),typeof(Base.mul_prod)}, B::AbstractArray, A::TransposeAbsMat{<:Union{Real,Complex}}) = + (Base.mapreducedim!(f∘transpose, op, switch_dim12(B), parent(A)); B) +Base.mapreducedim!(f::typeof(identity), op::Union{typeof(*),typeof(Base.mul_prod)}, B::AbstractArray, A::AdjointAbsMat{<:Union{Real,Complex}}) = + (Base.mapreducedim!(f∘adjoint, op, switch_dim12(B), parent(A)); B) + +switch_dim12(B::AbstractVector) = permutedims(B) +switch_dim12(B::AbstractArray{<:Any,0}) = B +switch_dim12(B::AbstractArray) = PermutedDimsArray(B, (2, 1, ntuple(Base.Fix1(+,2), ndims(B) - 2)...)) ### linear algebra diff --git a/stdlib/LinearAlgebra/test/adjtrans.jl b/stdlib/LinearAlgebra/test/adjtrans.jl index 7b782d463768d..e96ea28531d37 100644 --- a/stdlib/LinearAlgebra/test/adjtrans.jl +++ b/stdlib/LinearAlgebra/test/adjtrans.jl @@ -588,24 +588,52 @@ end @test transpose(Int[]) * Int[] == 0 end -@testset "reductions: $adjtrans" for adjtrans in [transpose, adjoint] - mat = rand(ComplexF64, 3,5) - @test sum(adjtrans(mat)) ≈ sum(collect(adjtrans(mat))) - @test sum(adjtrans(mat), dims=1) ≈ sum(collect(adjtrans(mat)), dims=1) - @test sum(adjtrans(mat), dims=(1,2)) ≈ sum(collect(adjtrans(mat)), dims=(1,2)) - - @test sum(imag, adjtrans(mat)) ≈ sum(imag, collect(adjtrans(mat))) - @test sum(imag, adjtrans(mat), dims=1) ≈ sum(imag, collect(adjtrans(mat)), dims=1) - - mat = [rand(ComplexF64,2,2) for _ in 1:3, _ in 1:5] - @test sum(adjtrans(mat)) ≈ sum(collect(adjtrans(mat))) - @test sum(adjtrans(mat), dims=1) ≈ sum(collect(adjtrans(mat)), dims=1) - @test sum(adjtrans(mat), dims=(1,2)) ≈ sum(collect(adjtrans(mat)), dims=(1,2)) - - @test sum(imag, adjtrans(mat)) ≈ sum(imag, collect(adjtrans(mat))) - @test sum(x -> x[1,2], adjtrans(mat)) ≈ sum(x -> x[1,2], collect(adjtrans(mat))) - @test sum(imag, adjtrans(mat), dims=1) ≈ sum(imag, collect(adjtrans(mat)), dims=1) - @test sum(x -> x[1,2], adjtrans(mat), dims=1) ≈ sum(x -> x[1,2], collect(adjtrans(mat)), dims=1) +@testset "reductions: $adjtrans" for adjtrans in (transpose, adjoint) + for (reduction, reduction!, op) in ((sum, sum!, +), (prod, prod!, *), (minimum, minimum!, min), (maximum, maximum!, max)) + T = op in (max, min) ? Float64 : ComplexF64 + mat = rand(T, 3,5) + rd1 = zeros(T, 1, 3) + rd2 = zeros(T, 5, 1) + rd3 = zeros(T, 1, 1) + @test reduction(adjtrans(mat)) ≈ reduction(copy(adjtrans(mat))) + @test reduction(adjtrans(mat), dims=1) ≈ reduction(copy(adjtrans(mat)), dims=1) + @test reduction(adjtrans(mat), dims=2) ≈ reduction(copy(adjtrans(mat)), dims=2) + @test reduction(adjtrans(mat), dims=(1,2)) ≈ reduction(copy(adjtrans(mat)), dims=(1,2)) + + @test reduction!(rd1, adjtrans(mat)) ≈ reduction!(rd1, copy(adjtrans(mat))) + @test reduction!(rd2, adjtrans(mat)) ≈ reduction!(rd2, copy(adjtrans(mat))) + @test reduction!(rd3, adjtrans(mat)) ≈ reduction!(rd3, copy(adjtrans(mat))) + + @test reduction(imag, adjtrans(mat)) ≈ reduction(imag, copy(adjtrans(mat))) + @test reduction(imag, adjtrans(mat), dims=1) ≈ reduction(imag, copy(adjtrans(mat)), dims=1) + @test reduction(imag, adjtrans(mat), dims=2) ≈ reduction(imag, copy(adjtrans(mat)), dims=2) + @test reduction(imag, adjtrans(mat), dims=(1,2)) ≈ reduction(imag, copy(adjtrans(mat)), dims=(1,2)) + + @test Base.mapreducedim!(imag, op, rd1, adjtrans(mat)) ≈ Base.mapreducedim!(imag, op, rd1, copy(adjtrans(mat))) + @test Base.mapreducedim!(imag, op, rd2, adjtrans(mat)) ≈ Base.mapreducedim!(imag, op, rd2, copy(adjtrans(mat))) + @test Base.mapreducedim!(imag, op, rd3, adjtrans(mat)) ≈ Base.mapreducedim!(imag, op, rd3, copy(adjtrans(mat))) + + op in (max, min) && continue + mat = [rand(T,2,2) for _ in 1:3, _ in 1:5] + rd1 = fill(zeros(T, 2, 2), 1, 3) + rd2 = fill(zeros(T, 2, 2), 5, 1) + rd3 = fill(zeros(T, 2, 2), 1, 1) + @test reduction(adjtrans(mat)) ≈ reduction(copy(adjtrans(mat))) + @test reduction(adjtrans(mat), dims=1) ≈ reduction(copy(adjtrans(mat)), dims=1) + @test reduction(adjtrans(mat), dims=2) ≈ reduction(copy(adjtrans(mat)), dims=2) + @test reduction(adjtrans(mat), dims=(1,2)) ≈ reduction(copy(adjtrans(mat)), dims=(1,2)) + + @test reduction(imag, adjtrans(mat)) ≈ reduction(imag, copy(adjtrans(mat))) + @test reduction(x -> x[1,2], adjtrans(mat)) ≈ reduction(x -> x[1,2], copy(adjtrans(mat))) + @test reduction(imag, adjtrans(mat), dims=1) ≈ reduction(imag, copy(adjtrans(mat)), dims=1) + @test reduction(x -> x[1,2], adjtrans(mat), dims=1) ≈ reduction(x -> x[1,2], copy(adjtrans(mat)), dims=1) + end + # see #46605 + Ac = [1 2; 3 4]' + @test mapreduce(identity, (x, y) -> 10x+y, copy(Ac)) == mapreduce(identity, (x, y) -> 10x+y, Ac) == 1234 + @test extrema([3,7,4]') == (3, 7) + @test mapreduce(x -> [x;;;], +, [1, 2, 3]') == sum(x -> [x;;;], [1, 2, 3]') == [6;;;] + @test mapreduce(string, *, [1 2; 3 4]') == mapreduce(string, *, copy([1 2; 3 4]')) == "1234" end end # module TestAdjointTranspose diff --git a/test/arrayops.jl b/test/arrayops.jl index b2badb66ce93d..22d38fddd3636 100644 --- a/test/arrayops.jl +++ b/test/arrayops.jl @@ -700,7 +700,7 @@ end ap = PermutedDimsArray(Array(a), (2,1,3)) @test strides(ap) == (3,1,12) - for A in [rand(1,2,3,4),rand(2,2,2,2),rand(5,6,5,6),rand(1,1,1,1)] + for A in [rand(1,2,3,4),rand(2,2,2,2),rand(5,6,5,6),rand(1,1,1,1), [rand(ComplexF64, 2,2) for _ in 1:2, _ in 1:3, _ in 1:2, _ in 1:4]] perm = randperm(4) @test isequal(A,permutedims(permutedims(A,perm),invperm(perm))) @test isequal(A,permutedims(permutedims(A,invperm(perm)),perm)) @@ -708,6 +708,10 @@ end @test sum(permutedims(A,perm)) ≈ sum(PermutedDimsArray(A,perm)) @test sum(permutedims(A,perm), dims=2) ≈ sum(PermutedDimsArray(A,perm), dims=2) @test sum(permutedims(A,perm), dims=(2,4)) ≈ sum(PermutedDimsArray(A,perm), dims=(2,4)) + + @test prod(permutedims(A,perm)) ≈ prod(PermutedDimsArray(A,perm)) + @test prod(permutedims(A,perm), dims=2) ≈ prod(PermutedDimsArray(A,perm), dims=2) + @test prod(permutedims(A,perm), dims=(2,4)) ≈ prod(PermutedDimsArray(A,perm), dims=(2,4)) end m = [1 2; 3 4] From cc2b7c581354ca45b6560009756545915fb2d470 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Fri, 16 Sep 2022 05:46:16 -0400 Subject: [PATCH 336/369] Make the "system image too large" error message more descriptive (#46570) (cherry picked from commit a7bef773282db153012c325d0758a7256836f41e) --- src/staticdata.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/staticdata.c b/src/staticdata.c index 3decbaaf5430a..1b98601026d49 100644 --- a/src/staticdata.c +++ b/src/staticdata.c @@ -59,6 +59,7 @@ done by `get_item_for_reloc`. #include #include #include // printf +#include // PRIxPTR #include "julia.h" #include "julia_internal.h" @@ -1956,9 +1957,22 @@ static void jl_save_system_image_to_stream(ios_t *f) JL_GC_DISABLED jl_write_gv_tagrefs(&s); } - if (sysimg.size > ((uintptr_t)1 << RELOC_TAG_OFFSET) || - const_data.size > ((uintptr_t)1 << RELOC_TAG_OFFSET)*sizeof(void*)) { - jl_printf(JL_STDERR, "ERROR: system image too large\n"); + if (sysimg.size > ((uintptr_t)1 << RELOC_TAG_OFFSET)) { + jl_printf( + JL_STDERR, + "ERROR: system image too large: sysimg.size is %jd but the limit is %" PRIxPTR "\n", + (intmax_t)sysimg.size, + ((uintptr_t)1 << RELOC_TAG_OFFSET) + ); + jl_exit(1); + } + if (const_data.size > ((uintptr_t)1 << RELOC_TAG_OFFSET)*sizeof(void*)) { + jl_printf( + JL_STDERR, + "ERROR: system image too large: const_data.size is %jd but the limit is %" PRIxPTR "\n", + (intmax_t)const_data.size, + ((uintptr_t)1 << RELOC_TAG_OFFSET)*sizeof(void*) + ); jl_exit(1); } From d336126d094ef834bbc9536ead60993ada948628 Mon Sep 17 00:00:00 2001 From: Francois-Xavier Coudert Date: Fri, 16 Sep 2022 11:30:28 +0200 Subject: [PATCH 337/369] Support LibGit2 ABI for 1.4.0 and later Partial backport of https://github.com/JuliaLang/julia/pull/45411 (cherry picked from commit 44bdf6b00b21863d165bd02e3ecfb6d413286ae9) --- stdlib/LibGit2/src/consts.jl | 5 +++++ stdlib/LibGit2/src/types.jl | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/stdlib/LibGit2/src/consts.jl b/stdlib/LibGit2/src/consts.jl index 2bc9edaf8950b..55887ebe2a8ab 100644 --- a/stdlib/LibGit2/src/consts.jl +++ b/stdlib/LibGit2/src/consts.jl @@ -247,6 +247,11 @@ const RESET_HARD = Cint(3) # MIXED plus changes in working tree discarded REBASE_OPERATION_FIXUP = Cint(4), REBASE_OPERATION_EXEC = Cint(5)) +# git_remote_redirect_t +const GIT_REMOTE_REDIRECT_NONE = Cint(0) +const GIT_REMOTE_REDIRECT_INITIAL = Cint(1) +const GIT_REMOTE_REDIRECT_ALL = Cint(2) + # fetch_prune const FETCH_PRUNE_UNSPECIFIED = Cint(0) const FETCH_PRUNE = Cint(1) diff --git a/stdlib/LibGit2/src/types.jl b/stdlib/LibGit2/src/types.jl index 2d95596cb276d..211bb4c08ad26 100644 --- a/stdlib/LibGit2/src/types.jl +++ b/stdlib/LibGit2/src/types.jl @@ -346,6 +346,9 @@ The fields represent: @static if LibGit2.VERSION >= v"0.25.0" proxy_opts::ProxyOptions = ProxyOptions() end + @static if LibGit2.VERSION >= v"1.4.0" + follow_redirects::Cint = Consts.GIT_REMOTE_REDIRECT_INITIAL + end @static if LibGit2.VERSION >= v"0.24.0" custom_headers::StrArrayStruct = StrArrayStruct() end @@ -677,6 +680,9 @@ The fields represent: @static if LibGit2.VERSION >= v"0.25.0" proxy_opts::ProxyOptions = ProxyOptions() end + @static if LibGit2.VERSION >= v"1.4.0" + follow_redirects::Cint = Consts.GIT_REMOTE_REDIRECT_INITIAL + end @static if LibGit2.VERSION >= v"0.24.0" custom_headers::StrArrayStruct = StrArrayStruct() end From 80fda110a2fe4db272156f39461419f7868b7cb8 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Mon, 25 Jul 2022 14:26:34 -0400 Subject: [PATCH 338/369] tcp: re-enable half-duplex operation support (#46088) Refs: #42005 (cherry picked from commit 69e319d005d812dbc4442b08fc9e8ea6a2ade110) --- base/stream.jl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/base/stream.jl b/base/stream.jl index cee4894b28c3c..0c902cd6fd946 100644 --- a/base/stream.jl +++ b/base/stream.jl @@ -662,8 +662,11 @@ function uv_readcb(handle::Ptr{Cvoid}, nread::Cssize_t, buf::Ptr{Cvoid}) elseif nread == UV_EOF # libuv called uv_stop_reading already if stream.status != StatusClosing stream.status = StatusEOF - if stream isa TTY # TODO: || ccall(:uv_is_writable, Cint, (Ptr{Cvoid},), stream.handle) != 0 - # stream can still be used either by reseteof # TODO: or write + if stream isa TTY + # stream can still be used by reseteof (or possibly write) + notify(stream.cond) + elseif !(stream isa PipeEndpoint) && ccall(:uv_is_writable, Cint, (Ptr{Cvoid},), stream.handle) != 0 + # stream can still be used by write notify(stream.cond) else # underlying stream is no longer useful: begin finalization From 86d03546010100d8f1d4e90a1633313dc4ec174f Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Fri, 5 Aug 2022 11:03:08 -0400 Subject: [PATCH 339/369] libuv: bump version to v2-1.44.2 (#46086) Includes several fixes: https://github.com/JuliaLang/libuv/compare/1b2d16477fe1142adea952168d828a066e03ee4c...3f7038d62e43c3682394a6ea7b4ccc46be0fa0bf And should make read-eof notification slightly faster in some cases (rather than waiting for close notification). (cherry picked from commit fa986d9e0525eedd7706929d549c61179e6c6090) --- base/stream.jl | 6 ++-- deps/checksums/libuv | 68 +++++++++++++++++------------------ deps/libuv.version | 4 +-- stdlib/LibUV_jll/Project.toml | 2 +- 4 files changed, 40 insertions(+), 40 deletions(-) diff --git a/base/stream.jl b/base/stream.jl index 0c902cd6fd946..b93e17707f6a6 100644 --- a/base/stream.jl +++ b/base/stream.jl @@ -409,7 +409,7 @@ function wait_readnb(x::LibuvStream, nb::Int) while bytesavailable(x.buffer) < nb x.readerror === nothing || throw(x.readerror) isopen(x) || break - x.status != StatusEOF || break + x.status == StatusEOF && break x.throttle = max(nb, x.throttle) start_reading(x) # ensure we are reading iolock_end() @@ -662,12 +662,11 @@ function uv_readcb(handle::Ptr{Cvoid}, nread::Cssize_t, buf::Ptr{Cvoid}) elseif nread == UV_EOF # libuv called uv_stop_reading already if stream.status != StatusClosing stream.status = StatusEOF + notify(stream.cond) if stream isa TTY # stream can still be used by reseteof (or possibly write) - notify(stream.cond) elseif !(stream isa PipeEndpoint) && ccall(:uv_is_writable, Cint, (Ptr{Cvoid},), stream.handle) != 0 # stream can still be used by write - notify(stream.cond) else # underlying stream is no longer useful: begin finalization ccall(:jl_close_uv, Cvoid, (Ptr{Cvoid},), stream.handle) @@ -676,6 +675,7 @@ function uv_readcb(handle::Ptr{Cvoid}, nread::Cssize_t, buf::Ptr{Cvoid}) end else stream.readerror = _UVError("read", nread) + notify(stream.cond) # This is a fatal connection error ccall(:jl_close_uv, Cvoid, (Ptr{Cvoid},), stream.handle) stream.status = StatusClosing diff --git a/deps/checksums/libuv b/deps/checksums/libuv index 6c90c1b2115c7..99b328f0dc9b5 100644 --- a/deps/checksums/libuv +++ b/deps/checksums/libuv @@ -1,34 +1,34 @@ -LibUV.v2.0.1+5.aarch64-apple-darwin.tar.gz/md5/54a94c839c561f5b74601d6d2bd5bf1e -LibUV.v2.0.1+5.aarch64-apple-darwin.tar.gz/sha512/bba06826461a4f35abbe54ba5266d9bf354d22e1f33d75f4273a917ce92437432d8b2cc9d4b4670164c14542e896ee97396a1c34ce0f653d6a2787ab4b6160bb -LibUV.v2.0.1+5.aarch64-linux-gnu.tar.gz/md5/b2680a3cebeb850bfec0df820e27072c -LibUV.v2.0.1+5.aarch64-linux-gnu.tar.gz/sha512/9c5611ae653642ef0060c46235fa2d2e0e4094804fb52629456ae4e5deed7e5fcc88640537799d11d824b6c0c00e75fa2bbddc0206e69c587ae3a77b68e11366 -LibUV.v2.0.1+5.aarch64-linux-musl.tar.gz/md5/a50cea6c75ea4093851cd7420168a59e -LibUV.v2.0.1+5.aarch64-linux-musl.tar.gz/sha512/51ed9be7dec0546cba4822eb116188c15c464ef155df03f0d5d8e9431ba8fe4c23dffde33c3331ef6e7ef3f8135b025fe26b01f036ab193aa340020f9d3bcb6e -LibUV.v2.0.1+5.armv6l-linux-gnueabihf.tar.gz/md5/1b6750b5c85c5f456a448325a77bee06 -LibUV.v2.0.1+5.armv6l-linux-gnueabihf.tar.gz/sha512/06decd104aad78de07101576fab5c0200867c332d12f1cb0cbe8c558c0c2c84c918e5772fbfc62f6ce80437ad68ae97e3d180c97dd40383c80d5e81fee96ecd7 -LibUV.v2.0.1+5.armv6l-linux-musleabihf.tar.gz/md5/54e9820e027e97af7f324d7b5c12fee1 -LibUV.v2.0.1+5.armv6l-linux-musleabihf.tar.gz/sha512/a30353cbf74bf698e38fd357e57fec03345a4ce71e971d9eb034aa211b536dc83b994da533df914a65ba3f5babc7ab66423ed12da665b67c050a8e799cdeada6 -LibUV.v2.0.1+5.armv7l-linux-gnueabihf.tar.gz/md5/252f5fc6d094edea5faef71630f4ba83 -LibUV.v2.0.1+5.armv7l-linux-gnueabihf.tar.gz/sha512/79ebe1e57cefa243219525fdebad35765736534a4b036f2487d6dfa0376a685c8e9f16259bbce83155baebe5ceeeff2592933b597ceafa724060ffd4dd63b0c4 -LibUV.v2.0.1+5.armv7l-linux-musleabihf.tar.gz/md5/39bc81ad36519ee9261a662d444c13b4 -LibUV.v2.0.1+5.armv7l-linux-musleabihf.tar.gz/sha512/97a312f2a42a2377458ff5d5356905fb469c9c30f9ae3fa7d091c7e2cdab3a7ea813e1142fb7d08f2e0000a3d8388fb5fe0d82d3ff646310924439ba99f02903 -LibUV.v2.0.1+5.i686-linux-gnu.tar.gz/md5/ca4b4a317b62cd48f4277bba5ebb9b80 -LibUV.v2.0.1+5.i686-linux-gnu.tar.gz/sha512/2cf17359c976b10a2e0e08d92b43ef2d113a0071748209ad6b2896d9578cb3e96b55f7c72a7c7243ded244b95945c67ea3aa248c1513b5fd37ea714154e04c2d -LibUV.v2.0.1+5.i686-linux-musl.tar.gz/md5/7f088f43c6ae4029e9d90c2881cf2509 -LibUV.v2.0.1+5.i686-linux-musl.tar.gz/sha512/b3653bd4cd95b2d4247b4b83215bfb756e211a3cc02e7e7ca1887e820cb1a7d461397d7259057b63e51825dc344e2f20e904d17defeba59584ddc54df94f1ccc -LibUV.v2.0.1+5.i686-w64-mingw32.tar.gz/md5/8ec8f225a708ebb95fd6dbe6039c386d -LibUV.v2.0.1+5.i686-w64-mingw32.tar.gz/sha512/fd9575300a65af9b7c3a59451646a5f617fd9df0fcae21db02f0f1e9c689605b1e75d12f0ee46654cb8d2b44ac044d2b44b34f9c6d008c19d41b001a69e40c6e -LibUV.v2.0.1+5.powerpc64le-linux-gnu.tar.gz/md5/54c51f81a0b69687f0cbfce63b530991 -LibUV.v2.0.1+5.powerpc64le-linux-gnu.tar.gz/sha512/79a9daa826432da8f389bbb6788720f0bdf0e6a09a16b8296f0ead8e0eae175a72a0690e4ffa5e5d8169e22f596a8ad41607eb836d3f55b217bcf74885e707e0 -LibUV.v2.0.1+5.x86_64-apple-darwin.tar.gz/md5/9ea7e5bf6107f0773e7cdb875d831939 -LibUV.v2.0.1+5.x86_64-apple-darwin.tar.gz/sha512/07b5137c94adaf1c024373b27c2a2a0e77b20cc87f536551e6080b59bd47f65d6ccaaf40ec14068e9e24140c07ad518ef749c09d93fcc36b0507c4ed6acc7032 -LibUV.v2.0.1+5.x86_64-linux-gnu.tar.gz/md5/c4feae1cb61b43ab38b8adb80f8cb46f -LibUV.v2.0.1+5.x86_64-linux-gnu.tar.gz/sha512/cef015385abca586215796c7d2420a4b2496b8a50a62bd9c483d76bb00adb4e3decefe17ba8398353166818bb23b758d3bdb311965849ea68f8b68377c1b08bc -LibUV.v2.0.1+5.x86_64-linux-musl.tar.gz/md5/47f23d12e6c2094604f168c6c40ca131 -LibUV.v2.0.1+5.x86_64-linux-musl.tar.gz/sha512/abe0d74ceabc2d7efc80c1e8d0a6938205bea883257c43a637fc739c82a7085d4f0109c22d0f67e332aa14bed60433dd739676e0237fd28aba6a15c82d3e41f4 -LibUV.v2.0.1+5.x86_64-unknown-freebsd.tar.gz/md5/6a6eeb9108db8a30f776685d4f98a853 -LibUV.v2.0.1+5.x86_64-unknown-freebsd.tar.gz/sha512/e08961cfeb904145b67c2833e6ea3f91b90bc9c8948cfd61399c7d10b1a9cffe17728a6c906a9d791b71da406d8012014b7dcde70ed445084d21e99563cdd377 -LibUV.v2.0.1+5.x86_64-w64-mingw32.tar.gz/md5/7d592fefa8b295e09b4640bd999aa358 -LibUV.v2.0.1+5.x86_64-w64-mingw32.tar.gz/sha512/b4e738c5d86ad27171289f284e35124c6bcf94fc55512622563c6be75027de5033672100008e283aced530c71a6bb1da038872719e1073566d5979278ea76e0b -libuv-3a63bf71de62c64097989254e4f03212e3bf5fc8.tar.gz/md5/a385b594c170085018bc954e50cb42cc -libuv-3a63bf71de62c64097989254e4f03212e3bf5fc8.tar.gz/sha512/5415e992a20498ae29c09bfdb4819857d15be83367488e9fbd8c5f6a460da4cd2d0dff7eaa6087a4bcf6dee6d1c873acbe5751f5594851c978456665d6a21cf9 +LibUV.v2.0.1+8.aarch64-apple-darwin.tar.gz/md5/c6123b5807b457a7b171b9060bcafa19 +LibUV.v2.0.1+8.aarch64-apple-darwin.tar.gz/sha512/bfbf31fde87e8a4bbb9cde72fba98c562a66a5c64cb2a9998dce4f94cc955fd6afa0b54757682499da483baee9c78c30bd685a60ef6419d2b7383fd313f7eee3 +LibUV.v2.0.1+8.aarch64-linux-gnu.tar.gz/md5/97274d22abb4c3674508732907d74b47 +LibUV.v2.0.1+8.aarch64-linux-gnu.tar.gz/sha512/2adbfaaf690d928b7d32b2e4d48a53c4ffdd94cb699db8e46d93dde496a33b29feb3f0d1c62df42b2dfaace9941a79829d54fd68900632f9cec5da71015de28f +LibUV.v2.0.1+8.aarch64-linux-musl.tar.gz/md5/0eaec69cc9b40d99c23182b7a20c4b81 +LibUV.v2.0.1+8.aarch64-linux-musl.tar.gz/sha512/224156e8fb287d45060445dbbc2dedafebee0cd44923b541c13d6688c8e8f7a86fe608fe6235c9459a2f07eac9e4b0d38577164674238f89033c3ab8c76e6e05 +LibUV.v2.0.1+8.armv6l-linux-gnueabihf.tar.gz/md5/2ddd26fac1ec25faa44be79a95ea52e0 +LibUV.v2.0.1+8.armv6l-linux-gnueabihf.tar.gz/sha512/123a1faf182e4e757b96faf2f4981f4985246780796e0be9239872dbcc76631f2d028171a6e40150b532b4840de83c36e274e9630c2474ed50e9c150efaf2dd7 +LibUV.v2.0.1+8.armv6l-linux-musleabihf.tar.gz/md5/bf474e3faa0a8dafdc3c37eef1f22133 +LibUV.v2.0.1+8.armv6l-linux-musleabihf.tar.gz/sha512/9a4e4b0af14e5e16e654033f2b77910a5004dbbd52eaad844429af7f521233a8a352d3f12e96a5d6dc6b709b578146d9bb34e12ba959b0cc111b8a6667fc88d9 +LibUV.v2.0.1+8.armv7l-linux-gnueabihf.tar.gz/md5/a10c8d87b4cc631e85d93c3e0ea0e882 +LibUV.v2.0.1+8.armv7l-linux-gnueabihf.tar.gz/sha512/65ebe30c7e14a4d72e0489cfcc299a45a6313102b540b2c245df0d098ec9c79c1037517c9a341b095912fe81c36fd6d5c308dfb090169dea76c04105c871e790 +LibUV.v2.0.1+8.armv7l-linux-musleabihf.tar.gz/md5/d77772d6330ae6692fd1295f3dfea8a8 +LibUV.v2.0.1+8.armv7l-linux-musleabihf.tar.gz/sha512/c21ab143bb5262fb09a8d457ef53f639e3040802abd128bb49b300015bba857fe3adaa0181e277b7a79ca20e02aaafc644f1297cfc18a1e1ca8af8cf1af711be +LibUV.v2.0.1+8.i686-linux-gnu.tar.gz/md5/54bb6813c26a7e0ea2518de5faa243a5 +LibUV.v2.0.1+8.i686-linux-gnu.tar.gz/sha512/cef37e6b164a66135bb5eb3742827575a41e0723fa66e037b030833461bec681054c70684d0ab3b30e52a5b0a16eb003cc9a67003652f0865b7e0d504af2e7a8 +LibUV.v2.0.1+8.i686-linux-musl.tar.gz/md5/515fbd2e524ae8bff39520fa50ebe792 +LibUV.v2.0.1+8.i686-linux-musl.tar.gz/sha512/5b5679937c4aef39fc22bb8681440a33bd53eb6115315f8b169f65a9f59d632f3d774b0cd3fe14d9a2f74db64a459f0e81ceb94648c6c464e0d275567c87dadb +LibUV.v2.0.1+8.i686-w64-mingw32.tar.gz/md5/7f0fedba47d432c48b26757348b1eb5d +LibUV.v2.0.1+8.i686-w64-mingw32.tar.gz/sha512/3d3fe9bbd210896d68d3de2748a013a59e11fa42360c186fe7a461e2aa4b8c26fa7bacd1a04cd22e86c8600b2d764cb5c66a0cacbf956df8df04aa6cf26503f7 +LibUV.v2.0.1+8.powerpc64le-linux-gnu.tar.gz/md5/feac1f65834f86b0f1aedf002431fbd4 +LibUV.v2.0.1+8.powerpc64le-linux-gnu.tar.gz/sha512/f78b55da9ee0c9cd13c4824e07d4b96f7b47dfbc2d7abc5d09210cfff3c659f46ebb3dc733f8eeb9c6464c8252927e89f76540b48cdb370dd89e8ea1eabc6cb8 +LibUV.v2.0.1+8.x86_64-apple-darwin.tar.gz/md5/930a03b3cb44a2a42ff20be4c5bb388d +LibUV.v2.0.1+8.x86_64-apple-darwin.tar.gz/sha512/5398264f42707c35cacb68ba5dab84e49efcb5571e01b16055030dd11f5b8ea4371972b419e2087a1daf9565b4b578633fce13d1e050adb23f91b7ac16ad1937 +LibUV.v2.0.1+8.x86_64-linux-gnu.tar.gz/md5/3a3346f4e91123d49bf41a124303a670 +LibUV.v2.0.1+8.x86_64-linux-gnu.tar.gz/sha512/d81951bb396e5116d80127a69546844ec99f9b19b229a0344d3f9051e2f08c13f3abb0650bc314ca5be0fc556f0a655dba960e2513de590db0bfaae4575d6f54 +LibUV.v2.0.1+8.x86_64-linux-musl.tar.gz/md5/603fec3ba7efb51be040c22803784ded +LibUV.v2.0.1+8.x86_64-linux-musl.tar.gz/sha512/345fe3f0cedf7404345d49e9eca7032787d758b3d5e2e0af2b59836a1fc2e5b71738c8389eb31738c161527a717c7f6f30af123e3a9056785bcdbcb9a1b18057 +LibUV.v2.0.1+8.x86_64-unknown-freebsd.tar.gz/md5/ec6df758c4b27a495adb97820b5a8b22 +LibUV.v2.0.1+8.x86_64-unknown-freebsd.tar.gz/sha512/16d3c39d8fd2e4c9035cff99433c5f5a9150da18fac3ed9639e22a38715ef51f30d28f83674c68be69d1305f4b53b785f3a8f89d28253fe254bd2515fc49d5ea +LibUV.v2.0.1+8.x86_64-w64-mingw32.tar.gz/md5/0dff06ff0a42ac3404f78f7eccf08f1b +LibUV.v2.0.1+8.x86_64-w64-mingw32.tar.gz/sha512/4884c6cd7c29eee725b0d9f6eab091086665b3070f3cd33854f482c9b2ec55924ab560bd5d27b46c5e0ed6a7af08bffb5beb0e75fef6aa82b4f90bd7599ee691 +libuv-3f7038d62e43c3682394a6ea7b4ccc46be0fa0bf.tar.gz/md5/fe6957e2603df688a40605134505052b +libuv-3f7038d62e43c3682394a6ea7b4ccc46be0fa0bf.tar.gz/sha512/28f13b8d927e0663bff26e9ab829538947754046088a42fc85d772d62c28fb47f8f3075d1a884bbbae6ce0ba294eb8f3b5f9cb95be14d7ae1f467b713b4a14a7 diff --git a/deps/libuv.version b/deps/libuv.version index 7339533223083..695eea73c9754 100644 --- a/deps/libuv.version +++ b/deps/libuv.version @@ -1,2 +1,2 @@ -LIBUV_BRANCH=julia-uv2-1.42.0 -LIBUV_SHA1=3a63bf71de62c64097989254e4f03212e3bf5fc8 +LIBUV_BRANCH=julia-uv2-1.44.2 +LIBUV_SHA1=3f7038d62e43c3682394a6ea7b4ccc46be0fa0bf diff --git a/stdlib/LibUV_jll/Project.toml b/stdlib/LibUV_jll/Project.toml index ec084417b7744..9a46adb07cc95 100644 --- a/stdlib/LibUV_jll/Project.toml +++ b/stdlib/LibUV_jll/Project.toml @@ -1,6 +1,6 @@ name = "LibUV_jll" uuid = "183b4373-6708-53ba-ad28-60e28bb38547" -version = "2.0.1+5" +version = "2.0.1+8" [deps] Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" From b79226e6618794d52d0799d8596ca45d1622788c Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Sat, 17 Sep 2022 11:59:15 +0900 Subject: [PATCH 340/369] inference: make `limit::Int` as a caching key of `CachedMethodTable` (#46799) Sometimes `Core.Compiler.findall(::Type, ::CachedMethodTable; limit::Int)` is called with different `limit` setting (in particularity `return_type_tfunc` calls it with `limit=-1`). The query should return different results given different `limit` settings, so its cache should also have different keys per different `limit` settings. fix #46722 --- base/compiler/methodtable.jl | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/base/compiler/methodtable.jl b/base/compiler/methodtable.jl index 8b3968332e2e8..705db11b33f8a 100644 --- a/base/compiler/methodtable.jl +++ b/base/compiler/methodtable.jl @@ -44,6 +44,12 @@ struct OverlayMethodTable <: MethodTableView mt::Core.MethodTable end +struct MethodMatchKey + sig # ::Type + limit::Int + MethodMatchKey(@nospecialize(sig), limit::Int) = new(sig, limit) +end + """ struct CachedMethodTable <: MethodTableView @@ -51,10 +57,10 @@ Overlays another method table view with an additional local fast path cache that can respond to repeated, identical queries faster than the original method table. """ struct CachedMethodTable{T} <: MethodTableView - cache::IdDict{Any, Union{Missing, MethodMatchResult}} + cache::IdDict{MethodMatchKey, Union{Missing,MethodMatchResult}} table::T end -CachedMethodTable(table::T) where T = CachedMethodTable{T}(IdDict{Any, Union{Missing, MethodMatchResult}}(), table) +CachedMethodTable(table::T) where T = CachedMethodTable{T}(IdDict{MethodMatchKey, Union{Missing,MethodMatchResult}}(), table) """ findall(sig::Type, view::MethodTableView; limit::Int=typemax(Int)) -> @@ -109,9 +115,11 @@ function findall(@nospecialize(sig::Type), table::CachedMethodTable; limit::Int= # as for concrete types, we cache result at on the next level return findall(sig, table.table; limit) end - box = Core.Box(sig) - return get!(table.cache, sig) do - findall(box.contents, table.table; limit) + key = MethodMatchKey(sig, limit) + if haskey(table.cache, key) + return table.cache[key] + else + return table.cache[key] = findall(sig, table.table; limit) end end From 5b365e5e0e263cdabdb38e330b06adad6c0f3e62 Mon Sep 17 00:00:00 2001 From: Kiran Date: Sat, 17 Sep 2022 17:11:59 -0400 Subject: [PATCH 341/369] Fix a bug accidentally introduced by 43453 (#46816) --- src/partr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/partr.c b/src/partr.c index ddba203b92b1d..5d50546440849 100644 --- a/src/partr.c +++ b/src/partr.c @@ -312,8 +312,10 @@ JL_DLLEXPORT int jl_enqueue_task(jl_task_t *task) char failed; if (multiq_insert(task, task->prio) == -1) failed = 1; - failed = 0; - JL_PROBE_RT_TASKQ_INSERT(jl_current_task->ptls, task); + else { + failed = 0; + JL_PROBE_RT_TASKQ_INSERT(jl_current_task->ptls, task); + } return failed; } From 6bfa51fb163c76c9a555b2c6db019d1275c338ea Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Tue, 20 Sep 2022 09:05:38 +0200 Subject: [PATCH 342/369] Expose constrained memory limits and have the GC use them (#46796) (cherry picked from commit 89c4a2a823af7d7c8f0d006c0723cec9b0ab3efd) --- base/sysinfo.jl | 31 ++++++++++++++-- deps/checksums/libuv | 68 +++++++++++++++++------------------ deps/libuv.version | 2 +- doc/src/base/base.md | 2 ++ src/gc.c | 2 +- stdlib/LibUV_jll/Project.toml | 2 +- 6 files changed, 68 insertions(+), 39 deletions(-) diff --git a/base/sysinfo.jl b/base/sysinfo.jl index f0852f32fc17d..62241457f8954 100644 --- a/base/sysinfo.jl +++ b/base/sysinfo.jl @@ -20,6 +20,8 @@ export BINDIR, loadavg, free_memory, total_memory, + physical_free_memory, + physical_total_memory, isapple, isbsd, isdragonfly, @@ -246,19 +248,44 @@ function loadavg() return loadavg_ end +""" + Sys.free_physical_memory() + +Get the free memory of the system in bytes. The entire amount may not be available to the +current process; use `Sys.free_memory()` for the actually available amount. +""" +free_physical_memory() = ccall(:uv_get_free_memory, UInt64, ()) + +""" + Sys.total_physical_memory() + +Get the total memory in RAM (including that which is currently used) in bytes. The entire +amount may not be available to the current process; see `Sys.total_memory()`. +""" +total_physical_memory() = ccall(:uv_get_total_memory, UInt64, ()) + """ Sys.free_memory() Get the total free memory in RAM in bytes. """ -free_memory() = ccall(:uv_get_free_memory, UInt64, ()) +free_memory() = ccall(:uv_get_available_memory, UInt64, ()) """ Sys.total_memory() Get the total memory in RAM (including that which is currently used) in bytes. +This amount may be constrained, e.g., by Linux control groups. For the unconstrained +amount, see `Sys.physical_memory()`. """ -total_memory() = ccall(:uv_get_total_memory, UInt64, ()) +function total_memory() + memory = ccall(:uv_get_constrained_memory, UInt64, ()) + if memory == 0 + return total_physical_memory() + else + return memory + end +end """ Sys.get_process_title() diff --git a/deps/checksums/libuv b/deps/checksums/libuv index 99b328f0dc9b5..844b063287c6d 100644 --- a/deps/checksums/libuv +++ b/deps/checksums/libuv @@ -1,34 +1,34 @@ -LibUV.v2.0.1+8.aarch64-apple-darwin.tar.gz/md5/c6123b5807b457a7b171b9060bcafa19 -LibUV.v2.0.1+8.aarch64-apple-darwin.tar.gz/sha512/bfbf31fde87e8a4bbb9cde72fba98c562a66a5c64cb2a9998dce4f94cc955fd6afa0b54757682499da483baee9c78c30bd685a60ef6419d2b7383fd313f7eee3 -LibUV.v2.0.1+8.aarch64-linux-gnu.tar.gz/md5/97274d22abb4c3674508732907d74b47 -LibUV.v2.0.1+8.aarch64-linux-gnu.tar.gz/sha512/2adbfaaf690d928b7d32b2e4d48a53c4ffdd94cb699db8e46d93dde496a33b29feb3f0d1c62df42b2dfaace9941a79829d54fd68900632f9cec5da71015de28f -LibUV.v2.0.1+8.aarch64-linux-musl.tar.gz/md5/0eaec69cc9b40d99c23182b7a20c4b81 -LibUV.v2.0.1+8.aarch64-linux-musl.tar.gz/sha512/224156e8fb287d45060445dbbc2dedafebee0cd44923b541c13d6688c8e8f7a86fe608fe6235c9459a2f07eac9e4b0d38577164674238f89033c3ab8c76e6e05 -LibUV.v2.0.1+8.armv6l-linux-gnueabihf.tar.gz/md5/2ddd26fac1ec25faa44be79a95ea52e0 -LibUV.v2.0.1+8.armv6l-linux-gnueabihf.tar.gz/sha512/123a1faf182e4e757b96faf2f4981f4985246780796e0be9239872dbcc76631f2d028171a6e40150b532b4840de83c36e274e9630c2474ed50e9c150efaf2dd7 -LibUV.v2.0.1+8.armv6l-linux-musleabihf.tar.gz/md5/bf474e3faa0a8dafdc3c37eef1f22133 -LibUV.v2.0.1+8.armv6l-linux-musleabihf.tar.gz/sha512/9a4e4b0af14e5e16e654033f2b77910a5004dbbd52eaad844429af7f521233a8a352d3f12e96a5d6dc6b709b578146d9bb34e12ba959b0cc111b8a6667fc88d9 -LibUV.v2.0.1+8.armv7l-linux-gnueabihf.tar.gz/md5/a10c8d87b4cc631e85d93c3e0ea0e882 -LibUV.v2.0.1+8.armv7l-linux-gnueabihf.tar.gz/sha512/65ebe30c7e14a4d72e0489cfcc299a45a6313102b540b2c245df0d098ec9c79c1037517c9a341b095912fe81c36fd6d5c308dfb090169dea76c04105c871e790 -LibUV.v2.0.1+8.armv7l-linux-musleabihf.tar.gz/md5/d77772d6330ae6692fd1295f3dfea8a8 -LibUV.v2.0.1+8.armv7l-linux-musleabihf.tar.gz/sha512/c21ab143bb5262fb09a8d457ef53f639e3040802abd128bb49b300015bba857fe3adaa0181e277b7a79ca20e02aaafc644f1297cfc18a1e1ca8af8cf1af711be -LibUV.v2.0.1+8.i686-linux-gnu.tar.gz/md5/54bb6813c26a7e0ea2518de5faa243a5 -LibUV.v2.0.1+8.i686-linux-gnu.tar.gz/sha512/cef37e6b164a66135bb5eb3742827575a41e0723fa66e037b030833461bec681054c70684d0ab3b30e52a5b0a16eb003cc9a67003652f0865b7e0d504af2e7a8 -LibUV.v2.0.1+8.i686-linux-musl.tar.gz/md5/515fbd2e524ae8bff39520fa50ebe792 -LibUV.v2.0.1+8.i686-linux-musl.tar.gz/sha512/5b5679937c4aef39fc22bb8681440a33bd53eb6115315f8b169f65a9f59d632f3d774b0cd3fe14d9a2f74db64a459f0e81ceb94648c6c464e0d275567c87dadb -LibUV.v2.0.1+8.i686-w64-mingw32.tar.gz/md5/7f0fedba47d432c48b26757348b1eb5d -LibUV.v2.0.1+8.i686-w64-mingw32.tar.gz/sha512/3d3fe9bbd210896d68d3de2748a013a59e11fa42360c186fe7a461e2aa4b8c26fa7bacd1a04cd22e86c8600b2d764cb5c66a0cacbf956df8df04aa6cf26503f7 -LibUV.v2.0.1+8.powerpc64le-linux-gnu.tar.gz/md5/feac1f65834f86b0f1aedf002431fbd4 -LibUV.v2.0.1+8.powerpc64le-linux-gnu.tar.gz/sha512/f78b55da9ee0c9cd13c4824e07d4b96f7b47dfbc2d7abc5d09210cfff3c659f46ebb3dc733f8eeb9c6464c8252927e89f76540b48cdb370dd89e8ea1eabc6cb8 -LibUV.v2.0.1+8.x86_64-apple-darwin.tar.gz/md5/930a03b3cb44a2a42ff20be4c5bb388d -LibUV.v2.0.1+8.x86_64-apple-darwin.tar.gz/sha512/5398264f42707c35cacb68ba5dab84e49efcb5571e01b16055030dd11f5b8ea4371972b419e2087a1daf9565b4b578633fce13d1e050adb23f91b7ac16ad1937 -LibUV.v2.0.1+8.x86_64-linux-gnu.tar.gz/md5/3a3346f4e91123d49bf41a124303a670 -LibUV.v2.0.1+8.x86_64-linux-gnu.tar.gz/sha512/d81951bb396e5116d80127a69546844ec99f9b19b229a0344d3f9051e2f08c13f3abb0650bc314ca5be0fc556f0a655dba960e2513de590db0bfaae4575d6f54 -LibUV.v2.0.1+8.x86_64-linux-musl.tar.gz/md5/603fec3ba7efb51be040c22803784ded -LibUV.v2.0.1+8.x86_64-linux-musl.tar.gz/sha512/345fe3f0cedf7404345d49e9eca7032787d758b3d5e2e0af2b59836a1fc2e5b71738c8389eb31738c161527a717c7f6f30af123e3a9056785bcdbcb9a1b18057 -LibUV.v2.0.1+8.x86_64-unknown-freebsd.tar.gz/md5/ec6df758c4b27a495adb97820b5a8b22 -LibUV.v2.0.1+8.x86_64-unknown-freebsd.tar.gz/sha512/16d3c39d8fd2e4c9035cff99433c5f5a9150da18fac3ed9639e22a38715ef51f30d28f83674c68be69d1305f4b53b785f3a8f89d28253fe254bd2515fc49d5ea -LibUV.v2.0.1+8.x86_64-w64-mingw32.tar.gz/md5/0dff06ff0a42ac3404f78f7eccf08f1b -LibUV.v2.0.1+8.x86_64-w64-mingw32.tar.gz/sha512/4884c6cd7c29eee725b0d9f6eab091086665b3070f3cd33854f482c9b2ec55924ab560bd5d27b46c5e0ed6a7af08bffb5beb0e75fef6aa82b4f90bd7599ee691 -libuv-3f7038d62e43c3682394a6ea7b4ccc46be0fa0bf.tar.gz/md5/fe6957e2603df688a40605134505052b -libuv-3f7038d62e43c3682394a6ea7b4ccc46be0fa0bf.tar.gz/sha512/28f13b8d927e0663bff26e9ab829538947754046088a42fc85d772d62c28fb47f8f3075d1a884bbbae6ce0ba294eb8f3b5f9cb95be14d7ae1f467b713b4a14a7 +LibUV.v2.0.1+11.aarch64-apple-darwin.tar.gz/md5/60c0a26acbd9c6d35743c19ac917f9b9 +LibUV.v2.0.1+11.aarch64-apple-darwin.tar.gz/sha512/4f62658c10486040ffe04e8e694fbcdb2a07340d8f1d18b703598141f5b377c421e06b7896dc0be8472c6c9f748ff44be109db99304b0442f10eb878bf2af1df +LibUV.v2.0.1+11.aarch64-linux-gnu.tar.gz/md5/215a204f1fb13a8d1fc9b26106814bee +LibUV.v2.0.1+11.aarch64-linux-gnu.tar.gz/sha512/3f20dc865a1ebae98ac75581585c5057b6c27bbfe084580274089f3103b4ad5fceee7dd5822b6f1cee4dfdfe027a379ea5116e37ca331845108380d6c2ecf63f +LibUV.v2.0.1+11.aarch64-linux-musl.tar.gz/md5/b618837c1c2ff1e64578ae043c0a00c3 +LibUV.v2.0.1+11.aarch64-linux-musl.tar.gz/sha512/7a82709a183977237f76cc0048034522466843d583519cec95fc7dd39cab1891b397052c6deb69b8d6fab6d0f57c91b642431b579bfb6c790881509b8daaa24c +LibUV.v2.0.1+11.armv6l-linux-gnueabihf.tar.gz/md5/f09464b716b779b6cccc8e8103313acb +LibUV.v2.0.1+11.armv6l-linux-gnueabihf.tar.gz/sha512/7c39685bbb9beb39670c94a3dea0cfac8685c9ff1116026784e68610d9314c281690f87bba918dfcc60f39e3f5c54ce432ab7365f785510be4108fa2454905dc +LibUV.v2.0.1+11.armv6l-linux-musleabihf.tar.gz/md5/6a483f49e053a1d796c2280a165e5cdd +LibUV.v2.0.1+11.armv6l-linux-musleabihf.tar.gz/sha512/16d6ade651018b20e2b465ee9beab6d6442a8d3942249a90def2797ac2b2c0376173eb9411f26cdd3f82ae9798640f819e139dd3cd70ce7e4684f6154f68fbfa +LibUV.v2.0.1+11.armv7l-linux-gnueabihf.tar.gz/md5/d3c6110ba03be6136d0c0a3740b2bc21 +LibUV.v2.0.1+11.armv7l-linux-gnueabihf.tar.gz/sha512/a41c26cd52c82804bf14d783965ebf4893db0cae7319d9840777485a328237e9f7c54aa3c2dc9a0ee39f98db430b8616de6f60906fbd00771f9a50e989e68fde +LibUV.v2.0.1+11.armv7l-linux-musleabihf.tar.gz/md5/a302e22ac3bc6d0909cd1b2a90c712ac +LibUV.v2.0.1+11.armv7l-linux-musleabihf.tar.gz/sha512/dd0291b86e11dbf7a8cf5b22f862bb0a93dcfd0d5ae009fe0c53f569d012bc2ea4895976c699aabd79ce05f4ae6161ce56263859c1994ea696e50f918fc2f51b +LibUV.v2.0.1+11.i686-linux-gnu.tar.gz/md5/d3b8cfaee74da3f4ba58c6845345ebfe +LibUV.v2.0.1+11.i686-linux-gnu.tar.gz/sha512/9623b84f6411f9b7c5a67f5e346d6661f00103a8417e22018b513efa3b8904268c57c7de21cc2f66a55727060436159f70727beed49b7efc882befd4d399332d +LibUV.v2.0.1+11.i686-linux-musl.tar.gz/md5/0e04697b85d2798c19f56e437eb55e56 +LibUV.v2.0.1+11.i686-linux-musl.tar.gz/sha512/75373bb5a5e3dd8f3fa4a85664bcfa0c651a793d8b104264eafa9626520cfb936025d4b1540c8e6d16a73468b7a1068a5ab4fb3b37762404d1ef7225a85e1664 +LibUV.v2.0.1+11.i686-w64-mingw32.tar.gz/md5/617dfd4290517837ad4c709dc4301733 +LibUV.v2.0.1+11.i686-w64-mingw32.tar.gz/sha512/7069f8bbb876ab5e2a7f0d79f4a297cd7984e1a83eadb1f91f5de86afc951b38e5bf2641883a4b7f327eabbc2f25434453b855ff7d537d30cc5ae6c8a00341d4 +LibUV.v2.0.1+11.powerpc64le-linux-gnu.tar.gz/md5/70f16a63097a353fa45971d3e4313da4 +LibUV.v2.0.1+11.powerpc64le-linux-gnu.tar.gz/sha512/ecc9f39fef7e9917dbadf4a7fd7966d06fb240f73cc2df021d9b8fa1951655d078782f17948abbfb5a21f2b7fcd9c7390af0a05610a9b952d55d53b6826ec312 +LibUV.v2.0.1+11.x86_64-apple-darwin.tar.gz/md5/17fee1aaeb6947614705120a62a21fa4 +LibUV.v2.0.1+11.x86_64-apple-darwin.tar.gz/sha512/cf4c80e797e3d68f54916bae6163d948f0a300f201f2b8209310970751d68eef6c29da571721aa98794c9ae30f7dc655385a5091c716e0402d3241342a1d9544 +LibUV.v2.0.1+11.x86_64-linux-gnu.tar.gz/md5/7e2cfbd1d4cdf2afec2ab18f0f75e812 +LibUV.v2.0.1+11.x86_64-linux-gnu.tar.gz/sha512/8551dbaf242c859010481e12864d75e8df01c69a90b94293402881b50e32105add7f7fdae455144076a2169f37e5796eb528d8ef6fc02226fbbb9d0f1bc6f6d3 +LibUV.v2.0.1+11.x86_64-linux-musl.tar.gz/md5/3879f86977865ceac0ea36e3f563be73 +LibUV.v2.0.1+11.x86_64-linux-musl.tar.gz/sha512/0831c0606e9bed4f819cb8f2abba464c9e0034533abdb5bf6e6e92b9f37644103c39adc4498db5128395dc65da28c93d7cd01bfc474985fa5dd660b04ca14cc1 +LibUV.v2.0.1+11.x86_64-unknown-freebsd.tar.gz/md5/288d9ab3dd95028568880838462c1f35 +LibUV.v2.0.1+11.x86_64-unknown-freebsd.tar.gz/sha512/ac0366d8eb4d0908d5ea55105dc608418455bc601fc22058512e228225cbd1ad2c778f7838b9d2374a6f1661e386f4121bae0f4cecaa18a4ba70a3a743318e24 +LibUV.v2.0.1+11.x86_64-w64-mingw32.tar.gz/md5/2b390151d13474968444b0f07adc92c0 +LibUV.v2.0.1+11.x86_64-w64-mingw32.tar.gz/sha512/6c56a7ab3e28ebcc7e55917b5ba051b4725ca77752b5206f865b306e905d119170cd0bb4e117c7352a95aa13b814ec5e15547ec3904615b561775a17e6993741 +libuv-e6f0e4900e195c8352f821abe2b3cffc3089547b.tar.gz/md5/c4465d7bff6610761cf37a1e8e3da08c +libuv-e6f0e4900e195c8352f821abe2b3cffc3089547b.tar.gz/sha512/3347668b2b377704f3188e8901b130e891d19ac944ab3b7c1f4939d7afa119afff7dc10feaa2a518ec4122968147e31eb8932c6dfc1142a58a4828488f343191 diff --git a/deps/libuv.version b/deps/libuv.version index 695eea73c9754..c8a705608fdff 100644 --- a/deps/libuv.version +++ b/deps/libuv.version @@ -1,2 +1,2 @@ LIBUV_BRANCH=julia-uv2-1.44.2 -LIBUV_SHA1=3f7038d62e43c3682394a6ea7b4ccc46be0fa0bf +LIBUV_SHA1=e6f0e4900e195c8352f821abe2b3cffc3089547b diff --git a/doc/src/base/base.md b/doc/src/base/base.md index 93d0547098706..9b9d14bbffbd0 100644 --- a/doc/src/base/base.md +++ b/doc/src/base/base.md @@ -344,6 +344,8 @@ Base.Sys.iswindows Base.Sys.windows_version Base.Sys.free_memory Base.Sys.total_memory +Base.Sys.free_physical_memory +Base.Sys.total_physical_memory Base.@static ``` diff --git a/src/gc.c b/src/gc.c index f86030f421c2c..b60cc4ff7e8d6 100644 --- a/src/gc.c +++ b/src/gc.c @@ -3432,7 +3432,7 @@ void jl_gc_init(void) // on a big memory machine, set max_collect_interval to totalmem / nthreads / 2 uint64_t total_mem = uv_get_total_memory(); uint64_t constrained_mem = uv_get_constrained_memory(); - if (constrained_mem > 0 && constrained_mem < total_mem) + if (constrained_mem != 0) total_mem = constrained_mem; size_t maxmem = total_mem / jl_n_threads / 2; if (maxmem > max_collect_interval) diff --git a/stdlib/LibUV_jll/Project.toml b/stdlib/LibUV_jll/Project.toml index 9a46adb07cc95..6f68176fc97e7 100644 --- a/stdlib/LibUV_jll/Project.toml +++ b/stdlib/LibUV_jll/Project.toml @@ -1,6 +1,6 @@ name = "LibUV_jll" uuid = "183b4373-6708-53ba-ad28-60e28bb38547" -version = "2.0.1+8" +version = "2.0.1+11" [deps] Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" From 39ae07ca802058363dab37e7349e67115d2c7288 Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Tue, 20 Sep 2022 08:07:35 +0200 Subject: [PATCH 343/369] set number of openblas threads to 1 while precompiling (#46792) (cherry picked from commit b6d2434909f15abeca03bb9b68333f5ff670ce9e) --- base/loading.jl | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/base/loading.jl b/base/loading.jl index 71e464f49eda5..8625db41df0a2 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -1587,12 +1587,14 @@ function create_expr_cache(pkg::PkgId, input::String, output::String, concrete_d deps_eltype = sprint(show, eltype(concrete_deps); context = :module=>nothing) deps = deps_eltype * "[" * join(deps_strs, ",") * "]" trace = isassigned(PRECOMPILE_TRACE_COMPILE) ? `--trace-compile=$(PRECOMPILE_TRACE_COMPILE[])` : `` - io = open(pipeline(`$(julia_cmd()::Cmd) -O0 - --output-ji $output --output-incremental=yes - --startup-file=no --history-file=no --warn-overwrite=yes - --color=$(have_color === nothing ? "auto" : have_color ? "yes" : "no") - $trace - -`, stderr = internal_stderr, stdout = internal_stdout), + io = open(pipeline(addenv(`$(julia_cmd()::Cmd) -O0 + --output-ji $output --output-incremental=yes + --startup-file=no --history-file=no --warn-overwrite=yes + --color=$(have_color === nothing ? "auto" : have_color ? "yes" : "no") + $trace + -`, + "OPENBLAS_NUM_THREADS" => 1), + stderr = internal_stderr, stdout = internal_stdout), "w", stdout) # write data over stdin to avoid the (unlikely) case of exceeding max command line size write(io.in, """ From 285b75c30b7b674affa25646b4a33e93687ffd17 Mon Sep 17 00:00:00 2001 From: KristofferC Date: Wed, 21 Sep 2022 12:54:46 +0200 Subject: [PATCH 344/369] update to latest Pkg 1.8 --- .../Pkg-0027cb18c39dfa2f0bf649fda654315e11be7bc3.tar.gz/md5 | 1 + .../Pkg-0027cb18c39dfa2f0bf649fda654315e11be7bc3.tar.gz/sha512 | 1 + .../Pkg-03e3bad8ef894f5a8b0edcfb00e4025173652b2b.tar.gz/md5 | 1 - .../Pkg-03e3bad8ef894f5a8b0edcfb00e4025173652b2b.tar.gz/sha512 | 1 - stdlib/Pkg.version | 2 +- 5 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 deps/checksums/Pkg-0027cb18c39dfa2f0bf649fda654315e11be7bc3.tar.gz/md5 create mode 100644 deps/checksums/Pkg-0027cb18c39dfa2f0bf649fda654315e11be7bc3.tar.gz/sha512 delete mode 100644 deps/checksums/Pkg-03e3bad8ef894f5a8b0edcfb00e4025173652b2b.tar.gz/md5 delete mode 100644 deps/checksums/Pkg-03e3bad8ef894f5a8b0edcfb00e4025173652b2b.tar.gz/sha512 diff --git a/deps/checksums/Pkg-0027cb18c39dfa2f0bf649fda654315e11be7bc3.tar.gz/md5 b/deps/checksums/Pkg-0027cb18c39dfa2f0bf649fda654315e11be7bc3.tar.gz/md5 new file mode 100644 index 0000000000000..23240c5a01673 --- /dev/null +++ b/deps/checksums/Pkg-0027cb18c39dfa2f0bf649fda654315e11be7bc3.tar.gz/md5 @@ -0,0 +1 @@ +8bd9c967dc50430afdd890b967b2d776 diff --git a/deps/checksums/Pkg-0027cb18c39dfa2f0bf649fda654315e11be7bc3.tar.gz/sha512 b/deps/checksums/Pkg-0027cb18c39dfa2f0bf649fda654315e11be7bc3.tar.gz/sha512 new file mode 100644 index 0000000000000..a808d9ea4410b --- /dev/null +++ b/deps/checksums/Pkg-0027cb18c39dfa2f0bf649fda654315e11be7bc3.tar.gz/sha512 @@ -0,0 +1 @@ +f6ada1d6bd99b25edd4411100cb8adb2918c2e58b4e33d2623c1044009f815f2addeeab3f519cf0e60d0eabaf66f1c8d45c6bd45a86837c9f3377b808483e849 diff --git a/deps/checksums/Pkg-03e3bad8ef894f5a8b0edcfb00e4025173652b2b.tar.gz/md5 b/deps/checksums/Pkg-03e3bad8ef894f5a8b0edcfb00e4025173652b2b.tar.gz/md5 deleted file mode 100644 index 5d95a7b01b6c7..0000000000000 --- a/deps/checksums/Pkg-03e3bad8ef894f5a8b0edcfb00e4025173652b2b.tar.gz/md5 +++ /dev/null @@ -1 +0,0 @@ -682606d3308f82eaca8c33fe1f0bd083 diff --git a/deps/checksums/Pkg-03e3bad8ef894f5a8b0edcfb00e4025173652b2b.tar.gz/sha512 b/deps/checksums/Pkg-03e3bad8ef894f5a8b0edcfb00e4025173652b2b.tar.gz/sha512 deleted file mode 100644 index c4f3205f38150..0000000000000 --- a/deps/checksums/Pkg-03e3bad8ef894f5a8b0edcfb00e4025173652b2b.tar.gz/sha512 +++ /dev/null @@ -1 +0,0 @@ -9de41dced83f007cc425acde3ca1a8646d30dceb8f071381820fac0f5bf57ed58fe1aed0be09317084c5b8abb7a415921f2f22c9517dd610748de53cd5046baa diff --git a/stdlib/Pkg.version b/stdlib/Pkg.version index cba86fbb03674..f97004e4bc79a 100644 --- a/stdlib/Pkg.version +++ b/stdlib/Pkg.version @@ -1,4 +1,4 @@ PKG_BRANCH = release-1.8 -PKG_SHA1 = 03e3bad8ef894f5a8b0edcfb00e4025173652b2b +PKG_SHA1 = 0027cb18c39dfa2f0bf649fda654315e11be7bc3 PKG_GIT_URL := https://github.com/JuliaLang/Pkg.jl.git PKG_TAR_URL = https://api.github.com/repos/JuliaLang/Pkg.jl/tarball/$1 From 36034abf26062acad4af9dcec7c4fc53b260dbb4 Mon Sep 17 00:00:00 2001 From: Alex Arslan Date: Thu, 29 Sep 2022 08:21:12 -0700 Subject: [PATCH 345/369] Set VERSION to 1.8.2 (#46956) --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index a8fdfda1c7824..53adb84c8220e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.8.1 +1.8.2 From 3df02121d6b37dafedfb9dab7dc15a4aaa3ad30b Mon Sep 17 00:00:00 2001 From: K Pamnany Date: Fri, 9 Dec 2022 17:38:34 -0500 Subject: [PATCH 346/369] version-rai.patch Add "RAI" suffix to VERSION. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 53adb84c8220e..ee44b740da413 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.8.2 +1.8.2-RAI From e36fbf0724ed30eb8e0a48209bedfc5fbf2e03ef Mon Sep 17 00:00:00 2001 From: K Pamnany Date: Fri, 9 Dec 2022 17:39:20 -0500 Subject: [PATCH 347/369] jl-pool-alloc.patch GC wasn't freeing blocks. --- src/gc-pages.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/src/gc-pages.c b/src/gc-pages.c index a4ebe0315d71e..454864d45c766 100644 --- a/src/gc-pages.c +++ b/src/gc-pages.c @@ -21,6 +21,30 @@ extern "C" { static int block_pg_cnt = DEFAULT_BLOCK_PG_ALLOC; static size_t current_pg_count = 0; +// Julia allocates large blocks (64M) with mmap. These are never +// released back but the underlying physical memory may be released +// with calls to madvise(MADV_DONTNEED). +// These large blocks are used to allocated jl_page_size sized +// pages, that are tracked by current_pg_count. +static uint64_t poolmem_bytes_allocated = 0; +static uint64_t poolmem_blocks_allocated_total = 0; + + +JL_DLLEXPORT uint64_t jl_poolmem_blocks_allocated_total() +{ + return poolmem_blocks_allocated_total; +} + +JL_DLLEXPORT uint64_t jl_poolmem_bytes_allocated() +{ + return poolmem_bytes_allocated; +} + +JL_DLLEXPORT uint64_t jl_current_pg_count() +{ + return (uint64_t)current_pg_count; +} + void jl_gc_init_page(void) { if (GC_PAGE_SZ * block_pg_cnt < jl_page_size) @@ -48,6 +72,8 @@ static char *jl_gc_try_alloc_pages(int pg_cnt) JL_NOTSAFEPOINT MAP_NORESERVE | MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); if (mem == MAP_FAILED) return NULL; + poolmem_bytes_allocated += pages_sz; + poolmem_blocks_allocated_total++; #endif if (GC_PAGE_SZ > jl_page_size) // round data pointer up to the nearest gc_page_data-aligned @@ -155,8 +181,11 @@ static jl_gc_pagemeta_t *jl_gc_alloc_new_page(void) JL_NOTSAFEPOINT // that we successfully created the metadata for. // This is not supported by the Windows kernel, // so we have to just skip it there and just lose these virtual addresses. - munmap(mem + LLT_ALIGN(GC_PAGE_SZ * pg, jl_page_size), - GC_PAGE_SZ * pg_cnt - LLT_ALIGN(GC_PAGE_SZ * pg, jl_page_size)); + // + // + size_t shrink_sz = GC_PAGE_SZ * pg_cnt - LLT_ALIGN(GC_PAGE_SZ * pg, jl_page_size); + munmap(mem + LLT_ALIGN(GC_PAGE_SZ * pg, jl_page_size), shrink_sz); + poolmem_bytes_allocated -= shrink_sz; #endif if (pg == 0) { uv_mutex_unlock(&gc_perm_lock); From 9580648c82deeef7f144467902510db10cb007d4 Mon Sep 17 00:00:00 2001 From: K Pamnany Date: Fri, 9 Dec 2022 17:45:30 -0500 Subject: [PATCH 348/369] 44215.patch Put off major collections to improve GC times. --- src/gc-debug.c | 16 +++++++++++++ src/gc.c | 61 ++++++++++++++++++++------------------------------ src/gc.h | 5 +++++ 3 files changed, 45 insertions(+), 37 deletions(-) diff --git a/src/gc-debug.c b/src/gc-debug.c index fcd1b464e5b43..24e39f77d164f 100644 --- a/src/gc-debug.c +++ b/src/gc-debug.c @@ -976,6 +976,22 @@ void gc_time_sweep_pause(uint64_t gc_end_t, int64_t actual_allocd, jl_ns2ms(gc_postmark_end - gc_premark_end), sweep_full ? "full" : "quick", -gc_num.allocd / 1024); } + +void gc_time_summary(int sweep_full, uint64_t start, uint64_t end, + uint64_t freed, uint64_t live, uint64_t interval, + uint64_t pause) +{ + if (sweep_full > 0) + jl_safe_printf("%ld Major collection: estimate freed = %ld + live = %ldm new interval = %ldm time = %ldms\n", + end - start, freed, live/1024/1024, + interval/1024/1024, pause/1000000 ); + else + jl_safe_printf("%ld Minor collection: estimate freed = %ld live = %ldm + new interval = %ldm time = %ldms\n", + end - start, freed, live/1024/1024, + interval/1024/1024, pause/1000000 ); +} #endif void jl_gc_debug_init(void) diff --git a/src/gc.c b/src/gc.c index b60cc4ff7e8d6..5d1a63eca1923 100644 --- a/src/gc.c +++ b/src/gc.c @@ -672,9 +672,8 @@ static int prev_sweep_full = 1; // Full collection heuristics static int64_t live_bytes = 0; static int64_t promoted_bytes = 0; -static int64_t last_full_live = 0; // live_bytes after last full collection static int64_t last_live_bytes = 0; // live_bytes at last collection -static int64_t grown_heap_age = 0; // # of collects since live_bytes grew and remained +static int64_t t_start = 0; // Time GC starts; #ifdef __GLIBC__ // maxrss at last malloc_trim static int64_t last_trim_maxrss = 0; @@ -3160,43 +3159,23 @@ static int _jl_gc_collect(jl_ptls_t ptls, jl_gc_collection_t collection) int nptr = 0; for (int i = 0;i < jl_n_threads;i++) nptr += jl_all_tls_states[i]->heap.remset_nptr; - int large_frontier = nptr*sizeof(void*) >= default_collect_interval; // many pointers in the intergen frontier => "quick" mark is not quick - // trigger a full collection if the number of live bytes doubles since the last full - // collection and then remains at least that high for a while. - if (grown_heap_age == 0) { - if (live_bytes > 2 * last_full_live) - grown_heap_age = 1; - } - else if (live_bytes >= last_live_bytes) { - grown_heap_age++; - } + + // many pointers in the intergen frontier => "quick" mark is not quick + int large_frontier = nptr*sizeof(void*) >= default_collect_interval; int sweep_full = 0; int recollect = 0; - if ((large_frontier || - ((not_freed_enough || promoted_bytes >= gc_num.interval) && - (promoted_bytes >= default_collect_interval || prev_sweep_full)) || - grown_heap_age > 1) && gc_num.pause > 1) { - sweep_full = 1; - } + // update heuristics only if this GC was automatically triggered if (collection == JL_GC_AUTO) { - if (sweep_full) { - if (large_frontier) - gc_num.interval = last_long_collect_interval; - if (not_freed_enough || large_frontier) { - if (gc_num.interval <= 2*(max_collect_interval/5)) { - gc_num.interval = 5 * (gc_num.interval / 2); - } - } - last_long_collect_interval = gc_num.interval; + if (not_freed_enough) { + gc_num.interval = gc_num.interval * 2; } - else { - // reset interval to default, or at least half of live_bytes - int64_t half = live_bytes/2; - if (default_collect_interval < half && half <= max_collect_interval) - gc_num.interval = half; - else - gc_num.interval = default_collect_interval; + if (large_frontier) { + sweep_full = 1; + } + if (gc_num.interval > max_collect_interval) { + sweep_full = 1; + gc_num.interval = max_collect_interval; } } if (gc_sweep_always_full) { @@ -3269,10 +3248,17 @@ static int _jl_gc_collect(jl_ptls_t ptls, jl_gc_collection_t collection) gc_num.allocd = 0; last_live_bytes = live_bytes; live_bytes += -gc_num.freed + gc_num.since_sweep; - if (prev_sweep_full) { - last_full_live = live_bytes; - grown_heap_age = 0; + + if (collection == JL_GC_AUTO) { + // If the current interval is larger than half the live data decrease the interval + int64_t half = live_bytes/2; + if (gc_num.interval > half) gc_num.interval = half; + // But never go below default + if (gc_num.interval < default_collect_interval) gc_num.interval = default_collect_interval; } + + gc_time_summary(sweep_full, t_start, gc_end_t, gc_num.freed, live_bytes, gc_num.interval, pause); + prev_sweep_full = sweep_full; gc_num.pause += !recollect; gc_num.total_time += pause; @@ -3440,6 +3426,7 @@ void jl_gc_init(void) #endif jl_gc_mark_sp_t sp = {NULL, NULL, NULL, NULL}; gc_mark_loop(NULL, sp); + t_start = jl_hrtime(); } // callback for passing OOM errors from gmp diff --git a/src/gc.h b/src/gc.h index 544486d933e10..d50e32c1a0444 100644 --- a/src/gc.h +++ b/src/gc.h @@ -557,6 +557,9 @@ void gc_time_mark_pause(int64_t t0, int64_t scanned_bytes, void gc_time_sweep_pause(uint64_t gc_end_t, int64_t actual_allocd, int64_t live_bytes, int64_t estimate_freed, int sweep_full); +void gc_time_summary(int sweep_full, uint64_t start, uint64_t end, + uint64_t freed, uint64_t live, uint64_t interval, + uint64_t pause); #else #define gc_time_pool_start() STATIC_INLINE void gc_time_count_page(int freedall, int pg_skpd) JL_NOTSAFEPOINT @@ -582,6 +585,8 @@ STATIC_INLINE void gc_time_count_mallocd_array(int bits) JL_NOTSAFEPOINT #define gc_time_mark_pause(t0, scanned_bytes, perm_scanned_bytes) #define gc_time_sweep_pause(gc_end_t, actual_allocd, live_bytes, \ estimate_freed, sweep_full) +#define gc_time_summary(sweep_full, start, end, freed, live, \ + interval, pause) #endif #ifdef MEMFENCE From 70742d1cce2f8267448629ba5787af1b3a756536 Mon Sep 17 00:00:00 2001 From: K Pamnany Date: Fri, 9 Dec 2022 17:49:34 -0500 Subject: [PATCH 349/369] 44350.patch Silence all warnings when building with GCC on Linux. --- src/ccall.cpp | 2 +- src/cgutils.cpp | 2 +- src/crc32c.c | 2 +- src/dlload.c | 11 ++++++++--- src/dump.c | 1 + src/gc-debug.c | 8 ++++---- src/jitlayers.cpp | 2 +- src/jitlayers.h | 2 +- 8 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/ccall.cpp b/src/ccall.cpp index 4742130f66629..2722d7f7bb0fa 100644 --- a/src/ccall.cpp +++ b/src/ccall.cpp @@ -346,7 +346,7 @@ static bool is_native_simd_type(jl_datatype_t *dt) { #elif defined _CPU_PPC64_ typedef ABI_PPC64leLayout DefaultAbiState; #else -# warning "ccall is defaulting to llvm ABI, since no platform ABI has been defined for this CPU/OS combination" +# pragma message("ccall is defaulting to llvm ABI, since no platform ABI has been defined for this CPU/OS combination") typedef ABI_LLVMLayout DefaultAbiState; #endif diff --git a/src/cgutils.cpp b/src/cgutils.cpp index 8f3a4caf7b906..261b41b6da956 100644 --- a/src/cgutils.cpp +++ b/src/cgutils.cpp @@ -3299,7 +3299,7 @@ static jl_cgval_t emit_setfield(jl_codectx_t &ctx, Value *ptindex = ctx.builder.CreateInBoundsGEP(getInt8Ty(ctx.builder.getContext()), emit_bitcast(ctx, maybe_decay_tracked(ctx, addr), getInt8PtrTy(ctx.builder.getContext())), ConstantInt::get(getSizeTy(ctx.builder.getContext()), fsz)); if (needlock) emit_lockstate_value(ctx, strct, true); - BasicBlock *ModifyBB; + BasicBlock *ModifyBB = NULL; if (ismodifyfield) { ModifyBB = BasicBlock::Create(ctx.builder.getContext(), "modify_xchg", ctx.f); ctx.builder.CreateBr(ModifyBB); diff --git a/src/crc32c.c b/src/crc32c.c index 1e57d8aef85db..11b71b5061ede 100644 --- a/src/crc32c.c +++ b/src/crc32c.c @@ -346,7 +346,7 @@ static crc32c_func_t crc32c_dispatch(unsigned long hwcap) # define crc32c_dispatch() crc32c_dispatch(getauxval(AT_HWCAP)) # define crc32c_dispatch_ifunc "crc32c_dispatch" # else -# warning CRC32 feature detection not implemented for this OS. Falling back to software version. +# pragma message("CRC32 feature detection not implemented for this OS. Falling back to software version.") # endif #else // If we don't have any accelerated version to define, just make the _sw version define diff --git a/src/dlload.c b/src/dlload.c index 33afe62acad90..b7c2bcd36a3db 100644 --- a/src/dlload.c +++ b/src/dlload.c @@ -159,6 +159,7 @@ JL_DLLEXPORT void *jl_load_dynamic_library(const char *modname, unsigned flags, // number of extensions to try — if modname already ends with the // standard extension, then we don't try adding additional extensions int n_extensions = endswith_extension(modname) ? 1 : N_EXTENSIONS; + int ret; /* this branch returns handle of libjulia-internal @@ -228,8 +229,12 @@ JL_DLLEXPORT void *jl_load_dynamic_library(const char *modname, unsigned flags, path[0] = '\0'; if (relocated[len-1] == PATHSEPSTRING[0]) snprintf(path, PATHBUF, "%s%s%s", relocated, modname, ext); - else - snprintf(path, PATHBUF, "%s" PATHSEPSTRING "%s%s", relocated, modname, ext); + else { + ret = snprintf(path, PATHBUF, "%s" PATHSEPSTRING "%s%s", relocated, modname, ext); + if (ret < 0) + jl_errorf("path is longer than %d\n", PATHBUF); + } + #ifdef _OS_WINDOWS_ if (i == 0) { // LoadLibrary already tested the extensions, we just need to check the `stat` result #endif @@ -299,7 +304,7 @@ JL_DLLEXPORT int jl_dlsym(void *handle, const char *symbol, void ** value, int t */ symbol_found = *value != NULL; #ifndef _OS_WINDOWS_ - const char *err; + const char *err = ""; if (!symbol_found) { dlerror(); /* Reset error status. */ *value = dlsym(handle, symbol); diff --git a/src/dump.c b/src/dump.c index 8cb2f901ee45b..1e0e96f5f80d1 100644 --- a/src/dump.c +++ b/src/dump.c @@ -1071,6 +1071,7 @@ static void serialize_htable_keys(jl_serializer_state *s, htable_t *ht, int nite write_int32(s->s, nitems); void **table = ht->table; size_t i, n = 0, sz = ht->size; + (void)n; for (i = 0; i < sz; i += 2) { if (table[i+1] != HT_NOTFOUND) { jl_serialize_value(s, (jl_value_t*)table[i]); diff --git a/src/gc-debug.c b/src/gc-debug.c index 24e39f77d164f..f199d29872697 100644 --- a/src/gc-debug.c +++ b/src/gc-debug.c @@ -982,13 +982,13 @@ void gc_time_summary(int sweep_full, uint64_t start, uint64_t end, uint64_t pause) { if (sweep_full > 0) - jl_safe_printf("%ld Major collection: estimate freed = %ld - live = %ldm new interval = %ldm time = %ldms\n", + jl_safe_printf("%ld Major collection: estimate freed = %ld\n" + "live = %ldm new interval = %ldm time = %ldms\n", end - start, freed, live/1024/1024, interval/1024/1024, pause/1000000 ); else - jl_safe_printf("%ld Minor collection: estimate freed = %ld live = %ldm - new interval = %ldm time = %ldms\n", + jl_safe_printf("%ld Minor collection: estimate freed = %ld live = %ldm\n" + "new interval = %ldm time = %ldms\n", end - start, freed, live/1024/1024, interval/1024/1024, pause/1000000 ); } diff --git a/src/jitlayers.cpp b/src/jitlayers.cpp index 034cef516da5b..47bb9451f99ca 100644 --- a/src/jitlayers.cpp +++ b/src/jitlayers.cpp @@ -1036,7 +1036,7 @@ StringRef JuliaOJIT::getFunctionAtAddress(uint64_t Addr, jl_code_instance_t *cod #ifdef JL_USE_JITLINK # if JL_LLVM_VERSION < 140000 -# warning "JIT debugging (GDB integration) not available on LLVM < 14.0 (for JITLink)" +# pragma message("JIT debugging (GDB integration) not available on LLVM < 14.0 (for JITLink)") void JuliaOJIT::enableJITDebuggingSupport() {} # else extern "C" orc::shared::CWrapperFunctionResult diff --git a/src/jitlayers.h b/src/jitlayers.h index 30e130f07273a..bda291b74bdc5 100644 --- a/src/jitlayers.h +++ b/src/jitlayers.h @@ -31,7 +31,7 @@ // for Mac/aarch64. #if defined(_OS_DARWIN_) && defined(_CPU_AARCH64_) # if JL_LLVM_VERSION < 130000 -# warning "On aarch64-darwin, LLVM version >= 13 is required for JITLink; fallback suffers from occasional segfaults" +# pragma message("On aarch64-darwin, LLVM version >= 13 is required for JITLink; fallback suffers from occasional segfaults") # endif # define JL_USE_JITLINK #endif From a4014bec899e3fc9ced436e801425849d0a42767 Mon Sep 17 00:00:00 2001 From: K Pamnany Date: Fri, 9 Dec 2022 17:52:08 -0500 Subject: [PATCH 350/369] 45191.patch Keep track of more GC stats. --- base/timing.jl | 9 +++++++++ src/gc-debug.c | 25 +++++++++++++++--------- src/gc.c | 52 +++++++++++++++++++++++++++++++++++++++++++------- src/gc.h | 15 ++++++++++++--- 4 files changed, 82 insertions(+), 19 deletions(-) diff --git a/base/timing.jl b/base/timing.jl index f924382a37a47..a97e185b036cb 100644 --- a/base/timing.jl +++ b/base/timing.jl @@ -16,9 +16,18 @@ struct GC_Num collect ::Csize_t # GC internal pause ::Cint full_sweep ::Cint + max_pause ::Int64 + max_memory ::Int64 + time_to_safepoint ::Int64 + max_time_to_safepointp ::Int64 + sweep_time ::Int64 + mark_time ::Int64 + total_sweep_time ::Int64 + total_mark_time ::Int64 end gc_num() = ccall(:jl_gc_num, GC_Num, ()) +reset_gc_stats() = ccall(:jl_gc_reset_stats, Cvoid, ()) # This type is to represent differences in the counters, so fields may be negative struct GC_Diff diff --git a/src/gc-debug.c b/src/gc-debug.c index f199d29872697..7d6ca8ece2ecf 100644 --- a/src/gc-debug.c +++ b/src/gc-debug.c @@ -979,18 +979,25 @@ void gc_time_sweep_pause(uint64_t gc_end_t, int64_t actual_allocd, void gc_time_summary(int sweep_full, uint64_t start, uint64_t end, uint64_t freed, uint64_t live, uint64_t interval, - uint64_t pause) + uint64_t pause, uint64_t ttsp, uint64_t mark, + uint64_t sweep) { if (sweep_full > 0) - jl_safe_printf("%ld Major collection: estimate freed = %ld\n" - "live = %ldm new interval = %ldm time = %ldms\n", - end - start, freed, live/1024/1024, - interval/1024/1024, pause/1000000 ); + jl_safe_printf("TS: %" PRIu64 " Major collection: estimate freed = %" PRIu64 + " live = %" PRIu64 "m new interval = %" PRIu64 + "m time = %" PRIu64 "ms ttsp = %" PRIu64 "us mark time = %" + PRIu64 "ms sweep time = %" PRIu64 "ms \n", + end, freed, live/1024/1024, + interval/1024/1024, pause/1000000, ttsp, + mark/1000000,sweep/1000000); else - jl_safe_printf("%ld Minor collection: estimate freed = %ld live = %ldm\n" - "new interval = %ldm time = %ldms\n", - end - start, freed, live/1024/1024, - interval/1024/1024, pause/1000000 ); + jl_safe_printf("TS: %" PRIu64 " Minor collection: estimate freed = %" PRIu64 + " live = %" PRIu64 "m new interval = %" PRIu64 "m pause time = %" + PRIu64 "ms ttsp = %" PRIu64 "us mark time = %" PRIu64 + "ms sweep time = %" PRIu64 "ms \n", + end, freed, live/1024/1024, + interval/1024/1024, pause/1000000, ttsp, + mark/1000000,sweep/1000000); } #endif diff --git a/src/gc.c b/src/gc.c index 5d1a63eca1923..938f2c3bd9f1b 100644 --- a/src/gc.c +++ b/src/gc.c @@ -2972,6 +2972,13 @@ JL_DLLEXPORT jl_gc_num_t jl_gc_num(void) return num; } +JL_DLLEXPORT void jl_gc_reset_stats(void) +{ + gc_num.max_pause = 0; + gc_num.max_memory = 0; + gc_num.max_time_to_safepoint = 0; +} + // TODO: these were supposed to be thread local JL_DLLEXPORT int64_t jl_gc_diff_total_bytes(void) JL_NOTSAFEPOINT { @@ -3068,9 +3075,10 @@ static int _jl_gc_collect(jl_ptls_t ptls, jl_gc_collection_t collection) jl_gc_mark_sp_t sp; gc_mark_sp_init(gc_cache, &sp); - uint64_t t0 = jl_hrtime(); + uint64_t gc_start_time = jl_hrtime(); int64_t last_perm_scanned_bytes = perm_scanned_bytes; JL_PROBE_GC_MARK_BEGIN(); + uint64_t start_mark_time = jl_hrtime(); // 1. fix GC bits of objects in the remset. for (int t_i = 0; t_i < jl_n_threads; t_i++) @@ -3099,7 +3107,11 @@ static int _jl_gc_collect(jl_ptls_t ptls, jl_gc_collection_t collection) gc_num.since_sweep += gc_num.allocd; JL_PROBE_GC_MARK_END(scanned_bytes, perm_scanned_bytes); gc_settime_premark_end(); - gc_time_mark_pause(t0, scanned_bytes, perm_scanned_bytes); + gc_time_mark_pause(gc_start_time, scanned_bytes, perm_scanned_bytes); + uint64_t end_mark_time = jl_hrtime(); + uint64_t mark_time = end_mark_time - start_mark_time; + gc_num.mark_time = mark_time; + gc_num.total_mark_time += mark_time; int64_t actual_allocd = gc_num.since_sweep; // marking is over @@ -3193,6 +3205,7 @@ static int _jl_gc_collect(jl_ptls_t ptls, jl_gc_collection_t collection) } scanned_bytes = 0; // 5. start sweeping + uint64_t start_sweep_time = jl_hrtime(); JL_PROBE_GC_SWEEP_BEGIN(sweep_full); sweep_weak_refs(); sweep_stack_pools(); @@ -3204,6 +3217,13 @@ static int _jl_gc_collect(jl_ptls_t ptls, jl_gc_collection_t collection) if (sweep_full) gc_sweep_perm_alloc(); JL_PROBE_GC_SWEEP_END(); + + uint64_t gc_end_time = jl_hrtime(); + uint64_t pause = gc_end_time - gc_start_time; + uint64_t sweep_time = gc_end_time - start_sweep_time; + gc_num.total_sweep_time += sweep_time; + gc_num.sweep_time = sweep_time; + // sweeping is over // 6. if it is a quick sweep, put back the remembered objects in queued state // so that we don't trigger the barrier again on them. @@ -3236,15 +3256,18 @@ static int _jl_gc_collect(jl_ptls_t ptls, jl_gc_collection_t collection) } #endif - uint64_t gc_end_t = jl_hrtime(); - uint64_t pause = gc_end_t - t0; _report_gc_finished(pause, gc_num.freed, sweep_full, recollect); - gc_final_pause_end(t0, gc_end_t); - gc_time_sweep_pause(gc_end_t, actual_allocd, live_bytes, + gc_final_pause_end(t0, gc_end_time); + gc_time_sweep_pause(gc_end_time, actual_allocd, live_bytes, estimate_freed, sweep_full); gc_num.full_sweep += sweep_full; + uint64_t max_memory = last_live_bytes + gc_num.allocd; + if (max_memory > gc_num.max_memory) { + gc_num.max_memory = max_memory; + } + gc_num.allocd = 0; last_live_bytes = live_bytes; live_bytes += -gc_num.freed + gc_num.since_sweep; @@ -3257,13 +3280,19 @@ static int _jl_gc_collect(jl_ptls_t ptls, jl_gc_collection_t collection) if (gc_num.interval < default_collect_interval) gc_num.interval = default_collect_interval; } - gc_time_summary(sweep_full, t_start, gc_end_t, gc_num.freed, live_bytes, gc_num.interval, pause); + gc_time_summary(sweep_full, t_start, gc_end_time, gc_num.freed, + live_bytes, gc_num.interval, pause, + gc_num.time_to_safepoint, + gc_num.mark_time, gc_num.sweep_time); prev_sweep_full = sweep_full; gc_num.pause += !recollect; gc_num.total_time += pause; gc_num.since_sweep = 0; gc_num.freed = 0; + if (pause > gc_num.max_pause) { + gc_num.max_pause = pause; + } reset_thread_gc_counts(); return recollect; @@ -3288,6 +3317,7 @@ JL_DLLEXPORT void jl_gc_collect(jl_gc_collection_t collection) jl_atomic_store_release(&ptls->gc_state, JL_GC_STATE_WAITING); // `jl_safepoint_start_gc()` makes sure only one thread can // run the GC. + uint64_t t0 = jl_hrtime(); if (!jl_safepoint_start_gc()) { // Multithread only. See assertion in `safepoint.c` jl_gc_state_set(ptls, old_state, JL_GC_STATE_WAITING); @@ -3305,6 +3335,12 @@ JL_DLLEXPORT void jl_gc_collect(jl_gc_collection_t collection) jl_gc_wait_for_the_world(); JL_PROBE_GC_STOP_THE_WORLD(); + uint64_t t1 = jl_hrtime(); + uint64_t duration = t1 - t0; + if (duration > gc_num.max_time_to_safepoint) + gc_num.max_time_to_safepoint = duration; + gc_num.time_to_safepoint = duration; + gc_invoke_callbacks(jl_gc_cb_pre_gc_t, gc_cblist_pre_gc, (collection)); @@ -3413,6 +3449,8 @@ void jl_gc_init(void) gc_num.interval = default_collect_interval; last_long_collect_interval = default_collect_interval; gc_num.allocd = 0; + gc_num.max_pause = 0; + gc_num.max_memory = 0; #ifdef _P64 // on a big memory machine, set max_collect_interval to totalmem / nthreads / 2 diff --git a/src/gc.h b/src/gc.h index d50e32c1a0444..00c3d48b52935 100644 --- a/src/gc.h +++ b/src/gc.h @@ -56,7 +56,7 @@ typedef struct { jl_alloc_num_t print; } jl_gc_debug_env_t; -// This struct must be kept in sync with the Julia type of the same name in base/util.jl +// This struct must be kept in sync with the Julia type of the same name in base/timing.jl typedef struct { int64_t allocd; int64_t deferred_alloc; @@ -72,6 +72,14 @@ typedef struct { size_t interval; int pause; int full_sweep; + uint64_t max_pause; + uint64_t max_memory; + uint64_t time_to_safepoint; + uint64_t max_time_to_safepoint; + uint64_t sweep_time; + uint64_t mark_time; + uint64_t total_sweep_time; + uint64_t total_mark_time; } jl_gc_num_t; enum { @@ -559,7 +567,8 @@ void gc_time_sweep_pause(uint64_t gc_end_t, int64_t actual_allocd, int sweep_full); void gc_time_summary(int sweep_full, uint64_t start, uint64_t end, uint64_t freed, uint64_t live, uint64_t interval, - uint64_t pause); + uint64_t pause, uint64_t ttsp, uint64_t mark, + uint64_t sweep); #else #define gc_time_pool_start() STATIC_INLINE void gc_time_count_page(int freedall, int pg_skpd) JL_NOTSAFEPOINT @@ -586,7 +595,7 @@ STATIC_INLINE void gc_time_count_mallocd_array(int bits) JL_NOTSAFEPOINT #define gc_time_sweep_pause(gc_end_t, actual_allocd, live_bytes, \ estimate_freed, sweep_full) #define gc_time_summary(sweep_full, start, end, freed, live, \ - interval, pause) + interval, pause, ttsp, mark, sweep) #endif #ifdef MEMFENCE From 2d247e831275f3c9cb643e557dc4e53352957cf1 Mon Sep 17 00:00:00 2001 From: K Pamnany Date: Fri, 9 Dec 2022 17:52:58 -0500 Subject: [PATCH 351/369] 45110.patch Implement jl_rec_backtrace stackwalk for more platform configurations. --- src/stackwalk.c | 319 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 319 insertions(+) diff --git a/src/stackwalk.c b/src/stackwalk.c index 766e318a46b7b..0574a8393a15a 100644 --- a/src/stackwalk.c +++ b/src/stackwalk.c @@ -697,6 +697,161 @@ void jl_print_bt_entry_codeloc(jl_bt_element_t *bt_entry) JL_NOTSAFEPOINT } } + +#ifdef _OS_LINUX_ +#if defined(__GLIBC__) && defined(_CPU_AARCH64_) +#define LONG_JMP_SP_ENV_SLOT 13 +static uintptr_t julia_longjmp_xor_key; +// GLIBC mangles the function pointers in jmp_buf (used in {set,long}*jmp +// functions) by XORing them with a random key. For AArch64 it is a global +// variable rather than a TCB one (as for x86_64/powerpc). We obtain the key by +// issuing a setjmp and XORing the SP pointer values to derive the key. +static void JuliaInitializeLongjmpXorKey(void) +{ + // 1. Call REAL(setjmp), which stores the mangled SP in env. + jmp_buf env; + _setjmp(env); + + // 2. Retrieve vanilla/mangled SP. + uintptr_t sp; + asm("mov %0, sp" : "=r" (sp)); + uintptr_t mangled_sp = ((uintptr_t*)&env)[LONG_JMP_SP_ENV_SLOT]; + + // 3. xor SPs to obtain key. + julia_longjmp_xor_key = mangled_sp ^ sp; +} +#endif + +JL_UNUSED static uintptr_t ptr_demangle(uintptr_t p) +{ +#if defined(__GLIBC__) +#if defined(_CPU_X86_) +// from https://github.com/bminor/glibc/blame/master/sysdeps/unix/sysv/linux/i386/sysdep.h +// last changed for GLIBC_2.6 on 2007-02-01 + asm(" rorl $9, %0\n" + " xorl %%gs:0x18, %0" + : "=r"(p) : "0"(p) : ); +#elif defined(_CPU_X86_64_) +// from https://github.com/bminor/glibc/blame/master/sysdeps/unix/sysv/linux/i386/sysdep.h + asm(" rorq $17, %0\n" + " xorq %%fs:0x30, %0" + : "=r"(p) : "0"(p) : ); +#elif defined(_CPU_AARCH64_) +// from https://github.com/bminor/glibc/blame/master/sysdeps/unix/sysv/linux/aarch64/sysdep.h +// We need to use a trick like this (from GCC/LLVM TSAN) to get access to it: +// https://github.com/llvm/llvm-project/commit/daa3ebce283a753f280c549cdb103fbb2972f08e + static pthread_once_t once = PTHREAD_ONCE_INIT; + pthread_once(&once, &JuliaInitializeLongjmpXorKey); + p ^= julia_longjmp_xor_key; +#elif defined(_CPU_ARM_) +// from https://github.com/bminor/glibc/blame/master/sysdeps/unix/sysv/linux/arm/sysdep.h + ; // nothing to do +#endif +#endif + return p; +} +#endif + +// n.b. musl does not mangle pointers, but intentionally makes that impossible +// to determine (https://www.openwall.com/lists/musl/2013/03/29/13) so we do +// not support musl here. + +// n.b. We have not looked at other libc (e.g. ulibc), though they are probably +// often compatible with glibc (perhaps with or without pointer mangling). + + +#ifdef _OS_DARWIN_ +// from https://github.com/apple/darwin-xnu/blame/main/libsyscall/os/tsd.h +#define __TSD_PTR_MUNGE 7 + +#if defined(__i386__) || defined(__x86_64__) + +#if defined(__has_attribute) +#if __has_attribute(address_space) +#define OS_GS_RELATIVE __attribute__((address_space(256))) +#endif +#endif + +#ifdef OS_GS_RELATIVE +#define _os_tsd_get_base() ((void * OS_GS_RELATIVE *)0) +#else +__attribute__((always_inline)) +static __inline__ void* +_os_tsd_get_direct(unsigned long slot) +{ + void *ret; + __asm__("mov %%gs:%1, %0" : "=r" (ret) : "m" (*(void **)(slot * sizeof(void *)))); + return ret; +} +#endif + +#elif defined(__arm__) || defined(__arm64__) +// Unconditionally defined ptrauth_strip (instead of using the ptrauth.h header) +// since libsystem will likely be compiled with -mbranch-protection, and we currently are not. +// code from https://github.com/llvm/llvm-project/blob/7714e0317520207572168388f22012dd9e152e9e/compiler-rt/lib/sanitizer_common/sanitizer_ptrauth.h +inline uint64_t ptrauth_strip(uint64_t __value, unsigned int __key) { + // On the stack the link register is protected with Pointer + // Authentication Code when compiled with -mbranch-protection. + // Let's strip the PAC unconditionally because xpaclri is in the NOP space, + // so will do nothing when it is not enabled or not available. + uint64_t ret; + asm volatile( + "mov x30, %1\n\t" + "hint #7\n\t" // xpaclri + "mov %0, x30\n\t" + : "=r"(ret) + : "r"(__value) + : "x30"); + return ret; +} + +__attribute__((always_inline, pure)) +static __inline__ void** +_os_tsd_get_base(void) +{ +#if defined(__arm__) + uintptr_t tsd; + __asm__("mrc p15, 0, %0, c13, c0, 3\n" + "bic %0, %0, #0x3\n" : "=r" (tsd)); + /* lower 2-bits contain CPU number */ +#elif defined(__arm64__) + uint64_t tsd; + __asm__("mrs %0, TPIDRRO_EL0\n" + "bic %0, %0, #0x7\n" : "=r" (tsd)); + /* lower 3-bits contain CPU number */ +#endif + + return (void**)(uintptr_t)tsd; +} +#define _os_tsd_get_base() _os_tsd_get_base() +#endif + +#ifdef _os_tsd_get_base +__attribute__((always_inline)) +static __inline__ void* +_os_tsd_get_direct(unsigned long slot) +{ + return _os_tsd_get_base()[slot]; +} +#endif + +__attribute__((always_inline, pure)) +static __inline__ uintptr_t +_os_ptr_munge_token(void) +{ + return (uintptr_t)_os_tsd_get_direct(__TSD_PTR_MUNGE); +} + +__attribute__((always_inline, pure)) +JL_UNUSED static __inline__ uintptr_t +_os_ptr_munge(uintptr_t ptr) +{ + return ptr ^ _os_ptr_munge_token(); +} +#define _OS_PTR_UNMUNGE(_ptr) _os_ptr_munge((uintptr_t)(_ptr)) +#endif + + extern bt_context_t *jl_to_bt_context(void *sigctx); void jl_rec_backtrace(jl_task_t *t) @@ -740,7 +895,171 @@ void jl_rec_backtrace(jl_task_t *t) context = &t->ctx.ctx; #elif defined(JL_HAVE_UCONTEXT) context = jl_to_bt_context(&t->ctx.ctx); +#elif defined(JL_HAVE_ASM) + bt_context_t c; + memset(&c, 0, sizeof(c)); + #if defined(_OS_LINUX_) && defined(__GLIBC__) + __jmp_buf *mctx = &t->ctx.ctx.uc_mcontext->__jmpbuf; + mcontext_t *mc = &c.uc_mcontext; + #if defined(_CPU_X86_) + // https://github.com/bminor/glibc/blame/master/sysdeps/i386/__longjmp.S + // https://github.com/bminor/glibc/blame/master/sysdeps/i386/jmpbuf-offsets.h + // https://github.com/bminor/musl/blame/master/src/setjmp/i386/longjmp.s + mc->gregs[REG_EBX] = (*mctx)[0]; + mc->gregs[REG_ESI] = (*mctx)[1]; + mc->gregs[REG_EDI] = (*mctx)[2]; + mc->gregs[REG_EBP] = (*mctx)[3]; + mc->gregs[REG_ESP] = (*mctx)[4]; + mc->gregs[REG_EIP] = (*mctx)[5]; + // ifdef PTR_DEMANGLE ? + mc->gregs[REG_ESP] = ptr_demangle(mc->gregs[REG_ESP]); + mc->gregs[REG_EIP] = ptr_demangle(mc->gregs[REG_EIP]); + context = &c; + #elif defined(_CPU_X86_64_) + // https://github.com/bminor/glibc/blame/master/sysdeps/x86_64/__longjmp.S + // https://github.com/bminor/glibc/blame/master/sysdeps/x86_64/jmpbuf-offsets.h + // https://github.com/bminor/musl/blame/master/src/setjmp/x86_64/setjmp.s + mc->gregs[REG_RBX] = (*mctx)[0]; + mc->gregs[REG_RBP] = (*mctx)[1]; + mc->gregs[REG_R12] = (*mctx)[2]; + mc->gregs[REG_R13] = (*mctx)[3]; + mc->gregs[REG_R14] = (*mctx)[4]; + mc->gregs[REG_R15] = (*mctx)[5]; + mc->gregs[REG_RSP] = (*mctx)[6]; + mc->gregs[REG_RIP] = (*mctx)[7]; + // ifdef PTR_DEMANGLE ? + mc->gregs[REG_RBP] = ptr_demangle(mc->gregs[REG_RBP]); + mc->gregs[REG_RSP] = ptr_demangle(mc->gregs[REG_RSP]); + mc->gregs[REG_RIP] = ptr_demangle(mc->gregs[REG_RIP]); + context = &c; + #elif defined(_CPU_ARM_) + // https://github.com/bminor/glibc/blame/master/sysdeps/arm/__longjmp.S + // https://github.com/bminor/glibc/blame/master/sysdeps/arm/include/bits/setjmp.h + // https://github.com/bminor/musl/blame/master/src/setjmp/arm/longjmp.S + mc->arm_sp = (*mctx)[0]; + mc->arm_lr = (*mctx)[1]; + mc->arm_r4 = (*mctx)[2]; // aka v1 + mc->arm_r5 = (*mctx)[3]; // aka v2 + mc->arm_r6 = (*mctx)[4]; // aka v3 + mc->arm_r7 = (*mctx)[5]; // aka v4 + mc->arm_r8 = (*mctx)[6]; // aka v5 + mc->arm_r9 = (*mctx)[7]; // aka v6 aka sb + mc->arm_r10 = (*mctx)[8]; // aka v7 aka sl + mc->arm_fp = (*mctx)[10]; // aka v8 aka r11 + // ifdef PTR_DEMANGLE ? + mc->arm_sp = ptr_demangle(mc->arm_sp); + mc->arm_lr = ptr_demangle(mc->arm_lr); + mc->arm_pc = mc->arm_lr; + context = &c; + #elif defined(_CPU_AARCH64_) + // https://github.com/bminor/glibc/blame/master/sysdeps/aarch64/__longjmp.S + // https://github.com/bminor/glibc/blame/master/sysdeps/aarch64/jmpbuf-offsets.h + // https://github.com/bminor/musl/blame/master/src/setjmp/aarch64/longjmp.s + // https://github.com/libunwind/libunwind/blob/ec171c9ba7ea3abb2a1383cee2988a7abd483a1f/src/aarch64/unwind_i.h#L62 + unw_fpsimd_context_t *mcfp = (unw_fpsimd_context_t*)&mc->__reserved; + mc->regs[19] = (*mctx)[0]; + mc->regs[20] = (*mctx)[1]; + mc->regs[21] = (*mctx)[2]; + mc->regs[22] = (*mctx)[3]; + mc->regs[23] = (*mctx)[4]; + mc->regs[24] = (*mctx)[5]; + mc->regs[25] = (*mctx)[6]; + mc->regs[26] = (*mctx)[7]; + mc->regs[27] = (*mctx)[8]; + mc->regs[28] = (*mctx)[9]; + mc->regs[29] = (*mctx)[10]; // aka fp + mc->regs[30] = (*mctx)[11]; // aka lr + // Yes, they did skip 12 why writing the code originally; and, no, I do not know why. + mc->sp = (*mctx)[13]; + mcfp->vregs[7] = (*mctx)[14]; // aka d8 + mcfp->vregs[8] = (*mctx)[15]; // aka d9 + mcfp->vregs[9] = (*mctx)[16]; // aka d10 + mcfp->vregs[10] = (*mctx)[17]; // aka d11 + mcfp->vregs[11] = (*mctx)[18]; // aka d12 + mcfp->vregs[12] = (*mctx)[19]; // aka d13 + mcfp->vregs[13] = (*mctx)[20]; // aka d14 + mcfp->vregs[14] = (*mctx)[21]; // aka d15 + // ifdef PTR_DEMANGLE ? + mc->sp = ptr_demangle(mc->sp); + mc->regs[30] = ptr_demangle(mc->regs[30]); + mc->pc = mc->regs[30]; + context = &c; + #else + #pragma message("jl_rec_backtrace not defined for ASM/SETJMP on unknown linux") + (void)mc; + (void)c; + #endif + #elif defined(_OS_DARWIN_) + sigjmp_buf *mctx = &t->ctx.ctx.uc_mcontext; + #if defined(_CPU_X86_64_) + // from https://github.com/apple/darwin-libplatform/blob/main/src/setjmp/x86_64/_setjmp.s + x86_thread_state64_t *mc = (x86_thread_state64_t*)&c; + mc->__rbx = ((uint64_t*)mctx)[0]; + mc->__rbp = ((uint64_t*)mctx)[1]; + mc->__rsp = ((uint64_t*)mctx)[2]; + mc->__r12 = ((uint64_t*)mctx)[3]; + mc->__r13 = ((uint64_t*)mctx)[4]; + mc->__r14 = ((uint64_t*)mctx)[5]; + mc->__r15 = ((uint64_t*)mctx)[6]; + mc->__rip = ((uint64_t*)mctx)[7]; + // added in libsystem_plaform 177.200.16 (macOS Mojave 10.14.3) + // prior to that _os_ptr_munge_token was (hopefully) typically 0, + // so x ^ 0 == x and this is a no-op + mc->__rbp = _OS_PTR_UNMUNGE(mc->__rbp); + mc->__rsp = _OS_PTR_UNMUNGE(mc->__rsp); + mc->__rip = _OS_PTR_UNMUNGE(mc->__rip); + context = &c; + #elif defined(_CPU_AARCH64_) + // from https://github.com/apple/darwin-libplatform/blob/main/src/setjmp/arm64/setjmp.s + // https://github.com/apple/darwin-xnu/blob/main/osfmk/mach/arm/_structs.h + // https://github.com/llvm/llvm-project/blob/7714e0317520207572168388f22012dd9e152e9e/libunwind/src/Registers.hpp -> Registers_arm64 + arm_thread_state64_t *mc = (arm_thread_state64_t*)&c; + mc->__x[19] = ((uint64_t*)mctx)[0]; + mc->__x[20] = ((uint64_t*)mctx)[1]; + mc->__x[21] = ((uint64_t*)mctx)[2]; + mc->__x[22] = ((uint64_t*)mctx)[3]; + mc->__x[23] = ((uint64_t*)mctx)[4]; + mc->__x[24] = ((uint64_t*)mctx)[5]; + mc->__x[25] = ((uint64_t*)mctx)[6]; + mc->__x[26] = ((uint64_t*)mctx)[7]; + mc->__x[27] = ((uint64_t*)mctx)[8]; + mc->__x[28] = ((uint64_t*)mctx)[9]; + mc->__x[10] = ((uint64_t*)mctx)[10]; + mc->__x[11] = ((uint64_t*)mctx)[11]; + mc->__x[12] = ((uint64_t*)mctx)[12]; + // 13 is reserved/unused + double *mcfp = (double*)&mc[1]; + mcfp[7] = ((uint64_t*)mctx)[14]; // aka d8 + mcfp[8] = ((uint64_t*)mctx)[15]; // aka d9 + mcfp[9] = ((uint64_t*)mctx)[16]; // aka d10 + mcfp[10] = ((uint64_t*)mctx)[17]; // aka d11 + mcfp[11] = ((uint64_t*)mctx)[18]; // aka d12 + mcfp[12] = ((uint64_t*)mctx)[19]; // aka d13 + mcfp[13] = ((uint64_t*)mctx)[20]; // aka d14 + mcfp[14] = ((uint64_t*)mctx)[21]; // aka d15 + mc->__fp = _OS_PTR_UNMUNGE(mc->__x[10]); + mc->__lr = _OS_PTR_UNMUNGE(mc->__x[11]); + mc->__x[12] = _OS_PTR_UNMUNGE(mc->__x[12]); + mc->__sp = mc->__x[12]; + // libunwind is broken for signed-pointers, but perhaps best not to leave the signed pointer lying around either + mc->__pc = ptrauth_strip(mc->__lr, 0); + mc->__pad = 0; // aka __ra_sign_state = not signed + context = &c; + #else + #pragma message("jl_rec_backtrace not defined for ASM/SETJMP on unknown darwin") + (void)mctx; + (void)c; + #endif + #else + #pragma message("jl_rec_backtrace not defined for ASM/SETJMP on unknown system") + (void)c; + #endif +#elif defined(JL_HAVE_ASYNCIFY) + #pragma message("jl_rec_backtrace not defined for ASYNCIFY") +#elif defined(JL_HAVE_SIGALTSTACK) + #pragma message("jl_rec_backtrace not defined for SIGALTSTACK") #else + #pragma message("jl_rec_backtrace not defined for unknown task system") #endif if (context) ptls->bt_size = rec_backtrace_ctx(ptls->bt_data, JL_MAX_BT_SIZE, context, t->gcstack); From 6a15e704d49ff34807c49acae899d82af1837e5b Mon Sep 17 00:00:00 2001 From: K Pamnany Date: Fri, 9 Dec 2022 17:57:11 -0500 Subject: [PATCH 352/369] 47402.patch (edited) Add jl_print_task_backtraces(). --- src/stackwalk.c | 44 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/src/stackwalk.c b/src/stackwalk.c index 0574a8393a15a..033478918dd61 100644 --- a/src/stackwalk.c +++ b/src/stackwalk.c @@ -722,7 +722,7 @@ static void JuliaInitializeLongjmpXorKey(void) } #endif -JL_UNUSED static uintptr_t ptr_demangle(uintptr_t p) +JL_UNUSED static uintptr_t ptr_demangle(uintptr_t p) JL_NOTSAFEPOINT { #if defined(__GLIBC__) #if defined(_CPU_X86_) @@ -854,7 +854,7 @@ _os_ptr_munge(uintptr_t ptr) extern bt_context_t *jl_to_bt_context(void *sigctx); -void jl_rec_backtrace(jl_task_t *t) +void jl_rec_backtrace(jl_task_t *t) JL_NOTSAFEPOINT { jl_task_t *ct = jl_current_task; jl_ptls_t ptls = ct->ptls; @@ -1090,7 +1090,9 @@ JL_DLLEXPORT void jlbacktrace(void) JL_NOTSAFEPOINT jl_print_bt_entry_codeloc(bt_data + i); } } -JL_DLLEXPORT void jlbacktracet(jl_task_t *t) + +// Print backtrace for specified task +JL_DLLEXPORT void jlbacktracet(jl_task_t *t) JL_NOTSAFEPOINT { jl_task_t *ct = jl_current_task; jl_ptls_t ptls = ct->ptls; @@ -1107,6 +1109,42 @@ JL_DLLEXPORT void jl_print_backtrace(void) JL_NOTSAFEPOINT jlbacktrace(); } +// Print backtraces for all live tasks, for all threads. +// WARNING: this is dangerous and can crash if used outside of gdb, if +// all of Julia's threads are not stopped! +JL_DLLEXPORT void jl_print_task_backtraces(void) JL_NOTSAFEPOINT +{ + for (size_t i = 0; i < jl_n_threads; i++) { + jl_ptls_t ptls2 = jl_all_tls_states[i]; + arraylist_t *live_tasks = &ptls2->heap.live_tasks; + size_t n = live_tasks->len; + jl_safe_printf("==== Thread %d created %zu live tasks\n", + ptls2->tid + 1, n + 1); + jl_safe_printf(" ---- Root task (%p)\n", ptls2->root_task); + jl_safe_printf(" (sticky: %d, started: %d, state: %d, tid: %d)\n", + ptls2->root_task->sticky, ptls2->root_task->started, + jl_atomic_load_relaxed(&ptls2->root_task->_state), + jl_atomic_load_relaxed(&ptls2->root_task->tid) + 1); + jlbacktracet(ptls2->root_task); + + void **lst = live_tasks->items; + for (size_t j = 0; j < live_tasks->len; j++) { + jl_task_t *t = (jl_task_t *)lst[j]; + jl_safe_printf(" ---- Task %zu (%p)\n", j + 1, t); + jl_safe_printf(" (sticky: %d, started: %d, state: %d, tid: %d)\n", + t->sticky, t->started, jl_atomic_load_relaxed(&t->_state), + jl_atomic_load_relaxed(&t->tid) + 1); + if (t->stkbuf != NULL) + jlbacktracet(t); + else + jl_safe_printf(" no stack\n"); + jl_safe_printf(" ---- End task %zu\n", j + 1); + } + jl_safe_printf("==== End thread %d\n", ptls2->tid + 1); + } + jl_safe_printf("==== Done\n"); +} + #ifdef __cplusplus } #endif From 3103690df62b7c9655c4651023388849d3d28e71 Mon Sep 17 00:00:00 2001 From: K Pamnany Date: Fri, 9 Dec 2022 17:59:10 -0500 Subject: [PATCH 353/369] 47419.patch MacOS: add missing shared_map_lock initialization. --- src/cgmemmgr.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/cgmemmgr.cpp b/src/cgmemmgr.cpp index 37e02b0efccbb..49f708cd76e76 100644 --- a/src/cgmemmgr.cpp +++ b/src/cgmemmgr.cpp @@ -218,7 +218,12 @@ static _Atomic(size_t) map_offset{0}; // Hopefully no one will set a ulimit for this to be a problem... static constexpr size_t map_size_inc_default = 128 * 1024 * 1024; static size_t map_size = 0; -static uv_mutex_t shared_map_lock; +static struct _make_shared_map_lock { + uv_mutex_t mtx; + _make_shared_map_lock() { + uv_mutex_init(&mtx); + }; +} shared_map_lock; static size_t get_map_size_inc() { @@ -264,7 +269,7 @@ static void *alloc_shared_page(size_t size, size_t *id, bool exec) *id = off; size_t map_size_inc = get_map_size_inc(); if (__unlikely(off + size > map_size)) { - uv_mutex_lock(&shared_map_lock); + uv_mutex_lock(&shared_map_lock.mtx); size_t old_size = map_size; while (off + size > map_size) map_size += map_size_inc; @@ -275,7 +280,7 @@ static void *alloc_shared_page(size_t size, size_t *id, bool exec) abort(); } } - uv_mutex_unlock(&shared_map_lock); + uv_mutex_unlock(&shared_map_lock.mtx); } return create_shared_map(size, off); } @@ -313,7 +318,6 @@ ssize_t pwrite_addr(int fd, const void *buf, size_t nbyte, uintptr_t addr) // Use `get_self_mem_fd` which has a guard to call this only once. static int _init_self_mem() { - uv_mutex_init(&shared_map_lock); struct utsname kernel; uname(&kernel); int major, minor; From 468e659e715ca0e82d987b09c7f8ffc6a37043ec Mon Sep 17 00:00:00 2001 From: K Pamnany Date: Fri, 9 Dec 2022 18:02:20 -0500 Subject: [PATCH 354/369] 44653.patch (edited) Port partr multiq to Julia. --- base/Base.jl | 1 + base/boot.jl | 2 +- base/partr.jl | 166 +++++++++++++++++++++++++++++ base/task.jl | 40 ++++--- src/builtins.c | 5 +- src/gc.c | 4 - src/init.c | 6 +- src/jl_exported_funcs.inc | 1 - src/jltypes.c | 14 ++- src/julia.h | 4 +- src/partr.c | 217 ++++---------------------------------- src/staticdata.c | 2 +- src/task.c | 2 +- 13 files changed, 229 insertions(+), 235 deletions(-) create mode 100644 base/partr.jl diff --git a/base/Base.jl b/base/Base.jl index b2e79224edbd7..866a5ea1ba3a6 100644 --- a/base/Base.jl +++ b/base/Base.jl @@ -270,6 +270,7 @@ include("condition.jl") include("threads.jl") include("lock.jl") include("channels.jl") +include("partr.jl") include("task.jl") include("threads_overloads.jl") include("weakkeydict.jl") diff --git a/base/boot.jl b/base/boot.jl index 2476114b62d70..8703b6287fbea 100644 --- a/base/boot.jl +++ b/base/boot.jl @@ -222,7 +222,7 @@ primitive type Char <: AbstractChar 32 end primitive type Int8 <: Signed 8 end #primitive type UInt8 <: Unsigned 8 end primitive type Int16 <: Signed 16 end -primitive type UInt16 <: Unsigned 16 end +#primitive type UInt16 <: Unsigned 16 end #primitive type Int32 <: Signed 32 end #primitive type UInt32 <: Unsigned 32 end #primitive type Int64 <: Signed 64 end diff --git a/base/partr.jl b/base/partr.jl new file mode 100644 index 0000000000000..159cba1e9021a --- /dev/null +++ b/base/partr.jl @@ -0,0 +1,166 @@ +# This file is a part of Julia. License is MIT: https://julialang.org/license + +module Partr + +using ..Threads: SpinLock + +# a task heap +mutable struct taskheap + const lock::SpinLock + const tasks::Vector{Task} + @atomic ntasks::Int32 + @atomic priority::UInt16 + taskheap() = new(SpinLock(), Vector{Task}(undef, tasks_per_heap), zero(Int32), typemax(UInt16)) +end + +# multiqueue parameters +const heap_d = UInt32(8) +const heap_c = UInt32(2) + +# size of each heap +const tasks_per_heap = Int32(65536) # TODO: this should be smaller by default, but growable! + +# the multiqueue's heaps +global heaps::Vector{taskheap} +global heap_p::UInt32 = 0 + +# unbias state for the RNG +global cong_unbias::UInt32 = 0 + + +cong(max::UInt32, unbias::UInt32) = ccall(:jl_rand_ptls, UInt32, (UInt32, UInt32), max, unbias) + UInt32(1) + +function unbias_cong(max::UInt32) + return typemax(UInt32) - ((typemax(UInt32) % max) + UInt32(1)) +end + + +function multiq_init(nthreads) + global heap_p = heap_c * nthreads + global cong_unbias = unbias_cong(UInt32(heap_p)) + global heaps = Vector{taskheap}(undef, heap_p) + for i = UInt32(1):heap_p + heaps[i] = taskheap() + end + nothing +end + + +function sift_up(heap::taskheap, idx::Int32) + while idx > Int32(1) + parent = (idx - Int32(2)) ÷ heap_d + Int32(1) + if heap.tasks[idx].priority < heap.tasks[parent].priority + t = heap.tasks[parent] + heap.tasks[parent] = heap.tasks[idx] + heap.tasks[idx] = t + idx = parent + else + break + end + end +end + + +function sift_down(heap::taskheap, idx::Int32) + if idx <= heap.ntasks + for child = (heap_d * idx - heap_d + Int32(2)):(heap_d * idx + Int32(1)) + child > tasks_per_heap && break + if isassigned(heap.tasks, child) && + heap.tasks[child].priority < heap.tasks[idx].priority + t = heap.tasks[idx] + heap.tasks[idx] = heap.tasks[child] + heap.tasks[child] = t + sift_down(heap, child) + end + end + end +end + + +function multiq_insert(task::Task, priority::UInt16) + task.priority = priority + + rn = cong(heap_p, cong_unbias) + while !trylock(heaps[rn].lock) + rn = cong(heap_p, cong_unbias) + end + + if heaps[rn].ntasks >= tasks_per_heap + unlock(heaps[rn].lock) + # multiq insertion failed, increase #tasks per heap + return false + end + + ntasks = heaps[rn].ntasks + Int32(1) + @atomic :monotonic heaps[rn].ntasks = ntasks + heaps[rn].tasks[ntasks] = task + sift_up(heaps[rn], ntasks) + priority = heaps[rn].priority + if task.priority < priority + @atomic :monotonic heaps[rn].priority = task.priority + end + unlock(heaps[rn].lock) + return true +end + + +function multiq_deletemin() + local rn1, rn2 + local prio1, prio2 + + @label retry + GC.safepoint() + for i = UInt32(1):heap_p + if i == heap_p + return nothing + end + rn1 = cong(heap_p, cong_unbias) + rn2 = cong(heap_p, cong_unbias) + prio1 = heaps[rn1].priority + prio2 = heaps[rn2].priority + if prio1 > prio2 + prio1 = prio2 + rn1 = rn2 + elseif prio1 == prio2 && prio1 == typemax(UInt16) + continue + end + if trylock(heaps[rn1].lock) + if prio1 == heaps[rn1].priority + break + end + unlock(heaps[rn1].lock) + end + end + + task = heaps[rn1].tasks[1] + tid = Threads.threadid() + if ccall(:jl_set_task_tid, Cint, (Any, Cint), task, tid-1) == 0 + unlock(heaps[rn1].lock) + @goto retry + end + ntasks = heaps[rn1].ntasks + @atomic :monotonic heaps[rn1].ntasks = ntasks - Int32(1) + heaps[rn1].tasks[1] = heaps[rn1].tasks[ntasks] + Base._unsetindex!(heaps[rn1].tasks, Int(ntasks)) + prio1 = typemax(UInt16) + if ntasks > 1 + sift_down(heaps[rn1], Int32(1)) + prio1 = heaps[rn1].tasks[1].priority + end + @atomic :monotonic heaps[rn1].priority = prio1 + unlock(heaps[rn1].lock) + + return task +end + + +function multiq_check_empty() + for i = UInt32(1):heap_p + if heaps[i].ntasks != 0 + return false + end + end + return true +end + +end diff --git a/base/task.jl b/base/task.jl index fa6b6df4a7f5d..b64ab35f2f318 100644 --- a/base/task.jl +++ b/base/task.jl @@ -705,12 +705,14 @@ const StickyWorkqueue = InvasiveLinkedListSynchronized{Task} global const Workqueues = [StickyWorkqueue()] global const Workqueue = Workqueues[1] # default work queue is thread 1 function __preinit_threads__() - if length(Workqueues) < Threads.nthreads() - resize!(Workqueues, Threads.nthreads()) - for i = 2:length(Workqueues) + nt = Threads.nthreads() + if length(Workqueues) < nt + resize!(Workqueues, nt) + for i = 2:nt Workqueues[i] = StickyWorkqueue() end end + Partr.multiq_init(nt) nothing end @@ -735,7 +737,7 @@ function enq_work(t::Task) end push!(Workqueues[tid], t) else - if ccall(:jl_enqueue_task, Cint, (Any,), t) != 0 + if !Partr.multiq_insert(t, t.priority) # if multiq is full, give to a random thread (TODO fix) if tid == 0 tid = mod(time_ns() % Int, Threads.nthreads()) + 1 @@ -901,24 +903,30 @@ function ensure_rescheduled(othertask::Task) end function trypoptask(W::StickyWorkqueue) - isempty(W) && return - t = popfirst!(W) - if t._state !== task_state_runnable - # assume this somehow got queued twice, - # probably broken now, but try discarding this switch and keep going - # can't throw here, because it's probably not the fault of the caller to wait - # and don't want to use print() here, because that may try to incur a task switch - ccall(:jl_safe_printf, Cvoid, (Ptr{UInt8}, Int32...), - "\nWARNING: Workqueue inconsistency detected: popfirst!(Workqueue).state != :runnable\n") - return + while !isempty(W) + t = popfirst!(W) + if t._state !== task_state_runnable + # assume this somehow got queued twice, + # probably broken now, but try discarding this switch and keep going + # can't throw here, because it's probably not the fault of the caller to wait + # and don't want to use print() here, because that may try to incur a task switch + ccall(:jl_safe_printf, Cvoid, (Ptr{UInt8}, Int32...), + "\nWARNING: Workqueue inconsistency detected: popfirst!(Workqueue).state != :runnable\n") + continue + end + return t end - return t + return Partr.multiq_deletemin() +end + +function checktaskempty() + return Partr.multiq_check_empty() end @noinline function poptask(W::StickyWorkqueue) task = trypoptask(W) if !(task isa Task) - task = ccall(:jl_task_get_next, Ref{Task}, (Any, Any), trypoptask, W) + task = ccall(:jl_task_get_next, Ref{Task}, (Any, Any, Any), trypoptask, W, checktaskempty) end set_next_task(task) nothing diff --git a/src/builtins.c b/src/builtins.c index 64f0755182816..62bfd431584c3 100644 --- a/src/builtins.c +++ b/src/builtins.c @@ -1988,10 +1988,11 @@ void jl_init_primitives(void) JL_GC_DISABLED add_builtin("Bool", (jl_value_t*)jl_bool_type); add_builtin("UInt8", (jl_value_t*)jl_uint8_type); - add_builtin("Int32", (jl_value_t*)jl_int32_type); - add_builtin("Int64", (jl_value_t*)jl_int64_type); + add_builtin("UInt16", (jl_value_t*)jl_uint16_type); add_builtin("UInt32", (jl_value_t*)jl_uint32_type); add_builtin("UInt64", (jl_value_t*)jl_uint64_type); + add_builtin("Int32", (jl_value_t*)jl_int32_type); + add_builtin("Int64", (jl_value_t*)jl_int64_type); #ifdef _P64 add_builtin("Int", (jl_value_t*)jl_int64_type); #else diff --git a/src/gc.c b/src/gc.c index 938f2c3bd9f1b..5c4f838c6bd11 100644 --- a/src/gc.c +++ b/src/gc.c @@ -2839,7 +2839,6 @@ static void jl_gc_queue_thread_local(jl_gc_mark_cache_t *gc_cache, jl_gc_mark_sp gc_mark_queue_obj(gc_cache, sp, ptls2->previous_exception); } -void jl_gc_mark_enqueued_tasks(jl_gc_mark_cache_t *gc_cache, jl_gc_mark_sp_t *sp); extern jl_value_t *cmpswap_names JL_GLOBALLY_ROOTED; // mark the initial root set @@ -2848,9 +2847,6 @@ static void mark_roots(jl_gc_mark_cache_t *gc_cache, jl_gc_mark_sp_t *sp) // modules gc_mark_queue_obj(gc_cache, sp, jl_main_module); - // tasks - jl_gc_mark_enqueued_tasks(gc_cache, sp); - // invisible builtin values if (jl_an_empty_vec_any != NULL) gc_mark_queue_obj(gc_cache, sp, jl_an_empty_vec_any); diff --git a/src/init.c b/src/init.c index ab2e0aa1c4123..0172a0520d038 100644 --- a/src/init.c +++ b/src/init.c @@ -782,7 +782,6 @@ static void post_boot_hooks(void) jl_char_type = (jl_datatype_t*)core("Char"); jl_int8_type = (jl_datatype_t*)core("Int8"); jl_int16_type = (jl_datatype_t*)core("Int16"); - jl_uint16_type = (jl_datatype_t*)core("UInt16"); jl_float16_type = (jl_datatype_t*)core("Float16"); jl_float32_type = (jl_datatype_t*)core("Float32"); jl_float64_type = (jl_datatype_t*)core("Float64"); @@ -794,10 +793,11 @@ static void post_boot_hooks(void) jl_bool_type->super = jl_integer_type; jl_uint8_type->super = jl_unsigned_type; - jl_int32_type->super = jl_signed_type; - jl_int64_type->super = jl_signed_type; + jl_uint16_type->super = jl_unsigned_type; jl_uint32_type->super = jl_unsigned_type; jl_uint64_type->super = jl_unsigned_type; + jl_int32_type->super = jl_signed_type; + jl_int64_type->super = jl_signed_type; jl_errorexception_type = (jl_datatype_t*)core("ErrorException"); jl_stackovf_exception = jl_new_struct_uninit((jl_datatype_t*)core("StackOverflowError")); diff --git a/src/jl_exported_funcs.inc b/src/jl_exported_funcs.inc index b81e0ef5b6489..6663b3ebd0f99 100644 --- a/src/jl_exported_funcs.inc +++ b/src/jl_exported_funcs.inc @@ -119,7 +119,6 @@ XX(jl_egal__bits) \ XX(jl_egal__special) \ XX(jl_eh_restore_state) \ - XX(jl_enqueue_task) \ XX(jl_enter_handler) \ XX(jl_enter_threaded_region) \ XX(jl_environ) \ diff --git a/src/jltypes.c b/src/jltypes.c index ef09f6f457fd1..a3afdc740907a 100644 --- a/src/jltypes.c +++ b/src/jltypes.c @@ -2166,6 +2166,8 @@ void jl_init_types(void) JL_GC_DISABLED jl_any_type, jl_emptysvec, 64); jl_uint8_type = jl_new_primitivetype((jl_value_t*)jl_symbol("UInt8"), core, jl_any_type, jl_emptysvec, 8); + jl_uint16_type = jl_new_primitivetype((jl_value_t*)jl_symbol("UInt16"), core, + jl_any_type, jl_emptysvec, 16); jl_ssavalue_type = jl_new_datatype(jl_symbol("SSAValue"), core, jl_any_type, jl_emptysvec, jl_perm_symsvec(1, "id"), @@ -2530,7 +2532,7 @@ void jl_init_types(void) JL_GC_DISABLED "inferred", //"edges", //"absolute_max", - "ipo_purity_bits", "purity_bits", + "ipo_purity_bits", "purity_bits", "argescapes", "isspecsig", "precompile", "invoke", "specptr", // function object decls "relocatability"), @@ -2624,7 +2626,7 @@ void jl_init_types(void) JL_GC_DISABLED NULL, jl_any_type, jl_emptysvec, - jl_perm_symsvec(14, + jl_perm_symsvec(15, "next", "queue", "storage", @@ -2638,8 +2640,9 @@ void jl_init_types(void) JL_GC_DISABLED "rngState3", "_state", "sticky", - "_isexception"), - jl_svec(14, + "_isexception", + "priority"), + jl_svec(15, jl_any_type, jl_any_type, jl_any_type, @@ -2653,7 +2656,8 @@ void jl_init_types(void) JL_GC_DISABLED jl_uint64_type, jl_uint8_type, jl_bool_type, - jl_bool_type), + jl_bool_type, + jl_uint16_type), jl_emptysvec, 0, 1, 6); jl_value_t *listt = jl_new_struct(jl_uniontype_type, jl_task_type, jl_nothing_type); diff --git a/src/julia.h b/src/julia.h index 9cdf124fccaa7..7d99ab641ea4f 100644 --- a/src/julia.h +++ b/src/julia.h @@ -1885,12 +1885,12 @@ typedef struct _jl_task_t { _Atomic(uint8_t) _state; uint8_t sticky; // record whether this Task can be migrated to a new thread _Atomic(uint8_t) _isexception; // set if `result` is an exception to throw or that we exited with + // multiqueue priority + uint16_t priority; // hidden state: // id of owning thread - does not need to be defined until the task runs _Atomic(int16_t) tid; - // multiqueue priority - int16_t prio; // saved gc stack top for context switches jl_gcframe_t *gcstack; size_t world_age; diff --git a/src/partr.c b/src/partr.c index 5d50546440849..8c26b46990cac 100644 --- a/src/partr.c +++ b/src/partr.c @@ -34,11 +34,9 @@ static const int16_t sleeping = 1; // information: These observations require sequentially-consistent fences to be inserted between each of those operational phases. // [^store_buffering_1]: These fences are used to avoid the cycle 2b -> 1a -> 1b -> 2a -> 2b where // * Dequeuer: -// * 1a: `jl_atomic_store_relaxed(&ptls->sleep_check_state, sleeping)` -// * 1b: `multiq_check_empty` returns true +// * 1: `jl_atomic_store_relaxed(&ptls->sleep_check_state, sleeping)` // * Enqueuer: -// * 2a: `multiq_insert` -// * 2b: `jl_atomic_load_relaxed(&ptls->sleep_check_state)` in `jl_wakeup_thread` returns `not_sleeping` +// * 2: `jl_atomic_load_relaxed(&ptls->sleep_check_state)` in `jl_wakeup_thread` returns `not_sleeping` // i.e., the dequeuer misses the enqueue and enqueuer misses the sleep state transition. // [^store_buffering_2]: and also // * Enqueuer: @@ -74,187 +72,21 @@ JL_DLLEXPORT int jl_set_task_tid(jl_task_t *task, int tid) JL_NOTSAFEPOINT extern int jl_gc_mark_queue_obj_explicit(jl_gc_mark_cache_t *gc_cache, jl_gc_mark_sp_t *sp, jl_value_t *obj) JL_NOTSAFEPOINT; -// multiq -// --- - -/* a task heap */ -typedef struct taskheap_tag { - uv_mutex_t lock; - jl_task_t **tasks; - _Atomic(int32_t) ntasks; - _Atomic(int16_t) prio; -} taskheap_t; - -/* multiqueue parameters */ -static const int32_t heap_d = 8; -static const int heap_c = 2; - -/* size of each heap */ -static const int tasks_per_heap = 65536; // TODO: this should be smaller by default, but growable! - -/* the multiqueue's heaps */ -static taskheap_t *heaps; -static int32_t heap_p; - -/* unbias state for the RNG */ -static uint64_t cong_unbias; - - -static inline void multiq_init(void) -{ - heap_p = heap_c * jl_n_threads; - heaps = (taskheap_t *)calloc(heap_p, sizeof(taskheap_t)); - for (int32_t i = 0; i < heap_p; ++i) { - uv_mutex_init(&heaps[i].lock); - heaps[i].tasks = (jl_task_t **)calloc(tasks_per_heap, sizeof(jl_task_t*)); - jl_atomic_store_relaxed(&heaps[i].ntasks, 0); - jl_atomic_store_relaxed(&heaps[i].prio, INT16_MAX); - } - unbias_cong(heap_p, &cong_unbias); -} - - -static inline void sift_up(taskheap_t *heap, int32_t idx) -{ - if (idx > 0) { - int32_t parent = (idx-1)/heap_d; - if (heap->tasks[idx]->prio < heap->tasks[parent]->prio) { - jl_task_t *t = heap->tasks[parent]; - heap->tasks[parent] = heap->tasks[idx]; - heap->tasks[idx] = t; - sift_up(heap, parent); - } - } -} - - -static inline void sift_down(taskheap_t *heap, int32_t idx) -{ - if (idx < jl_atomic_load_relaxed(&heap->ntasks)) { - for (int32_t child = heap_d*idx + 1; - child < tasks_per_heap && child <= heap_d*idx + heap_d; - ++child) { - if (heap->tasks[child] - && heap->tasks[child]->prio < heap->tasks[idx]->prio) { - jl_task_t *t = heap->tasks[idx]; - heap->tasks[idx] = heap->tasks[child]; - heap->tasks[child] = t; - sift_down(heap, child); - } - } - } -} - - -static inline int multiq_insert(jl_task_t *task, int16_t priority) -{ - jl_ptls_t ptls = jl_current_task->ptls; - uint64_t rn; - - task->prio = priority; - do { - rn = cong(heap_p, cong_unbias, &ptls->rngseed); - } while (uv_mutex_trylock(&heaps[rn].lock) != 0); - - if (jl_atomic_load_relaxed(&heaps[rn].ntasks) >= tasks_per_heap) { - uv_mutex_unlock(&heaps[rn].lock); - // multiq insertion failed, increase #tasks per heap - return -1; - } - - int32_t ntasks = jl_atomic_load_relaxed(&heaps[rn].ntasks); - jl_atomic_store_relaxed(&heaps[rn].ntasks, ntasks + 1); - heaps[rn].tasks[ntasks] = task; - sift_up(&heaps[rn], ntasks); - int16_t prio = jl_atomic_load_relaxed(&heaps[rn].prio); - if (task->prio < prio) - jl_atomic_store_relaxed(&heaps[rn].prio, task->prio); - uv_mutex_unlock(&heaps[rn].lock); - - return 0; -} +// parallel task runtime +// --- -static inline jl_task_t *multiq_deletemin(void) +JL_DLLEXPORT uint32_t jl_rand_ptls(uint32_t max, uint32_t unbias) { jl_ptls_t ptls = jl_current_task->ptls; - uint64_t rn1 = 0, rn2; - int32_t i; - int16_t prio1, prio2; - jl_task_t *task; - retry: - jl_gc_safepoint(); - for (i = 0; i < heap_p; ++i) { - rn1 = cong(heap_p, cong_unbias, &ptls->rngseed); - rn2 = cong(heap_p, cong_unbias, &ptls->rngseed); - prio1 = jl_atomic_load_relaxed(&heaps[rn1].prio); - prio2 = jl_atomic_load_relaxed(&heaps[rn2].prio); - if (prio1 > prio2) { - prio1 = prio2; - rn1 = rn2; - } - else if (prio1 == prio2 && prio1 == INT16_MAX) - continue; - if (uv_mutex_trylock(&heaps[rn1].lock) == 0) { - if (prio1 == jl_atomic_load_relaxed(&heaps[rn1].prio)) - break; - uv_mutex_unlock(&heaps[rn1].lock); - } - } - if (i == heap_p) - return NULL; - - task = heaps[rn1].tasks[0]; - if (!jl_set_task_tid(task, ptls->tid)) { - uv_mutex_unlock(&heaps[rn1].lock); - goto retry; - } - int32_t ntasks = jl_atomic_load_relaxed(&heaps[rn1].ntasks) - 1; - jl_atomic_store_relaxed(&heaps[rn1].ntasks, ntasks); - heaps[rn1].tasks[0] = heaps[rn1].tasks[ntasks]; - heaps[rn1].tasks[ntasks] = NULL; - prio1 = INT16_MAX; - if (ntasks > 0) { - sift_down(&heaps[rn1], 0); - prio1 = heaps[rn1].tasks[0]->prio; - } - jl_atomic_store_relaxed(&heaps[rn1].prio, prio1); - uv_mutex_unlock(&heaps[rn1].lock); - - return task; -} - - -void jl_gc_mark_enqueued_tasks(jl_gc_mark_cache_t *gc_cache, jl_gc_mark_sp_t *sp) -{ - int32_t i, j; - for (i = 0; i < heap_p; ++i) - for (j = 0; j < jl_atomic_load_relaxed(&heaps[i].ntasks); ++j) - jl_gc_mark_queue_obj_explicit(gc_cache, sp, (jl_value_t *)heaps[i].tasks[j]); -} - - -static int multiq_check_empty(void) -{ - int32_t i; - for (i = 0; i < heap_p; ++i) { - if (jl_atomic_load_relaxed(&heaps[i].ntasks) != 0) - return 0; - } - return 1; + return cong(max, -(uint64_t)-unbias, &ptls->rngseed); } - - -// parallel task runtime -// --- - // initialize the threading infrastructure // (used only by the main thread) void jl_init_threadinginfra(void) { - /* initialize the synchronization trees pool and the multiqueue */ - multiq_init(); + /* initialize the synchronization trees pool */ sleep_threshold = DEFAULT_THREAD_SLEEP_THRESHOLD; char *cp = getenv(THREAD_SLEEP_THRESHOLD_NAME); @@ -306,20 +138,6 @@ void jl_threadfun(void *arg) } -// enqueue the specified task for execution -JL_DLLEXPORT int jl_enqueue_task(jl_task_t *task) -{ - char failed; - if (multiq_insert(task, task->prio) == -1) - failed = 1; - else { - failed = 0; - JL_PROBE_RT_TASKQ_INSERT(jl_current_task->ptls, task); - } - return failed; -} - - int jl_running_under_rr(int recheck) { #ifdef _OS_LINUX_ @@ -448,21 +266,22 @@ JL_DLLEXPORT void jl_wakeup_thread(int16_t tid) } -// get the next runnable task from the multiq +// get the next runnable task static jl_task_t *get_next_task(jl_value_t *trypoptask, jl_value_t *q) { jl_gc_safepoint(); - jl_value_t *args[2] = { trypoptask, q }; - jl_task_t *task = (jl_task_t*)jl_apply(args, 2); + jl_task_t *task = (jl_task_t*)jl_apply_generic(trypoptask, &q, 1); if (jl_typeis(task, jl_task_type)) { int self = jl_atomic_load_relaxed(&jl_current_task->tid); jl_set_task_tid(task, self); return task; } - task = multiq_deletemin(); - if (task) - JL_PROBE_RT_TASKQ_GET(jl_current_task->ptls, task); - return task; + return NULL; +} + +static int check_empty(jl_value_t *checkempty) +{ + return jl_apply_generic(checkempty, NULL, 0) == jl_true; } static int may_sleep(jl_ptls_t ptls) JL_NOTSAFEPOINT @@ -477,7 +296,7 @@ static int may_sleep(jl_ptls_t ptls) JL_NOTSAFEPOINT extern _Atomic(unsigned) _threadedregion; -JL_DLLEXPORT jl_task_t *jl_task_get_next(jl_value_t *trypoptask, jl_value_t *q) +JL_DLLEXPORT jl_task_t *jl_task_get_next(jl_value_t *trypoptask, jl_value_t *q, jl_value_t *checkempty) { jl_task_t *ct = jl_current_task; uint64_t start_cycles = 0; @@ -489,7 +308,7 @@ JL_DLLEXPORT jl_task_t *jl_task_get_next(jl_value_t *trypoptask, jl_value_t *q) // quick, race-y check to see if there seems to be any stuff in there jl_cpu_pause(); - if (!multiq_check_empty()) { + if (!check_empty(checkempty)) { start_cycles = 0; continue; } @@ -501,7 +320,7 @@ JL_DLLEXPORT jl_task_t *jl_task_get_next(jl_value_t *trypoptask, jl_value_t *q) jl_atomic_store_relaxed(&ptls->sleep_check_state, sleeping); jl_fence(); // [^store_buffering_1] JL_PROBE_RT_SLEEP_CHECK_SLEEP(ptls); - if (!multiq_check_empty()) { // uses relaxed loads + if (!check_empty(checkempty)) { // uses relaxed loads if (jl_atomic_load_relaxed(&ptls->sleep_check_state) != not_sleeping) { jl_atomic_store_relaxed(&ptls->sleep_check_state, not_sleeping); // let other threads know they don't need to wake us JL_PROBE_RT_SLEEP_CHECK_TASKQ_WAKE(ptls); diff --git a/src/staticdata.c b/src/staticdata.c index 1b98601026d49..1ff0e7ae50540 100644 --- a/src/staticdata.c +++ b/src/staticdata.c @@ -165,13 +165,13 @@ jl_value_t **const*const get_tags(void) { INSERT_TAG(jl_int64_type); INSERT_TAG(jl_bool_type); INSERT_TAG(jl_uint8_type); + INSERT_TAG(jl_uint16_type); INSERT_TAG(jl_uint32_type); INSERT_TAG(jl_uint64_type); INSERT_TAG(jl_char_type); INSERT_TAG(jl_weakref_type); INSERT_TAG(jl_int8_type); INSERT_TAG(jl_int16_type); - INSERT_TAG(jl_uint16_type); INSERT_TAG(jl_float16_type); INSERT_TAG(jl_float32_type); INSERT_TAG(jl_float64_type); diff --git a/src/task.c b/src/task.c index 34e5d618e2bf1..f239febb409e4 100644 --- a/src/task.c +++ b/src/task.c @@ -798,7 +798,7 @@ JL_DLLEXPORT jl_task_t *jl_new_task(jl_function_t *start, jl_value_t *completion t->gcstack = NULL; t->excstack = NULL; t->started = 0; - t->prio = -1; + t->priority = 0; jl_atomic_store_relaxed(&t->tid, t->copy_stack ? jl_atomic_load_relaxed(&ct->tid) : -1); // copy_stacks are always pinned since they can't be moved t->ptls = NULL; t->world_age = ct->world_age; From e74a087e9e448f198dd554d597dffed8c45473a5 Mon Sep 17 00:00:00 2001 From: K Pamnany Date: Fri, 9 Dec 2022 18:13:21 -0500 Subject: [PATCH 355/369] 44542.patch pcre: remove nthreads constant dependency. --- base/Base.jl | 4 ++++ base/client.jl | 4 ---- base/pcre.jl | 39 +++++++++++++++++++++++++++++---------- 3 files changed, 33 insertions(+), 14 deletions(-) diff --git a/base/Base.jl b/base/Base.jl index 866a5ea1ba3a6..7c76791880d03 100644 --- a/base/Base.jl +++ b/base/Base.jl @@ -496,6 +496,10 @@ function __init__() nothing end +# enable threads support +@eval PCRE PCRE_COMPILE_LOCK = Threads.SpinLock() + end + end # baremodule Base diff --git a/base/client.jl b/base/client.jl index 124bfd281c6a1..842389224637f 100644 --- a/base/client.jl +++ b/base/client.jl @@ -514,10 +514,6 @@ MainInclude.include function _start() empty!(ARGS) append!(ARGS, Core.ARGS) - if ccall(:jl_generating_output, Cint, ()) != 0 && JLOptions().incremental == 0 - # clear old invalid pointers - PCRE.__init__() - end try exec_options(JLOptions()) catch diff --git a/base/pcre.jl b/base/pcre.jl index a8edaaa089c31..81e9b1d4d0ff8 100644 --- a/base/pcre.jl +++ b/base/pcre.jl @@ -24,28 +24,47 @@ function create_match_context() return ctx end -const THREAD_MATCH_CONTEXTS = Ptr{Cvoid}[C_NULL] +THREAD_MATCH_CONTEXTS::Vector{Ptr{Cvoid}} = [C_NULL] PCRE_COMPILE_LOCK = nothing -_tid() = Int(ccall(:jl_threadid, Int16, ())+1) +_tid() = Int(ccall(:jl_threadid, Int16, ())) + 1 _nth() = Int(unsafe_load(cglobal(:jl_n_threads, Cint))) function get_local_match_context() + global THREAD_MATCH_CONTEXTS tid = _tid() - ctx = @inbounds THREAD_MATCH_CONTEXTS[tid] + ctxs = THREAD_MATCH_CONTEXTS + if length(ctxs) < tid + # slow path to allocate it + l = PCRE_COMPILE_LOCK::Threads.SpinLock + lock(l) + try + THREAD_MATCH_CONTEXTS = ctxs = copyto!(fill(C_NULL, _nth()), THREAD_MATCH_CONTEXTS) + finally + unlock(l) + end + end + ctx = @inbounds ctxs[tid] if ctx == C_NULL - @inbounds THREAD_MATCH_CONTEXTS[tid] = ctx = create_match_context() + # slow path to allocate it + ctx = create_match_context() + l = PCRE_COMPILE_LOCK + if l === nothing + THREAD_MATCH_CONTEXTS[tid] = ctx + else + l = l::Threads.SpinLock + lock(l) + try + THREAD_MATCH_CONTEXTS[tid] = ctx + finally + unlock(l) + end + end end return ctx end -function __init__() - resize!(THREAD_MATCH_CONTEXTS, _nth()) - fill!(THREAD_MATCH_CONTEXTS, C_NULL) - global PCRE_COMPILE_LOCK = Threads.SpinLock() -end - # supported options for different use cases # arguments to pcre2_compile From e6a6b3e56fbeb0e4afc58570363f4f4f2ebec5ac Mon Sep 17 00:00:00 2001 From: K Pamnany Date: Fri, 9 Dec 2022 18:14:42 -0500 Subject: [PATCH 356/369] 44721.patch partr: add dynamic scaling and optimize. --- base/condition.jl | 8 +- base/linked_list.jl | 36 ++++----- base/partr.jl | 123 +++++++++++++++++------------- base/pcre.jl | 19 ++--- base/task.jl | 84 ++++++++++---------- doc/src/manual/multi-threading.md | 2 +- src/init.c | 12 +-- src/partr.c | 1 + test/threads_exec.jl | 8 +- 9 files changed, 143 insertions(+), 150 deletions(-) diff --git a/base/condition.jl b/base/condition.jl index c536eceec17a0..4965b43a7019b 100644 --- a/base/condition.jl +++ b/base/condition.jl @@ -61,12 +61,12 @@ Abstract implementation of a condition object for synchronizing tasks objects with a given lock. """ struct GenericCondition{L<:AbstractLock} - waitq::InvasiveLinkedList{Task} + waitq::IntrusiveLinkedList{Task} lock::L - GenericCondition{L}() where {L<:AbstractLock} = new{L}(InvasiveLinkedList{Task}(), L()) - GenericCondition{L}(l::L) where {L<:AbstractLock} = new{L}(InvasiveLinkedList{Task}(), l) - GenericCondition(l::AbstractLock) = new{typeof(l)}(InvasiveLinkedList{Task}(), l) + GenericCondition{L}() where {L<:AbstractLock} = new{L}(IntrusiveLinkedList{Task}(), L()) + GenericCondition{L}(l::L) where {L<:AbstractLock} = new{L}(IntrusiveLinkedList{Task}(), l) + GenericCondition(l::AbstractLock) = new{typeof(l)}(IntrusiveLinkedList{Task}(), l) end assert_havelock(c::GenericCondition) = assert_havelock(c.lock) diff --git a/base/linked_list.jl b/base/linked_list.jl index 113607f63a2ff..c477dc56bdb2b 100644 --- a/base/linked_list.jl +++ b/base/linked_list.jl @@ -1,23 +1,23 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license -mutable struct InvasiveLinkedList{T} +mutable struct IntrusiveLinkedList{T} # Invasive list requires that T have a field `.next >: U{T, Nothing}` and `.queue >: U{ILL{T}, Nothing}` head::Union{T, Nothing} tail::Union{T, Nothing} - InvasiveLinkedList{T}() where {T} = new{T}(nothing, nothing) + IntrusiveLinkedList{T}() where {T} = new{T}(nothing, nothing) end #const list_append!! = append! #const list_deletefirst! = delete! -eltype(::Type{<:InvasiveLinkedList{T}}) where {T} = @isdefined(T) ? T : Any +eltype(::Type{<:IntrusiveLinkedList{T}}) where {T} = @isdefined(T) ? T : Any -iterate(q::InvasiveLinkedList) = (h = q.head; h === nothing ? nothing : (h, h)) -iterate(q::InvasiveLinkedList{T}, v::T) where {T} = (h = v.next; h === nothing ? nothing : (h, h)) +iterate(q::IntrusiveLinkedList) = (h = q.head; h === nothing ? nothing : (h, h)) +iterate(q::IntrusiveLinkedList{T}, v::T) where {T} = (h = v.next; h === nothing ? nothing : (h, h)) -isempty(q::InvasiveLinkedList) = (q.head === nothing) +isempty(q::IntrusiveLinkedList) = (q.head === nothing) -function length(q::InvasiveLinkedList) +function length(q::IntrusiveLinkedList) i = 0 head = q.head while head !== nothing @@ -27,7 +27,7 @@ function length(q::InvasiveLinkedList) return i end -function list_append!!(q::InvasiveLinkedList{T}, q2::InvasiveLinkedList{T}) where T +function list_append!!(q::IntrusiveLinkedList{T}, q2::IntrusiveLinkedList{T}) where T q === q2 && error("can't append list to itself") head2 = q2.head if head2 !== nothing @@ -49,7 +49,7 @@ function list_append!!(q::InvasiveLinkedList{T}, q2::InvasiveLinkedList{T}) wher return q end -function push!(q::InvasiveLinkedList{T}, val::T) where T +function push!(q::IntrusiveLinkedList{T}, val::T) where T val.queue === nothing || error("val already in a list") val.queue = q tail = q.tail @@ -62,7 +62,7 @@ function push!(q::InvasiveLinkedList{T}, val::T) where T return q end -function pushfirst!(q::InvasiveLinkedList{T}, val::T) where T +function pushfirst!(q::IntrusiveLinkedList{T}, val::T) where T val.queue === nothing || error("val already in a list") val.queue = q head = q.head @@ -75,20 +75,20 @@ function pushfirst!(q::InvasiveLinkedList{T}, val::T) where T return q end -function pop!(q::InvasiveLinkedList{T}) where {T} +function pop!(q::IntrusiveLinkedList{T}) where {T} val = q.tail::T list_deletefirst!(q, val) # expensive! return val end -function popfirst!(q::InvasiveLinkedList{T}) where {T} +function popfirst!(q::IntrusiveLinkedList{T}) where {T} val = q.head::T list_deletefirst!(q, val) # cheap return val end # this function assumes `val` is found in `q` -function list_deletefirst!(q::InvasiveLinkedList{T}, val::T) where T +function list_deletefirst!(q::IntrusiveLinkedList{T}, val::T) where T val.queue === q || return head = q.head::T if head === val @@ -125,20 +125,20 @@ end mutable struct LinkedListItem{T} # Adapter class to use any `T` in a LinkedList next::Union{LinkedListItem{T}, Nothing} - queue::Union{InvasiveLinkedList{LinkedListItem{T}}, Nothing} + queue::Union{IntrusiveLinkedList{LinkedListItem{T}}, Nothing} value::T LinkedListItem{T}(value::T) where {T} = new{T}(nothing, nothing, value) end -const LinkedList{T} = InvasiveLinkedList{LinkedListItem{T}} +const LinkedList{T} = IntrusiveLinkedList{LinkedListItem{T}} # delegate methods, as needed eltype(::Type{<:LinkedList{T}}) where {T} = @isdefined(T) ? T : Any iterate(q::LinkedList) = (h = q.head; h === nothing ? nothing : (h.value, h)) -iterate(q::InvasiveLinkedList{LLT}, v::LLT) where {LLT<:LinkedListItem} = (h = v.next; h === nothing ? nothing : (h.value, h)) +iterate(q::IntrusiveLinkedList{LLT}, v::LLT) where {LLT<:LinkedListItem} = (h = v.next; h === nothing ? nothing : (h.value, h)) push!(q::LinkedList{T}, val::T) where {T} = push!(q, LinkedListItem{T}(val)) pushfirst!(q::LinkedList{T}, val::T) where {T} = pushfirst!(q, LinkedListItem{T}(val)) -pop!(q::LinkedList) = invoke(pop!, Tuple{InvasiveLinkedList,}, q).value -popfirst!(q::LinkedList) = invoke(popfirst!, Tuple{InvasiveLinkedList,}, q).value +pop!(q::LinkedList) = invoke(pop!, Tuple{IntrusiveLinkedList,}, q).value +popfirst!(q::LinkedList) = invoke(popfirst!, Tuple{IntrusiveLinkedList,}, q).value function list_deletefirst!(q::LinkedList{T}, val::T) where T h = q.head while h !== nothing diff --git a/base/partr.jl b/base/partr.jl index 159cba1e9021a..debf38fb72930 100644 --- a/base/partr.jl +++ b/base/partr.jl @@ -2,30 +2,23 @@ module Partr -using ..Threads: SpinLock +using ..Threads: SpinLock, nthreads -# a task heap +# a task minheap mutable struct taskheap const lock::SpinLock const tasks::Vector{Task} @atomic ntasks::Int32 @atomic priority::UInt16 - taskheap() = new(SpinLock(), Vector{Task}(undef, tasks_per_heap), zero(Int32), typemax(UInt16)) + taskheap() = new(SpinLock(), Vector{Task}(undef, 256), zero(Int32), typemax(UInt16)) end -# multiqueue parameters -const heap_d = UInt32(8) -const heap_c = UInt32(2) - -# size of each heap -const tasks_per_heap = Int32(65536) # TODO: this should be smaller by default, but growable! - -# the multiqueue's heaps -global heaps::Vector{taskheap} -global heap_p::UInt32 = 0 -# unbias state for the RNG -global cong_unbias::UInt32 = 0 +# multiqueue minheap state +const heap_d = UInt32(8) +global heaps::Vector{taskheap} = Vector{taskheap}(undef, 0) +const heaps_lock = SpinLock() +global cong_unbias::UInt32 = typemax(UInt32) cong(max::UInt32, unbias::UInt32) = ccall(:jl_rand_ptls, UInt32, (UInt32, UInt32), max, unbias) + UInt32(1) @@ -35,18 +28,7 @@ function unbias_cong(max::UInt32) end -function multiq_init(nthreads) - global heap_p = heap_c * nthreads - global cong_unbias = unbias_cong(UInt32(heap_p)) - global heaps = Vector{taskheap}(undef, heap_p) - for i = UInt32(1):heap_p - heaps[i] = taskheap() - end - nothing -end - - -function sift_up(heap::taskheap, idx::Int32) +function multiq_sift_up(heap::taskheap, idx::Int32) while idx > Int32(1) parent = (idx - Int32(2)) ÷ heap_d + Int32(1) if heap.tasks[idx].priority < heap.tasks[parent].priority @@ -61,45 +43,76 @@ function sift_up(heap::taskheap, idx::Int32) end -function sift_down(heap::taskheap, idx::Int32) +function multiq_sift_down(heap::taskheap, idx::Int32) if idx <= heap.ntasks for child = (heap_d * idx - heap_d + Int32(2)):(heap_d * idx + Int32(1)) - child > tasks_per_heap && break - if isassigned(heap.tasks, child) && + child > length(heap.tasks) && break + if isassigned(heap.tasks, Int(child)) && heap.tasks[child].priority < heap.tasks[idx].priority t = heap.tasks[idx] heap.tasks[idx] = heap.tasks[child] heap.tasks[child] = t - sift_down(heap, child) + multiq_sift_down(heap, child) end end end end +function multiq_size() + heap_c = UInt32(2) + heap_p = UInt32(length(heaps)) + nt = UInt32(nthreads()) + + if heap_c * nt <= heap_p + return heap_p + end + + @lock heaps_lock begin + heap_p = UInt32(length(heaps)) + nt = UInt32(nthreads()) + if heap_c * nt <= heap_p + return heap_p + end + + heap_p += heap_c * nt + newheaps = Vector{taskheap}(undef, heap_p) + copyto!(newheaps, heaps) + for i = (1 + length(heaps)):heap_p + newheaps[i] = taskheap() + end + global heaps = newheaps + global cong_unbias = unbias_cong(heap_p) + end + + return heap_p +end + + function multiq_insert(task::Task, priority::UInt16) task.priority = priority + heap_p = multiq_size() rn = cong(heap_p, cong_unbias) while !trylock(heaps[rn].lock) rn = cong(heap_p, cong_unbias) end - if heaps[rn].ntasks >= tasks_per_heap - unlock(heaps[rn].lock) - # multiq insertion failed, increase #tasks per heap - return false + heap = heaps[rn] + if heap.ntasks >= length(heap.tasks) + resize!(heap.tasks, length(heap.tasks) * 2) end - ntasks = heaps[rn].ntasks + Int32(1) - @atomic :monotonic heaps[rn].ntasks = ntasks - heaps[rn].tasks[ntasks] = task - sift_up(heaps[rn], ntasks) - priority = heaps[rn].priority + ntasks = heap.ntasks + Int32(1) + @atomic :monotonic heap.ntasks = ntasks + heap.tasks[ntasks] = task + multiq_sift_up(heap, ntasks) + priority = heap.priority if task.priority < priority - @atomic :monotonic heaps[rn].priority = task.priority + @atomic :monotonic heap.priority = task.priority end - unlock(heaps[rn].lock) + unlock(heap.lock) + return true end @@ -110,7 +123,8 @@ function multiq_deletemin() @label retry GC.safepoint() - for i = UInt32(1):heap_p + heap_p = UInt32(length(heaps)) + for i = UInt32(0):heap_p if i == heap_p return nothing end @@ -132,30 +146,31 @@ function multiq_deletemin() end end - task = heaps[rn1].tasks[1] + heap = heaps[rn1] + task = heap.tasks[1] tid = Threads.threadid() if ccall(:jl_set_task_tid, Cint, (Any, Cint), task, tid-1) == 0 - unlock(heaps[rn1].lock) + unlock(heap.lock) @goto retry end - ntasks = heaps[rn1].ntasks - @atomic :monotonic heaps[rn1].ntasks = ntasks - Int32(1) - heaps[rn1].tasks[1] = heaps[rn1].tasks[ntasks] - Base._unsetindex!(heaps[rn1].tasks, Int(ntasks)) + ntasks = heap.ntasks + @atomic :monotonic heap.ntasks = ntasks - Int32(1) + heap.tasks[1] = heap.tasks[ntasks] + Base._unsetindex!(heap.tasks, Int(ntasks)) prio1 = typemax(UInt16) if ntasks > 1 - sift_down(heaps[rn1], Int32(1)) - prio1 = heaps[rn1].tasks[1].priority + multiq_sift_down(heap, Int32(1)) + prio1 = heap.tasks[1].priority end - @atomic :monotonic heaps[rn1].priority = prio1 - unlock(heaps[rn1].lock) + @atomic :monotonic heap.priority = prio1 + unlock(heap.lock) return task end function multiq_check_empty() - for i = UInt32(1):heap_p + for i = UInt32(1):length(heaps) if heaps[i].ntasks != 0 return false end diff --git a/base/pcre.jl b/base/pcre.jl index 81e9b1d4d0ff8..d689e9be29113 100644 --- a/base/pcre.jl +++ b/base/pcre.jl @@ -32,7 +32,6 @@ _tid() = Int(ccall(:jl_threadid, Int16, ())) + 1 _nth() = Int(unsafe_load(cglobal(:jl_n_threads, Cint))) function get_local_match_context() - global THREAD_MATCH_CONTEXTS tid = _tid() ctxs = THREAD_MATCH_CONTEXTS if length(ctxs) < tid @@ -40,7 +39,10 @@ function get_local_match_context() l = PCRE_COMPILE_LOCK::Threads.SpinLock lock(l) try - THREAD_MATCH_CONTEXTS = ctxs = copyto!(fill(C_NULL, _nth()), THREAD_MATCH_CONTEXTS) + ctxs = THREAD_MATCH_CONTEXTS + if length(ctxs) < tid + global THREAD_MATCH_CONTEXTS = ctxs = copyto!(fill(C_NULL, _nth()), ctxs) + end finally unlock(l) end @@ -49,18 +51,7 @@ function get_local_match_context() if ctx == C_NULL # slow path to allocate it ctx = create_match_context() - l = PCRE_COMPILE_LOCK - if l === nothing - THREAD_MATCH_CONTEXTS[tid] = ctx - else - l = l::Threads.SpinLock - lock(l) - try - THREAD_MATCH_CONTEXTS[tid] = ctx - finally - unlock(l) - end - end + THREAD_MATCH_CONTEXTS[tid] = ctx end return ctx end diff --git a/base/task.jl b/base/task.jl index b64ab35f2f318..f13ed9c02cfe4 100644 --- a/base/task.jl +++ b/base/task.jl @@ -650,14 +650,14 @@ end ## scheduler and work queue -struct InvasiveLinkedListSynchronized{T} - queue::InvasiveLinkedList{T} +struct IntrusiveLinkedListSynchronized{T} + queue::IntrusiveLinkedList{T} lock::Threads.SpinLock - InvasiveLinkedListSynchronized{T}() where {T} = new(InvasiveLinkedList{T}(), Threads.SpinLock()) + IntrusiveLinkedListSynchronized{T}() where {T} = new(IntrusiveLinkedList{T}(), Threads.SpinLock()) end -isempty(W::InvasiveLinkedListSynchronized) = isempty(W.queue) -length(W::InvasiveLinkedListSynchronized) = length(W.queue) -function push!(W::InvasiveLinkedListSynchronized{T}, t::T) where T +isempty(W::IntrusiveLinkedListSynchronized) = isempty(W.queue) +length(W::IntrusiveLinkedListSynchronized) = length(W.queue) +function push!(W::IntrusiveLinkedListSynchronized{T}, t::T) where T lock(W.lock) try push!(W.queue, t) @@ -666,7 +666,7 @@ function push!(W::InvasiveLinkedListSynchronized{T}, t::T) where T end return W end -function pushfirst!(W::InvasiveLinkedListSynchronized{T}, t::T) where T +function pushfirst!(W::IntrusiveLinkedListSynchronized{T}, t::T) where T lock(W.lock) try pushfirst!(W.queue, t) @@ -675,7 +675,7 @@ function pushfirst!(W::InvasiveLinkedListSynchronized{T}, t::T) where T end return W end -function pop!(W::InvasiveLinkedListSynchronized) +function pop!(W::IntrusiveLinkedListSynchronized) lock(W.lock) try return pop!(W.queue) @@ -683,7 +683,7 @@ function pop!(W::InvasiveLinkedListSynchronized) unlock(W.lock) end end -function popfirst!(W::InvasiveLinkedListSynchronized) +function popfirst!(W::IntrusiveLinkedListSynchronized) lock(W.lock) try return popfirst!(W.queue) @@ -691,7 +691,7 @@ function popfirst!(W::InvasiveLinkedListSynchronized) unlock(W.lock) end end -function list_deletefirst!(W::InvasiveLinkedListSynchronized{T}, t::T) where T +function list_deletefirst!(W::IntrusiveLinkedListSynchronized{T}, t::T) where T lock(W.lock) try list_deletefirst!(W.queue, t) @@ -701,30 +701,36 @@ function list_deletefirst!(W::InvasiveLinkedListSynchronized{T}, t::T) where T return W end -const StickyWorkqueue = InvasiveLinkedListSynchronized{Task} -global const Workqueues = [StickyWorkqueue()] -global const Workqueue = Workqueues[1] # default work queue is thread 1 -function __preinit_threads__() - nt = Threads.nthreads() - if length(Workqueues) < nt - resize!(Workqueues, nt) - for i = 2:nt - Workqueues[i] = StickyWorkqueue() +const StickyWorkqueue = IntrusiveLinkedListSynchronized{Task} +global Workqueues::Vector{StickyWorkqueue} = [StickyWorkqueue()] +const Workqueues_lock = Threads.SpinLock() +const Workqueue = Workqueues[1] # default work queue is thread 1 // TODO: deprecate this variable + +function workqueue_for(tid::Int) + qs = Workqueues + if length(qs) >= tid && isassigned(qs, tid) + return @inbounds qs[tid] + end + # slow path to allocate it + l = Workqueues_lock + @lock l begin + qs = Workqueues + if length(qs) < tid + nt = Threads.nthreads() + @assert tid <= nt + global Workqueues = qs = copyto!(typeof(qs)(undef, length(qs) + nt - 1), qs) end + if !isassigned(qs, tid) + @inbounds qs[tid] = StickyWorkqueue() + end + return @inbounds qs[tid] end - Partr.multiq_init(nt) - nothing end function enq_work(t::Task) (t._state === task_state_runnable && t.queue === nothing) || error("schedule: Task not runnable") - tid = Threads.threadid(t) - # Note there are three reasons a Task might be put into a sticky queue - # even if t.sticky == false: - # 1. The Task's stack is currently being used by the scheduler for a certain thread. - # 2. There is only 1 thread. - # 3. The multiq is full (can be fixed by making it growable). if t.sticky || Threads.nthreads() == 1 + tid = Threads.threadid(t) if tid == 0 # Issue #41324 # t.sticky && tid == 0 is a task that needs to be co-scheduled with @@ -735,18 +741,10 @@ function enq_work(t::Task) tid = Threads.threadid() ccall(:jl_set_task_tid, Cint, (Any, Cint), t, tid-1) end - push!(Workqueues[tid], t) + push!(workqueue_for(tid), t) else - if !Partr.multiq_insert(t, t.priority) - # if multiq is full, give to a random thread (TODO fix) - if tid == 0 - tid = mod(time_ns() % Int, Threads.nthreads()) + 1 - ccall(:jl_set_task_tid, Cint, (Any, Cint), t, tid-1) - end - push!(Workqueues[tid], t) - else - tid = 0 - end + Partr.multiq_insert(t, t.priority) + tid = 0 end ccall(:jl_wakeup_thread, Cvoid, (Int16,), (tid - 1) % Int16) return t @@ -887,12 +885,12 @@ end function ensure_rescheduled(othertask::Task) ct = current_task() - W = Workqueues[Threads.threadid()] + W = workqueue_for(Threads.threadid()) if ct !== othertask && othertask._state === task_state_runnable # we failed to yield to othertask # return it to the head of a queue to be retried later tid = Threads.threadid(othertask) - Wother = tid == 0 ? W : Workqueues[tid] + Wother = tid == 0 ? W : workqueue_for(tid) pushfirst!(Wother, othertask) end # if the current task was queued, @@ -919,9 +917,7 @@ function trypoptask(W::StickyWorkqueue) return Partr.multiq_deletemin() end -function checktaskempty() - return Partr.multiq_check_empty() -end +checktaskempty = Partr.multiq_check_empty @noinline function poptask(W::StickyWorkqueue) task = trypoptask(W) @@ -934,7 +930,7 @@ end function wait() GC.safepoint() - W = Workqueues[Threads.threadid()] + W = workqueue_for(Threads.threadid()) poptask(W) result = try_yieldto(ensure_rescheduled) process_events() diff --git a/doc/src/manual/multi-threading.md b/doc/src/manual/multi-threading.md index 55140c8938b8a..bf0ac72022c14 100644 --- a/doc/src/manual/multi-threading.md +++ b/doc/src/manual/multi-threading.md @@ -361,7 +361,7 @@ There are a few approaches to dealing with this problem: 3. A related third strategy is to use a yield-free queue. We don't currently have a lock-free queue implemented in Base, but - `Base.InvasiveLinkedListSynchronized{T}` is suitable. This can frequently be a + `Base.IntrusiveLinkedListSynchronized{T}` is suitable. This can frequently be a good strategy to use for code with event loops. For example, this strategy is employed by `Gtk.jl` to manage lifetime ref-counting. In this approach, we don't do any explicit work inside the `finalizer`, and instead add it to a queue diff --git a/src/init.c b/src/init.c index 0172a0520d038..29339a41309d2 100644 --- a/src/init.c +++ b/src/init.c @@ -733,17 +733,7 @@ static NOINLINE void _finish_julia_init(JL_IMAGE_SEARCH rel, jl_ptls_t ptls, jl_ post_boot_hooks(); } - if (jl_base_module != NULL) { - // Do initialization needed before starting child threads - jl_value_t *f = jl_get_global(jl_base_module, jl_symbol("__preinit_threads__")); - if (f) { - size_t last_age = ct->world_age; - ct->world_age = jl_get_world_counter(); - jl_apply(&f, 1); - ct->world_age = last_age; - } - } - else { + if (jl_base_module == NULL) { // nthreads > 1 requires code in Base jl_n_threads = 1; } diff --git a/src/partr.c b/src/partr.c index 8c26b46990cac..c8988875c306d 100644 --- a/src/partr.c +++ b/src/partr.c @@ -79,6 +79,7 @@ extern int jl_gc_mark_queue_obj_explicit(jl_gc_mark_cache_t *gc_cache, JL_DLLEXPORT uint32_t jl_rand_ptls(uint32_t max, uint32_t unbias) { jl_ptls_t ptls = jl_current_task->ptls; + // one-extend unbias back to 64-bits return cong(max, -(uint64_t)-unbias, &ptls->rngseed); } diff --git a/test/threads_exec.jl b/test/threads_exec.jl index ca8ec03b685e4..9cd5992d90a74 100644 --- a/test/threads_exec.jl +++ b/test/threads_exec.jl @@ -588,12 +588,12 @@ function test_thread_too_few_iters() end test_thread_too_few_iters() -@testset "InvasiveLinkedList" begin - @test eltype(Base.InvasiveLinkedList{Integer}) == Integer +@testset "IntrusiveLinkedList" begin + @test eltype(Base.IntrusiveLinkedList{Integer}) == Integer @test eltype(Base.LinkedList{Integer}) == Integer - @test eltype(Base.InvasiveLinkedList{<:Integer}) == Any + @test eltype(Base.IntrusiveLinkedList{<:Integer}) == Any @test eltype(Base.LinkedList{<:Integer}) == Any - @test eltype(Base.InvasiveLinkedList{<:Base.LinkedListItem{Integer}}) == Any + @test eltype(Base.IntrusiveLinkedList{<:Base.LinkedListItem{Integer}}) == Any t = Base.LinkedList{Integer}() @test eltype(t) == Integer From b0d873f4a67bb5f0939af58544039c45ef841c62 Mon Sep 17 00:00:00 2001 From: K Pamnany Date: Fri, 9 Dec 2022 18:16:11 -0500 Subject: [PATCH 357/369] task-priority.patch Fix task ordering problem. --- base/partr.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/partr.jl b/base/partr.jl index debf38fb72930..8a0544215c866 100644 --- a/base/partr.jl +++ b/base/partr.jl @@ -48,7 +48,7 @@ function multiq_sift_down(heap::taskheap, idx::Int32) for child = (heap_d * idx - heap_d + Int32(2)):(heap_d * idx + Int32(1)) child > length(heap.tasks) && break if isassigned(heap.tasks, Int(child)) && - heap.tasks[child].priority < heap.tasks[idx].priority + heap.tasks[child].priority <= heap.tasks[idx].priority t = heap.tasks[idx] heap.tasks[idx] = heap.tasks[child] heap.tasks[child] = t From 87ccc4802eb37046f01b2555041a6c593db7eedf Mon Sep 17 00:00:00 2001 From: K Pamnany Date: Fri, 9 Dec 2022 18:21:41 -0500 Subject: [PATCH 358/369] 42340.patch (edited) Use uv_thread_getaffinity to bound nthreads. --- NEWS.md | 2 ++ doc/man/julia.1 | 8 +++++++- doc/src/manual/command-line-options.md | 4 +++- doc/src/manual/multi-threading.md | 4 ++-- src/jloptions.c | 11 ++++++++--- src/julia_internal.h | 1 + src/sys.c | 23 ++++++++++++++++++++++ src/threading.c | 4 ++-- test/threads.jl | 27 ++++++++++++++++++++++++++ 9 files changed, 75 insertions(+), 9 deletions(-) diff --git a/NEWS.md b/NEWS.md index 91fb4bf6d3b5f..a78249ed95182 100644 --- a/NEWS.md +++ b/NEWS.md @@ -73,6 +73,8 @@ Command-line option changes code when building a system image. The resulting image will only work if `--compile=all` is used, or if all needed code is precompiled ([#42925]). * When the program file is `-` the code to be executed is read from standard in ([#43191]). +* In Linux and Windows, `--threads=auto` now tries to infer usable number of CPUs from the + process affinity which is set typically in HPC and cloud environments ([#42340]). Multi-threading changes ----------------------- diff --git a/doc/man/julia.1 b/doc/man/julia.1 index 249c8e0bd214e..9423cffd45cd4 100644 --- a/doc/man/julia.1 +++ b/doc/man/julia.1 @@ -110,7 +110,13 @@ Load immediately on all processors .TP -t, --threads -Enable n threads +Enable n threads; "auto" tries to infer a useful default number +of threads to use but the exact behavior might change in the future. +Currently, "auto" uses the number of CPUs assigned to this julia +process based on the OS-specific affinity assignment interface, if +supported (Linux and Windows). If this is not supported (macOS) or +process affinity is not configured, it uses the number of CPU +threads. .TP -p, --procs {N|auto} diff --git a/doc/src/manual/command-line-options.md b/doc/src/manual/command-line-options.md index f171386604708..093528fb1c9a0 100644 --- a/doc/src/manual/command-line-options.md +++ b/doc/src/manual/command-line-options.md @@ -89,7 +89,7 @@ The following is a complete list of command-line switches available when launchi |`-e`, `--eval ` |Evaluate ``| |`-E`, `--print ` |Evaluate `` and display the result| |`-L`, `--load ` |Load `` immediately on all processors| -|`-t`, `--threads {N\|auto`} |Enable N threads; `auto` currently sets N to the number of local CPU threads but this might change in the future| +|`-t`, `--threads {N\|auto`} |Enable N threads; `auto` tries to infer a useful default number of threads to use but the exact behavior might change in the future. Currently, `auto` uses the number of CPUs assigned to this julia process based on the OS-specific affinity assignment interface, if supported (Linux and Windows). If this is not supported (macOS) or process affinity is not configured, it uses the number of CPU threads.| |`-p`, `--procs {N\|auto`} |Integer value N launches N additional local worker processes; `auto` launches as many workers as the number of local CPU threads (logical cores)| |`--machine-file ` |Run processes on hosts listed in ``| |`-i` |Interactive mode; REPL runs and `isinteractive()` is true| @@ -124,6 +124,8 @@ The following is a complete list of command-line switches available when launchi |`--image-codegen` |Force generate code in imaging mode| + + !!! compat "Julia 1.1" In Julia 1.0, the default `--project=@.` option did not search up from the root directory of a Git repository for the `Project.toml` file. From Julia 1.1 forward, it diff --git a/doc/src/manual/multi-threading.md b/doc/src/manual/multi-threading.md index bf0ac72022c14..1289c7e5c6e84 100644 --- a/doc/src/manual/multi-threading.md +++ b/doc/src/manual/multi-threading.md @@ -19,8 +19,8 @@ The number of execution threads is controlled either by using the specified, then `-t`/`--threads` takes precedence. The number of threads can either be specified as an integer (`--threads=4`) or as `auto` -(`--threads=auto`), where `auto` sets the number of threads to the number of local CPU -threads. +(`--threads=auto`), where `auto` tries to infer a useful default number of threads to use +(see [Command-line Options](@id command-line-options) for more details). !!! compat "Julia 1.5" The `-t`/`--threads` command line argument requires at least Julia 1.5. diff --git a/src/jloptions.c b/src/jloptions.c index 978da79c1e95d..925e8a54f6163 100644 --- a/src/jloptions.c +++ b/src/jloptions.c @@ -112,8 +112,13 @@ static const char opts[] = " -L, --load Load immediately on all processors\n\n" // parallel options - " -t, --threads {N|auto} Enable N threads; \"auto\" currently sets N to the number of local\n" - " CPU threads but this might change in the future\n" + " -t, --threads {N|auto} Enable N threads; \"auto\" tries to infer a useful default number\n" + " of threads to use but the exact behavior might change in the future.\n" + " Currently, \"auto\" uses the number of CPUs assigned to this julia\n" + " process based on the OS-specific affinity assignment interface, if\n" + " supported (Linux and Windows). If this is not supported (macOS) or\n" + " process affinity is not configured, it uses the number of CPU\n" + " threads.\n" " -p, --procs {N|auto} Integer value N launches N additional local worker processes\n" " \"auto\" launches as many workers as the number of local CPU threads (logical cores)\n" " --machine-file Run processes on hosts listed in \n\n" @@ -456,7 +461,7 @@ JL_DLLEXPORT void jl_parse_opts(int *argcp, char ***argvp) case 'p': // procs errno = 0; if (!strcmp(optarg,"auto")) { - jl_options.nprocs = jl_cpu_threads(); + jl_options.nprocs = jl_effective_threads(); } else { long nprocs = strtol(optarg, &endptr, 10); diff --git a/src/julia_internal.h b/src/julia_internal.h index a7e9c0af2ad3d..21e0ebaaf58ab 100644 --- a/src/julia_internal.h +++ b/src/julia_internal.h @@ -772,6 +772,7 @@ extern JL_DLLEXPORT ssize_t jl_tls_offset; extern JL_DLLEXPORT const int jl_tls_elf_support; void jl_init_threading(void); void jl_start_threads(void); +int jl_effective_threads(void); // Whether the GC is running extern char *jl_safepoint_pages; diff --git a/src/sys.c b/src/sys.c index 6cf015eb05c1d..27ace8f963acc 100644 --- a/src/sys.c +++ b/src/sys.c @@ -661,6 +661,29 @@ JL_DLLEXPORT int jl_cpu_threads(void) JL_NOTSAFEPOINT #endif } +int jl_effective_threads(void) JL_NOTSAFEPOINT +{ + int cpu = jl_cpu_threads(); + int masksize = uv_cpumask_size(); + if (masksize < 0 || jl_running_under_rr(0)) + return cpu; + uv_thread_t tid = uv_thread_self(); + char *cpumask = (char *)calloc(masksize, sizeof(char)); + int err = uv_thread_getaffinity(&tid, cpumask, masksize); + if (err) { + free(cpumask); + jl_safe_printf("WARNING: failed to get thread affinity (%s %d)\n", uv_err_name(err), + err); + return cpu; + } + int n = 0; + for (size_t i = 0; i < masksize; i++) { + n += cpumask[i]; + } + free(cpumask); + return n < cpu ? n : cpu; +} + // -- high resolution timers -- // Returns time in nanosec diff --git a/src/threading.c b/src/threading.c index c8c0b7d5cfa8f..b0757ad106dec 100644 --- a/src/threading.c +++ b/src/threading.c @@ -455,7 +455,7 @@ void jl_init_threading(void) // how many threads available, usable jl_n_threads = JULIA_NUM_THREADS; if (jl_options.nthreads < 0) { // --threads=auto - jl_n_threads = jl_cpu_threads(); + jl_n_threads = jl_effective_threads(); } else if (jl_options.nthreads > 0) { // --threads=N jl_n_threads = jl_options.nthreads; @@ -464,7 +464,7 @@ void jl_init_threading(void) if (strcmp(cp, "auto")) jl_n_threads = (uint64_t)strtol(cp, NULL, 10); // ENV[NUM_THREADS_NAME] == "N" else - jl_n_threads = jl_cpu_threads(); // ENV[NUM_THREADS_NAME] == "auto" + jl_n_threads = jl_effective_threads(); // ENV[NUM_THREADS_NAME] == "auto" } if (jl_n_threads <= 0) jl_n_threads = 1; diff --git a/test/threads.jl b/test/threads.jl index 8322bcfa2ebbd..88fbbe18e5cf7 100644 --- a/test/threads.jl +++ b/test/threads.jl @@ -105,6 +105,33 @@ if AFFINITY_SUPPORTED end end +function get_nthreads(options = ``; cpus = nothing) + cmd = `$(Base.julia_cmd()) --startup-file=no $(options)` + cmd = `$cmd -e "print(Threads.nthreads())"` + cmd = addenv(cmd, "JULIA_EXCLUSIVE" => "0", "JULIA_NUM_THREADS" => "auto") + if cpus !== nothing + cmd = setcpuaffinity(cmd, cpus) + end + return parse(Int, read(cmd, String)) +end + +@testset "nthreads determined based on CPU affinity" begin + if AFFINITY_SUPPORTED && Sys.CPU_THREADS ≥ 2 + @test get_nthreads() ≥ 2 + @test get_nthreads(cpus = [1]) == 1 + @test get_nthreads(cpus = [2]) == 1 + @test get_nthreads(cpus = [1, 2]) == 2 + @test get_nthreads(`-t1`, cpus = [1]) == 1 + @test get_nthreads(`-t1`, cpus = [2]) == 1 + @test get_nthreads(`-t1`, cpus = [1, 2]) == 1 + + if Sys.CPU_THREADS ≥ 3 + @test get_nthreads(cpus = [1, 3]) == 2 + @test get_nthreads(cpus = [2, 3]) == 2 + end + end +end + # issue #34769 function idle_callback(handle) idle = @Base.handle_as handle UvTestIdle From 4221662765d093703cd2875ac3b5d34e8233b726 Mon Sep 17 00:00:00 2001 From: K Pamnany Date: Fri, 9 Dec 2022 18:23:09 -0500 Subject: [PATCH 359/369] 44747.patch Use correct variable for threads auto. --- src/jl_exported_funcs.inc | 1 + src/julia.h | 1 + src/sys.c | 2 +- test/cmdlineargs.jl | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/jl_exported_funcs.inc b/src/jl_exported_funcs.inc index 6663b3ebd0f99..2ddc44705b967 100644 --- a/src/jl_exported_funcs.inc +++ b/src/jl_exported_funcs.inc @@ -103,6 +103,7 @@ XX(jl_copy_ast) \ XX(jl_copy_code_info) \ XX(jl_cpu_threads) \ + XX(jl_effective_threads) \ XX(jl_crc32c_sw) \ XX(jl_create_system_image) \ XX(jl_cstr_to_string) \ diff --git a/src/julia.h b/src/julia.h index 7d99ab641ea4f..8ae843f381fa9 100644 --- a/src/julia.h +++ b/src/julia.h @@ -1642,6 +1642,7 @@ JL_DLLEXPORT int jl_errno(void) JL_NOTSAFEPOINT; JL_DLLEXPORT void jl_set_errno(int e) JL_NOTSAFEPOINT; JL_DLLEXPORT int32_t jl_stat(const char *path, char *statbuf) JL_NOTSAFEPOINT; JL_DLLEXPORT int jl_cpu_threads(void) JL_NOTSAFEPOINT; +JL_DLLEXPORT int jl_effective_threads(void) JL_NOTSAFEPOINT; JL_DLLEXPORT long jl_getpagesize(void) JL_NOTSAFEPOINT; JL_DLLEXPORT long jl_getallocationgranularity(void) JL_NOTSAFEPOINT; JL_DLLEXPORT int jl_is_debugbuild(void) JL_NOTSAFEPOINT; diff --git a/src/sys.c b/src/sys.c index 27ace8f963acc..31981241ec290 100644 --- a/src/sys.c +++ b/src/sys.c @@ -661,7 +661,7 @@ JL_DLLEXPORT int jl_cpu_threads(void) JL_NOTSAFEPOINT #endif } -int jl_effective_threads(void) JL_NOTSAFEPOINT +JL_DLLEXPORT int jl_effective_threads(void) JL_NOTSAFEPOINT { int cpu = jl_cpu_threads(); int masksize = uv_cpumask_size(); diff --git a/test/cmdlineargs.jl b/test/cmdlineargs.jl index bf6b696948fff..9be112bf5a64c 100644 --- a/test/cmdlineargs.jl +++ b/test/cmdlineargs.jl @@ -229,7 +229,7 @@ let exename = `$(Base.julia_cmd()) --startup-file=no --color=no` # -t, --threads code = "print(Threads.nthreads())" - cpu_threads = ccall(:jl_cpu_threads, Int32, ()) + cpu_threads = ccall(:jl_effective_threads, Int32, ()) @test string(cpu_threads) == read(`$exename --threads auto -e $code`, String) == read(`$exename --threads=auto -e $code`, String) == From 0db279d617b16178e26153cbfecb1ff1e0fc7ad5 Mon Sep 17 00:00:00 2001 From: K Pamnany Date: Fri, 9 Dec 2022 18:26:57 -0500 Subject: [PATCH 360/369] 42302.patch (edited) Add threadpool support to runtime. --- base/options.jl | 6 +- base/partr.jl | 78 +++++++++++--------- base/task.jl | 4 ++ base/threadcall.jl | 2 +- base/threadingconstructs.jl | 104 +++++++++++++++++++++------ doc/src/base/multi-threading.md | 4 +- doc/src/manual/multi-threading.md | 56 ++++++++++++++- src/jl_exported_data.inc | 2 + src/jl_exported_funcs.inc | 3 + src/jloptions.c | 63 ++++++++++++---- src/jloptions.h | 4 +- src/julia.h | 7 +- src/julia_threads.h | 3 +- src/options.h | 3 + src/partr.c | 11 ++- src/task.c | 7 ++ src/threading.c | 76 +++++++++++++++----- test/llvmpasses/alloc-opt-gcframe.jl | 2 +- test/llvmpasses/late-lower-gc.ll | 4 +- test/misc.jl | 4 +- test/threadpool_latency.jl | 50 +++++++++++++ test/threadpool_use.jl | 16 +++++ test/threads.jl | 17 +++++ 23 files changed, 428 insertions(+), 98 deletions(-) create mode 100644 test/threadpool_latency.jl create mode 100644 test/threadpool_use.jl diff --git a/base/options.jl b/base/options.jl index 9d08af940136f..63f73982b2e8e 100644 --- a/base/options.jl +++ b/base/options.jl @@ -1,6 +1,6 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license -# NOTE: This type needs to be kept in sync with jl_options in src/julia.h +# NOTE: This type needs to be kept in sync with jl_options in src/jloptions.h struct JLOptions quiet::Int8 banner::Int8 @@ -9,7 +9,9 @@ struct JLOptions commands::Ptr{Ptr{UInt8}} # (e)eval, (E)print, (L)load image_file::Ptr{UInt8} cpu_target::Ptr{UInt8} - nthreads::Int32 + nthreadpools::Int16 + nthreads::Int16 + nthreads_per_pool::Ptr{Int16} nprocs::Int32 machine_file::Ptr{UInt8} project::Ptr{UInt8} diff --git a/base/partr.jl b/base/partr.jl index 8a0544215c866..4bf916abb4ba6 100644 --- a/base/partr.jl +++ b/base/partr.jl @@ -2,7 +2,7 @@ module Partr -using ..Threads: SpinLock, nthreads +using ..Threads: SpinLock, nthreads, threadid # a task minheap mutable struct taskheap @@ -16,12 +16,13 @@ end # multiqueue minheap state const heap_d = UInt32(8) -global heaps::Vector{taskheap} = Vector{taskheap}(undef, 0) -const heaps_lock = SpinLock() -global cong_unbias::UInt32 = typemax(UInt32) +const heaps = [Vector{taskheap}(undef, 0), Vector{taskheap}(undef, 0)] +const heaps_lock = [SpinLock(), SpinLock()] +const cong_unbias = [typemax(UInt32), typemax(UInt32)] -cong(max::UInt32, unbias::UInt32) = ccall(:jl_rand_ptls, UInt32, (UInt32, UInt32), max, unbias) + UInt32(1) +cong(max::UInt32, unbias::UInt32) = + ccall(:jl_rand_ptls, UInt32, (UInt32, UInt32), max, unbias) + UInt32(1) function unbias_cong(max::UInt32) return typemax(UInt32) - ((typemax(UInt32) % max) + UInt32(1)) @@ -59,30 +60,32 @@ function multiq_sift_down(heap::taskheap, idx::Int32) end -function multiq_size() +function multiq_size(tpid::Int8) + nt = UInt32(Threads._nthreads_in_pool(tpid)) + tp = tpid + 1 + tpheaps = heaps[tp] heap_c = UInt32(2) - heap_p = UInt32(length(heaps)) - nt = UInt32(nthreads()) + heap_p = UInt32(length(tpheaps)) if heap_c * nt <= heap_p return heap_p end - @lock heaps_lock begin - heap_p = UInt32(length(heaps)) - nt = UInt32(nthreads()) + @lock heaps_lock[tp] begin + heap_p = UInt32(length(tpheaps)) + nt = UInt32(Threads._nthreads_in_pool(tpid)) if heap_c * nt <= heap_p return heap_p end heap_p += heap_c * nt newheaps = Vector{taskheap}(undef, heap_p) - copyto!(newheaps, heaps) - for i = (1 + length(heaps)):heap_p + copyto!(newheaps, tpheaps) + for i = (1 + length(tpheaps)):heap_p newheaps[i] = taskheap() end - global heaps = newheaps - global cong_unbias = unbias_cong(heap_p) + heaps[tp] = newheaps + cong_unbias[tp] = unbias_cong(heap_p) end return heap_p @@ -90,15 +93,19 @@ end function multiq_insert(task::Task, priority::UInt16) + tpid = ccall(:jl_get_task_threadpoolid, Int8, (Any,), task) + heap_p = multiq_size(tpid) + tp = tpid + 1 + task.priority = priority - heap_p = multiq_size() - rn = cong(heap_p, cong_unbias) - while !trylock(heaps[rn].lock) - rn = cong(heap_p, cong_unbias) + rn = cong(heap_p, cong_unbias[tp]) + tpheaps = heaps[tp] + while !trylock(tpheaps[rn].lock) + rn = cong(heap_p, cong_unbias[tp]) end - heap = heaps[rn] + heap = tpheaps[rn] if heap.ntasks >= length(heap.tasks) resize!(heap.tasks, length(heap.tasks) * 2) end @@ -121,34 +128,37 @@ function multiq_deletemin() local rn1, rn2 local prio1, prio2 + tid = Threads.threadid() + tp = ccall(:jl_threadpoolid, Int8, (Int16,), tid-1) + 1 + tpheaps = heaps[tp] + @label retry GC.safepoint() - heap_p = UInt32(length(heaps)) + heap_p = UInt32(length(tpheaps)) for i = UInt32(0):heap_p if i == heap_p return nothing end - rn1 = cong(heap_p, cong_unbias) - rn2 = cong(heap_p, cong_unbias) - prio1 = heaps[rn1].priority - prio2 = heaps[rn2].priority + rn1 = cong(heap_p, cong_unbias[tp]) + rn2 = cong(heap_p, cong_unbias[tp]) + prio1 = tpheaps[rn1].priority + prio2 = tpheaps[rn2].priority if prio1 > prio2 prio1 = prio2 rn1 = rn2 elseif prio1 == prio2 && prio1 == typemax(UInt16) continue end - if trylock(heaps[rn1].lock) - if prio1 == heaps[rn1].priority + if trylock(tpheaps[rn1].lock) + if prio1 == tpheaps[rn1].priority break end - unlock(heaps[rn1].lock) + unlock(tpheaps[rn1].lock) end end - heap = heaps[rn1] + heap = tpheaps[rn1] task = heap.tasks[1] - tid = Threads.threadid() if ccall(:jl_set_task_tid, Cint, (Any, Cint), task, tid-1) == 0 unlock(heap.lock) @goto retry @@ -170,9 +180,11 @@ end function multiq_check_empty() - for i = UInt32(1):length(heaps) - if heaps[i].ntasks != 0 - return false + for j = UInt32(1):length(heaps) + for i = UInt32(1):length(heaps[j]) + if heaps[j][i].ntasks != 0 + return false + end end end return true diff --git a/base/task.jl b/base/task.jl index f13ed9c02cfe4..d7b144150301c 100644 --- a/base/task.jl +++ b/base/task.jl @@ -251,6 +251,10 @@ true istaskfailed(t::Task) = (load_state_acquire(t) === task_state_failed) Threads.threadid(t::Task) = Int(ccall(:jl_get_task_tid, Int16, (Any,), t)+1) +function Threads.threadpool(t::Task) + tpid = ccall(:jl_get_task_threadpoolid, Int8, (Any,), t) + return tpid == 0 ? :default : :interactive +end task_result(t::Task) = t.result diff --git a/base/threadcall.jl b/base/threadcall.jl index f0e5f336ec0ca..45965fdbc6c65 100644 --- a/base/threadcall.jl +++ b/base/threadcall.jl @@ -9,7 +9,7 @@ const threadcall_restrictor = Semaphore(max_ccall_threads) The `@threadcall` macro is called in the same way as [`ccall`](@ref) but does the work in a different thread. This is useful when you want to call a blocking C -function without causing the main `julia` thread to become blocked. Concurrency +function without causing the current `julia` thread to become blocked. Concurrency is limited by size of the libuv thread pool, which defaults to 4 threads but can be increased by setting the `UV_THREADPOOL_SIZE` environment variable and restarting the `julia` process. diff --git a/base/threadingconstructs.jl b/base/threadingconstructs.jl index a3413701fb7de..b4c5c22c5cf8e 100644 --- a/base/threadingconstructs.jl +++ b/base/threadingconstructs.jl @@ -1,26 +1,62 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license -export threadid, nthreads, @threads, @spawn +export threadid, nthreads, @threads, @spawn, + threadpool, nthreadpools """ - Threads.threadid() + Threads.threadid() -> Int -Get the ID number of the current thread of execution. The master thread has ID `1`. +Get the ID number of the current thread of execution. The master thread has +ID `1`. """ threadid() = Int(ccall(:jl_threadid, Int16, ())+1) -# Inclusive upper bound on threadid() """ - Threads.nthreads() + Threads.nthreads([:default|:interactive]) -> Int -Get the number of threads available to the Julia process. This is the inclusive upper bound -on [`threadid()`](@ref). +Get the number of threads (across all thread pools or within the specified +thread pool) available to Julia. The number of threads across all thread +pools is the inclusive upper bound on [`threadid()`](@ref). See also: `BLAS.get_num_threads` and `BLAS.set_num_threads` in the [`LinearAlgebra`](@ref man-linalg) standard library, and `nprocs()` in the [`Distributed`](@ref man-distributed) standard library. """ +function nthreads end + nthreads() = Int(unsafe_load(cglobal(:jl_n_threads, Cint))) +function nthreads(pool::Symbol) + if pool == :default + tpid = Int8(0) + elseif pool == :interactive + tpid = Int8(1) + else + error("invalid threadpool specified") + end + return _nthreads_in_pool(tpid) +end +function _nthreads_in_pool(tpid::Int8) + p = unsafe_load(cglobal(:jl_n_threads_per_pool, Ptr{Cint})) + return Int(unsafe_load(p, tpid + 1)) +end + +""" + Threads.threadpool(tid = threadid()) -> Symbol + +Returns the specified thread's threadpool; either `:default` or `:interactive`. +""" +function threadpool(tid = threadid()) + tpid = ccall(:jl_threadpoolid, Int8, (Int16,), tid-1) + return tpid == 0 ? :default : :interactive +end + +""" + Threads.nthreadpools() -> Int + +Returns the number of threadpools currently configured. +""" +nthreadpools() = Int(unsafe_load(cglobal(:jl_n_threadpools, Cint))) + function threading_run(fun, static) ccall(:jl_enter_threaded_region, Cvoid, ()) @@ -48,7 +84,7 @@ function _threadsfor(iter, lbody, schedule) quote local threadsfor_fun let range = $(esc(range)) - function threadsfor_fun(tid=1; onethread=false) + function threadsfor_fun(tid = 1; onethread = false) r = range # Load into local variable lenr = length(r) # divide loop iterations among threads @@ -232,35 +268,63 @@ macro threads(args...) end """ - Threads.@spawn expr + Threads.@spawn [:default|:interactive] expr -Create a [`Task`](@ref) and [`schedule`](@ref) it to run on any available thread. -The task is allocated to a thread after it becomes available. To wait for the task -to finish, call [`wait`](@ref) on the result of this macro, or call [`fetch`](@ref) to -wait and then obtain its return value. +Create a [`Task`](@ref) and [`schedule`](@ref) it to run on any available +thread in the specified threadpool (`:default` if unspecified). The task is +allocated to a thread once one becomes available. To wait for the task to +finish, call [`wait`](@ref) on the result of this macro, or call +[`fetch`](@ref) to wait and then obtain its return value. -Values can be interpolated into `@spawn` via `\$`, which copies the value directly into the -constructed underlying closure. This allows you to insert the _value_ of a variable, -isolating the asynchronous code from changes to the variable's value in the current task. +Values can be interpolated into `@spawn` via `\$`, which copies the value +directly into the constructed underlying closure. This allows you to insert +the _value_ of a variable, isolating the asynchronous code from changes to +the variable's value in the current task. !!! note - See the manual chapter on threading for important caveats. + See the manual chapter on [multi-threading](@ref man-multithreading) + for important caveats. See also the chapter on [threadpools](@ref man-threadpools). !!! compat "Julia 1.3" This macro is available as of Julia 1.3. !!! compat "Julia 1.4" Interpolating values via `\$` is available as of Julia 1.4. + +!!! compat "Julia 1.9" + A threadpool may be specified as of Julia 1.9. """ -macro spawn(expr) - letargs = Base._lift_one_interp!(expr) +macro spawn(args...) + tpid = Int8(0) + na = length(args) + if na == 2 + ttype, ex = args + if ttype isa QuoteNode + ttype = ttype.value + elseif ttype isa Symbol + # TODO: allow unquoted symbols + ttype = nothing + end + if ttype === :interactive + tpid = Int8(1) + elseif ttype !== :default + throw(ArgumentError("unsupported threadpool in @spawn: $ttype")) + end + elseif na == 1 + ex = args[1] + else + throw(ArgumentError("wrong number of arguments in @spawn")) + end + + letargs = Base._lift_one_interp!(ex) - thunk = esc(:(()->($expr))) + thunk = esc(:(()->($ex))) var = esc(Base.sync_varname) quote let $(letargs...) local task = Task($thunk) task.sticky = false + ccall(:jl_set_task_threadpoolid, Cint, (Any, Int8), task, $tpid) if $(Expr(:islocal, var)) put!($var, task) end diff --git a/doc/src/base/multi-threading.md b/doc/src/base/multi-threading.md index 6760d3f25f5d4..293857c1c6c65 100644 --- a/doc/src/base/multi-threading.md +++ b/doc/src/base/multi-threading.md @@ -6,6 +6,8 @@ Base.Threads.foreach Base.Threads.@spawn Base.Threads.threadid Base.Threads.nthreads +Base.Threads.threadpool +Base.Threads.nthreadpools ``` See also [Multi-Threading](@ref man-multithreading). @@ -49,7 +51,7 @@ Base.Threads.atomic_min! Base.Threads.atomic_fence ``` -## ccall using a threadpool (Experimental) +## ccall using a libuv threadpool (Experimental) ```@docs Base.@threadcall diff --git a/doc/src/manual/multi-threading.md b/doc/src/manual/multi-threading.md index 1289c7e5c6e84..c93cf623c3c33 100644 --- a/doc/src/manual/multi-threading.md +++ b/doc/src/manual/multi-threading.md @@ -72,7 +72,61 @@ julia> Threads.threadid() three processes have 2 threads enabled. For more fine grained control over worker threads use [`addprocs`](@ref) and pass `-t`/`--threads` as `exeflags`. -## Data-race freedom +## [Threadpools](@id man-threadpools) + +When a program's threads are busy with many tasks to run, tasks may experience +delays which may negatively affect the responsiveness and interactivity of the +program. To address this, you can specify that a task is interactive when you +[`Threads.@spawn`](@ref) it: + +```julia +using Base.Threads +@spawn :interactive f() +``` + +Interactive tasks should avoid performing high latency operations, and if they +are long duration tasks, should yield frequently. + +Julia may be started with one or more threads reserved to run interactive tasks: + +```bash +$ julia --threads 3,1 +``` + +The environment variable `JULIA_NUM_THREADS` can also be used similarly: +```bash +export JULIA_NUM_THREADS=3,1 +``` + +This starts Julia with 3 threads in the `:default` threadpool and 1 thread in +the `:interactive` threadpool: + +```julia-repl +julia> using Base.Threads + +julia> nthreads() +4 + +julia> nthreadpools() +2 + +julia> threadpool() +:default + +julia> nthreads(:interactive) +1 +``` + +Either or both numbers can be replaced with the word `auto`, which causes +Julia to choose a reasonable default. + +## Communication and synchronization + +Although Julia's threads can communicate through shared memory, it is notoriously +difficult to write correct and data-race free multi-threaded code. Julia's +[`Channel`](@ref)s are thread-safe and may be used to communicate safely. + +### Data-race freedom You are entirely responsible for ensuring that your program is data-race free, and nothing promised here can be assumed if you do not observe that diff --git a/src/jl_exported_data.inc b/src/jl_exported_data.inc index 09d2949c22489..b0994ce0a0c4a 100644 --- a/src/jl_exported_data.inc +++ b/src/jl_exported_data.inc @@ -68,6 +68,7 @@ XX(jl_method_type) \ XX(jl_methtable_type) \ XX(jl_module_type) \ + XX(jl_n_threads_per_pool) \ XX(jl_namedtuple_type) \ XX(jl_namedtuple_typename) \ XX(jl_newvarnode_type) \ @@ -128,5 +129,6 @@ // Data symbols that are defined inside the public libjulia #define JL_EXPORTED_DATA_SYMBOLS(XX) \ + XX(jl_n_threadpools, int) \ XX(jl_n_threads, int) \ XX(jl_options, jl_options_t) diff --git a/src/jl_exported_funcs.inc b/src/jl_exported_funcs.inc index 2ddc44705b967..64e6ee608ae01 100644 --- a/src/jl_exported_funcs.inc +++ b/src/jl_exported_funcs.inc @@ -236,6 +236,7 @@ XX(jl_get_safe_restore) \ XX(jl_get_size) \ XX(jl_get_task_tid) \ + XX(jl_get_task_threadpoolid) \ XX(jl_get_tls_world_age) \ XX(jl_get_UNAME) \ XX(jl_get_world_counter) \ @@ -423,6 +424,7 @@ XX(jl_set_safe_restore) \ XX(jl_set_sysimg_so) \ XX(jl_set_task_tid) \ + XX(jl_set_task_threadpoolid) \ XX(jl_set_typeinf_func) \ XX(jl_set_zero_subnormals) \ XX(jl_sigatomic_begin) \ @@ -462,6 +464,7 @@ XX(jl_task_stack_buffer) \ XX(jl_test_cpu_feature) \ XX(jl_threadid) \ + XX(jl_threadpoolid) \ XX(jl_throw) \ XX(jl_throw_out_of_memory_error) \ XX(jl_too_few_args) \ diff --git a/src/jloptions.c b/src/jloptions.c index 925e8a54f6163..20018637251f5 100644 --- a/src/jloptions.c +++ b/src/jloptions.c @@ -38,7 +38,9 @@ JL_DLLEXPORT void jl_init_options(void) NULL, // cmds NULL, // image_file (will be filled in below) NULL, // cpu_target ("native", "core2", etc...) + 0, // nthreadpools 0, // nthreads + NULL, // nthreads_per_pool 0, // nprocs NULL, // machine_file NULL, // project @@ -112,13 +114,16 @@ static const char opts[] = " -L, --load Load immediately on all processors\n\n" // parallel options - " -t, --threads {N|auto} Enable N threads; \"auto\" tries to infer a useful default number\n" - " of threads to use but the exact behavior might change in the future.\n" - " Currently, \"auto\" uses the number of CPUs assigned to this julia\n" - " process based on the OS-specific affinity assignment interface, if\n" - " supported (Linux and Windows). If this is not supported (macOS) or\n" - " process affinity is not configured, it uses the number of CPU\n" - " threads.\n" + " -t, --threads {auto|N[,auto|M]}\n" + " Enable N[+M] threads; N threads are assigned to the `default`\n" + " threadpool, and if M is specified, M threads are assigned to the\n" + " `interactive` threadpool; \"auto\" tries to infer a useful\n" + " default number of threads to use but the exact behavior might change\n" + " in the future. Currently sets N to the number of CPUs assigned to\n" + " this Julia process based on the OS-specific affinity assignment\n" + " interface if supported (Linux and Windows) or to the number of CPU\n" + " threads if not supported (MacOS) or if process affinity is not\n" + " configured, and sets M to 1.\n" " -p, --procs {N|auto} Integer value N launches N additional local worker processes\n" " \"auto\" launches as many workers as the number of local CPU threads (logical cores)\n" " --machine-file Run processes on hosts listed in \n\n" @@ -243,7 +248,7 @@ JL_DLLEXPORT void jl_parse_opts(int *argcp, char ***argvp) static const struct option longopts[] = { // exposed command line options // NOTE: This set of required arguments need to be kept in sync - // with the required arguments defined in base/client.jl `process_options()` + // with the required arguments defined in base/options.jl `struct JLOptions` { "version", no_argument, 0, 'v' }, { "help", no_argument, 0, 'h' }, { "help-hidden", no_argument, 0, opt_help_hidden }, @@ -448,15 +453,45 @@ JL_DLLEXPORT void jl_parse_opts(int *argcp, char ***argvp) break; case 't': // threads errno = 0; - if (!strcmp(optarg,"auto")) { + jl_options.nthreadpools = 1; + long nthreads = -1, nthreadsi = 0; + if (!strncmp(optarg, "auto", 4)) { jl_options.nthreads = -1; + if (optarg[4] == ',') { + if (!strncmp(&optarg[5], "auto", 4)) + nthreadsi = 1; + else { + errno = 0; + nthreadsi = strtol(&optarg[5], &endptr, 10); + if (errno != 0 || endptr == &optarg[5] || *endptr != 0 || nthreadsi < 1 || nthreadsi >= INT16_MAX) + jl_errorf("julia: -t,--threads=auto,; m must be an integer >= 1"); + } + jl_options.nthreadpools++; + } } else { - long nthreads = strtol(optarg, &endptr, 10); - if (errno != 0 || optarg == endptr || *endptr != 0 || nthreads < 1 || nthreads >= INT_MAX) - jl_errorf("julia: -t,--threads= must be an integer >= 1"); - jl_options.nthreads = (int)nthreads; + nthreads = strtol(optarg, &endptr, 10); + if (errno != 0 || optarg == endptr || nthreads < 1 || nthreads >= INT16_MAX) + jl_errorf("julia: -t,--threads=[,auto|]; n must be an integer >= 1"); + if (*endptr == ',') { + if (!strncmp(&endptr[1], "auto", 4)) + nthreadsi = 1; + else { + errno = 0; + char *endptri; + nthreadsi = strtol(&endptr[1], &endptri, 10); + if (errno != 0 || endptri == &endptr[1] || *endptri != 0 || nthreadsi < 1 || nthreadsi >= INT16_MAX) + jl_errorf("julia: -t,--threads=,; n and m must be integers >= 1"); + } + jl_options.nthreadpools++; + } + jl_options.nthreads = nthreads + nthreadsi; } + int16_t *ntpp = (int16_t *)malloc_s(jl_options.nthreadpools * sizeof(int16_t)); + ntpp[0] = (int16_t)nthreads; + if (jl_options.nthreadpools == 2) + ntpp[1] = (int16_t)nthreadsi; + jl_options.nthreads_per_pool = ntpp; break; case 'p': // procs errno = 0; @@ -465,7 +500,7 @@ JL_DLLEXPORT void jl_parse_opts(int *argcp, char ***argvp) } else { long nprocs = strtol(optarg, &endptr, 10); - if (errno != 0 || optarg == endptr || *endptr != 0 || nprocs < 1 || nprocs >= INT_MAX) + if (errno != 0 || optarg == endptr || *endptr != 0 || nprocs < 1 || nprocs >= INT16_MAX) jl_errorf("julia: -p,--procs= must be an integer >= 1"); jl_options.nprocs = (int)nprocs; } diff --git a/src/jloptions.h b/src/jloptions.h index 2425b2bb680c2..9ac681c4ffacf 100644 --- a/src/jloptions.h +++ b/src/jloptions.h @@ -13,7 +13,9 @@ typedef struct { const char **cmds; const char *image_file; const char *cpu_target; - int32_t nthreads; + int8_t nthreadpools; + int16_t nthreads; + const int16_t *nthreads_per_pool; int32_t nprocs; const char *machine_file; const char *project; diff --git a/src/julia.h b/src/julia.h index 8ae843f381fa9..83b3f5f925fb6 100644 --- a/src/julia.h +++ b/src/julia.h @@ -1649,7 +1649,9 @@ JL_DLLEXPORT int jl_is_debugbuild(void) JL_NOTSAFEPOINT; JL_DLLEXPORT jl_sym_t *jl_get_UNAME(void) JL_NOTSAFEPOINT; JL_DLLEXPORT jl_sym_t *jl_get_ARCH(void) JL_NOTSAFEPOINT; JL_DLLEXPORT jl_value_t *jl_get_libllvm(void) JL_NOTSAFEPOINT; +extern JL_DLLIMPORT int jl_n_threadpools; extern JL_DLLIMPORT int jl_n_threads; +extern JL_DLLIMPORT int *jl_n_threads_per_pool; // environment entries JL_DLLEXPORT jl_value_t *jl_environ(int i); @@ -1892,6 +1894,8 @@ typedef struct _jl_task_t { // hidden state: // id of owning thread - does not need to be defined until the task runs _Atomic(int16_t) tid; + // threadpool id + int8_t threadpoolid; // saved gc stack top for context switches jl_gcframe_t *gcstack; size_t world_age; @@ -1915,7 +1919,8 @@ typedef struct _jl_task_t { JL_DLLEXPORT jl_task_t *jl_new_task(jl_function_t*, jl_value_t*, size_t); JL_DLLEXPORT void jl_switchto(jl_task_t **pt); -JL_DLLEXPORT int jl_set_task_tid(jl_task_t *task, int tid) JL_NOTSAFEPOINT; +JL_DLLEXPORT int jl_set_task_tid(jl_task_t *task, int16_t tid) JL_NOTSAFEPOINT; +JL_DLLEXPORT int jl_set_task_threadpoolid(jl_task_t *task, int8_t tpid) JL_NOTSAFEPOINT; JL_DLLEXPORT void JL_NORETURN jl_throw(jl_value_t *e JL_MAYBE_UNROOTED); JL_DLLEXPORT void JL_NORETURN jl_rethrow(void); JL_DLLEXPORT void JL_NORETURN jl_sig_throw(void); diff --git a/src/julia_threads.h b/src/julia_threads.h index 9ad6ae089dad4..b9f0df4a701a1 100644 --- a/src/julia_threads.h +++ b/src/julia_threads.h @@ -16,7 +16,7 @@ extern "C" { JL_DLLEXPORT int16_t jl_threadid(void); -JL_DLLEXPORT void jl_threading_profile(void); +JL_DLLEXPORT int8_t jl_threadpoolid(int16_t tid) JL_NOTSAFEPOINT; // JULIA_ENABLE_THREADING may be controlled by altering JULIA_THREADS in Make.user @@ -206,6 +206,7 @@ struct _jl_bt_element_t; #define JL_MAX_BT_SIZE 80000 typedef struct _jl_tls_states_t { int16_t tid; + int8_t threadpoolid; uint64_t rngseed; volatile size_t *safepoint; _Atomic(int8_t) sleep_check_state; // read/write from foreign threads diff --git a/src/options.h b/src/options.h index 36f34654b2bd0..5a1700708d9e7 100644 --- a/src/options.h +++ b/src/options.h @@ -134,6 +134,9 @@ # define JULIA_NUM_THREADS 1 #endif +// threadpools specification +#define THREADPOOLS_NAME "JULIA_THREADPOOLS" + // affinitization behavior #define MACHINE_EXCLUSIVE_NAME "JULIA_EXCLUSIVE" #define DEFAULT_MACHINE_EXCLUSIVE 0 diff --git a/src/partr.c b/src/partr.c index c8988875c306d..c0c2e8907db92 100644 --- a/src/partr.c +++ b/src/partr.c @@ -57,7 +57,7 @@ uint64_t io_wakeup_leave; uv_mutex_t *sleep_locks; uv_cond_t *wake_signals; -JL_DLLEXPORT int jl_set_task_tid(jl_task_t *task, int tid) JL_NOTSAFEPOINT +JL_DLLEXPORT int jl_set_task_tid(jl_task_t *task, int16_t tid) JL_NOTSAFEPOINT { // Try to acquire the lock on this task. int16_t was = jl_atomic_load_relaxed(&task->tid); @@ -68,11 +68,18 @@ JL_DLLEXPORT int jl_set_task_tid(jl_task_t *task, int tid) JL_NOTSAFEPOINT return 0; } +JL_DLLEXPORT int jl_set_task_threadpoolid(jl_task_t *task, int8_t tpid) JL_NOTSAFEPOINT +{ + if (tpid < 0 || tpid >= jl_n_threadpools) + return 0; + task->threadpoolid = tpid; + return 1; +} + // GC functions used extern int jl_gc_mark_queue_obj_explicit(jl_gc_mark_cache_t *gc_cache, jl_gc_mark_sp_t *sp, jl_value_t *obj) JL_NOTSAFEPOINT; - // parallel task runtime // --- diff --git a/src/task.c b/src/task.c index f239febb409e4..a0577132eca8c 100644 --- a/src/task.c +++ b/src/task.c @@ -800,6 +800,7 @@ JL_DLLEXPORT jl_task_t *jl_new_task(jl_function_t *start, jl_value_t *completion t->started = 0; t->priority = 0; jl_atomic_store_relaxed(&t->tid, t->copy_stack ? jl_atomic_load_relaxed(&ct->tid) : -1); // copy_stacks are always pinned since they can't be moved + t->threadpoolid = ct->threadpoolid; t->ptls = NULL; t->world_age = ct->world_age; @@ -1361,6 +1362,7 @@ jl_task_t *jl_init_root_task(jl_ptls_t ptls, void *stack_lo, void *stack_hi) ct->gcstack = NULL; ct->excstack = NULL; jl_atomic_store_relaxed(&ct->tid, ptls->tid); + ct->threadpoolid = jl_threadpoolid(ptls->tid); ct->sticky = 1; ct->ptls = ptls; ct->world_age = 1; // OK to run Julia code on this task @@ -1407,6 +1409,11 @@ JL_DLLEXPORT int16_t jl_get_task_tid(jl_task_t *t) JL_NOTSAFEPOINT return jl_atomic_load_relaxed(&t->tid); } +JL_DLLEXPORT int8_t jl_get_task_threadpoolid(jl_task_t *t) +{ + return t->threadpoolid; +} + #ifdef _OS_WINDOWS_ #if defined(_CPU_X86_) diff --git a/src/threading.c b/src/threading.c index b0757ad106dec..4464406d21a76 100644 --- a/src/threading.c +++ b/src/threading.c @@ -292,13 +292,24 @@ JL_DLLEXPORT _Atomic(uint64_t) jl_cumulative_compile_time = 0; JL_DLLEXPORT _Atomic(uint64_t) jl_cumulative_recompile_time = 0; // return calling thread's ID -// Also update the suspended_threads list in signals-mach when changing the -// type of the thread id. JL_DLLEXPORT int16_t jl_threadid(void) { return jl_atomic_load_relaxed(&jl_current_task->tid); } +JL_DLLEXPORT int8_t jl_threadpoolid(int16_t tid) JL_NOTSAFEPOINT +{ + if (tid < 0 || tid >= jl_n_threads) + jl_error("invalid tid"); + int n = 0; + for (int i = 0; i < jl_n_threadpools; i++) { + n += jl_n_threads_per_pool[i]; + if (tid < n) + return (int8_t)i; + } + jl_error("internal error: couldn't determine threadpool id"); +} + jl_ptls_t jl_init_threadtls(int16_t tid) { jl_ptls_t ptls = (jl_ptls_t)calloc(1, sizeof(jl_tls_states_t)); @@ -452,22 +463,55 @@ void jl_init_threading(void) jl_check_tls(); #endif - // how many threads available, usable + // Determine how many threads and pools are requested. This may have been + // specified on the command line (and so are in `jl_options`) or by the + // environment variable. Set the globals `jl_n_threadpools`, `jl_n_threads` + // and `jl_n_threads_per_pool`. + jl_n_threadpools = 1; jl_n_threads = JULIA_NUM_THREADS; - if (jl_options.nthreads < 0) { // --threads=auto - jl_n_threads = jl_effective_threads(); - } - else if (jl_options.nthreads > 0) { // --threads=N - jl_n_threads = jl_options.nthreads; + int16_t nthreads = jl_n_threads, nthreadsi = 0; + char *endptr, *endptri; + + if (jl_options.nthreads != 0) { // --threads specified + jl_n_threadpools = jl_options.nthreadpools; + nthreads = jl_options.nthreads_per_pool[0]; + if (nthreads < 0) + nthreads = jl_effective_threads(); + if (jl_n_threadpools == 2) + nthreadsi = jl_options.nthreads_per_pool[1]; } - else if ((cp = getenv(NUM_THREADS_NAME))) { - if (strcmp(cp, "auto")) - jl_n_threads = (uint64_t)strtol(cp, NULL, 10); // ENV[NUM_THREADS_NAME] == "N" - else - jl_n_threads = jl_effective_threads(); // ENV[NUM_THREADS_NAME] == "auto" + else if ((cp = getenv(NUM_THREADS_NAME))) { // ENV[NUM_THREADS_NAME] specified + if (!strncmp(cp, "auto", 4)) { + nthreads = jl_effective_threads(); + cp += 4; + } + else { + errno = 0; + nthreads = strtol(cp, &endptr, 10); + if (errno != 0 || endptr == cp || nthreads <= 0) + nthreads = 1; + cp = endptr; + } + if (*cp == ',') { + cp++; + if (!strncmp(cp, "auto", 4)) + nthreadsi = 1; + else { + errno = 0; + nthreadsi = strtol(cp, &endptri, 10); + if (errno != 0 || endptri == cp || nthreadsi < 0) + nthreadsi = 0; + } + if (nthreadsi > 0) + jl_n_threadpools++; + } } - if (jl_n_threads <= 0) - jl_n_threads = 1; + + jl_n_threads = nthreads + nthreadsi; + jl_n_threads_per_pool = (int *)malloc(2 * sizeof(int)); + jl_n_threads_per_pool[0] = nthreads; + jl_n_threads_per_pool[1] = nthreadsi; + #ifndef __clang_gcanalyzer__ jl_all_tls_states = (jl_ptls_t*)calloc(jl_n_threads, sizeof(void*)); #endif @@ -513,7 +557,7 @@ void jl_start_threads(void) uv_barrier_init(&thread_init_done, nthreads); for (i = 1; i < nthreads; ++i) { - jl_threadarg_t *t = (jl_threadarg_t*)malloc_s(sizeof(jl_threadarg_t)); // ownership will be passed to the thread + jl_threadarg_t *t = (jl_threadarg_t *)malloc_s(sizeof(jl_threadarg_t)); // ownership will be passed to the thread t->tid = i; t->barrier = &thread_init_done; uv_thread_create(&uvtid, jl_threadfun, t); diff --git a/test/llvmpasses/alloc-opt-gcframe.jl b/test/llvmpasses/alloc-opt-gcframe.jl index 8e3de7645595e..4502400f57577 100644 --- a/test/llvmpasses/alloc-opt-gcframe.jl +++ b/test/llvmpasses/alloc-opt-gcframe.jl @@ -13,7 +13,7 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" # CHECK-LABEL: @return_obj # CHECK-NOT: @julia.gc_alloc_obj # CHECK: %current_task = getelementptr inbounds {}*, {}** %gcstack, i64 -12 -# CHECK-NEXT: [[ptls_field:%.*]] = getelementptr inbounds {}*, {}** %current_task, i64 14 +# CHECK-NEXT: [[ptls_field:%.*]] = getelementptr inbounds {}*, {}** %current_task, i64 15 # CHECK-NEXT: [[ptls_load:%.*]] = load {}*, {}** [[ptls_field]], align 8, !tbaa !0 # CHECK-NEXT: [[ppjl_ptls:%.*]] = bitcast {}* [[ptls_load]] to {}** # CHECK-NEXT: [[ptls_i8:%.*]] = bitcast {}** [[ppjl_ptls]] to i8* diff --git a/test/llvmpasses/late-lower-gc.ll b/test/llvmpasses/late-lower-gc.ll index 22cb558c54158..a0a8bb7b63682 100644 --- a/test/llvmpasses/late-lower-gc.ll +++ b/test/llvmpasses/late-lower-gc.ll @@ -41,7 +41,7 @@ top: %0 = bitcast {}*** %pgcstack to {}** %current_task = getelementptr inbounds {}*, {}** %0, i64 -12 ; CHECK: %current_task = getelementptr inbounds {}*, {}** %0, i64 -12 -; CHECK-NEXT: [[ptls_field:%.*]] = getelementptr inbounds {}*, {}** %current_task, i64 14 +; CHECK-NEXT: [[ptls_field:%.*]] = getelementptr inbounds {}*, {}** %current_task, i64 15 ; CHECK-NEXT: [[ptls_load:%.*]] = load {}*, {}** [[ptls_field]], align 8, !tbaa !0 ; CHECK-NEXT: [[ppjl_ptls:%.*]] = bitcast {}* [[ptls_load]] to {}** ; CHECK-NEXT: [[ptls_i8:%.*]] = bitcast {}** [[ppjl_ptls]] to i8* @@ -66,7 +66,7 @@ top: %0 = bitcast {}*** %pgcstack to {}** %current_task = getelementptr inbounds {}*, {}** %0, i64 -12 ; CHECK: %current_task = getelementptr inbounds {}*, {}** %0, i64 -12 -; CHECK-NEXT: [[ptls_field:%.*]] = getelementptr inbounds {}*, {}** %current_task, i64 14 +; CHECK-NEXT: [[ptls_field:%.*]] = getelementptr inbounds {}*, {}** %current_task, i64 15 ; CHECK-NEXT: [[ptls_load:%.*]] = load {}*, {}** [[ptls_field]], align 8, !tbaa !0 ; CHECK-NEXT: [[ppjl_ptls:%.*]] = bitcast {}* [[ptls_load]] to {}** ; CHECK-NEXT: [[ptls_i8:%.*]] = bitcast {}** [[ppjl_ptls]] to i8* diff --git a/test/misc.jl b/test/misc.jl index bda0566650170..a2fae4e97eae8 100644 --- a/test/misc.jl +++ b/test/misc.jl @@ -665,7 +665,7 @@ end let optstring = repr("text/plain", Base.JLOptions()) @test startswith(optstring, "JLOptions(\n") - @test !occursin("Ptr", optstring) + @test !occursin("Ptr{UInt8}", optstring) @test endswith(optstring, "\n)") @test occursin(" = \"", optstring) end @@ -673,7 +673,7 @@ let optstring = repr(Base.JLOptions()) @test startswith(optstring, "JLOptions(") @test endswith(optstring, ")") @test !occursin("\n", optstring) - @test !occursin("Ptr", optstring) + @test !occursin("Ptr{UInt8}", optstring) @test occursin(" = \"", optstring) end diff --git a/test/threadpool_latency.jl b/test/threadpool_latency.jl new file mode 100644 index 0000000000000..bdf02b81da03f --- /dev/null +++ b/test/threadpool_latency.jl @@ -0,0 +1,50 @@ +# This file is a part of Julia. License is MIT: https://julialang.org/license + +using Test +using Base.Threads + +# This test has not been added to CI as there can be unexpected delays +# which cause timing-dependent actions to fail. + +#= +Test to ensure that the interactive threadpool works as designed. + +Task A is a standard task that does a lot of work (~2 seconds) without +yielding. This would prevent ordinarily prevent other tasks from running. + +Task B is an interactive task that does a little work (~0.02 seconds) and +yields. + +With an interactive threadpool, multiple task Bs should not see notable +delays in execution even when multiple task As are occupying Julia's +default threads. + +This test should fail in the absence of an interactive thread. +=# +const N = 263000000 # busywork(N) takes ~1 sec on an i7-9750H @ 2.6GHz +function busywork(n::Int) + acc = 0 + for i = 1:n + x = rand(2:10) + acc += i * x + end + return acc +end + +function itask() + h = N ÷ 50 + for i = 1:100 + t1 = time() + busywork(h) + yield() + t2 = time() + @test t2 - t1 < 0.15 + end +end + +it1 = @spawn :interactive itask() +ti1 = @spawn busywork(N * 2); +it2 = @spawn :interactive itask() +ti2 = @spawn busywork(N * 2); +wait(it1) +wait(it2) diff --git a/test/threadpool_use.jl b/test/threadpool_use.jl new file mode 100644 index 0000000000000..92a4458ee8076 --- /dev/null +++ b/test/threadpool_use.jl @@ -0,0 +1,16 @@ +# This file is a part of Julia. License is MIT: https://julialang.org/license + +using Test +using Base.Threads + +@test nthreadpools() == 2 +@test threadpool() == :default +@test threadpool(2) == :interactive +dtask() = @test threadpool(current_task()) == :default +itask() = @test threadpool(current_task()) == :interactive +dt1 = @spawn dtask() +dt2 = @spawn :default dtask() +it = @spawn :interactive itask() +wait(dt1) +wait(dt2) +wait(it) diff --git a/test/threads.jl b/test/threads.jl index 88fbbe18e5cf7..e1340d69881f9 100644 --- a/test/threads.jl +++ b/test/threads.jl @@ -79,6 +79,23 @@ let cmd = `$(Base.julia_cmd()) --depwarn=error --rr-detach --startup-file=no thr end end +# Timing-sensitive tests can fail on CI due to occasional unexpected delays, +# so this test is disabled. +#= +let cmd = `$(Base.julia_cmd()) --depwarn=error --rr-detach --startup-file=no threadpool_latency.jl` + for test_nthreads in (1, 2) + new_env = copy(ENV) + new_env["JULIA_NUM_THREADS"] = string(test_nthreads, ",1") + run(pipeline(setenv(cmd, new_env), stdout = stdout, stderr = stderr)) + end +end +=# +let cmd = `$(Base.julia_cmd()) --depwarn=error --rr-detach --startup-file=no threadpool_use.jl` + new_env = copy(ENV) + new_env["JULIA_NUM_THREADS"] = "1,1" + run(pipeline(setenv(cmd, new_env), stdout = stdout, stderr = stderr)) +end + function run_with_affinity(cpus) script = joinpath(@__DIR__, "print_process_affinity.jl") return readchomp(setcpuaffinity(`$(Base.julia_cmd()) $script`, cpus)) From 3edd37b10613c0bfa70302c0bfa5125b47909745 Mon Sep 17 00:00:00 2001 From: K Pamnany Date: Fri, 9 Dec 2022 18:27:59 -0500 Subject: [PATCH 361/369] total-ttsp.patch Add total_time_to_safepoint GC metric. --- base/timing.jl | 3 ++- src/gc.c | 1 + src/gc.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/base/timing.jl b/base/timing.jl index a97e185b036cb..04994914049a0 100644 --- a/base/timing.jl +++ b/base/timing.jl @@ -19,7 +19,8 @@ struct GC_Num max_pause ::Int64 max_memory ::Int64 time_to_safepoint ::Int64 - max_time_to_safepointp ::Int64 + max_time_to_safepoint ::Int64 + total_time_to_safepoint ::Int64 sweep_time ::Int64 mark_time ::Int64 total_sweep_time ::Int64 diff --git a/src/gc.c b/src/gc.c index 5c4f838c6bd11..8cfd74df49809 100644 --- a/src/gc.c +++ b/src/gc.c @@ -3336,6 +3336,7 @@ JL_DLLEXPORT void jl_gc_collect(jl_gc_collection_t collection) if (duration > gc_num.max_time_to_safepoint) gc_num.max_time_to_safepoint = duration; gc_num.time_to_safepoint = duration; + gc_num.total_time_to_safepoint += duration; gc_invoke_callbacks(jl_gc_cb_pre_gc_t, gc_cblist_pre_gc, (collection)); diff --git a/src/gc.h b/src/gc.h index 00c3d48b52935..36a8f87c0b6c7 100644 --- a/src/gc.h +++ b/src/gc.h @@ -76,6 +76,7 @@ typedef struct { uint64_t max_memory; uint64_t time_to_safepoint; uint64_t max_time_to_safepoint; + uint64_t total_time_to_safepoint; uint64_t sweep_time; uint64_t mark_time; uint64_t total_sweep_time; From 2ad1e590e03fdb7b0dc341f19fcf487f9a77009d Mon Sep 17 00:00:00 2001 From: K Pamnany Date: Fri, 9 Dec 2022 18:30:19 -0500 Subject: [PATCH 362/369] 46862.patch (edited) Add heap snapshot capability. --- src/Makefile | 6 +- src/gc-debug.c | 17 +- src/gc-heap-snapshot.cpp | 506 +++++++++++++++++++++++++++++++ src/gc-heap-snapshot.h | 108 +++++++ src/gc.c | 87 ++++-- src/gc.h | 7 +- src/staticdata.c | 4 +- stdlib/Profile/docs/src/index.md | 21 ++ stdlib/Profile/src/Profile.jl | 21 ++ stdlib/Profile/test/runtests.jl | 9 + 10 files changed, 751 insertions(+), 35 deletions(-) create mode 100644 src/gc-heap-snapshot.cpp create mode 100644 src/gc-heap-snapshot.h diff --git a/src/Makefile b/src/Makefile index 475f2eb949d6e..2a46566d96568 100644 --- a/src/Makefile +++ b/src/Makefile @@ -46,7 +46,7 @@ RUNTIME_SRCS := \ dlload sys init task array dump staticdata toplevel jl_uv datatype \ simplevector runtime_intrinsics precompile \ threading partr stackwalk gc gc-debug gc-pages gc-stacks gc-alloc-profiler method \ - jlapi signal-handling safepoint timing subtype \ + jlapi signal-handling safepoint timing subtype gc-heap-snapshot \ crc32c APInt-C processor ircode opaque_closure codegen-stubs coverage SRCS := jloptions runtime_ccall rtutils ifeq ($(OS),WINNT) @@ -294,7 +294,9 @@ $(BUILDDIR)/disasm.o $(BUILDDIR)/disasm.dbg.obj: $(SRCDIR)/debuginfo.h $(SRCDIR) $(BUILDDIR)/dump.o $(BUILDDIR)/dump.dbg.obj: $(addprefix $(SRCDIR)/,common_symbols1.inc common_symbols2.inc builtin_proto.h serialize.h) $(BUILDDIR)/gc-debug.o $(BUILDDIR)/gc-debug.dbg.obj: $(SRCDIR)/gc.h $(BUILDDIR)/gc-pages.o $(BUILDDIR)/gc-pages.dbg.obj: $(SRCDIR)/gc.h -$(BUILDDIR)/gc.o $(BUILDDIR)/gc.dbg.obj: $(SRCDIR)/gc.h $(SRCDIR)/gc-alloc-profiler.h +$(BUILDDIR)/gc.o $(BUILDDIR)/gc.dbg.obj: $(SRCDIR)/gc.h $(SRCDIR)/gc-heap-snapshot.h $(SRCDIR)/gc-alloc-profiler.h +$(BUILDDIR)/gc-heap-snapshot.o $(BUILDDIR)/gc-heap-snapshot.dbg.obj: $(SRCDIR)/gc.h $(SRCDIR)/gc-heap-snapshot.h +$(BUILDDIR)/gc-alloc-profiler.o $(BUILDDIR)/gc-alloc-profiler.dbg.obj: $(SRCDIR)/gc.h $(SRCDIR)/gc-alloc-profiler.h $(BUILDDIR)/init.o $(BUILDDIR)/init.dbg.obj: $(SRCDIR)/builtin_proto.h $(BUILDDIR)/interpreter.o $(BUILDDIR)/interpreter.dbg.obj: $(SRCDIR)/builtin_proto.h $(BUILDDIR)/jitlayers.o $(BUILDDIR)/jitlayers.dbg.obj: $(SRCDIR)/jitlayers.h $(SRCDIR)/codegen_shared.h $(SRCDIR)/debug-registry.h diff --git a/src/gc-debug.c b/src/gc-debug.c index 7d6ca8ece2ecf..6484c2bd8bd07 100644 --- a/src/gc-debug.c +++ b/src/gc-debug.c @@ -1227,20 +1227,17 @@ void gc_count_pool(void) jl_safe_printf("************************\n"); } -int gc_slot_to_fieldidx(void *obj, void *slot) +int gc_slot_to_fieldidx(void *obj, void *slot, jl_datatype_t *vt) JL_NOTSAFEPOINT { - jl_datatype_t *vt = (jl_datatype_t*)jl_typeof(obj); int nf = (int)jl_datatype_nfields(vt); - for (int i = 0; i < nf; i++) { - void *fieldaddr = (char*)obj + jl_field_offset(vt, i); - if (fieldaddr >= slot) { - return i; - } + for (int i = 1; i < nf; i++) { + if (slot < (void*)((char*)obj + jl_field_offset(vt, i))) + return i - 1; } - return -1; + return nf - 1; } -int gc_slot_to_arrayidx(void *obj, void *_slot) +int gc_slot_to_arrayidx(void *obj, void *_slot) JL_NOTSAFEPOINT { char *slot = (char*)_slot; jl_datatype_t *vt = (jl_datatype_t*)jl_typeof(obj); @@ -1258,8 +1255,6 @@ int gc_slot_to_arrayidx(void *obj, void *_slot) } else if (vt->name == jl_array_typename) { jl_array_t *a = (jl_array_t*)obj; - if (!a->flags.ptrarray) - return -1; start = (char*)a->data; len = jl_array_len(a); elsize = a->elsize; diff --git a/src/gc-heap-snapshot.cpp b/src/gc-heap-snapshot.cpp new file mode 100644 index 0000000000000..2349a33cebae3 --- /dev/null +++ b/src/gc-heap-snapshot.cpp @@ -0,0 +1,506 @@ +// This file is a part of Julia. License is MIT: https://julialang.org/license + +#include "gc-heap-snapshot.h" + +#include "julia_internal.h" +#include "gc.h" + +#include "llvm/ADT/StringMap.h" +#include "llvm/ADT/DenseMap.h" + +#include +#include +#include + +using std::vector; +using std::string; +using std::ostringstream; +using std::pair; +using std::make_pair; +using llvm::StringMap; +using llvm::DenseMap; +using llvm::StringRef; + +// https://stackoverflow.com/a/33799784/751061 +void print_str_escape_json(ios_t *stream, StringRef s) +{ + ios_printf(stream, "\""); + for (auto c = s.begin(); c != s.end(); c++) { + switch (*c) { + case '"': ios_printf(stream, "\\\""); break; + case '\\': ios_printf(stream, "\\\\"); break; + case '\b': ios_printf(stream, "\\b"); break; + case '\f': ios_printf(stream, "\\f"); break; + case '\n': ios_printf(stream, "\\n"); break; + case '\r': ios_printf(stream, "\\r"); break; + case '\t': ios_printf(stream, "\\t"); break; + default: + if ('\x00' <= *c && *c <= '\x1f') { + ios_printf(stream, "\\u%04x", (int)*c); + } + else { + ios_printf(stream, "%c", *c); + } + } + } + ios_printf(stream, "\""); +} + + +// Edges +// "edge_fields": +// [ "type", "name_or_index", "to_node" ] +// mimicking https://github.com/nodejs/node/blob/5fd7a72e1c4fbaf37d3723c4c81dce35c149dc84/deps/v8/src/profiler/heap-snapshot-generator.cc#L2598-L2601 + +struct Edge { + size_t type; // These *must* match the Enums on the JS side; control interpretation of name_or_index. + size_t name_or_index; // name of the field (for objects/modules) or index of array + size_t to_node; +}; + +// Nodes +// "node_fields": +// [ "type", "name", "id", "self_size", "edge_count", "trace_node_id", "detachedness" ] +// mimicking https://github.com/nodejs/node/blob/5fd7a72e1c4fbaf37d3723c4c81dce35c149dc84/deps/v8/src/profiler/heap-snapshot-generator.cc#L2568-L2575 + +const int k_node_number_of_fields = 7; +struct Node { + size_t type; // index into snapshot->node_types + size_t name; + size_t id; // This should be a globally-unique counter, but we use the memory address + size_t self_size; + size_t trace_node_id; // This is ALWAYS 0 in Javascript heap-snapshots. + // whether the from_node is attached or dettached from the main application state + // https://github.com/nodejs/node/blob/5fd7a72e1c4fbaf37d3723c4c81dce35c149dc84/deps/v8/include/v8-profiler.h#L739-L745 + int detachedness; // 0 - unknown, 1 - attached, 2 - detached + vector edges; + + ~Node() JL_NOTSAFEPOINT = default; +}; + +struct StringTable { + StringMap map; + vector strings; + + size_t find_or_create_string_id(StringRef key) JL_NOTSAFEPOINT { + auto val = map.insert(make_pair(key, map.size())); + if (val.second) + strings.push_back(val.first->first()); + return val.first->second; + } + + void print_json_array(ios_t *stream, bool newlines) { + ios_printf(stream, "["); + bool first = true; + for (const auto &str : strings) { + if (first) { + first = false; + } + else { + ios_printf(stream, newlines ? ",\n" : ","); + } + print_str_escape_json(stream, str); + } + ios_printf(stream, "]"); + } +}; + +struct HeapSnapshot { + vector nodes; + // edges are stored on each from_node + + StringTable names; + StringTable node_types; + StringTable edge_types; + DenseMap node_ptr_to_index_map; + + size_t num_edges = 0; // For metadata, updated as you add each edge. Needed because edges owned by nodes. +}; + +// global heap snapshot, mutated by garbage collector +// when snapshotting is on. +int gc_heap_snapshot_enabled = 0; +HeapSnapshot *g_snapshot = nullptr; +extern jl_mutex_t heapsnapshot_lock; + +void serialize_heap_snapshot(ios_t *stream, HeapSnapshot &snapshot, char all_one); +static inline void _record_gc_edge(const char *node_type, const char *edge_type, + jl_value_t *a, jl_value_t *b, size_t name_or_index) JL_NOTSAFEPOINT; +void _record_gc_just_edge(const char *edge_type, Node &from_node, size_t to_idx, size_t name_or_idx) JL_NOTSAFEPOINT; +void _add_internal_root(HeapSnapshot *snapshot); + + +JL_DLLEXPORT void jl_gc_take_heap_snapshot(ios_t *stream, char all_one) +{ + HeapSnapshot snapshot; + _add_internal_root(&snapshot); + + jl_mutex_lock(&heapsnapshot_lock); + + // Enable snapshotting + g_snapshot = &snapshot; + gc_heap_snapshot_enabled = true; + + // Do a full GC mark (and incremental sweep), which will invoke our callbacks on `g_snapshot` + jl_gc_collect(JL_GC_FULL); + + // Disable snapshotting + gc_heap_snapshot_enabled = false; + g_snapshot = nullptr; + + jl_mutex_unlock(&heapsnapshot_lock); + + // When we return, the snapshot is full + // Dump the snapshot + serialize_heap_snapshot((ios_t*)stream, snapshot, all_one); +} + +// adds a node at id 0 which is the "uber root": +// a synthetic node which points to all the GC roots. +void _add_internal_root(HeapSnapshot *snapshot) +{ + Node internal_root{ + snapshot->node_types.find_or_create_string_id("synthetic"), + snapshot->names.find_or_create_string_id(""), // name + 0, // id + 0, // size + 0, // size_t trace_node_id (unused) + 0, // int detachedness; // 0 - unknown, 1 - attached; 2 - detached + vector() // outgoing edges + }; + snapshot->nodes.push_back(internal_root); +} + +// mimicking https://github.com/nodejs/node/blob/5fd7a72e1c4fbaf37d3723c4c81dce35c149dc84/deps/v8/src/profiler/heap-snapshot-generator.cc#L597-L597 +// returns the index of the new node +size_t record_node_to_gc_snapshot(jl_value_t *a) JL_NOTSAFEPOINT +{ + auto val = g_snapshot->node_ptr_to_index_map.insert(make_pair(a, g_snapshot->nodes.size())); + if (!val.second) { + return val.first->second; + } + + ios_t str_; + bool ios_need_close = 0; + + // Insert a new Node + size_t self_size = 0; + StringRef name = ""; + StringRef node_type = "object"; + + jl_datatype_t *type = (jl_datatype_t*)jl_typeof(a); + + if (jl_is_string(a)) { + node_type = "string"; + name = jl_string_data(a); + self_size = jl_string_len(a); + } + else if (jl_is_symbol(a)) { + node_type = "symbol"; + name = jl_symbol_name((jl_sym_t*)a); + self_size = name.size(); + } + else if (jl_is_simplevector(a)) { + node_type = "array"; + name = "SimpleVector"; + self_size = sizeof(jl_svec_t) + sizeof(void*) * jl_svec_len(a); + } + else if (jl_is_module(a)) { + name = "Module"; + self_size = sizeof(jl_module_t); + } + else if (jl_is_task(a)) { + name = "Task"; + self_size = sizeof(jl_task_t); + } + else { + self_size = jl_is_array_type(type) + ? sizeof(jl_array_t) + : (size_t)jl_datatype_size(type); + + // print full type into ios buffer and get StringRef to it. + // The ios is cleaned up below. + ios_need_close = 1; + ios_mem(&str_, 0); + JL_STREAM* str = (JL_STREAM*)&str_; + jl_static_show(str, (jl_value_t*)type); + + name = StringRef((const char*)str_.buf, str_.size); + } + + g_snapshot->nodes.push_back(Node{ + g_snapshot->node_types.find_or_create_string_id(node_type), // size_t type; + g_snapshot->names.find_or_create_string_id(name), // size_t name; + (size_t)a, // size_t id; + // We add 1 to self-size for the type tag that all heap-allocated objects have. + // Also because the Chrome Snapshot viewer ignores size-0 leaves! + sizeof(void*) + self_size, // size_t self_size; + 0, // size_t trace_node_id (unused) + 0, // int detachedness; // 0 - unknown, 1 - attached; 2 - detached + vector() // outgoing edges + }); + + if (ios_need_close) + ios_close(&str_); + + return val.first->second; +} + +static size_t record_pointer_to_gc_snapshot(void *a, size_t bytes, StringRef name) JL_NOTSAFEPOINT +{ + auto val = g_snapshot->node_ptr_to_index_map.insert(make_pair(a, g_snapshot->nodes.size())); + if (!val.second) { + return val.first->second; + } + + g_snapshot->nodes.push_back(Node{ + g_snapshot->node_types.find_or_create_string_id( "object"), // size_t type; + g_snapshot->names.find_or_create_string_id(name), // size_t name; + (size_t)a, // size_t id; + bytes, // size_t self_size; + 0, // size_t trace_node_id (unused) + 0, // int detachedness; // 0 - unknown, 1 - attached; 2 - detached + vector() // outgoing edges + }); + + return val.first->second; +} + +static string _fieldpath_for_slot(void *obj, void *slot) JL_NOTSAFEPOINT +{ + string res; + jl_datatype_t *objtype = (jl_datatype_t*)jl_typeof(obj); + + while (1) { + int i = gc_slot_to_fieldidx(obj, slot, objtype); + + if (jl_is_tuple_type(objtype) || jl_is_namedtuple_type(objtype)) { + ostringstream ss; + ss << "[" << i << "]"; + res += ss.str(); + } + else { + jl_svec_t *field_names = jl_field_names(objtype); + jl_sym_t *name = (jl_sym_t*)jl_svecref(field_names, i); + res += jl_symbol_name(name); + } + + if (!jl_field_isptr(objtype, i)) { + // Tail recurse + res += "."; + obj = (void*)((char*)obj + jl_field_offset(objtype, i)); + objtype = (jl_datatype_t*)jl_field_type_concrete(objtype, i); + } + else { + return res; + } + } +} + + +void _gc_heap_snapshot_record_root(jl_value_t *root, char *name) JL_NOTSAFEPOINT +{ + record_node_to_gc_snapshot(root); + + auto &internal_root = g_snapshot->nodes.front(); + auto to_node_idx = g_snapshot->node_ptr_to_index_map[root]; + auto edge_label = g_snapshot->names.find_or_create_string_id(name); + + _record_gc_just_edge("internal", internal_root, to_node_idx, edge_label); +} + +// Add a node to the heap snapshot representing a Julia stack frame. +// Each task points at a stack frame, which points at the stack frame of +// the function it's currently calling, forming a linked list. +// Stack frame nodes point at the objects they have as local variables. +size_t _record_stack_frame_node(HeapSnapshot *snapshot, void *frame) JL_NOTSAFEPOINT +{ + auto val = g_snapshot->node_ptr_to_index_map.insert(make_pair(frame, g_snapshot->nodes.size())); + if (!val.second) { + return val.first->second; + } + + snapshot->nodes.push_back(Node{ + snapshot->node_types.find_or_create_string_id("synthetic"), + snapshot->names.find_or_create_string_id("(stack frame)"), // name + (size_t)frame, // id + 1, // size + 0, // size_t trace_node_id (unused) + 0, // int detachedness; // 0 - unknown, 1 - attached; 2 - detached + vector() // outgoing edges + }); + + return val.first->second; +} + +void _gc_heap_snapshot_record_frame_to_object_edge(void *from, jl_value_t *to) JL_NOTSAFEPOINT +{ + auto from_node_idx = _record_stack_frame_node(g_snapshot, (jl_gcframe_t*)from); + auto to_idx = record_node_to_gc_snapshot(to); + Node &from_node = g_snapshot->nodes[from_node_idx]; + + auto name_idx = g_snapshot->names.find_or_create_string_id("local var"); + _record_gc_just_edge("internal", from_node, to_idx, name_idx); +} + +void _gc_heap_snapshot_record_task_to_frame_edge(jl_task_t *from, void *to) JL_NOTSAFEPOINT +{ + auto from_node_idx = record_node_to_gc_snapshot((jl_value_t*)from); + auto to_node_idx = _record_stack_frame_node(g_snapshot, to); + Node &from_node = g_snapshot->nodes[from_node_idx]; + + auto name_idx = g_snapshot->names.find_or_create_string_id("stack"); + _record_gc_just_edge("internal", from_node, to_node_idx, name_idx); +} + +void _gc_heap_snapshot_record_frame_to_frame_edge(jl_gcframe_t *from, jl_gcframe_t *to) JL_NOTSAFEPOINT +{ + auto from_node_idx = _record_stack_frame_node(g_snapshot, from); + auto to_node_idx = _record_stack_frame_node(g_snapshot, to); + Node &from_node = g_snapshot->nodes[from_node_idx]; + + auto name_idx = g_snapshot->names.find_or_create_string_id("next frame"); + _record_gc_just_edge("internal", from_node, to_node_idx, name_idx); +} + +void _gc_heap_snapshot_record_array_edge(jl_value_t *from, jl_value_t *to, size_t index) JL_NOTSAFEPOINT +{ + _record_gc_edge("array", "element", from, to, index); +} + +void _gc_heap_snapshot_record_object_edge(jl_value_t *from, jl_value_t *to, void *slot) JL_NOTSAFEPOINT +{ + string path = _fieldpath_for_slot(from, slot); + _record_gc_edge("object", "property", from, to, + g_snapshot->names.find_or_create_string_id(path)); +} + +void _gc_heap_snapshot_record_module_to_binding(jl_module_t* module, jl_binding_t* binding) JL_NOTSAFEPOINT +{ + auto from_node_idx = record_node_to_gc_snapshot((jl_value_t*)module); + auto to_node_idx = record_pointer_to_gc_snapshot(binding, sizeof(jl_binding_t), jl_symbol_name(binding->name)); + + jl_value_t *value = jl_atomic_load_relaxed(&binding->value); + auto value_idx = value ? record_node_to_gc_snapshot(value) : 0; + jl_value_t *ty = jl_atomic_load_relaxed(&binding->ty); + auto ty_idx = ty ? record_node_to_gc_snapshot(ty) : 0; + jl_value_t *globalref = jl_atomic_load_relaxed(&binding->globalref); + auto globalref_idx = globalref ? record_node_to_gc_snapshot(globalref) : 0; + + auto &from_node = g_snapshot->nodes[from_node_idx]; + auto &to_node = g_snapshot->nodes[to_node_idx]; + from_node.type = g_snapshot->node_types.find_or_create_string_id("object"); + + _record_gc_just_edge("property", from_node, to_node_idx, g_snapshot->names.find_or_create_string_id("")); + if (value_idx) _record_gc_just_edge("internal", to_node, value_idx, g_snapshot->names.find_or_create_string_id("value")); + if (ty_idx) _record_gc_just_edge("internal", to_node, ty_idx, g_snapshot->names.find_or_create_string_id("ty")); + if (globalref_idx) _record_gc_just_edge("internal", to_node, globalref_idx, g_snapshot->names.find_or_create_string_id("globalref")); +} + +void _gc_heap_snapshot_record_internal_array_edge(jl_value_t *from, jl_value_t *to) JL_NOTSAFEPOINT +{ + _record_gc_edge("object", "internal", from, to, + g_snapshot->names.find_or_create_string_id("")); +} + +void _gc_heap_snapshot_record_hidden_edge(jl_value_t *from, void* to, size_t bytes) JL_NOTSAFEPOINT +{ + size_t name_or_idx = g_snapshot->names.find_or_create_string_id(""); + + auto from_node_idx = record_node_to_gc_snapshot(from); + auto to_node_idx = record_pointer_to_gc_snapshot(to, bytes, ""); + + auto &from_node = g_snapshot->nodes[from_node_idx]; + from_node.type = g_snapshot->node_types.find_or_create_string_id("native"); + + _record_gc_just_edge("hidden", from_node, to_node_idx, name_or_idx); +} + +static inline void _record_gc_edge(const char *node_type, const char *edge_type, + jl_value_t *a, jl_value_t *b, size_t name_or_idx) JL_NOTSAFEPOINT +{ + auto from_node_idx = record_node_to_gc_snapshot(a); + auto to_node_idx = record_node_to_gc_snapshot(b); + + auto &from_node = g_snapshot->nodes[from_node_idx]; + from_node.type = g_snapshot->node_types.find_or_create_string_id(node_type); + + _record_gc_just_edge(edge_type, from_node, to_node_idx, name_or_idx); +} + +void _record_gc_just_edge(const char *edge_type, Node &from_node, size_t to_idx, size_t name_or_idx) JL_NOTSAFEPOINT +{ + from_node.edges.push_back(Edge{ + g_snapshot->edge_types.find_or_create_string_id(edge_type), + name_or_idx, // edge label + to_idx // to + }); + + g_snapshot->num_edges += 1; +} + +void serialize_heap_snapshot(ios_t *stream, HeapSnapshot &snapshot, char all_one) +{ + // mimicking https://github.com/nodejs/node/blob/5fd7a72e1c4fbaf37d3723c4c81dce35c149dc84/deps/v8/src/profiler/heap-snapshot-generator.cc#L2567-L2567 + ios_printf(stream, "{\"snapshot\":{"); + ios_printf(stream, "\"meta\":{"); + ios_printf(stream, "\"node_fields\":[\"type\",\"name\",\"id\",\"self_size\",\"edge_count\",\"trace_node_id\",\"detachedness\"],"); + ios_printf(stream, "\"node_types\":["); + snapshot.node_types.print_json_array(stream, false); + ios_printf(stream, ","); + ios_printf(stream, "\"string\", \"number\", \"number\", \"number\", \"number\", \"number\"],"); + ios_printf(stream, "\"edge_fields\":[\"type\",\"name_or_index\",\"to_node\"],"); + ios_printf(stream, "\"edge_types\":["); + snapshot.edge_types.print_json_array(stream, false); + ios_printf(stream, ","); + ios_printf(stream, "\"string_or_number\",\"from_node\"]"); + ios_printf(stream, "},\n"); // end "meta" + ios_printf(stream, "\"node_count\":%zu,", snapshot.nodes.size()); + ios_printf(stream, "\"edge_count\":%zu", snapshot.num_edges); + ios_printf(stream, "},\n"); // end "snapshot" + + ios_printf(stream, "\"nodes\":["); + bool first_node = true; + for (const auto &from_node : snapshot.nodes) { + if (first_node) { + first_node = false; + } + else { + ios_printf(stream, ","); + } + // ["type","name","id","self_size","edge_count","trace_node_id","detachedness"] + ios_printf(stream, "%zu", from_node.type); + ios_printf(stream, ",%zu", from_node.name); + ios_printf(stream, ",%zu", from_node.id); + ios_printf(stream, ",%zu", all_one ? (size_t)1 : from_node.self_size); + ios_printf(stream, ",%zu", from_node.edges.size()); + ios_printf(stream, ",%zu", from_node.trace_node_id); + ios_printf(stream, ",%d", from_node.detachedness); + ios_printf(stream, "\n"); + } + ios_printf(stream, "],\n"); + + ios_printf(stream, "\"edges\":["); + bool first_edge = true; + for (const auto &from_node : snapshot.nodes) { + for (const auto &edge : from_node.edges) { + if (first_edge) { + first_edge = false; + } + else { + ios_printf(stream, ","); + } + ios_printf(stream, "%zu", edge.type); + ios_printf(stream, ",%zu", edge.name_or_index); + ios_printf(stream, ",%zu", edge.to_node * k_node_number_of_fields); + ios_printf(stream, "\n"); + } + } + ios_printf(stream, "],\n"); // end "edges" + + ios_printf(stream, "\"strings\":"); + + snapshot.names.print_json_array(stream, true); + + ios_printf(stream, "}"); +} diff --git a/src/gc-heap-snapshot.h b/src/gc-heap-snapshot.h new file mode 100644 index 0000000000000..96cdaf6a9a866 --- /dev/null +++ b/src/gc-heap-snapshot.h @@ -0,0 +1,108 @@ +// This file is a part of Julia. License is MIT: https://julialang.org/license + +#ifndef JL_GC_HEAP_SNAPSHOT_H +#define JL_GC_HEAP_SNAPSHOT_H + +#include "julia.h" +#include "ios.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +// --------------------------------------------------------------------- +// Functions to call from GC when heap snapshot is enabled +// --------------------------------------------------------------------- +void _gc_heap_snapshot_record_root(jl_value_t *root, char *name) JL_NOTSAFEPOINT; +void _gc_heap_snapshot_record_frame_to_object_edge(void *from, jl_value_t *to) JL_NOTSAFEPOINT; +void _gc_heap_snapshot_record_task_to_frame_edge(jl_task_t *from, void *to) JL_NOTSAFEPOINT; +void _gc_heap_snapshot_record_frame_to_frame_edge(jl_gcframe_t *from, jl_gcframe_t *to) JL_NOTSAFEPOINT; +void _gc_heap_snapshot_record_array_edge(jl_value_t *from, jl_value_t *to, size_t index) JL_NOTSAFEPOINT; +void _gc_heap_snapshot_record_object_edge(jl_value_t *from, jl_value_t *to, void* slot) JL_NOTSAFEPOINT; +void _gc_heap_snapshot_record_module_to_binding(jl_module_t* module, jl_binding_t* binding) JL_NOTSAFEPOINT; +// Used for objects managed by GC, but which aren't exposed in the julia object, so have no +// field or index. i.e. they're not reacahable from julia code, but we _will_ hit them in +// the GC mark phase (so we can check their type tag to get the size). +void _gc_heap_snapshot_record_internal_array_edge(jl_value_t *from, jl_value_t *to) JL_NOTSAFEPOINT; +// Used for objects manually allocated in C (outside julia GC), to still tell the heap snapshot about the +// size of the object, even though we're never going to mark that object. +void _gc_heap_snapshot_record_hidden_edge(jl_value_t *from, void* to, size_t bytes) JL_NOTSAFEPOINT; + + +extern int gc_heap_snapshot_enabled; +extern int prev_sweep_full; + +int gc_slot_to_fieldidx(void *_obj, void *slot, jl_datatype_t *vt) JL_NOTSAFEPOINT; +int gc_slot_to_arrayidx(void *_obj, void *begin) JL_NOTSAFEPOINT; + +static inline void gc_heap_snapshot_record_frame_to_object_edge(void *from, jl_value_t *to) JL_NOTSAFEPOINT +{ + if (__unlikely(gc_heap_snapshot_enabled && prev_sweep_full)) { + _gc_heap_snapshot_record_frame_to_object_edge(from, to); + } +} +static inline void gc_heap_snapshot_record_task_to_frame_edge(jl_task_t *from, void *to) JL_NOTSAFEPOINT +{ + if (__unlikely(gc_heap_snapshot_enabled && prev_sweep_full)) { + _gc_heap_snapshot_record_task_to_frame_edge(from, to); + } +} +static inline void gc_heap_snapshot_record_frame_to_frame_edge(jl_gcframe_t *from, jl_gcframe_t *to) JL_NOTSAFEPOINT +{ + if (__unlikely(gc_heap_snapshot_enabled && prev_sweep_full)) { + _gc_heap_snapshot_record_frame_to_frame_edge(from, to); + } +} +static inline void gc_heap_snapshot_record_root(jl_value_t *root, char *name) JL_NOTSAFEPOINT +{ + if (__unlikely(gc_heap_snapshot_enabled && prev_sweep_full)) { + _gc_heap_snapshot_record_root(root, name); + } +} +static inline void gc_heap_snapshot_record_array_edge(jl_value_t *from, jl_value_t **to) JL_NOTSAFEPOINT +{ + if (__unlikely(gc_heap_snapshot_enabled && prev_sweep_full)) { + _gc_heap_snapshot_record_array_edge(from, *to, gc_slot_to_arrayidx(from, to)); + } +} +static inline void gc_heap_snapshot_record_object_edge(jl_value_t *from, jl_value_t **to) JL_NOTSAFEPOINT +{ + if (__unlikely(gc_heap_snapshot_enabled && prev_sweep_full)) { + _gc_heap_snapshot_record_object_edge(from, *to, to); + } +} + +static inline void gc_heap_snapshot_record_module_to_binding(jl_module_t* module, jl_binding_t* binding) JL_NOTSAFEPOINT +{ + if (__unlikely(gc_heap_snapshot_enabled && prev_sweep_full)) { + _gc_heap_snapshot_record_module_to_binding(module, binding); + } +} + +static inline void gc_heap_snapshot_record_internal_array_edge(jl_value_t *from, jl_value_t *to) JL_NOTSAFEPOINT +{ + if (__unlikely(gc_heap_snapshot_enabled && prev_sweep_full)) { + _gc_heap_snapshot_record_internal_array_edge(from, to); + } +} + +static inline void gc_heap_snapshot_record_hidden_edge(jl_value_t *from, void* to, size_t bytes) JL_NOTSAFEPOINT +{ + if (__unlikely(gc_heap_snapshot_enabled && prev_sweep_full)) { + _gc_heap_snapshot_record_hidden_edge(from, to, bytes); + } +} + +// --------------------------------------------------------------------- +// Functions to call from Julia to take heap snapshot +// --------------------------------------------------------------------- +JL_DLLEXPORT void jl_gc_take_heap_snapshot(ios_t *stream, char all_one); + + +#ifdef __cplusplus +} +#endif + + +#endif // JL_GC_HEAP_SNAPSHOT_H diff --git a/src/gc.c b/src/gc.c index 8cfd74df49809..e1ac14d4772f2 100644 --- a/src/gc.c +++ b/src/gc.c @@ -130,6 +130,9 @@ STATIC_INLINE void import_gc_state(jl_ptls_t ptls, jl_gc_mark_sp_t *sp) { static jl_mutex_t finalizers_lock; static uv_mutex_t gc_cache_lock; +// mutex for gc-heap-snapshot. +jl_mutex_t heapsnapshot_lock; + // Flag that tells us whether we need to support conservative marking // of objects. static _Atomic(int) support_conservative_marking = 0; @@ -665,7 +668,7 @@ static int mark_reset_age = 0; static int64_t scanned_bytes; // young bytes scanned while marking static int64_t perm_scanned_bytes; // old bytes scanned while marking -static int prev_sweep_full = 1; +int prev_sweep_full = 1; #define inc_sat(v,s) v = (v) >= s ? s : (v)+1 @@ -1869,9 +1872,11 @@ STATIC_INLINE int gc_mark_scan_objarray(jl_ptls_t ptls, jl_gc_mark_sp_t *sp, (void)jl_assume(objary == (gc_mark_objarray_t*)sp->data); for (; begin < end; begin += objary->step) { *pnew_obj = *begin; - if (*pnew_obj) + if (*pnew_obj) { verify_parent2("obj array", objary->parent, begin, "elem(%d)", gc_slot_to_arrayidx(objary->parent, begin)); + gc_heap_snapshot_record_array_edge(objary->parent, begin); + } if (!gc_try_setmark(*pnew_obj, &objary->nptr, ptag, pbits)) continue; begin += objary->step; @@ -1905,9 +1910,11 @@ STATIC_INLINE int gc_mark_scan_array8(jl_ptls_t ptls, jl_gc_mark_sp_t *sp, for (; elem_begin < elem_end; elem_begin++) { jl_value_t **slot = &begin[*elem_begin]; *pnew_obj = *slot; - if (*pnew_obj) + if (*pnew_obj) { verify_parent2("array", ary8->elem.parent, slot, "elem(%d)", gc_slot_to_arrayidx(ary8->elem.parent, begin)); + gc_heap_snapshot_record_array_edge(ary8->elem.parent, slot); + } if (!gc_try_setmark(*pnew_obj, &ary8->elem.nptr, ptag, pbits)) continue; elem_begin++; @@ -1953,9 +1960,11 @@ STATIC_INLINE int gc_mark_scan_array16(jl_ptls_t ptls, jl_gc_mark_sp_t *sp, for (; elem_begin < elem_end; elem_begin++) { jl_value_t **slot = &begin[*elem_begin]; *pnew_obj = *slot; - if (*pnew_obj) + if (*pnew_obj) { verify_parent2("array", ary16->elem.parent, slot, "elem(%d)", gc_slot_to_arrayidx(ary16->elem.parent, begin)); + gc_heap_snapshot_record_array_edge(ary16->elem.parent, slot); + } if (!gc_try_setmark(*pnew_obj, &ary16->elem.nptr, ptag, pbits)) continue; elem_begin++; @@ -1999,9 +2008,11 @@ STATIC_INLINE int gc_mark_scan_obj8(jl_ptls_t ptls, jl_gc_mark_sp_t *sp, gc_mark for (; begin < end; begin++) { jl_value_t **slot = &((jl_value_t**)parent)[*begin]; *pnew_obj = *slot; - if (*pnew_obj) + if (*pnew_obj) { verify_parent2("object", parent, slot, "field(%d)", - gc_slot_to_fieldidx(parent, slot)); + gc_slot_to_fieldidx(parent, slot, (jl_datatype_t*)jl_typeof(parent))); + gc_heap_snapshot_record_object_edge((jl_value_t*)parent, slot); + } if (!gc_try_setmark(*pnew_obj, &obj8->nptr, ptag, pbits)) continue; begin++; @@ -2032,9 +2043,11 @@ STATIC_INLINE int gc_mark_scan_obj16(jl_ptls_t ptls, jl_gc_mark_sp_t *sp, gc_mar for (; begin < end; begin++) { jl_value_t **slot = &((jl_value_t**)parent)[*begin]; *pnew_obj = *slot; - if (*pnew_obj) + if (*pnew_obj) { verify_parent2("object", parent, slot, "field(%d)", - gc_slot_to_fieldidx(parent, slot)); + gc_slot_to_fieldidx(parent, slot, (jl_datatype_t*)jl_typeof(parent))); + gc_heap_snapshot_record_object_edge((jl_value_t*)parent, slot); + } if (!gc_try_setmark(*pnew_obj, &obj16->nptr, ptag, pbits)) continue; begin++; @@ -2065,9 +2078,11 @@ STATIC_INLINE int gc_mark_scan_obj32(jl_ptls_t ptls, jl_gc_mark_sp_t *sp, gc_mar for (; begin < end; begin++) { jl_value_t **slot = &((jl_value_t**)parent)[*begin]; *pnew_obj = *slot; - if (*pnew_obj) + if (*pnew_obj) { verify_parent2("object", parent, slot, "field(%d)", - gc_slot_to_fieldidx(parent, slot)); + gc_slot_to_fieldidx(parent, slot, (jl_datatype_t*)jl_typeof(parent))); + gc_heap_snapshot_record_object_edge((jl_value_t*)parent, slot); + } if (!gc_try_setmark(*pnew_obj, &obj32->nptr, ptag, pbits)) continue; begin++; @@ -2354,13 +2369,16 @@ stack: { } if (!gc_try_setmark(new_obj, &nptr, &tag, &bits)) continue; + gc_heap_snapshot_record_frame_to_object_edge(s, new_obj); i++; if (i < nr) { // Haven't done with this one yet. Update the content and push it back stack->i = i; gc_repush_markdata(&sp, gc_mark_stackframe_t); } + // TODO stack addresses needs copy stack handling else if ((s = (jl_gcframe_t*)gc_read_stack(&s->prev, offset, lb, ub))) { + gc_heap_snapshot_record_frame_to_frame_edge(stack->s, s); stack->s = s; stack->i = 0; uintptr_t new_nroots = gc_read_stack(&s->nroots, offset, lb, ub); @@ -2371,7 +2389,9 @@ stack: { goto mark; } s = (jl_gcframe_t*)gc_read_stack(&s->prev, offset, lb, ub); + // walk up one stack frame if (s != 0) { + gc_heap_snapshot_record_frame_to_frame_edge(stack->s, s); stack->s = s; i = 0; uintptr_t new_nroots = gc_read_stack(&s->nroots, offset, lb, ub); @@ -2403,6 +2423,7 @@ excstack: { size_t njlvals = jl_bt_num_jlvals(bt_entry); while (jlval_index < njlvals) { new_obj = jl_bt_entry_jlvalue(bt_entry, jlval_index); + gc_heap_snapshot_record_frame_to_object_edge(bt_entry, new_obj); uintptr_t nptr = 0; jlval_index += 1; if (gc_try_setmark(new_obj, &nptr, &tag, &bits)) { @@ -2417,6 +2438,7 @@ excstack: { } // The exception comes last - mark it new_obj = jl_excstack_exception(excstack, itr); + gc_heap_snapshot_record_frame_to_object_edge(excstack, new_obj); itr = jl_excstack_next(excstack, itr); bt_index = 0; jlval_index = 0; @@ -2455,6 +2477,8 @@ module_binding: { } void *vb = jl_astaggedvalue(b); verify_parent1("module", binding->parent, &vb, "binding_buff"); + // Record the size used for the box for non-const bindings + gc_heap_snapshot_record_module_to_binding(binding->parent, b); (void)vb; jl_value_t *value = jl_atomic_load_relaxed(&b->value); jl_value_t *globalref = jl_atomic_load_relaxed(&b->globalref); @@ -2592,6 +2616,7 @@ mark: { if (flags.how == 1) { void *val_buf = jl_astaggedvalue((char*)a->data - a->offset * a->elsize); verify_parent1("array", new_obj, &val_buf, "buffer ('loc' addr is meaningless)"); + gc_heap_snapshot_record_hidden_edge(new_obj, jl_valueof(val_buf), jl_array_nbytes(a)); (void)val_buf; gc_setmark_buf_(ptls, (char*)a->data - a->offset * a->elsize, bits, jl_array_nbytes(a)); @@ -2600,6 +2625,7 @@ mark: { if (update_meta || foreign_alloc) { objprofile_count(jl_malloc_tag, bits == GC_OLD_MARKED, jl_array_nbytes(a)); + gc_heap_snapshot_record_hidden_edge(new_obj, a->data, jl_array_nbytes(a)); if (bits == GC_OLD_MARKED) { ptls->gc_cache.perm_scanned_bytes += jl_array_nbytes(a); } @@ -2611,6 +2637,7 @@ mark: { else if (flags.how == 3) { jl_value_t *owner = jl_array_data_owner(a); uintptr_t nptr = (1 << 2) | (bits & GC_OLD); + gc_heap_snapshot_record_internal_array_edge(new_obj, owner); int markowner = gc_try_setmark(owner, &nptr, &tag, &bits); gc_mark_push_remset(ptls, new_obj, nptr); if (markowner) { @@ -2707,8 +2734,13 @@ mark: { } #ifdef COPY_STACKS void *stkbuf = ta->stkbuf; - if (stkbuf && ta->copy_stack) + if (stkbuf && ta->copy_stack) { gc_setmark_buf_(ptls, stkbuf, bits, ta->bufsz); + // For gc_heap_snapshot_record: + // TODO: attribute size of stack + // TODO: edge to stack data + // TODO: synthetic node for stack data (how big is it?) + } #endif jl_gcframe_t *s = ta->gcstack; size_t nroots; @@ -2727,12 +2759,15 @@ mark: { #endif if (s) { nroots = gc_read_stack(&s->nroots, offset, lb, ub); + gc_heap_snapshot_record_task_to_frame_edge(ta, s); + assert(nroots <= UINT32_MAX); gc_mark_stackframe_t stackdata = {s, 0, (uint32_t)nroots, offset, lb, ub}; gc_mark_stack_push(&ptls->gc_cache, &sp, gc_mark_laddr(stack), &stackdata, sizeof(stackdata), 1); } if (ta->excstack) { + gc_heap_snapshot_record_task_to_frame_edge(ta, ta->excstack); gc_setmark_buf_(ptls, ta->excstack, bits, sizeof(jl_excstack_t) + sizeof(uintptr_t)*ta->excstack->reserved_size); gc_mark_excstack_t stackdata = {ta->excstack, ta->excstack->top, 0, 0}; @@ -2829,14 +2864,24 @@ mark: { static void jl_gc_queue_thread_local(jl_gc_mark_cache_t *gc_cache, jl_gc_mark_sp_t *sp, jl_ptls_t ptls2) { - gc_mark_queue_obj(gc_cache, sp, jl_atomic_load_relaxed(&ptls2->current_task)); + jl_value_t *current_task = (jl_value_t*)jl_atomic_load_relaxed(&ptls2->current_task); + gc_mark_queue_obj(gc_cache, sp, current_task); + gc_heap_snapshot_record_root(current_task, "current task"); gc_mark_queue_obj(gc_cache, sp, ptls2->root_task); - if (ptls2->next_task) + + gc_heap_snapshot_record_root((jl_value_t*)ptls2->root_task, "root task"); + if (ptls2->next_task) { gc_mark_queue_obj(gc_cache, sp, ptls2->next_task); - if (ptls2->previous_task) // shouldn't be necessary, but no reason not to + gc_heap_snapshot_record_root((jl_value_t*)ptls2->next_task, "next task"); + } + if (ptls2->previous_task) { // shouldn't be necessary, but no reason not to gc_mark_queue_obj(gc_cache, sp, ptls2->previous_task); - if (ptls2->previous_exception) + gc_heap_snapshot_record_root((jl_value_t*)ptls2->previous_task, "previous task"); + } + if (ptls2->previous_exception) { gc_mark_queue_obj(gc_cache, sp, ptls2->previous_exception); + gc_heap_snapshot_record_root((jl_value_t*)ptls2->previous_exception, "previous exception"); + } } extern jl_value_t *cmpswap_names JL_GLOBALLY_ROOTED; @@ -2846,6 +2891,7 @@ static void mark_roots(jl_gc_mark_cache_t *gc_cache, jl_gc_mark_sp_t *sp) { // modules gc_mark_queue_obj(gc_cache, sp, jl_main_module); + gc_heap_snapshot_record_root((jl_value_t*)jl_main_module, "main_module"); // invisible builtin values if (jl_an_empty_vec_any != NULL) @@ -2855,16 +2901,19 @@ static void mark_roots(jl_gc_mark_cache_t *gc_cache, jl_gc_mark_sp_t *sp) for (size_t i = 0; i < jl_current_modules.size; i += 2) { if (jl_current_modules.table[i + 1] != HT_NOTFOUND) { gc_mark_queue_obj(gc_cache, sp, jl_current_modules.table[i]); + gc_heap_snapshot_record_root((jl_value_t*)jl_current_modules.table[i], "top level module"); } } gc_mark_queue_obj(gc_cache, sp, jl_anytuple_type_type); for (size_t i = 0; i < N_CALL_CACHE; i++) { jl_typemap_entry_t *v = jl_atomic_load_relaxed(&call_cache[i]); - if (v != NULL) + if (v != NULL) { gc_mark_queue_obj(gc_cache, sp, v); + } } - if (jl_all_methods != NULL) + if (jl_all_methods != NULL) { gc_mark_queue_obj(gc_cache, sp, jl_all_methods); + } if (_jl_debug_method_invalidation != NULL) gc_mark_queue_obj(gc_cache, sp, _jl_debug_method_invalidation); @@ -3087,6 +3136,7 @@ static int _jl_gc_collect(jl_ptls_t ptls, jl_gc_collection_t collection) // 2.2. mark every thread local root jl_gc_queue_thread_local(gc_cache, &sp, ptls2); // 2.3. mark any managed objects in the backtrace buffer + // TODO: treat these as roots for gc_heap_snapshot_record jl_gc_queue_bt_buf(gc_cache, &sp, ptls2); } @@ -3189,7 +3239,7 @@ static int _jl_gc_collect(jl_ptls_t ptls, jl_gc_collection_t collection) if (gc_sweep_always_full) { sweep_full = 1; } - if (collection == JL_GC_FULL) { + if (collection == JL_GC_FULL && !prev_sweep_full) { sweep_full = 1; recollect = 1; } @@ -3433,6 +3483,7 @@ void jl_init_thread_heap(jl_ptls_t ptls) // System-wide initializations void jl_gc_init(void) { + JL_MUTEX_INIT(&heapsnapshot_lock); JL_MUTEX_INIT(&finalizers_lock); uv_mutex_init(&gc_cache_lock); uv_mutex_init(&gc_perm_lock); diff --git a/src/gc.h b/src/gc.h index 36a8f87c0b6c7..7d6aff3499eae 100644 --- a/src/gc.h +++ b/src/gc.h @@ -24,6 +24,7 @@ #endif #endif #include "julia_assert.h" +#include "gc-heap-snapshot.h" #include "gc-alloc-profiler.h" #ifdef __cplusplus @@ -647,8 +648,10 @@ extern int gc_verifying; #define verify_parent2(ty,obj,slot,arg1,arg2) do {} while (0) #define gc_verifying (0) #endif -int gc_slot_to_fieldidx(void *_obj, void *slot); -int gc_slot_to_arrayidx(void *_obj, void *begin); + + +int gc_slot_to_fieldidx(void *_obj, void *slot, jl_datatype_t *vt) JL_NOTSAFEPOINT; +int gc_slot_to_arrayidx(void *_obj, void *begin) JL_NOTSAFEPOINT; NOINLINE void gc_mark_loop_unwind(jl_ptls_t ptls, jl_gc_mark_sp_t sp, int pc_offset); #ifdef GC_DEBUG_ENV diff --git a/src/staticdata.c b/src/staticdata.c index 1ff0e7ae50540..5efdba67583d1 100644 --- a/src/staticdata.c +++ b/src/staticdata.c @@ -1338,7 +1338,7 @@ static inline uintptr_t get_item_for_reloc(jl_serializer_state *s, uintptr_t bas assert(offset < deser_sym.len && deser_sym.items[offset] && "corrupt relocation item id"); return (uintptr_t)deser_sym.items[offset]; case BindingRef: - return jl_buff_tag | GC_OLD_MARKED; + return jl_buff_tag | GC_OLD; case TagRef: if (offset == 0) return (uintptr_t)s->ptls->root_task; @@ -2168,7 +2168,7 @@ static void jl_restore_system_image_from_stream(ios_t *f) JL_GC_DISABLED jl_gc_set_permalloc_region((void*)sysimg_base, (void*)(sysimg_base + sysimg.size)); s.s = &sysimg; - jl_read_relocations(&s, GC_OLD_MARKED); // gctags + jl_read_relocations(&s, GC_OLD); // gctags size_t sizeof_tags = ios_pos(&relocs); (void)sizeof_tags; jl_read_relocations(&s, 0); // general relocs diff --git a/stdlib/Profile/docs/src/index.md b/stdlib/Profile/docs/src/index.md index 8701dded0d427..e67c1d3a6fdc3 100644 --- a/stdlib/Profile/docs/src/index.md +++ b/stdlib/Profile/docs/src/index.md @@ -107,3 +107,24 @@ Profile.Allocs.fetch Profile.Allocs.start Profile.Allocs.stop ``` + +## Heap Snapshots + +```@docs +Profile.take_heap_snapshot +``` + +The methods in `Profile` are not exported and need to be called e.g. as `Profile.take_heap_snapshot()`. + +```julia-repl +julia> using Profile + +julia> Profile.take_heap_snapshot("snapshot.heapsnapshot") +``` + +Traces and records julia objects on the heap. This only records objects known to the Julia +garbage collector. Memory allocated by external libraries not managed by the garbage +collector will not show up in the snapshot. + +The resulting heap snapshot file can be uploaded to chrome devtools to be viewed. +For more information, see the [chrome devtools docs](https://developer.chrome.com/docs/devtools/memory-problems/heap-snapshots/#view_snapshots). diff --git a/stdlib/Profile/src/Profile.jl b/stdlib/Profile/src/Profile.jl index 2a4c33228755c..5a833936bfeea 100644 --- a/stdlib/Profile/src/Profile.jl +++ b/stdlib/Profile/src/Profile.jl @@ -1239,6 +1239,27 @@ function warning_empty(;summary = false) end end + +""" + Profile.take_heap_snapshot(io::IOStream, all_one::Bool=false) + Profile.take_heap_snapshot(filepath::String, all_one::Bool=false) + +Write a snapshot of the heap, in the JSON format expected by the Chrome +Devtools Heap Snapshot viewer (.heapsnapshot extension), to the given +file path or IO stream. If all_one is true, then report the size of +every object as one so they can be easily counted. Otherwise, report +the actual size. +""" +function take_heap_snapshot(io::IOStream, all_one::Bool=false) + @Base._lock_ios(io, ccall(:jl_gc_take_heap_snapshot, Cvoid, (Ptr{Cvoid}, Cchar), io.handle, Cchar(all_one))) +end +function take_heap_snapshot(filepath::String, all_one::Bool=false) + open(filepath, "w") do io + take_heap_snapshot(io, all_one) + end +end + + include("Allocs.jl") end # module diff --git a/stdlib/Profile/test/runtests.jl b/stdlib/Profile/test/runtests.jl index 2b523ffa44f0e..a0320b27a2cf1 100644 --- a/stdlib/Profile/test/runtests.jl +++ b/stdlib/Profile/test/runtests.jl @@ -272,4 +272,13 @@ end @test only(node.down).first == lidict[8] end +@testset "HeapSnapshot" begin + fname = tempname() + Profile.take_heap_snapshot(fname) + + open(fname) do fs + @test readline(fs) != "" + end +end + include("allocs.jl") From 6493ddc35ac157c33c96cf17ea160fc64c226aef Mon Sep 17 00:00:00 2001 From: K Pamnany Date: Fri, 9 Dec 2022 18:33:56 -0500 Subject: [PATCH 363/369] 47300.patch (edited) Add method for `Profile.task_heap_snapshot` with auto path. --- stdlib/Profile/src/Profile.jl | 15 +++++++++++---- stdlib/Profile/test/runtests.jl | 9 +++++++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/stdlib/Profile/src/Profile.jl b/stdlib/Profile/src/Profile.jl index 5a833936bfeea..0b5b7d3977590 100644 --- a/stdlib/Profile/src/Profile.jl +++ b/stdlib/Profile/src/Profile.jl @@ -1243,12 +1243,14 @@ end """ Profile.take_heap_snapshot(io::IOStream, all_one::Bool=false) Profile.take_heap_snapshot(filepath::String, all_one::Bool=false) + Profile.take_heap_snapshot(all_one::Bool=false) Write a snapshot of the heap, in the JSON format expected by the Chrome -Devtools Heap Snapshot viewer (.heapsnapshot extension), to the given -file path or IO stream. If all_one is true, then report the size of -every object as one so they can be easily counted. Otherwise, report -the actual size. +Devtools Heap Snapshot viewer (.heapsnapshot extension), to a file +(`\$pid_\$timestamp.heapsnapshot`) in the current directory, or the given +file path, or IO stream. If `all_one` is true, then report the size of +every object as one so they can be easily counted. Otherwise, report the +actual size. """ function take_heap_snapshot(io::IOStream, all_one::Bool=false) @Base._lock_ios(io, ccall(:jl_gc_take_heap_snapshot, Cvoid, (Ptr{Cvoid}, Cchar), io.handle, Cchar(all_one))) @@ -1257,6 +1259,11 @@ function take_heap_snapshot(filepath::String, all_one::Bool=false) open(filepath, "w") do io take_heap_snapshot(io, all_one) end + return filepath +end +function take_heap_snapshot(all_one::Bool=false) + f = joinpath(pwd(), "$(getpid())_$(time_ns()).heapsnapshot") + return take_heap_snapshot(f, all_one) end diff --git a/stdlib/Profile/test/runtests.jl b/stdlib/Profile/test/runtests.jl index a0320b27a2cf1..4f5e0b4f86631 100644 --- a/stdlib/Profile/test/runtests.jl +++ b/stdlib/Profile/test/runtests.jl @@ -273,12 +273,17 @@ end end @testset "HeapSnapshot" begin - fname = tempname() - Profile.take_heap_snapshot(fname) + fname = strip(String(read( + `$(Base.julia_cmd()) --startup-file=no -E "using Profile; Profile.take_heap_snapshot()"` + )), ['\n', '\"']) + + @test isfile(fname) open(fname) do fs @test readline(fs) != "" end + + rm(fname) end include("allocs.jl") From 6d48962890bc8de820fad838e5aa776d2f073d33 Mon Sep 17 00:00:00 2001 From: K Pamnany Date: Fri, 9 Dec 2022 18:35:17 -0500 Subject: [PATCH 364/369] 47320.patch A couple of tidy ups on 47300. --- stdlib/Profile/src/Profile.jl | 2 +- stdlib/Profile/test/runtests.jl | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/stdlib/Profile/src/Profile.jl b/stdlib/Profile/src/Profile.jl index 0b5b7d3977590..44032fce2da1b 100644 --- a/stdlib/Profile/src/Profile.jl +++ b/stdlib/Profile/src/Profile.jl @@ -1262,7 +1262,7 @@ function take_heap_snapshot(filepath::String, all_one::Bool=false) return filepath end function take_heap_snapshot(all_one::Bool=false) - f = joinpath(pwd(), "$(getpid())_$(time_ns()).heapsnapshot") + f = abspath("$(getpid())_$(time_ns()).heapsnapshot") return take_heap_snapshot(f, all_one) end diff --git a/stdlib/Profile/test/runtests.jl b/stdlib/Profile/test/runtests.jl index 4f5e0b4f86631..c4391cf5c3674 100644 --- a/stdlib/Profile/test/runtests.jl +++ b/stdlib/Profile/test/runtests.jl @@ -273,9 +273,7 @@ end end @testset "HeapSnapshot" begin - fname = strip(String(read( - `$(Base.julia_cmd()) --startup-file=no -E "using Profile; Profile.take_heap_snapshot()"` - )), ['\n', '\"']) + fname = read(`$(Base.julia_cmd()) --startup-file=no -e "using Profile; print(Profile.take_heap_snapshot())"`, String) @test isfile(fname) From 1827685936b257e5c407e04cbf4f8bb9d711e9f4 Mon Sep 17 00:00:00 2001 From: K Pamnany Date: Fri, 9 Dec 2022 18:36:36 -0500 Subject: [PATCH 365/369] 47217.patch Optimized heap snapshot write. --- src/gc-heap-snapshot.cpp | 46 ++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/gc-heap-snapshot.cpp b/src/gc-heap-snapshot.cpp index 2349a33cebae3..c898e27a48ea7 100644 --- a/src/gc-heap-snapshot.cpp +++ b/src/gc-heap-snapshot.cpp @@ -24,26 +24,26 @@ using llvm::StringRef; // https://stackoverflow.com/a/33799784/751061 void print_str_escape_json(ios_t *stream, StringRef s) { - ios_printf(stream, "\""); + ios_putc('"', stream); for (auto c = s.begin(); c != s.end(); c++) { switch (*c) { - case '"': ios_printf(stream, "\\\""); break; - case '\\': ios_printf(stream, "\\\\"); break; - case '\b': ios_printf(stream, "\\b"); break; - case '\f': ios_printf(stream, "\\f"); break; - case '\n': ios_printf(stream, "\\n"); break; - case '\r': ios_printf(stream, "\\r"); break; - case '\t': ios_printf(stream, "\\t"); break; + case '"': ios_write(stream, "\\\"", 2); break; + case '\\': ios_write(stream, "\\\\", 2); break; + case '\b': ios_write(stream, "\\b", 2); break; + case '\f': ios_write(stream, "\\f", 2); break; + case '\n': ios_write(stream, "\\n", 2); break; + case '\r': ios_write(stream, "\\r", 2); break; + case '\t': ios_write(stream, "\\t", 2); break; default: - if ('\x00' <= *c && *c <= '\x1f') { + if (('\x00' <= *c) & (*c <= '\x1f')) { ios_printf(stream, "\\u%04x", (int)*c); } else { - ios_printf(stream, "%c", *c); + ios_putc(*c, stream); } } } - ios_printf(stream, "\""); + ios_putc('"', stream); } @@ -469,14 +469,14 @@ void serialize_heap_snapshot(ios_t *stream, HeapSnapshot &snapshot, char all_one ios_printf(stream, ","); } // ["type","name","id","self_size","edge_count","trace_node_id","detachedness"] - ios_printf(stream, "%zu", from_node.type); - ios_printf(stream, ",%zu", from_node.name); - ios_printf(stream, ",%zu", from_node.id); - ios_printf(stream, ",%zu", all_one ? (size_t)1 : from_node.self_size); - ios_printf(stream, ",%zu", from_node.edges.size()); - ios_printf(stream, ",%zu", from_node.trace_node_id); - ios_printf(stream, ",%d", from_node.detachedness); - ios_printf(stream, "\n"); + ios_printf(stream, "%zu,%zu,%zu,%zu,%zu,%zu,%d\n", + from_node.type, + from_node.name, + from_node.id, + all_one ? (size_t)1 : from_node.self_size, + from_node.edges.size(), + from_node.trace_node_id, + from_node.detachedness); } ios_printf(stream, "],\n"); @@ -490,10 +490,10 @@ void serialize_heap_snapshot(ios_t *stream, HeapSnapshot &snapshot, char all_one else { ios_printf(stream, ","); } - ios_printf(stream, "%zu", edge.type); - ios_printf(stream, ",%zu", edge.name_or_index); - ios_printf(stream, ",%zu", edge.to_node * k_node_number_of_fields); - ios_printf(stream, "\n"); + ios_printf(stream, "%zu,%zu,%zu\n", + edge.type, + edge.name_or_index, + edge.to_node * k_node_number_of_fields); } } ios_printf(stream, "],\n"); // end "edges" From 35477233fbc0dffe1e0490b5bd42069b470999df Mon Sep 17 00:00:00 2001 From: K Pamnany Date: Fri, 9 Dec 2022 18:59:29 -0500 Subject: [PATCH 366/369] 47615.patch (snapshot) (edited) Allow thread-safe access to buffer of type inference profiling trees. --- base/compiler/typeinfer.jl | 106 +++++++++++++++++++----------------- doc/src/devdocs/locks.md | 1 + src/Makefile | 3 +- src/inference-profiling.cpp | 46 ++++++++++++++++ src/jl_exported_funcs.inc | 2 + test/compiler/inference.jl | 29 +++++----- 6 files changed, 122 insertions(+), 65 deletions(-) create mode 100644 src/inference-profiling.cpp diff --git a/base/compiler/typeinfer.jl b/base/compiler/typeinfer.jl index 7f7770e6f9f4b..39c59982803b4 100644 --- a/base/compiler/typeinfer.jl +++ b/base/compiler/typeinfer.jl @@ -22,7 +22,7 @@ being used for this purpose alone. """ module Timings -using Core.Compiler: -, +, :, Vector, length, first, empty!, push!, pop!, @inline, +using Core.Compiler: -, +, :, >, Vector, length, first, empty!, push!, pop!, @inline, @inbounds, copy, backtrace # What we record for any given frame we infer during type inference. @@ -46,12 +46,12 @@ function _typeinf_identifier(frame::Core.Compiler.InferenceState) end """ - Core.Compiler.Timing(mi_info, start_time, ...) + Core.Compiler.Timings.Timing(mi_info, start_time, ...) Internal type containing the timing result for running type inference on a single MethodInstance. """ -struct Timing +mutable struct Timing mi_info::InferenceFrameInfo start_time::UInt64 cur_start_time::UInt64 @@ -64,6 +64,27 @@ Timing(mi_info, start_time) = Timing(mi_info, start_time, start_time, UInt64(0), _time_ns() = ccall(:jl_hrtime, UInt64, ()) # Re-implemented here because Base not yet available. +""" + Core.Compiler.Timings.clear_and_fetch_timings() + +Return, then clear, the previously recorded type inference timings (`Core.Compiler._timings`). + +This fetches a vector of all of the type inference timings that have _finished_ as of this call. Note +that there may be concurrent invocations of inference that are still running in another thread, but +which haven't yet been added to this buffer. Those can be fetched in a future call. +""" +function clear_and_fetch_timings() + # Pass in the type, since the C code doesn't know about our Timing struct. + ccall(:jl_typeinf_profiling_clear_and_fetch, Any, (Any, Any,), + _finished_timings, Vector{Timing})::Vector{Timing} +end + +function finish_timing_profile(timing::Timing) + ccall(:jl_typeinf_profiling_push_timing, Cvoid, (Any, Any,), _finished_timings, timing) +end + +const _finished_timings = Timing[] + # We keep a stack of the Timings for each of the MethodInstances currently being timed. # Since type inference currently operates via a depth-first search (during abstract # evaluation), this vector operates like a call stack. The last node in _timings is the @@ -72,6 +93,7 @@ _time_ns() = ccall(:jl_hrtime, UInt64, ()) # Re-implemented here because Base n # call structure through type inference is recorded. (It's recorded as a tree, not a graph, # because we create a new node for duplicates.) const _timings = Timing[] + # ROOT() is an empty function used as the top-level Timing node to measure all time spent # *not* in type inference during a given recording trace. It is used as a "dummy" node. function ROOT() end @@ -79,9 +101,10 @@ const ROOTmi = Core.Compiler.specialize_method( first(Core.Compiler.methods(ROOT)), Tuple{typeof(ROOT)}, Core.svec()) """ Core.Compiler.reset_timings() - Empty out the previously recorded type inference timings (`Core.Compiler._timings`), and start the ROOT() timer again. `ROOT()` measures all time spent _outside_ inference. + +DEPRECATED: this will be removed; use `clear_and_fetch_timings` instead. """ function reset_timings() empty!(_timings) @@ -91,7 +114,6 @@ function reset_timings() _time_ns())) return nothing end -reset_timings() # (This is split into a function so that it can be called both in this module, at the top # of `enter_new_timer()`, and once at the Very End of the operation, by whoever started @@ -103,16 +125,9 @@ reset_timings() parent_timer = _timings[end] accum_time = stop_time - parent_timer.cur_start_time - # Add in accum_time ("modify" the immutable struct) + # Add in accum_time @inbounds begin - _timings[end] = Timing( - parent_timer.mi_info, - parent_timer.start_time, - parent_timer.cur_start_time, - parent_timer.time + accum_time, - parent_timer.children, - parent_timer.bt, - ) + _timings[end].time += accum_time end return nothing end @@ -120,27 +135,21 @@ end @inline function enter_new_timer(frame) # Very first thing, stop the active timer: get the current time and add in the # time since it was last started to its aggregate exclusive time. - close_current_timer() - - mi_info = _typeinf_identifier(frame) + if length(_timings) > 0 + close_current_timer() + end # Start the new timer right before returning + mi_info = _typeinf_identifier(frame) push!(_timings, Timing(mi_info, UInt64(0))) len = length(_timings) new_timer = @inbounds _timings[len] + # Set the current time _after_ appending the node, to try to exclude the # overhead from measurement. start = _time_ns() - - @inbounds begin - _timings[len] = Timing( - new_timer.mi_info, - start, - start, - new_timer.time, - new_timer.children, - ) - end + new_timer.start_time = start + new_timer.cur_start_time = start return nothing end @@ -160,35 +169,30 @@ end new_timer = pop!(_timings) Core.Compiler.@assert new_timer.mi_info.mi === expected_mi_info.mi - # Prepare to unwind one level of the stack and record in the parent - parent_timer = _timings[end] + # check for two cases: normal case & backcompat case + is_profile_root_normal = length(_timings) === 0 + is_profile_root_backcompat = length(_timings) === 1 && _timings[1] === ROOTmi + is_profile_root = is_profile_root_normal || is_profile_root_backcompat accum_time = stop_time - new_timer.cur_start_time # Add in accum_time ("modify" the immutable struct) - new_timer = Timing( - new_timer.mi_info, - new_timer.start_time, - new_timer.cur_start_time, - new_timer.time + accum_time, - new_timer.children, - parent_timer.mi_info.mi === ROOTmi ? backtrace() : nothing, - ) - # Record the final timing with the original parent timer - push!(parent_timer.children, new_timer) - - # And finally restart the parent timer: - len = length(_timings) - @inbounds begin - _timings[len] = Timing( - parent_timer.mi_info, - parent_timer.start_time, - _time_ns(), - parent_timer.time, - parent_timer.children, - parent_timer.bt, - ) + new_timer.time += accum_time + if is_profile_root + new_timer.bt = backtrace() end + # Prepare to unwind one level of the stack and record in the parent + if is_profile_root + finish_timing_profile(new_timer) + else + parent_timer = _timings[end] + + # Record the final timing with the original parent timer + push!(parent_timer.children, new_timer) + + # And finally restart the parent timer: + parent_timer.cur_start_time = _time_ns() + end return nothing end diff --git a/doc/src/devdocs/locks.md b/doc/src/devdocs/locks.md index f01209cc73e52..a0cb86e7c8d0c 100644 --- a/doc/src/devdocs/locks.md +++ b/doc/src/devdocs/locks.md @@ -35,6 +35,7 @@ The following is a leaf lock (level 2), and only acquires level 1 locks (safepoi > * typecache > * Module->lock +> * typeinf_profiling_lock The following is a level 3 lock, which can only acquire level 1 or level 2 locks internally: diff --git a/src/Makefile b/src/Makefile index 2a46566d96568..468ed79fd7efd 100644 --- a/src/Makefile +++ b/src/Makefile @@ -44,7 +44,7 @@ endif RUNTIME_SRCS := \ jltypes gf typemap smallintset ast builtins module interpreter symbol \ dlload sys init task array dump staticdata toplevel jl_uv datatype \ - simplevector runtime_intrinsics precompile \ + simplevector runtime_intrinsics precompile inference-profiling \ threading partr stackwalk gc gc-debug gc-pages gc-stacks gc-alloc-profiler method \ jlapi signal-handling safepoint timing subtype gc-heap-snapshot \ crc32c APInt-C processor ircode opaque_closure codegen-stubs coverage @@ -297,6 +297,7 @@ $(BUILDDIR)/gc-pages.o $(BUILDDIR)/gc-pages.dbg.obj: $(SRCDIR)/gc.h $(BUILDDIR)/gc.o $(BUILDDIR)/gc.dbg.obj: $(SRCDIR)/gc.h $(SRCDIR)/gc-heap-snapshot.h $(SRCDIR)/gc-alloc-profiler.h $(BUILDDIR)/gc-heap-snapshot.o $(BUILDDIR)/gc-heap-snapshot.dbg.obj: $(SRCDIR)/gc.h $(SRCDIR)/gc-heap-snapshot.h $(BUILDDIR)/gc-alloc-profiler.o $(BUILDDIR)/gc-alloc-profiler.dbg.obj: $(SRCDIR)/gc.h $(SRCDIR)/gc-alloc-profiler.h +$(BUILDDIR)/inference-profiling.o $(BUILDDIR)/inference-profiling.dbg.obj: $(SRCDIR)/gc.h $(BUILDDIR)/init.o $(BUILDDIR)/init.dbg.obj: $(SRCDIR)/builtin_proto.h $(BUILDDIR)/interpreter.o $(BUILDDIR)/interpreter.dbg.obj: $(SRCDIR)/builtin_proto.h $(BUILDDIR)/jitlayers.o $(BUILDDIR)/jitlayers.dbg.obj: $(SRCDIR)/jitlayers.h $(SRCDIR)/codegen_shared.h $(SRCDIR)/debug-registry.h diff --git a/src/inference-profiling.cpp b/src/inference-profiling.cpp new file mode 100644 index 0000000000000..d07b1137a5ee7 --- /dev/null +++ b/src/inference-profiling.cpp @@ -0,0 +1,46 @@ +// Implementation for type inference profiling + +#include "julia.h" +#include "julia_internal.h" + +jl_mutex_t typeinf_profiling_lock; + +// == exported interface == + +extern "C" { + +JL_DLLEXPORT jl_array_t* jl_typeinf_profiling_clear_and_fetch( + jl_array_t *inference_profiling_results_array, + jl_value_t *array_timing_type +) +{ + JL_LOCK(&typeinf_profiling_lock); + + size_t len = jl_array_len(inference_profiling_results_array); + + jl_array_t *out = jl_alloc_array_1d(array_timing_type, len); + JL_GC_PUSH1(&out); + + memcpy(out->data, inference_profiling_results_array->data, len * sizeof(void*)); + + jl_array_del_end(inference_profiling_results_array, len); + + JL_UNLOCK(&typeinf_profiling_lock); + + JL_GC_POP(); + return out; +} + +JL_DLLEXPORT void jl_typeinf_profiling_push_timing( + jl_array_t *inference_profiling_results_array, + jl_value_t *timing +) +{ + JL_LOCK(&typeinf_profiling_lock); + + jl_array_ptr_1d_push(inference_profiling_results_array, timing); + + JL_UNLOCK(&typeinf_profiling_lock); +} + +} // extern "C" diff --git a/src/jl_exported_funcs.inc b/src/jl_exported_funcs.inc index 64e6ee608ae01..081e9e42a694d 100644 --- a/src/jl_exported_funcs.inc +++ b/src/jl_exported_funcs.inc @@ -478,6 +478,8 @@ XX(jl_typeassert) \ XX(jl_typeinf_begin) \ XX(jl_typeinf_end) \ + XX(jl_typeinf_profiling_clear_and_fetch) \ + XX(jl_typeinf_profiling_push_timing) \ XX(jl_typename_str) \ XX(jl_typeof_str) \ XX(jl_types_equal) \ diff --git a/test/compiler/inference.jl b/test/compiler/inference.jl index 00470aaccf248..1c4edf0c72f14 100644 --- a/test/compiler/inference.jl +++ b/test/compiler/inference.jl @@ -3390,15 +3390,19 @@ f37532(T, x) = (Core.bitcast(Ptr{T}, x); x) # Helper functions for Core.Compiler.Timings. These are normally accessed via a package - # usually (SnoopCompileCore). function time_inference(f) - Core.Compiler.Timings.reset_timings() Core.Compiler.__set_measure_typeinf(true) f() Core.Compiler.__set_measure_typeinf(false) - Core.Compiler.Timings.close_current_timer() - return Core.Compiler.Timings._timings[1] + return Core.Compiler.Timings.clear_and_fetch_timings() end -function depth(t::Core.Compiler.Timings.Timing) - maximum(depth.(t.children), init=0) + 1 +function max_depth(t::Vector{Core.Compiler.Timings.Timing}) + maximum(max_depth.(t), init=0) + 1 +end +function max_depth(t::Core.Compiler.Timings.Timing) + maximum(max_depth.(t.children), init=0) + 1 +end +function flatten_times(t::Vector{Core.Compiler.Timings.Timing}) + collect(Iterators.flatten(flatten_times(el) for el in t)) end function flatten_times(t::Core.Compiler.Timings.Timing) collect(Iterators.flatten([(t.time => t.mi_info,), flatten_times.(t.children)...])) @@ -3415,14 +3419,14 @@ end timing1 = time_inference() do @eval M1.g(2, 3.0) end - @test occursin(r"Core.Compiler.Timings.Timing\(InferenceFrameInfo for Core.Compiler.Timings.ROOT\(\)\) with \d+ children", sprint(show, timing1)) + @test timing1 isa Vector{Core.Compiler.Timings.Timing} # The last two functions to be inferred should be `i` and `i2`, inferred at runtime with # their concrete types. @test sort([mi_info.mi.def.name for (time,mi_info) in flatten_times(timing1)[end-1:end]]) == [:i, :i2] - @test all(child->isa(child.bt, Vector), timing1.children) - @test all(child->child.bt===nothing, timing1.children[1].children) + @test all(child->isa(child.bt, Vector), timing1) + @test all(child->child.bt===nothing, timing1[1].children) # Test the stacktrace - @test isa(stacktrace(timing1.children[1].bt), Vector{Base.StackTraces.StackFrame}) + @test isa(stacktrace(timing1[1].bt), Vector{Base.StackTraces.StackFrame}) # Test that inference has cached some of the Method Instances timing2 = time_inference() do @eval M1.g(2, 3.0) @@ -3443,7 +3447,7 @@ end end end end - @test occursin("thunk from $(@__MODULE__) starting at $(@__FILE__):$((@__LINE__) - 5)", string(timingmod.children)) + @test occursin("thunk from $(@__MODULE__) starting at $(@__FILE__):$((@__LINE__) - 5)", string(timingmod)) # END LINE NUMBER SENSITIVITY # Recursive function @@ -3451,8 +3455,8 @@ end timing = time_inference() do @eval _Recursive.f(Base.inferencebarrier(5)) end - @test 2 <= depth(timing) <= 3 # root -> f (-> +) - @test 2 <= length(flatten_times(timing)) <= 3 # root, f, + + @test 1 <= max_depth(timing) <= 2 # f (-> +) + @test 1 <= length(flatten_times(timing)) <= 2 # f, + # Functions inferred with multiple constants @eval module C @@ -3480,7 +3484,6 @@ end @test !isempty(ft) str = sprint(show, ft) @test occursin("InferenceFrameInfo for /(1::$Int, ::$Int)", str) # inference constants - @test occursin("InferenceFrameInfo for Core.Compiler.Timings.ROOT()", str) # qualified # loopc has internal slots, check constant printing in this case sel = filter(ti -> ti.second.mi.def.name === :loopc, ft) ifi = sel[end].second From e26a9e30c9f0390ec0d25591049b41433892b54a Mon Sep 17 00:00:00 2001 From: K Pamnany Date: Fri, 9 Dec 2022 23:51:06 -0500 Subject: [PATCH 367/369] 44788.patch Fix potential error within `multiq_sift_down`. --- base/partr.jl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/base/partr.jl b/base/partr.jl index 4bf916abb4ba6..0393308802281 100644 --- a/base/partr.jl +++ b/base/partr.jl @@ -46,14 +46,15 @@ end function multiq_sift_down(heap::taskheap, idx::Int32) if idx <= heap.ntasks - for child = (heap_d * idx - heap_d + Int32(2)):(heap_d * idx + Int32(1)) + for child = (heap_d * idx - heap_d + 2):(heap_d * idx + 1) + child = Int(child) child > length(heap.tasks) && break - if isassigned(heap.tasks, Int(child)) && + if isassigned(heap.tasks, child) && heap.tasks[child].priority <= heap.tasks[idx].priority t = heap.tasks[idx] heap.tasks[idx] = heap.tasks[child] heap.tasks[child] = t - multiq_sift_down(heap, child) + multiq_sift_down(heap, Int32(child)) end end end From 31599d4720d845adf63e309bbfd63e2febf31722 Mon Sep 17 00:00:00 2001 From: Nathan Daly Date: Mon, 2 Jan 2023 11:36:36 -0700 Subject: [PATCH 368/369] 47933.patch (#3) Add option to `jl_print_task_backtraces(bool)` to control whether or not to print DONE tasks (#47933) --- src/stackwalk.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/stackwalk.c b/src/stackwalk.c index 033478918dd61..b09d41319f93f 100644 --- a/src/stackwalk.c +++ b/src/stackwalk.c @@ -1112,7 +1112,7 @@ JL_DLLEXPORT void jl_print_backtrace(void) JL_NOTSAFEPOINT // Print backtraces for all live tasks, for all threads. // WARNING: this is dangerous and can crash if used outside of gdb, if // all of Julia's threads are not stopped! -JL_DLLEXPORT void jl_print_task_backtraces(void) JL_NOTSAFEPOINT +JL_DLLEXPORT void jl_print_task_backtraces(int show_done) JL_NOTSAFEPOINT { for (size_t i = 0; i < jl_n_threads; i++) { jl_ptls_t ptls2 = jl_all_tls_states[i]; @@ -1130,9 +1130,13 @@ JL_DLLEXPORT void jl_print_task_backtraces(void) JL_NOTSAFEPOINT void **lst = live_tasks->items; for (size_t j = 0; j < live_tasks->len; j++) { jl_task_t *t = (jl_task_t *)lst[j]; + int t_state = jl_atomic_load_relaxed(&t->_state); + if (!show_done && t_state == JL_TASK_STATE_DONE) { + continue; + } jl_safe_printf(" ---- Task %zu (%p)\n", j + 1, t); jl_safe_printf(" (sticky: %d, started: %d, state: %d, tid: %d)\n", - t->sticky, t->started, jl_atomic_load_relaxed(&t->_state), + t->sticky, t->started, t_state, jl_atomic_load_relaxed(&t->tid) + 1); if (t->stkbuf != NULL) jlbacktracet(t); From a49a909e79405aca16d493bcba2af07d76da44b0 Mon Sep 17 00:00:00 2001 From: Diogo Netto Date: Mon, 27 Mar 2023 12:31:57 -0300 Subject: [PATCH 369/369] 48660.patch --- src/codegen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/codegen.cpp b/src/codegen.cpp index c7aba9a4942cd..f85197cd3ccac 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -10,7 +10,7 @@ #if defined(_CPU_X86_) #define JL_NEED_FLOATTEMP_VAR 1 #endif -#if defined(_OS_WINDOWS_) || defined(_OS_FREEBSD_) +#if defined(_OS_LINUX_) || defined(_OS_WINDOWS_) || defined(_OS_FREEBSD_) #define JL_DISABLE_FPO #endif