Skip to content

Commit f9b2614

Browse files
authored
release-1.10: Backports for 1.10-alpha2 (#50508)
Backported PRs: - [x] #50411 <!-- Fix weird dispatch of * with zero arguments --> - [x] #50202 <!-- Remove dynamic dispatch from _wait/wait2 --> - [x] #50064 <!-- Fix numbered prompt with input only with comment --> - [x] #50026 <!-- Store heapsnapshot files in tempdir() instead of current directory --> - [x] #50402 <!-- Add CPU feature helper function --> - [x] #50387 <!-- update newpages pointer after actually sweeping pages --> - [x] #50424 <!-- avoid potential type-instability in _replace_(str, ...) --> - [x] #50444 <!-- Optimize getfield lowering to avoid boxing in some cases --> - [x] #50474 <!-- docs: Fix a `!!! note` which was miscapitalized --> - [x] #50466 <!-- relax assertion involving pg->nold to reflect that it may be a bit in… --> - [x] #50490 <!-- Fix compat annotation for italic printstyled --> - [x] #50488 <!-- fix typo in `Base.isassigned` with `Tridiagonal` --> - [x] #50476 <!-- Profile: Add specifying dir for `take_heap_snapshot` and handling if current dir is unwritable --> - [x] #50461 <!-- fix typo in the --gcthreads argument description --> - [x] #50528 <!-- ssair: Correctly handle stmt insertion at end of basic block --> - [x] #50533 <!-- ensure internal_obj_base_ptr checks whether objects past freelist pointer are in freelist --> - [x] #49322 <!-- improve cat design / performance --> - [x] #50540 <!-- gc: remove over-eager assertion --> - [x] #50542 <!-- gf: remove unnecessary assert cycle==depth --> - [x] #50559 <!-- Expand kwcall lowering positional default check to vararg --> - [x] #50058 <!-- Add unwrapping mechanism for triangular mul and solves --> - [x] #50551 <!-- typeintersect: also record chained `innervars` --> - [x] #50552 <!-- read(io, Char): fix read with too many leading ones --> - [x] #50541 <!-- precompile: ensure globals are not accidentally created where disallowed --> - [x] #50576 <!-- use atomic compare exchange when setting the GC mark-bit --> - [x] #50578 <!-- gf: make method overwrite/delete an error during precompile --> - [x] #50516 <!-- Fix visibility of assert on GCC12/13 --> - [x] #50597 <!-- Fix memory corruption if task is launched inside finalizer --> - [x] #50591 <!-- build: fix various makefile bugs --> - [x] #50599 <!-- faster invalid object lookup in conservative gc --> - [x] #50634 <!-- 🤖 [master] Bump the SparseArrays stdlib from b4b0e72 to 99c99b4 --> - [x] #50639 <!-- Backport LLVM patches to fix various issues. --> - [x] #50546 <!-- Revert storage of method instance in LineInfoNode --> - [x] #50631 <!-- Shift DCE pass to optimize imaging mode code better --> - [x] #50525 <!-- only check that values are finite in `generic_lufact` when `check=true` --> - [x] #50587 <!-- isassigned for ranges with BigInt indices --> - [x] #50144 <!-- Page based heap size heuristics --> Need manual backport: - [ ] #50595 <!-- Rename ENV variable `JULIA_USE_NEW_PARSER` -> `JULIA_USE_FLISP_PARSER` --> Non-merged PRs with backport label: - [ ] #50637 <!-- Remove SparseArrays legacy code --> - [ ] #50618 <!-- inference: continue const-prop' when concrete-eval returns non-inlineable --> - [ ] #50598 <!-- only limit types in stack traces in the REPL --> - [ ] #50594 <!-- Disallow non-index Integer types in isassigned --> - [ ] #50568 <!-- `Array(::AbstractRange)` should return an `Array` --> - [ ] #50523 <!-- Avoid generic call in most cases for getproperty --> - [ ] #50172 <!-- print feature flags used for matching pkgimage -->
2 parents bda3e09 + 152f0e9 commit f9b2614

Some content is hidden

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

100 files changed

+2039
-1486
lines changed

Make.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -603,15 +603,15 @@ endif
603603

604604
ifeq ($(OS),WINNT)
605605
define versioned_libname
606-
$$(if $(2),$(1)-$(2).$(SHLIB_EXT),$(1).$(SHLIB_EXT))
606+
$(if $(2),$(1)-$(2).$(SHLIB_EXT),$(1).$(SHLIB_EXT))
607607
endef
608608
else ifeq ($(OS),Darwin)
609609
define versioned_libname
610-
$$(if $(2),$(1).$(2).$(SHLIB_EXT),$(1).$(SHLIB_EXT))
610+
$(if $(2),$(1).$(2).$(SHLIB_EXT),$(1).$(SHLIB_EXT))
611611
endef
612612
else
613613
define versioned_libname
614-
$$(if $(2),$(1).$(SHLIB_EXT).$(2),$(1).$(SHLIB_EXT))
614+
$(if $(2),$(1).$(SHLIB_EXT).$(2),$(1).$(SHLIB_EXT))
615615
endef
616616
endif
617617

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ else ifeq ($(JULIA_BUILD_MODE),debug)
196196
JL_PRIVATE_LIBS-0 += libjulia-internal-debug libjulia-codegen-debug
197197
endif
198198
ifeq ($(USE_GPL_LIBS), 1)
199-
JL_PRIVATE_LIBS-$(USE_SYSTEM_LIBSUITESPARSE) += libamd libbtf libcamd libccolamd libcholmod libcolamd libklu libldl librbio libspqr libsuitesparseconfig libumfpack
199+
JL_PRIVATE_LIBS-$(USE_SYSTEM_LIBSUITESPARSE) += libamd libbtf libcamd libccolamd libcholmod libcholmod_cuda libcolamd libklu libldl librbio libspqr libspqr_cuda libsuitesparseconfig libumfpack
200200
endif
201201
JL_PRIVATE_LIBS-$(USE_SYSTEM_LIBBLASTRAMPOLINE) += libblastrampoline
202202
JL_PRIVATE_LIBS-$(USE_SYSTEM_PCRE) += libpcre2-8

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Language changes
3131

3232
Compiler/Runtime improvements
3333
-----------------------------
34+
* Updated GC heuristics to count allocated pages instead of individual objects ([#50144]).
3435

3536
* The `@pure` macro is now deprecated. Use `Base.@assume_effects :foldable` instead ([#48682]).
3637
* The mark phase of the Garbage Collector is now multi-threaded ([#48600]).
@@ -67,6 +68,8 @@ New library features
6768
* A `CartesianIndex` is now treated as a "scalar" for broadcasting ([#47044]).
6869
* `printstyled` now supports italic output ([#45164]).
6970
* `parent` and `parentindices` support `SubString`s
71+
* `replace(string, pattern...)` now supports an optional `IO` argument to
72+
write the output to a stream rather than returning a string ([#48625]).
7073

7174
Standard library changes
7275
------------------------

base/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,11 @@ $(eval $(call symlink_system_library,LIBSUITESPARSE,libamd))
269269
$(eval $(call symlink_system_library,LIBSUITESPARSE,libcamd))
270270
$(eval $(call symlink_system_library,LIBSUITESPARSE,libccolamd))
271271
$(eval $(call symlink_system_library,LIBSUITESPARSE,libcholmod))
272+
$(eval $(call symlink_system_library,LIBSUITESPARSE,libcholmod_cuda))
272273
$(eval $(call symlink_system_library,LIBSUITESPARSE,libcolamd))
273274
$(eval $(call symlink_system_library,LIBSUITESPARSE,libumfpack))
274275
$(eval $(call symlink_system_library,LIBSUITESPARSE,libspqr))
276+
$(eval $(call symlink_system_library,LIBSUITESPARSE,libspqr_cuda))
275277
$(eval $(call symlink_system_library,LIBSUITESPARSE,libsuitesparseconfig))
276278
# EXCLUDED LIBRARIES (installed/used, but not vendored for use with dlopen):
277279
# libunwind

base/abstractarray.jl

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1651,7 +1651,7 @@ function _typed_hcat(::Type{T}, A::AbstractVecOrTuple{AbstractVecOrMat}) where T
16511651
for j = 1:nargs
16521652
Aj = A[j]
16531653
if size(Aj, 1) != nrows
1654-
throw(ArgumentError("number of rows of each array must match (got $(map(x->size(x,1), A)))"))
1654+
throw(DimensionMismatch("number of rows of each array must match (got $(map(x->size(x,1), A)))"))
16551655
end
16561656
dense &= isa(Aj,Array)
16571657
nd = ndims(Aj)
@@ -1686,7 +1686,7 @@ function _typed_vcat(::Type{T}, A::AbstractVecOrTuple{AbstractVecOrMat}) where T
16861686
ncols = size(A[1], 2)
16871687
for j = 2:nargs
16881688
if size(A[j], 2) != ncols
1689-
throw(ArgumentError("number of columns of each array must match (got $(map(x->size(x,2), A)))"))
1689+
throw(DimensionMismatch("number of columns of each array must match (got $(map(x->size(x,2), A)))"))
16901690
end
16911691
end
16921692
B = similar(A[1], T, nrows, ncols)
@@ -1984,16 +1984,14 @@ julia> cat(1, [2], [3;;]; dims=Val(2))
19841984

19851985
# The specializations for 1 and 2 inputs are important
19861986
# especially when running with --inline=no, see #11158
1987-
# The specializations for Union{AbstractVecOrMat,Number} are necessary
1988-
# to have more specialized methods here than in LinearAlgebra/uniformscaling.jl
19891987
vcat(A::AbstractArray) = cat(A; dims=Val(1))
19901988
vcat(A::AbstractArray, B::AbstractArray) = cat(A, B; dims=Val(1))
19911989
vcat(A::AbstractArray...) = cat(A...; dims=Val(1))
1992-
vcat(A::Union{AbstractVecOrMat,Number}...) = cat(A...; dims=Val(1))
1990+
vcat(A::Union{AbstractArray,Number}...) = cat(A...; dims=Val(1))
19931991
hcat(A::AbstractArray) = cat(A; dims=Val(2))
19941992
hcat(A::AbstractArray, B::AbstractArray) = cat(A, B; dims=Val(2))
19951993
hcat(A::AbstractArray...) = cat(A...; dims=Val(2))
1996-
hcat(A::Union{AbstractVecOrMat,Number}...) = cat(A...; dims=Val(2))
1994+
hcat(A::Union{AbstractArray,Number}...) = cat(A...; dims=Val(2))
19971995

19981996
typed_vcat(T::Type, A::AbstractArray) = _cat_t(Val(1), T, A)
19991997
typed_vcat(T::Type, A::AbstractArray, B::AbstractArray) = _cat_t(Val(1), T, A, B)
@@ -2055,8 +2053,8 @@ julia> hvcat((2,2,2), a,b,c,d,e,f) == hvcat(2, a,b,c,d,e,f)
20552053
true
20562054
```
20572055
"""
2058-
hvcat(rows::Tuple{Vararg{Int}}, xs::AbstractVecOrMat...) = typed_hvcat(promote_eltype(xs...), rows, xs...)
2059-
hvcat(rows::Tuple{Vararg{Int}}, xs::AbstractVecOrMat{T}...) where {T} = typed_hvcat(T, rows, xs...)
2056+
hvcat(rows::Tuple{Vararg{Int}}, xs::AbstractArray...) = typed_hvcat(promote_eltype(xs...), rows, xs...)
2057+
hvcat(rows::Tuple{Vararg{Int}}, xs::AbstractArray{T}...) where {T} = typed_hvcat(T, rows, xs...)
20602058

20612059
function typed_hvcat(::Type{T}, rows::Tuple{Vararg{Int}}, as::AbstractVecOrMat...) where T
20622060
nbr = length(rows) # number of block rows
@@ -2084,16 +2082,16 @@ function typed_hvcat(::Type{T}, rows::Tuple{Vararg{Int}}, as::AbstractVecOrMat..
20842082
Aj = as[a+j-1]
20852083
szj = size(Aj,2)
20862084
if size(Aj,1) != szi
2087-
throw(ArgumentError("mismatched height in block row $(i) (expected $szi, got $(size(Aj,1)))"))
2085+
throw(DimensionMismatch("mismatched height in block row $(i) (expected $szi, got $(size(Aj,1)))"))
20882086
end
20892087
if c-1+szj > nc
2090-
throw(ArgumentError("block row $(i) has mismatched number of columns (expected $nc, got $(c-1+szj))"))
2088+
throw(DimensionMismatch("block row $(i) has mismatched number of columns (expected $nc, got $(c-1+szj))"))
20912089
end
20922090
out[r:r-1+szi, c:c-1+szj] = Aj
20932091
c += szj
20942092
end
20952093
if c != nc+1
2096-
throw(ArgumentError("block row $(i) has mismatched number of columns (expected $nc, got $(c-1))"))
2094+
throw(DimensionMismatch("block row $(i) has mismatched number of columns (expected $nc, got $(c-1))"))
20972095
end
20982096
r += szi
20992097
a += rows[i]
@@ -2115,7 +2113,7 @@ function hvcat(rows::Tuple{Vararg{Int}}, xs::T...) where T<:Number
21152113
k = 1
21162114
@inbounds for i=1:nr
21172115
if nc != rows[i]
2118-
throw(ArgumentError("row $(i) has mismatched number of columns (expected $nc, got $(rows[i]))"))
2116+
throw(DimensionMismatch("row $(i) has mismatched number of columns (expected $nc, got $(rows[i]))"))
21192117
end
21202118
for j=1:nc
21212119
a[i,j] = xs[k]
@@ -2144,14 +2142,14 @@ end
21442142
hvcat(rows::Tuple{Vararg{Int}}, xs::Number...) = typed_hvcat(promote_typeof(xs...), rows, xs...)
21452143
hvcat(rows::Tuple{Vararg{Int}}, xs...) = typed_hvcat(promote_eltypeof(xs...), rows, xs...)
21462144
# the following method is needed to provide a more specific one compared to LinearAlgebra/uniformscaling.jl
2147-
hvcat(rows::Tuple{Vararg{Int}}, xs::Union{AbstractVecOrMat,Number}...) = typed_hvcat(promote_eltypeof(xs...), rows, xs...)
2145+
hvcat(rows::Tuple{Vararg{Int}}, xs::Union{AbstractArray,Number}...) = typed_hvcat(promote_eltypeof(xs...), rows, xs...)
21482146

21492147
function typed_hvcat(::Type{T}, rows::Tuple{Vararg{Int}}, xs::Number...) where T
21502148
nr = length(rows)
21512149
nc = rows[1]
21522150
for i = 2:nr
21532151
if nc != rows[i]
2154-
throw(ArgumentError("row $(i) has mismatched number of columns (expected $nc, got $(rows[i]))"))
2152+
throw(DimensionMismatch("row $(i) has mismatched number of columns (expected $nc, got $(rows[i]))"))
21552153
end
21562154
end
21572155
hvcat_fill!(Matrix{T}(undef, nr, nc), xs)
@@ -2319,7 +2317,7 @@ function _typed_hvncat(::Type{T}, ::Val{N}, as::AbstractArray...) where {T, N}
23192317
Ndim += cat_size(as[i], N)
23202318
nd = max(nd, cat_ndims(as[i]))
23212319
for d 1:N - 1
2322-
cat_size(as[1], d) == cat_size(as[i], d) || throw(ArgumentError("mismatched size along axis $d in element $i"))
2320+
cat_size(as[1], d) == cat_size(as[i], d) || throw(DimensionMismatch("mismatched size along axis $d in element $i"))
23232321
end
23242322
end
23252323

@@ -2346,7 +2344,7 @@ function _typed_hvncat(::Type{T}, ::Val{N}, as...) where {T, N}
23462344
nd = max(nd, cat_ndims(as[i]))
23472345
for d 1:N-1
23482346
cat_size(as[i], d) == 1 ||
2349-
throw(ArgumentError("all dimensions of element $i other than $N must be of length 1"))
2347+
throw(DimensionMismatch("all dimensions of element $i other than $N must be of length 1"))
23502348
end
23512349
end
23522350

@@ -2463,7 +2461,7 @@ function _typed_hvncat_dims(::Type{T}, dims::NTuple{N, Int}, row_first::Bool, as
24632461
for dd 1:N
24642462
dd == d && continue
24652463
if cat_size(as[startelementi], dd) != cat_size(as[i], dd)
2466-
throw(ArgumentError("incompatible shape in element $i"))
2464+
throw(DimensionMismatch("incompatible shape in element $i"))
24672465
end
24682466
end
24692467
end
@@ -2500,18 +2498,18 @@ function _typed_hvncat_dims(::Type{T}, dims::NTuple{N, Int}, row_first::Bool, as
25002498
elseif currentdims[d] < outdims[d] # dimension in progress
25012499
break
25022500
else # exceeded dimension
2503-
throw(ArgumentError("argument $i has too many elements along axis $d"))
2501+
throw(DimensionMismatch("argument $i has too many elements along axis $d"))
25042502
end
25052503
end
25062504
end
25072505
elseif currentdims[d1] > outdims[d1] # exceeded dimension
2508-
throw(ArgumentError("argument $i has too many elements along axis $d1"))
2506+
throw(DimensionMismatch("argument $i has too many elements along axis $d1"))
25092507
end
25102508
end
25112509

25122510
outlen = prod(outdims)
25132511
elementcount == outlen ||
2514-
throw(ArgumentError("mismatched number of elements; expected $(outlen), got $(elementcount)"))
2512+
throw(DimensionMismatch("mismatched number of elements; expected $(outlen), got $(elementcount)"))
25152513

25162514
# copy into final array
25172515
A = cat_similar(as[1], T, outdims)
@@ -2572,8 +2570,8 @@ function _typed_hvncat_shape(::Type{T}, shape::NTuple{N, Tuple}, row_first, as::
25722570
if d == 1 || i == 1 || wasstartblock
25732571
currentdims[d] += dsize
25742572
elseif dsize != cat_size(as[i - 1], ad)
2575-
throw(ArgumentError("argument $i has a mismatched number of elements along axis $ad; \
2576-
expected $(cat_size(as[i - 1], ad)), got $dsize"))
2573+
throw(DimensionMismatch("argument $i has a mismatched number of elements along axis $ad; \
2574+
expected $(cat_size(as[i - 1], ad)), got $dsize"))
25772575
end
25782576

25792577
wasstartblock = blockcounts[d] == 1 # remember for next dimension
@@ -2583,15 +2581,15 @@ function _typed_hvncat_shape(::Type{T}, shape::NTuple{N, Tuple}, row_first, as::
25832581
if outdims[d] == -1
25842582
outdims[d] = currentdims[d]
25852583
elseif outdims[d] != currentdims[d]
2586-
throw(ArgumentError("argument $i has a mismatched number of elements along axis $ad; \
2587-
expected $(abs(outdims[d] - (currentdims[d] - dsize))), got $dsize"))
2584+
throw(DimensionMismatch("argument $i has a mismatched number of elements along axis $ad; \
2585+
expected $(abs(outdims[d] - (currentdims[d] - dsize))), got $dsize"))
25882586
end
25892587
currentdims[d] = 0
25902588
blockcounts[d] = 0
25912589
shapepos[d] += 1
25922590
d > 1 && (blockcounts[d - 1] == 0 ||
2593-
throw(ArgumentError("shape in level $d is inconsistent; level counts must nest \
2594-
evenly into each other")))
2591+
throw(DimensionMismatch("shape in level $d is inconsistent; level counts must nest \
2592+
evenly into each other")))
25952593
end
25962594
end
25972595
end

base/array.jl

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2041,18 +2041,6 @@ function vcat(arrays::Vector{T}...) where T
20412041
end
20422042
vcat(A::Vector...) = cat(A...; dims=Val(1)) # more special than SparseArrays's vcat
20432043

2044-
# disambiguation with LinAlg/special.jl
2045-
# Union{Number,Vector,Matrix} is for LinearAlgebra._DenseConcatGroup
2046-
# VecOrMat{T} is for LinearAlgebra._TypedDenseConcatGroup
2047-
hcat(A::Union{Number,Vector,Matrix}...) = cat(A...; dims=Val(2))
2048-
hcat(A::VecOrMat{T}...) where {T} = typed_hcat(T, A...)
2049-
vcat(A::Union{Number,Vector,Matrix}...) = cat(A...; dims=Val(1))
2050-
vcat(A::VecOrMat{T}...) where {T} = typed_vcat(T, A...)
2051-
hvcat(rows::Tuple{Vararg{Int}}, xs::Union{Number,Vector,Matrix}...) =
2052-
typed_hvcat(promote_eltypeof(xs...), rows, xs...)
2053-
hvcat(rows::Tuple{Vararg{Int}}, xs::VecOrMat{T}...) where {T} =
2054-
typed_hvcat(T, rows, xs...)
2055-
20562044
_cat(n::Integer, x::Integer...) = reshape([x...], (ntuple(Returns(1), n-1)..., length(x)))
20572045

20582046
## find ##

base/compiler/ssair/inlining.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ function ir_inline_linetable!(linetable::Vector{LineInfoNode}, inlinee_ir::IRCod
330330
# Append the linetable of the inlined function to our line table
331331
topline::Int32 = linetable_offset + Int32(1)
332332
coverage_by_path = JLOptions().code_coverage == 3
333-
push!(linetable, LineInfoNode(inlinee_def.module, inlinee, inlinee_def.file, inlinee_def.line, inlined_at))
333+
push!(linetable, LineInfoNode(inlinee_def.module, inlinee_def.name, inlinee_def.file, inlinee_def.line, inlined_at))
334334
oldlinetable = inlinee_ir.linetable
335335
extra_coverage_line = zero(Int32)
336336
for oldline in eachindex(oldlinetable)
@@ -1817,7 +1817,7 @@ end
18171817

18181818
function insert_spval!(insert_node!::Inserter, spvals_ssa::SSAValue, spidx::Int, do_isdefined::Bool)
18191819
ret = insert_node!(
1820-
effect_free_and_nothrow(NewInstruction(Expr(:call, Core._svec_ref, false, spvals_ssa, spidx), Any)))
1820+
effect_free_and_nothrow(NewInstruction(Expr(:call, Core._svec_ref, spvals_ssa, spidx), Any)))
18211821
tcheck_not = nothing
18221822
if do_isdefined
18231823
tcheck = insert_node!(

base/compiler/ssair/ir.jl

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,10 +1508,20 @@ function finish_current_bb!(compact::IncrementalCompact, active_bb::Int,
15081508
return skipped
15091509
end
15101510

1511-
function attach_after_stmt_after(compact::IncrementalCompact, idx::Int)
1512-
compact.new_nodes_idx > length(compact.perm) && return false
1513-
entry = compact.ir.new_nodes.info[compact.perm[compact.new_nodes_idx]]
1514-
return entry.pos == idx && entry.attach_after
1511+
"""
1512+
stmts_awaiting_insertion(compact::IncrementalCompact, idx::Int)
1513+
1514+
Returns true if there are new/pending instructions enqueued for insertion into
1515+
`compact` on any instruction in the range `1:idx`. Otherwise, returns false.
1516+
"""
1517+
function stmts_awaiting_insertion(compact::IncrementalCompact, idx::Int)
1518+
1519+
new_node_waiting = compact.new_nodes_idx <= length(compact.perm) &&
1520+
compact.ir.new_nodes.info[compact.perm[compact.new_nodes_idx]].pos <= idx
1521+
pending_node_waiting = !isempty(compact.pending_perm) &&
1522+
compact.pending_nodes.info[compact.pending_perm[1]].pos <= idx
1523+
1524+
return new_node_waiting || pending_node_waiting
15151525
end
15161526

15171527
function process_newnode!(compact::IncrementalCompact, new_idx::Int, new_node_entry::Instruction, new_node_info::NewNodeInfo, idx::Int, active_bb::Int, do_rename_ssa::Bool)
@@ -1523,7 +1533,7 @@ function process_newnode!(compact::IncrementalCompact, new_idx::Int, new_node_en
15231533
compact.result_idx = result_idx
15241534
# If this instruction has reverse affinity and we were at the end of a basic block,
15251535
# finish it now.
1526-
if new_node_info.attach_after && idx == last(bb.stmts)+1 && !attach_after_stmt_after(compact, idx-1)
1536+
if new_node_info.attach_after && idx == last(bb.stmts)+1 && !stmts_awaiting_insertion(compact, idx-1)
15271537
active_bb += 1
15281538
finish_current_bb!(compact, active_bb, old_result_idx)
15291539
end
@@ -1653,7 +1663,7 @@ function iterate_compact(compact::IncrementalCompact)
16531663
compact.result[old_result_idx] = compact.ir.stmts[idx]
16541664
result_idx = process_node!(compact, old_result_idx, compact.ir.stmts[idx], idx, idx, active_bb, true)
16551665
compact.result_idx = result_idx
1656-
if idx == last(bb.stmts) && !attach_after_stmt_after(compact, idx)
1666+
if idx == last(bb.stmts) && !stmts_awaiting_insertion(compact, idx)
16571667
finish_current_bb!(compact, active_bb, old_result_idx)
16581668
active_bb += 1
16591669
end

base/compiler/ssair/passes.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -810,10 +810,10 @@ function perform_lifting!(compact::IncrementalCompact,
810810
end
811811

812812
function lift_svec_ref!(compact::IncrementalCompact, idx::Int, stmt::Expr)
813-
length(stmt.args) != 4 && return
813+
length(stmt.args) != 3 && return
814814

815-
vec = stmt.args[3]
816-
val = stmt.args[4]
815+
vec = stmt.args[2]
816+
val = stmt.args[3]
817817
valT = argextype(val, compact)
818818
(isa(valT, Const) && isa(valT.val, Int)) || return
819819
valI = valT.val::Int

base/compiler/typeinfer.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ function typeinf_ext(interp::AbstractInterpreter, mi::MethodInstance)
10151015
tree.slotflags = fill(IR_FLAG_NULL, nargs)
10161016
tree.ssavaluetypes = 1
10171017
tree.codelocs = Int32[1]
1018-
tree.linetable = LineInfoNode[LineInfoNode(method.module, mi, method.file, method.line, Int32(0))]
1018+
tree.linetable = LineInfoNode[LineInfoNode(method.module, method.name, method.file, method.line, Int32(0))]
10191019
tree.ssaflags = UInt8[0]
10201020
set_inlineable!(tree, true)
10211021
tree.parent = mi

0 commit comments

Comments
 (0)