Skip to content

Commit 0009fb6

Browse files
authored
Merge branch 'master' into jishnub/diagview
2 parents 06d50cb + 04259da commit 0009fb6

File tree

168 files changed

+6372
-4106
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+6372
-4106
lines changed

Make.inc

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,8 +938,12 @@ endif
938938

939939
#If nothing is set default to native unless we are cross-compiling
940940
ifeq ($(MARCH)$(MCPU)$(MTUNE)$(JULIA_CPU_TARGET)$(XC_HOST),)
941-
ifeq ($(ARCH),aarch64) #ARM recommends only setting MCPU for AArch64
941+
ifeq ($(ARCH),aarch64)
942+
# ARM recommends only setting MCPU for AArch64
942943
MCPU=native
944+
else ifneq (,$(findstring riscv64,$(ARCH)))
945+
# RISC-V doesn't have a native option
946+
$(error Building for RISC-V requires a specific MARCH to be set))
943947
else
944948
MARCH=native
945949
MTUNE=native
@@ -995,6 +999,9 @@ endif
995999
ifneq (,$(findstring arm,$(ARCH)))
9961000
DIST_ARCH:=arm
9971001
endif
1002+
ifneq (,$(findstring riscv64,$(ARCH)))
1003+
DIST_ARCH:=riscv64
1004+
endif
9981005

9991006
JULIA_BINARYDIST_FILENAME := julia-$(JULIA_COMMIT)-$(DIST_OS)$(DIST_ARCH)
10001007
endif
@@ -1018,8 +1025,12 @@ ifneq ($(MARCH),)
10181025
CC += -march=$(MARCH)
10191026
CXX += -march=$(MARCH)
10201027
FC += -march=$(MARCH)
1028+
# On RISC-V, don't forward the MARCH ISA string to JULIA_CPU_TARGET,
1029+
# as it's always incompatible with LLVM's CPU target name parser.
1030+
ifeq (,$(findstring riscv64,$(ARCH)))
10211031
JULIA_CPU_TARGET ?= $(MARCH)
10221032
endif
1033+
endif
10231034

10241035
# Set MCPU-specific flags
10251036
ifneq ($(MCPU),)

