Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backports for 1.11.0-alpha2 #53543

Merged
merged 56 commits into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
6abaed1
add IR encoding for EnterNode (#53482)
JeffBezanson Feb 27, 2024
79421de
Avoid compiler warning about redefining jl_globalref_t (#53499)
fingolfin Feb 28, 2024
4301147
update staled `Core.Compiler.Effects` documentation (#53507)
aviatesk Feb 28, 2024
b701b5d
add back an alias for `check_top_bit` (#53523)
KristofferC Feb 29, 2024
1366e34
add _readdirx for returning more object info gathered during dir scan…
IanButterworth Feb 29, 2024
0520b80
fix InteractiveUtils call in Base.runtests on failure (#53525)
vtjnash Mar 1, 2024
8912805
Add a lazy `logrange` function and `LogRange` type (#39071)
mcabbott Feb 16, 2024
42a71a5
Allow AnnotatedStrings in log messages (#51802)
tecosaur Feb 17, 2024
6904351
improve `--heap-size-hint` arg handling (#48050)
mbauman Feb 23, 2024
7859e32
use more efficient `_readdirx` for tab completion (#53540)
IanButterworth Mar 1, 2024
b63e086
use `_readdirx` for `walkdir` (#53545)
IanButterworth Mar 1, 2024
c01ef98
Always return a value in 1-d circshift! of abstractarray.jl (#53554)
erich-9 Mar 3, 2024
53180e4
yet more atomics & cache-line fixes on work-stealing queue (#53424)
d-netto Mar 4, 2024
d30d8ef
Update Documenter to v1.3 for inventory writing (#53571)
goerz Mar 4, 2024
bd6b7eb
Move parallel precompilation to Base (#53403)
KristofferC Mar 5, 2024
f8fd7fd
add back `unsafe_convert` to pointer for arrays (#53589)
KristofferC Mar 5, 2024
d98f9cd
build: remove extra .a file (#53596)
inkydragon Mar 5, 2024
fb60a88
fix error path in `precompilepkgs` (#53606)
KristofferC Mar 5, 2024
2d89fee
bump Pkg
DilumAluthgeBot Mar 5, 2024
f46f0b8
task splitting: change additive accumulation to multiplicative (#53408)
StefanKarpinski Feb 28, 2024
2d485dc
revert "Add @create_log_macro for making custom styled logging macros…
IanButterworth Mar 2, 2024
f859acd
Unexport with, at_with, and ScopedValue from Base (#53004)
vchuravy Mar 6, 2024
dbc0241
typeintersect: fix `UnionAll` unaliasing bug caused by innervars. (#5…
N5N3 Mar 6, 2024
32efb7e
🤖 [master] Bump the Pkg stdlib from e7d740ac8 to 56c379045
DilumAluthge Mar 7, 2024
2a7100a
inlining: use method match signature for union-spliting (#53600)
aviatesk Mar 7, 2024
b3fdb92
Merge branch 'release-1.11' into backports-release-1.11
KristofferC Mar 8, 2024
814257c
add `construct_[post]domtree(::[IRCode|CFG])` interfaces (#53638)
aviatesk Mar 8, 2024
334fd49
bump Pkg
KristofferC Mar 8, 2024
06d5ca1
precompilepkgs: package in boths deps and weakdeps are in fact only w…
KristofferC Mar 8, 2024
a66bbfa
inlining: remove ineffective handling for unmatched params (#52092)
aviatesk Mar 13, 2024
6e80df2
inlining: bail out unless `match.spec_types <: match.method.sig` (#53…
aviatesk Mar 15, 2024
5adc0f6
Orthogonalize re-indexing for FastSubArrays (#53369)
jishnub Feb 18, 2024
12add8d
typo fix in scoped values docs (#53629)
palday Mar 7, 2024
90454b2
sroa: Fix incorrect scope counting (#53630)
Keno Mar 8, 2024
b147539
Use Base parallel precompilation to build stdlibs (#53598)
IanButterworth Mar 8, 2024
e6e8a1d
Fix bootstrap Base precompile in cross compile configuration (#53671)
Keno Mar 9, 2024
fcadc06
Load Pkg if not already to reinstate missing package add prompt (#52125)
IanButterworth Mar 9, 2024
8c9015f
Handle zero on arrays of unions of number types and missings (#53602)
oxinabox Mar 9, 2024
aa90ae7
permit NamedTuple{<:Any, Union{}} to be created (#53516)
vtjnash Mar 9, 2024
760f368
Bump CSL to 1.1.1 to fix libgomp bug (#53643)
gbaraldi Mar 9, 2024
ab37ee5
move precompile workload back from Base (#53679)
IanButterworth Mar 10, 2024
15f13f7
add isassigned methods for reinterpretarray (#53663)
vtjnash Mar 11, 2024
21a2602
[REPL] fix incorrectly cleared line after completions accepted (#53662)
vtjnash Mar 11, 2024
fd9c49c
Linalg: matprod_dest for Diagonal and adjvec (#53611)
jishnub Mar 11, 2024
641ae2c
fix #52025, re-allow all implicit pointer casts in cconvert for Array…
JeffBezanson Mar 11, 2024
0087a11
LAPACK: validate input parameters to throw informative errors (#53631)
jishnub Mar 12, 2024
91da115
Make some improvements to the Scoped Values documentation. (#53628)
CameronBieganek Mar 12, 2024
02839bd
codegen: change tbaa of ptr_phi to tbaa_value (#53655)
gbaraldi Mar 14, 2024
2e45f8f
Default to the medium code model in x86 linux (#53391)
gbaraldi Mar 14, 2024
2623abb
Enable analyzegc checks for try catch and fix found issues (#53527)
gbaraldi Mar 15, 2024
f54bb4c
Increase build precompilation (#53682)
IanButterworth Mar 14, 2024
b6c957b
Fix linear indexing for ReshapedArray if the parent has offset axes …
jishnub Mar 11, 2024
22db541
Use `@test ... skip=...` instead of `@test_skip`
giordano Feb 26, 2024
b9aaff5
Move `isexecutable, isreadable, iswritable` to `filesystem.jl` (#53699)
fatteneder Mar 13, 2024
b5e4104
update Pkg release branch
IanButterworth Mar 17, 2024
d6d84ed
🤖 [backports-release-1.11] Bump the Pkg stdlib from 1e6fa605f to bd78…
DilumAluthgeBot Mar 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1487,7 +1487,7 @@ endif
CLANGSA_FLAGS :=
CLANGSA_CXXFLAGS :=
ifeq ($(OS), Darwin) # on new XCode, the files are hidden
CLANGSA_FLAGS += -isysroot $(shell xcode-select -p)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
CLANGSA_FLAGS += -isysroot $(shell xcrun --show-sdk-path -sdk macosx)
endif
ifeq ($(USEGCC),1)
# try to help clang find the c++ files for CC by guessing the value for --prefix
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ julia-debug julia-release : julia-% : julia-sysimg-% julia-src-% julia-symlink j
julia-libccalllazyfoo julia-libccalllazybar julia-libllvmcalltest julia-base-cache

stdlibs-cache-release stdlibs-cache-debug : stdlibs-cache-% : julia-%
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) -f pkgimage.mk all-$*
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) -f pkgimage.mk $*

debug release : % : julia-% stdlibs-cache-%

Expand Down Expand Up @@ -289,6 +289,7 @@ else ifeq ($(JULIA_BUILD_MODE),debug)
-$(INSTALL_M) $(build_libdir)/libjulia-internal-debug.dll.a $(DESTDIR)$(libdir)/
endif
-$(INSTALL_M) $(wildcard $(build_private_libdir)/*.a) $(DESTDIR)$(private_libdir)/
-rm -f $(DESTDIR)$(private_libdir)/sys-o.a

# We have a single exception; we want 7z.dll to live in private_libexecdir,
# not bindir, so that 7z.exe can find it.
Expand Down Expand Up @@ -587,6 +588,7 @@ clean: | $(CLEAN_TARGETS)
@-$(MAKE) -C $(BUILDROOT)/cli clean
@-$(MAKE) -C $(BUILDROOT)/test clean
@-$(MAKE) -C $(BUILDROOT)/stdlib clean
@-$(MAKE) -C $(BUILDROOT) -f pkgimage.mk clean
-rm -f $(BUILDROOT)/julia
-rm -f $(BUILDROOT)/*.tar.gz
-rm -f $(build_depsbindir)/stringreplace \
Expand Down
7 changes: 1 addition & 6 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ New library functions
annotated and unannotated content.
* `in!(x, s::AbstractSet)` will return whether `x` is in `s`, and insert `x` in `s` if not ([#45156], [#51636]).
* The new `Libc.mkfifo` function wraps the `mkfifo` C function on Unix platforms ([#34587]).
* `logrange(start, stop; length)` makes a range of constant ratio, instead of constant step ([#39071])
* `copyuntil(out, io, delim)` and `copyline(out, io)` copy data into an `out::IO` stream ([#48273]).
* `eachrsplit(string, pattern)` iterates split substrings right to left ([#51646]).
* `Sys.username()` can be used to return the current user's username ([#51897]).
Expand Down Expand Up @@ -157,12 +158,6 @@ Standard library changes
* Packages that specialize matrix-matrix `mul!` with a method signature of the form `mul!(::AbstractMatrix, ::MyMatrix, ::AbstractMatrix, ::Number, ::Number)` no longer encounter method ambiguities when interacting with `LinearAlgebra`. Previously, ambiguities used to arise when multiplying a `MyMatrix` with a structured matrix type provided by LinearAlgebra, such as `AbstractTriangular`, which used to necessitate additional methods to resolve such ambiguities. Similar sources of ambiguities have also been removed for matrix-vector `mul!` operations ([#52837]).
* `lu` and `issuccess(::LU)` now accept an `allowsingular` keyword argument. When set to `true`, a valid factorization with rank-deficient U factor will be treated as success instead of throwing an error. Such factorizations are now shown by printing the factors together with a "rank-deficient" note rather than printing a "Failed Factorization" message ([#52957]).

#### Logging

* New `@create_log_macro` macro for creating new log macros like `@info`, `@warn` etc. For instance
`@create_log_macro MyLog 1500 :magenta` will create `@mylog` to be used like `@mylog "hello"` which
will show as `┌ MyLog: hello` etc. ([#52196]).

#### Random

* `rand` now supports sampling over `Tuple` types ([#35856], [#50251]).
Expand Down
57 changes: 2 additions & 55 deletions base/Base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,8 @@ if isdefined(Core, :Compiler) && is_primary_base_module
Docs.loaddocs(Core.Compiler.CoreDocs.DOCS)
end

include("precompilation.jl")

# finally, now make `include` point to the full version
for m in methods(include)
delete_method(m)
Expand All @@ -565,61 +567,6 @@ end_base_include = time_ns()
const _sysimage_modules = PkgId[]
in_sysimage(pkgid::PkgId) = pkgid in _sysimage_modules

# 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())
m = match.method
delete!(push!(Set{Method}(), m), m)
copy(Core.Compiler.retrieve_code_info(Core.Compiler.specialize_method(match), typemax(UInt)))

empty!(Set())
push!(push!(Set{Union{GlobalRef,Symbol}}(), :two), GlobalRef(Base, :two))
(setindex!(Dict{String,Base.PkgId}(), Base.PkgId(Base), "file.jl"))["file.jl"]
(setindex!(Dict{Symbol,Vector{Int}}(), [1], :two))[:two]
(setindex!(Dict{Base.PkgId,String}(), "file.jl", Base.PkgId(Base)))[Base.PkgId(Base)]
(setindex!(Dict{Union{GlobalRef,Symbol}, Vector{Int}}(), [1], :two))[:two]
(setindex!(IdDict{Type, Union{Missing, Vector{Tuple{LineNumberNode, Expr}}}}(), missing, Int))[Int]
Dict{Symbol, Union{Nothing, Bool, Symbol}}(:one => false)[:one]
Dict(Base => [:(1+1)])[Base]
Dict(:one => [1])[:one]
Dict("abc" => Set())["abc"]
pushfirst!([], sum)
get(Base.pkgorigins, Base.PkgId(Base), nothing)
sort!([1,2,3])
unique!([1,2,3])
cumsum([1,2,3])
append!(Int[], BitSet())
isempty(BitSet())
delete!(BitSet([1,2]), 3)
deleteat!(Int32[1,2,3], [1,3])
deleteat!(Any[1,2,3], [1,3])
Core.svec(1, 2) == Core.svec(3, 4)
any(t->t[1].line > 1, [(LineNumberNode(2,:none), :(1+1))])

# 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

if is_primary_base_module

# Profiling helper
Expand Down
5 changes: 3 additions & 2 deletions base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,7 @@ end
copymutable(itr) = collect(itr)

zero(x::AbstractArray{T}) where {T<:Number} = fill!(similar(x, typeof(zero(T))), zero(T))
zero(x::AbstractArray{S}) where {S<:Union{Missing, Number}} = fill!(similar(x, typeof(zero(S))), zero(S))
zero(x::AbstractArray) = map(zero, x)

## iteration support for arrays by iterating over `eachindex` in the array ##
Expand Down Expand Up @@ -3643,9 +3644,9 @@ end
## 1-d circshift ##
function circshift!(a::AbstractVector, shift::Integer)
n = length(a)
n == 0 && return
n == 0 && return a
shift = mod(shift, n)
shift == 0 && return
shift == 0 && return a
l = lastindex(a)
reverse!(a, firstindex(a), l-shift)
reverse!(a, l-shift+1, lastindex(a))
Expand Down
5 changes: 3 additions & 2 deletions base/boot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,8 @@ eval(Core, :(NamedTuple{names}(args::Tuple) where {names} =

using .Intrinsics: sle_int, add_int

eval(Core, :(NamedTuple{names,T}(args::T) where {names, T <: Tuple} =
$(Expr(:splatnew, :(NamedTuple{names,T}), :args))))
eval(Core, :((NT::Type{NamedTuple{names,T}})(args::T) where {names, T <: Tuple} =
$(Expr(:splatnew, :NT, :args))))

# constructors for built-in types

Expand Down Expand Up @@ -969,6 +969,7 @@ arrayset(inbounds::Bool, A::Array{T}, x::Any, i::Int...) where {T} = Main.Base.s
arraysize(a::Array) = a.size
arraysize(a::Array, i::Int) = sle_int(i, nfields(a.size)) ? getfield(a.size, i) : 1
export arrayref, arrayset, arraysize, const_arrayref
const check_top_bit = check_sign_bit

# For convenience
EnterNode(old::EnterNode, new_dest::Int) = isdefined(old, :scope) ?
Expand Down
2 changes: 1 addition & 1 deletion base/compiler/abstractinterpretation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2686,7 +2686,7 @@ function refine_partial_type(@nospecialize t)
# if the first/second parameter of `NamedTuple` is known to be empty,
# the second/first argument should also be empty tuple type,
# so refine it here
return Const(NamedTuple())
return Const((;))
end
return t
end
Expand Down
13 changes: 6 additions & 7 deletions base/compiler/effects.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,16 @@ following meanings:
except that it may access or modify mutable memory pointed to by its call arguments.
This may later be refined to `ALWAYS_TRUE` in a case when call arguments are known to be immutable.
This state corresponds to LLVM's `inaccessiblemem_or_argmemonly` function attribute.
- `noub::Bool`: indicates that the method will not execute any undefined behavior (for any input).
- `noub::UInt8`: indicates that the method will not execute any undefined behavior (for any input).
Note that undefined behavior may technically cause the method to violate any other effect
assertions (such as `:consistent` or `:effect_free`) as well, but we do not model this,
and they assume the absence of undefined behavior.
* `ALWAYS_TRUE`: this method is guaranteed to not execute any undefined behavior.
* `ALWAYS_FALSE`: this method may execute undefined behavior.
* `NOUB_IF_NOINBOUNDS`: this method is guaranteed to not execute any undefined behavior
if the caller does not set nor propagate the `@inbounds` context.
- `nonoverlayed::Bool`: indicates that any methods that may be called within this method
are not defined in an [overlayed method table](@ref OverlayMethodTable).
- `noinbounds::Bool`: If set, indicates that this method does not read the parent's `:inbounds`
state. In particular, it does not have any reached `:boundscheck` exprs, not propagates inbounds
to any children that do.

Note that the representations above are just internal implementation details and thus likely
to change in the future. See [`Base.@assume_effects`](@ref) for more detailed explanation
Expand Down Expand Up @@ -92,9 +93,7 @@ The output represents the state of different effect properties in the following
7. `noub` (`u`):
- `+u` (green): `true`
- `-u` (red): `false`
8. `noinbounds` (`i`):
- `+i` (green): `true`
- `-i` (red): `false`
- `?u` (yellow): `NOUB_IF_NOINBOUNDS`

Additionally, if the `nonoverlayed` property is false, a red prime symbol (′) is displayed after the tuple.
"""
Expand Down
6 changes: 3 additions & 3 deletions base/compiler/inferencestate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ mutable struct LazyCFGReachability
end
function get!(x::LazyCFGReachability)
isdefined(x, :reachability) && return x.reachability
domtree = construct_domtree(x.ir.cfg.blocks)
domtree = construct_domtree(x.ir)
return x.reachability = CFGReachability(x.ir.cfg, domtree)
end

Expand All @@ -189,8 +189,8 @@ end
function get!(x::LazyGenericDomtree{IsPostDom}) where {IsPostDom}
isdefined(x, :domtree) && return x.domtree
return @timeit "domtree 2" x.domtree = IsPostDom ?
construct_postdomtree(x.ir.cfg.blocks) :
construct_domtree(x.ir.cfg.blocks)
construct_postdomtree(x.ir) :
construct_domtree(x.ir)
end

const LazyDomtree = LazyGenericDomtree{false}
Expand Down
4 changes: 2 additions & 2 deletions base/compiler/optimize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ function get!(lazyagdomtree::LazyAugmentedDomtree)
cfg_insert_edge!(cfg, bb, length(cfg.blocks))
end
end
domtree = construct_domtree(cfg.blocks)
domtree = construct_domtree(cfg)
return lazyagdomtree.agdomtree = AugmentedDomtree(cfg, domtree)
end

Expand Down Expand Up @@ -1187,7 +1187,7 @@ function slot2reg(ir::IRCode, ci::CodeInfo, sv::OptimizationState)
# need `ci` for the slot metadata, IR for the code
svdef = sv.linfo.def
nargs = isa(svdef, Method) ? Int(svdef.nargs) : 0
@timeit "domtree 1" domtree = construct_domtree(ir.cfg.blocks)
@timeit "domtree 1" domtree = construct_domtree(ir)
defuse_insts = scan_slot_def_use(nargs, ci, ir.stmts.stmt)
𝕃ₒ = optimizer_lattice(sv.inlining.interp)
@timeit "construct_ssa" ir = construct_ssa!(ci, ir, sv, domtree, defuse_insts, 𝕃ₒ) # consumes `ir`
Expand Down
Loading