NEWS.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ variables. ([#53742]).
6868
Multi-threading changes
6969
-----------------------
7070

71+
* New types are defined to handle the pattern of code that must run once per process, called
72+
a `OncePerProcess{T}` type, which allows defining a function that should be run exactly once
73+
the first time it is called, and then always return the same result value of type `T`
74+
every subsequent time afterwards. There are also `OncePerThread{T}` and `OncePerTask{T}` types for
75+
similar usage with threads or tasks. ([#TBD])
76+
7177
Build system changes
7278
--------------------
7379

@@ -141,6 +147,9 @@ Standard library changes
141147
* A new function `zeroslike` is added that is used to generate the zero elements for matrix-valued banded matrices.
142148
Custom array types may specialize this function to return an appropriate result. ([#55252])
143149
* A new function `diagview` is added that returns a view into a specific band of an `AbstractMatrix`.
150+
Custom array types may specialize this function to return an appropriate result ([#55252]).
151+
* The matrix multiplication `A * B` calls `matprod_dest(A, B, T::Type)` to generate the destination.
152+
This function is now public ([#55537]).
144153

145154
#### Logging
146155

@@ -166,6 +175,8 @@ Standard library changes
166175
- the REPL will now warn if it detects a name is being accessed from a module which does not define it (nor has a submodule which defines it),
167176
and for which the name is not public in that module. For example, `map` is defined in Base, and executing `LinearAlgebra.map`
168177
in the REPL will now issue a warning the first time occurs. ([#54872])
178+
- When an object is printed automatically (by being returned in the REPL), its display is now truncated after printing 20 KiB.
179+
This does not affect manual calls to `show`, `print`, and so forth. ([#53959])
169180

170181
#### SuiteSparse
171182

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ and then use the command prompt to change into the resulting julia directory. By
9292
Julia. However, most users should use the [most recent stable version](https://github.com/JuliaLang/julia/releases)
9393
of Julia. You can get this version by running:
9494

95-
git checkout v1.10.5
95+
git checkout v1.11.1
9696

9797
To build the `julia` executable, run `make` from within the julia directory.
9898

base/Base.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ include("essentials.jl")
173173
include("ctypes.jl")
174174
include("gcutils.jl")
175175
include("generator.jl")
176+
include("runtime_internals.jl")
176177
include("reflection.jl")
177178
include("options.jl")
178179

@@ -532,6 +533,7 @@ include("deepcopy.jl")
532533
include("download.jl")
533534
include("summarysize.jl")
534535
include("errorshow.jl")
536+
include("util.jl")
535537

536538
include("initdefs.jl")
537539
Filesystem.__postinit__()
@@ -548,7 +550,6 @@ include("loading.jl")
548550

549551
# misc useful functions & macros
550552
include("timing.jl")
551-
include("util.jl")
552553
include("client.jl")
553554
include("asyncmap.jl")
554555

base/array.jl

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,17 @@ copy
355355
return $(Expr(:new, :(typeof(a)), :(memoryref(newmem)), :(a.size)))
356356
end
357357

358+
# a mutating version of copyto! that results in dst aliasing src afterwards
359+
function _take!(dst::Array{T,N}, src::Array{T,N}) where {T,N}
360+
if getfield(dst, :ref) !== getfield(src, :ref)
361+
setfield!(dst, :ref, getfield(src, :ref))
362+
end
363+
if getfield(dst, :size) !== getfield(src, :size)
364+
setfield!(dst, :size, getfield(src, :size))
365+
end
366+
return dst
367+
end
368+
358369
## Constructors ##
359370

360371
similar(a::Array{T,1}) where {T} = Vector{T}(undef, size(a,1))
@@ -999,11 +1010,11 @@ function setindex!(A::Array{T}, x, i1::Int, i2::Int, I::Int...) where {T}
9991010
x = x isa T ? x : convert(T, x)::T
10001011
return _setindex!(A, x, i1, i2, I...)
10011012
end
1002-
function _setindex!(A::Array{T}, x, i1::Int, i2::Int, I::Int...) where {T}
1013+
function _setindex!(A::Array{T}, x::T, i1::Int, i2::Int, I::Int...) where {T}
10031014
@inline
10041015
@_noub_if_noinbounds_meta
10051016
@boundscheck checkbounds(A, i1, i2, I...) # generally _to_linear_index requires bounds checking
1006-
memoryrefset!(memoryrefnew(A.ref, _to_linear_index(A, i1, i2, I...), false), x isa T ? x : convert(T,x)::T, :not_atomic, false)
1017+
memoryrefset!(memoryrefnew(A.ref, _to_linear_index(A, i1, i2, I...), false), x, :not_atomic, false)
10071018
return A
10081019
end
10091020

base/binaryplatforms.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ const arch_mapping = Dict(
597597
"armv7l" => "arm(v7l)?", # if we just see `arm-linux-gnueabihf`, we assume it's `armv7l`
598598
"armv6l" => "armv6l",
599599
"powerpc64le" => "p(ower)?pc64le",
600-
"riscv64" => "riscv64",
600+
"riscv64" => "(rv64|riscv64)",
601601
)
602602
# Keep this in sync with `CPUID.ISAs_by_family`
603603
# These are the CPUID side of the microarchitectures targeted by GCC flags in BinaryBuilder.jl
@@ -631,6 +631,9 @@ const arch_march_isa_mapping = let
631631
"a64fx" => get_set("aarch64", "a64fx"),
632632
"apple_m1" => get_set("aarch64", "apple_m1"),
633633
],
634+
"riscv64" => [
635+
"riscv64" => get_set("riscv64", "riscv64")
636+
],
634637
"powerpc64le" => [
635638
"power8" => get_set("powerpc64le", "power8"),
636639
],

base/compiler/abstractinterpretation.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2681,7 +2681,7 @@ function abstract_call(interp::AbstractInterpreter, arginfo::ArgInfo, sv::Infere
26812681
end
26822682
si = StmtInfo(!unused)
26832683
call = abstract_call(interp, arginfo, si, sv)::Future
2684-
Future{Nothing}(call, interp, sv) do call, interp, sv
2684+
Future{Any}(call, interp, sv) do call, interp, sv
26852685
# this only is needed for the side-effect, sequenced before any task tries to consume the return value,
26862686
# which this will do even without returning this Future
26872687
sv.stmt_info[sv.currpc] = call.info
@@ -2833,7 +2833,7 @@ function abstract_eval_new_opaque_closure(interp::AbstractInterpreter, e::Expr,
28332833
pushfirst!(argtypes, rt.env)
28342834
callinfo = abstract_call_opaque_closure(interp, rt,
28352835
ArgInfo(nothing, argtypes), StmtInfo(true), sv, #=check=#false)::Future
2836-
Future{Nothing}(callinfo, interp, sv) do callinfo, interp, sv
2836+
Future{Any}(callinfo, interp, sv) do callinfo, interp, sv
28372837
sv.stmt_info[sv.currpc] = OpaqueClosureCreateInfo(callinfo)
28382838
nothing
28392839
end
@@ -3775,6 +3775,7 @@ function typeinf(interp::AbstractInterpreter, frame::InferenceState)
37753775
takeprev = 0
37763776
while takenext >= frame.frameid
37773777
callee = takenext == 0 ? frame : callstack[takenext]::InferenceState
3778+
interp = callee.interp
37783779
if !isempty(callstack)
37793780
if length(callstack) - frame.frameid >= minwarn
37803781
topmethod = callstack[1].linfo

base/compiler/cicache.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ end
1313

1414
function setindex!(cache::InternalCodeCache, ci::CodeInstance, mi::MethodInstance)
1515
@assert ci.owner === cache.owner
16+
m = mi.def
17+
if isa(m, Method) && m.module != Core
18+
ccall(:jl_push_newly_inferred, Cvoid, (Any,), ci)
19+
end
1620
ccall(:jl_mi_cache_insert, Cvoid, (Any, Any), mi, ci)
1721
return cache
1822
end

base/compiler/compiler.jl

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -38,53 +38,12 @@ convert(::Type{T}, x::T) where {T} = x
3838
# Note that `@assume_effects` is available only after loading namedtuple.jl.
3939
abstract type MethodTableView end
4040
abstract type AbstractInterpreter end
41-
struct EffectsOverride
42-
consistent::Bool
43-
effect_free::Bool
44-
nothrow::Bool
45-
terminates_globally::Bool
46-
terminates_locally::Bool
47-
notaskstate::Bool
48-
inaccessiblememonly::Bool
49-
noub::Bool
50-
noub_if_noinbounds::Bool
51-
consistent_overlay::Bool
52-
nortcall::Bool
53-
end
54-
function EffectsOverride(
55-
override::EffectsOverride =
56-
EffectsOverride(false, false, false, false, false, false, false, false, false, false, false);
57-
consistent::Bool = override.consistent,
58-
effect_free::Bool = override.effect_free,
59-
nothrow::Bool = override.nothrow,
60-
terminates_globally::Bool = override.terminates_globally,
61-
terminates_locally::Bool = override.terminates_locally,
62-
notaskstate::Bool = override.notaskstate,
63-
inaccessiblememonly::Bool = override.inaccessiblememonly,
64-
noub::Bool = override.noub,
65-
noub_if_noinbounds::Bool = override.noub_if_noinbounds,
66-
consistent_overlay::Bool = override.consistent_overlay,
67-
nortcall::Bool = override.nortcall)
68-
return EffectsOverride(
69-
consistent,
70-
effect_free,
71-
nothrow,
72-
terminates_globally,
73-
terminates_locally,
74-
notaskstate,
75-
inaccessiblememonly,
76-
noub,
77-
noub_if_noinbounds,
78-
consistent_overlay,
79-
nortcall)
80-
end
81-
const NUM_EFFECTS_OVERRIDES = 11 # sync with julia.h
8241

8342
# essential files and libraries
8443
include("essentials.jl")
8544
include("ctypes.jl")
8645
include("generator.jl")
87-
include("reflection.jl")
46+
include("runtime_internals.jl")
8847
include("options.jl")
8948

9049
ntuple(f, ::Val{0}) = ()

base/compiler/effects.jl

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -355,36 +355,5 @@ function decode_effects(e::UInt32)
355355
_Bool((e >> 14) & 0x01))
356356
end
357357

358-
function encode_effects_override(eo::EffectsOverride)
359-
e = 0x0000
360-
eo.consistent && (e |= (0x0001 << 0))
361-
eo.effect_free && (e |= (0x0001 << 1))
362-
eo.nothrow && (e |= (0x0001 << 2))
363-
eo.terminates_globally && (e |= (0x0001 << 3))
364-
eo.terminates_locally && (e |= (0x0001 << 4))
365-
eo.notaskstate && (e |= (0x0001 << 5))
366-
eo.inaccessiblememonly && (e |= (0x0001 << 6))
367-
eo.noub && (e |= (0x0001 << 7))
368-
eo.noub_if_noinbounds && (e |= (0x0001 << 8))
369-
eo.consistent_overlay && (e |= (0x0001 << 9))
370-
eo.nortcall && (e |= (0x0001 << 10))
371-
return e
372-
end
373-
374-
function decode_effects_override(e::UInt16)
375-
return EffectsOverride(
376-
!iszero(e & (0x0001 << 0)),
377-
!iszero(e & (0x0001 << 1)),
378-
!iszero(e & (0x0001 << 2)),
379-
!iszero(e & (0x0001 << 3)),
380-
!iszero(e & (0x0001 << 4)),
381-
!iszero(e & (0x0001 << 5)),
382-
!iszero(e & (0x0001 << 6)),
383-
!iszero(e & (0x0001 << 7)),
384-
!iszero(e & (0x0001 << 8)),
385-
!iszero(e & (0x0001 << 9)),
386-
!iszero(e & (0x0001 << 10)))
387-
end
388-
389358
decode_statement_effects_override(ssaflag::UInt32) =
390359
decode_effects_override(UInt16((ssaflag >> NUM_IR_FLAGS) & (1 << NUM_EFFECTS_OVERRIDES - 1)))

0 commit comments

Comments
 (0)