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

Comparison of branch: backports-release-1.10+RAI #46

Closed
wants to merge 141 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
6eb535d
inference: Guard TypeVar special case against vararg (#52721)
Keno Jan 4, 2024
6a107d0
Use `jl_types_egal` in `equiv_field_types` (#52748)
timholy Jan 6, 2024
5c0a2a6
release 1.10: backport the lattice fix for array op type checks (#527…
aviatesk Jan 7, 2024
fd13cf0
effects: fix #52843, account for mutable values directly embedded to IR
aviatesk Jan 11, 2024
0cea48e
change Downloads branch to release-1.10
IanButterworth Jan 13, 2024
df9062b
lowering: remove `QuoteNode` wrapping for captured variables (#52878)
aviatesk Jan 13, 2024
813bfac
Revert inlined method signature stacktrace lookup code (#52754)
BioTurboNick Jan 14, 2024
e5ccc44
inference: always bail out const-prop' with non-const result limited …
aviatesk Jan 16, 2024
aaaf5de
🤖 [backports-release-1.10] Bump the Downloads stdlib from f97c72f to …
DilumAluthgeBot Jan 16, 2024
788eff9
Correctly port realloc from 1.9 to 1.10 (#52929)
gbaraldi Jan 16, 2024
f9c2461
Widen diagonal var during `Type` unwrapping in `instanceof_tfunc` (#5…
N5N3 Nov 18, 2023
47999ab
Fix `widen_diagonal` bug for nested `UnionAll` (#52924)
N5N3 Jan 16, 2024
ddb9d0d
🤖 [backports-release-1.10] Bump the Pkg stdlib from 563a3387a to 11cf…
DilumAluthgeBot Jan 22, 2024
3552d36
🤖 [backports-release-1.10] Bump the Pkg stdlib from 11cf00df7 to 7052…
DilumAluthgeBot Jan 24, 2024
7d3c68e
Fix edge cases where inexact conversions to UInt don't throw (#51095)
LilithHafner Aug 30, 2023
2481fdf
loading: fix finding bundled stdlibs even if they are e.g. devved in …
KristofferC Jan 5, 2024
cc26004
staticdata: handle cycles in datatypes (#52752)
vtjnash Jan 5, 2024
69d58e0
use a Dict instead of an IdDict for caching of the `cwstring` for Win…
KristofferC Jan 8, 2024
d2fd317
Insert hardcoded backlinks to stdlib doc pages (#51375)
LilithHafner Jan 16, 2024
4f3a3ae
place work-stealing queue indices on different cache lines to avoid f…
d-netto Jan 23, 2024
8517eb3
Add type assertion in iterate for logicalindex (#53015)
jishnub Jan 23, 2024
fa85fa7
Fix a list in GC devdocs (#53032)
fingolfin Jan 24, 2024
a4cc920
make "dec" and ryu functions faster and simpler (#51273)
vtjnash Sep 13, 2023
e0e3c63
fix type-stability bugs in Ryu code (#52781)
stevengj Jan 8, 2024
f371de8
Default uplo in symmetric/hermitian (#52605)
jishnub Dec 27, 2023
8a04df0
Fix GC rooting during rehashing of iddict (#52569)
Zentrik Dec 18, 2023
cfbff10
heap snapshot: add gc roots and gc finalist roots to fix unrooted nod…
JianFangAtRai Dec 30, 2023
f06a63d
Apple silicon has 128 byte alignment so fix our defines to match (#52…
gbaraldi Jan 24, 2024
6fdf37e
Replace `⇔` by `↔` in documentation (#52078)
fingolfin Jan 24, 2024
ece8b7b
Profile: use full terminal cols to show function name (#53055)
IanButterworth Jan 25, 2024
2c8ecd3
1.10: REPL: fix intermittent REPL test failure (#53096)
aviatesk Jan 29, 2024
a215b37
1.10: inlining: fix `joint_effects` calculation (#53076)
aviatesk Jan 29, 2024
3c73873
[OpenBLAS] Ugrade to v0.3.23+4
Jan 29, 2024
b0b804e
use proper cache-line size variable in work-stealing queue (#53035)
d-netto Jan 24, 2024
a45cd5f
doc: replace harr HTML entity by unicode (#53066)
fingolfin Jan 29, 2024
c644e89
apply OpenBLAS_jll v0.3.23+4 patch (#53074)
pablosanjose Jan 29, 2024
00aa65e
bump NetworkOptions
KristofferC Jan 30, 2024
6407c33
inference: avoid adding duplicate edges as invoke targets (#53121)
vtjnash Jan 31, 2024
0627076
Put mingw32 `*.a` files in `private_libdir` (#51698)
giordano Oct 19, 2023
7a96210
Add link to PR in NEWS (#53189)
andreasnoack Feb 5, 2024
1dfdf66
Backports for 1.10.1 (#52755)
KristofferC Feb 6, 2024
ff295ca
Ensure elision of `require_one_based_indexing` with high-dim array vi…
pablosanjose Jan 30, 2024
e1af4a9
Try to fix incorrect documentation of `nthreads` (#53117)
MasonProtter Jan 31, 2024
93a596e
Fix variable name in scaling an `AbstractTriangular` with zero alpha …
jishnub Jan 11, 2024
a1ad1ba
[REPLCompletions] enable completions for `using Module.Inner|` (#52952)
aviatesk Jan 18, 2024
2ef3842
Inplace transpose for unit Triangular may skip diagonal (#53101)
jishnub Jan 31, 2024
6fcff37
fix bus error on smaller readonly file in unix (#44354)
xgdgsc Aug 21, 2023
4745ef8
Backports release 1.10 (#53201)
KristofferC Feb 6, 2024
7790d6f
release-1.10: set VERSION to 1.10.1 (#53306)
KristofferC Feb 13, 2024
2111c03
release-1.10: set VERSION to 1.10.1 (#53306)
KristofferC Feb 13, 2024
2b2eb4d
Profile: add notes to `print()` docs (#53205)
IanButterworth Feb 6, 2024
be27b72
Document --heap-size-hint in Command-line Interface (#50480)
KnutAM Feb 8, 2024
5b54ddf
Fix typo in `Sys.total_memory` docstring. (#53301)
christiangnrd Feb 12, 2024
9e12184
bump NetworkOptions
KristofferC Feb 20, 2024
d002e96
do not call worker_from_id with pid<1
KristofferC Feb 20, 2024
45c2bd8
fix code coverage bug in tail position and `else` (#53354)
JeffBezanson Feb 20, 2024
25827a4
docs: remove outdated discussion about externally changing module bin…
goerz Feb 7, 2024
f2d56c7
SubArray: avoid invalid elimination of singleton indices (#53228)
N5N3 Feb 8, 2024
5ae8707
code_warntype docs: more neutral reference to @code_warntype (#51361)
ulysses4ever Feb 8, 2024
8f3304a
Fix documentation: thread pool of main thread (#53388)
carstenbauer Feb 21, 2024
7bfd9f4
Subtype: skip slow-path in `local_∀_∃_subtype` if inputs contain no ∃…
N5N3 Feb 22, 2024
5d971b9
Add debug variant of loader_trampolines.o (#53437)
fingolfin Feb 23, 2024
997b49f
Backports for 1.10.2 (#53405)
KristofferC Feb 27, 2024
bd47eca
set VERSION to 1.10.2 (#53489)
KristofferC Mar 1, 2024
8952861
Fix outdated usage of scrubbing for log test failures (#50759)
serenity4 Aug 2, 2023
801885f
[REPL] Fix typo in using/import completion (#53273)
Keno Feb 11, 2024
58b3dcb
Avoid compiler warning about redefining jl_globalref_t (#53499)
fingolfin Feb 28, 2024
996fe30
yet more atomics & cache-line fixes on work-stealing queue (#53424)
d-netto Mar 4, 2024
f191dcb
build: remove extra .a file (#53596)
inkydragon Mar 5, 2024
42477de
permit NamedTuple{<:Any, Union{}} to be created (#53516)
vtjnash Mar 9, 2024
2a49cfe
Bump CSL to 1.1.1 to fix libgomp bug (#53643)
gbaraldi Mar 9, 2024
d3c8eb9
gc scheduler synchronization fixes to 1.10 (#53661)
d-netto Mar 13, 2024
77b86fe
codegen: change tbaa of ptr_phi to tbaa_value (#53655)
gbaraldi Mar 14, 2024
7536f35
Default to the medium code model in x86 linux (#53391)
gbaraldi Mar 14, 2024
f6a3c5f
Remove some duplicates from emitted compilation traces for Julia 1.10…
kpamnany Mar 20, 2024
8c6595b
Add version string to sysimg triple (#51830)
gbaraldi Oct 24, 2023
e44f1ab
Add missing GC_POP() in emit_cfunction (#53809)
gbaraldi Mar 22, 2024
396f5d1
typeintersect: fix `UnionAll` unaliasing bug caused by innervars. (#5…
N5N3 Mar 6, 2024
c2d480c
Fix linear indexing for ReshapedArray if the parent has offset axes …
jishnub Mar 11, 2024
2baebfe
Fix the OpenBLAS checksum for Julia 1.10 (#54017)
kpamnany Apr 10, 2024
feceefe
`LazyString` in `LinearAlgebra.checksquare` error message (#53961)
jishnub Apr 5, 2024
8741c1a
Added docstring for Artifacts.jl (#52913)
jam-khan Feb 8, 2024
756c16a
🤖 [backports-release-1.10] Bump the Pkg stdlib from 70525539d to f487…
DilumAluthgeBot Apr 11, 2024
a8eedc6
switch Statistics branch to release-1.10
IanButterworth Apr 11, 2024
ba33b12
switch Tar branch to release-1.10
IanButterworth Apr 11, 2024
e386554
switch ArgTools branch to release-1.10
IanButterworth Apr 11, 2024
32b0613
switch SHA branch to release-0.7
IanButterworth Apr 12, 2024
1bf60fe
🤖 [backports-release-1.10] Bump the SHA stdlib from 2d1f84e to e1af7d…
DilumAluthgeBot Apr 12, 2024
ed94319
switch SparseArrays branch to release-1.10
IanButterworth Apr 12, 2024
3b32431
🤖 [backports-release-1.10] Bump the NetworkOptions stdlib from 0bd334…
DilumAluthgeBot Apr 12, 2024
97b0571
switch JuliaSyntax branch to release-0.4
IanButterworth Apr 12, 2024
b05a4f2
Revert "`LazyString` in `LinearAlgebra.checksquare` error message (#5…
KristofferC Apr 15, 2024
5cf5146
Revert "Default to the medium code model in x86 linux (#53391)"
KristofferC Apr 16, 2024
b0f607a
Add inventory writing via DocumenterInventoryWritingBackport
goerz Mar 4, 2024
525b3a2
Overload `Base.literal_pow` for `AbstractQ` (#54010)
dkarrasch Apr 13, 2024
58cf81e
Fix `make install` from tarballs (#54143)
nalimilan Apr 22, 2024
3577557
LinearAlgebra: Correct zero element in `_generic_matvecmul!` for bloc…
jishnub Apr 23, 2024
1de708b
set MAX_OS_WRITE on unix (#54233)
vtjnash Apr 25, 2024
f752249
fix typo in gc_mark_memory8 when chunking a large array (#54251)
d-netto Apr 26, 2024
1b21830
typeintersect: fix another stack overflow caused by circular constrai…
N5N3 May 7, 2024
e1b2099
Fix an off-by-one error in interpreter's `do_invoke` (#54443)
fatteneder May 17, 2024
94bef5d
Make TestLogger thread-safe (introduce a lock) (#54497)
NHDaly May 22, 2024
7eeeb56
Add a missing doc (#53796)
putianyi889 May 24, 2024
007d8de
Set storage class of julia globals to dllimport on windows to avoid a…
gbaraldi May 28, 2024
c81d02c
typeintersect: conservative typevar subtitution during `finish_uniona…
N5N3 May 16, 2024
7ebe203
typeintersect: followup cleanup for the nothrow path of type instanti…
N5N3 May 19, 2024
0e771af
Default to the medium code model in x86 linux (#53391)
gbaraldi Mar 14, 2024
5591e7d
`LazyString` in `LinearAlgebra.checksquare` error message (#53961)
jishnub Apr 5, 2024
21fc45e
set VERSION to 1.10.3 (#54246)
KristofferC Apr 30, 2024
727f875
correctly track freed bytes in array_to_string (#54309)
d-netto May 1, 2024
f266874
Extensions: make loading of extensions independent of what packages a…
KristofferC Jan 29, 2024
307939c
RAI: Add 'RAI' as the build part of the semantic version
Apr 30, 2024
c60f14d
RAI: Track blocks and bytes allocated for GC pools
d-netto Oct 30, 2023
8837037
RAI: Change task ordering behavior to prioritize older tasks
kpamnany Aug 9, 2023
509f208
RAI: Prepend signal number and thread ID on backtraces
kpamnany Aug 21, 2023
9db3cfe
Add GC metric `last_incremental_sweep` (#50190)
li1 Jul 6, 2023
eed158b
RAI: Disable huge pages for all mmap'ed memory
kpamnany Aug 21, 2023
20d1e67
RAI: Never use MADV_FREE
kuszmaul Aug 22, 2023
ea5bf75
Allocation Profiler: Types for all allocations (#50337)
NHDaly Jul 31, 2023
60bb551
Metric for number of live bytes in the pool allocator (#51151)
d-netto Aug 21, 2023
eab7ae9
Export num_stack_mappings to track the number of in-flight stack map…
NHDaly Sep 20, 2023
6455111
parallelize sweeping of object pools (#51282)
d-netto Sep 22, 2023
6fe62c6
don't print task backtrace for GC threads (#51413) (#78)
kpamnany Sep 26, 2023
a9223ac
RAI: Prepend "thread (%d) " to output from `jl_print_task_backtraces()`
kpamnany Oct 9, 2023
0040ca9
Add heartbeat capability
kpamnany Oct 7, 2023
0d1659a
Change heartbeat thread controls
kpamnany Nov 12, 2023
b15ca49
make pool_live_bytes metric more accurate (#52015)
d-netto Nov 4, 2023
9d62806
bugfix: load jl_n_threads in jl_gc_pool_live_bytes (#52034)
d-netto Nov 6, 2023
816a5d5
bugfix: don't set pool_live_bytes to zero at the end of GC (#107)
d-netto Nov 7, 2023
6637c68
add some instrumentation to measure page utilization per size class (…
d-netto Nov 16, 2023
61ceba0
add a compile-time option to enable 4k page sizes (#52229)
d-netto Nov 22, 2023
54db887
functionality to expose page utilization at the julia level (#113)
d-netto Dec 6, 2023
f61f5e3
backport memory pressure callback to 1.9 (#114)
d-netto Dec 13, 2023
dc05349
page profile (#123)
d-netto Dec 29, 2023
01ccad4
revert GC heuristics back to 1.9 (#126)
d-netto Jan 4, 2024
ea18314
Set the number of GC threads to number of compute threads
d-netto Jan 12, 2024
46e8327
reduce contention on page metadata lists during the sweeping phase (#…
d-netto Jan 21, 2024
b7a5dc9
Change to streaming out the heap snapshot data (#52854)
Drvi Feb 1, 2024
a9000b8
Add `Base.checked_pow(x,y)` to `Base.Checked` library (#52849) (#134)
d-netto Mar 19, 2024
f6211b0
--safe-crash-log-file flag (#140)
d-netto Mar 22, 2024
7d490ea
Correct GC bug (usage of `not_freed_enough`) (#143)
d-netto Apr 7, 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
4 changes: 2 additions & 2 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1233,7 +1233,7 @@ LIBGFORTRAN_VERSION := $(subst libgfortran,,$(filter libgfortran%,$(subst -,$(SP
# shipped with CSL. Although we do not depend on any of the symbols, it is entirely
# possible that a user might choose to install a library which depends on symbols provided
# by a newer libstdc++. Without runtime detection, those libraries would break.
CSL_NEXT_GLIBCXX_VERSION=GLIBCXX_3\.4\.31|GLIBCXX_3\.5\.|GLIBCXX_4\.
CSL_NEXT_GLIBCXX_VERSION=GLIBCXX_3\.4\.33|GLIBCXX_3\.5\.|GLIBCXX_4\.


# This is the set of projects that BinaryBuilder dependencies are hooked up for.
Expand Down Expand Up @@ -1365,7 +1365,7 @@ ifeq ($(OS), WINNT)
HAVE_SSP := 1
OSLIBS += -Wl,--export-all-symbols -Wl,--version-script=$(BUILDROOT)/src/julia.expmap \
$(NO_WHOLE_ARCHIVE) -lpsapi -lkernel32 -lws2_32 -liphlpapi -lwinmm -ldbghelp -luserenv -lsecur32 -latomic
JLDFLAGS += -Wl,--stack,8388608
JLDFLAGS += -Wl,--stack,8388608 --disable-auto-import --disable-runtime-pseudo-reloc
ifeq ($(ARCH),i686)
JLDFLAGS += -Wl,--large-address-aware
endif
Expand Down
18 changes: 10 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ $(foreach link,base $(JULIAHOME)/test,$(eval $(call symlink_target,$(link),$$(bu
julia_flisp.boot.inc.phony: julia-deps
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/src julia_flisp.boot.inc.phony

# Build the HTML docs (skipped if already exists, notably in tarballs)
$(BUILDROOT)/doc/_build/html/en/index.html: $(shell find $(BUILDROOT)/base $(BUILDROOT)/doc \( -path $(BUILDROOT)/doc/_build -o -path $(BUILDROOT)/doc/deps -o -name *_constants.jl -o -name *_h.jl -o -name version_git.jl \) -prune -o -type f -print)
@$(MAKE) docs

julia-symlink: julia-cli-$(JULIA_BUILD_MODE)
ifeq ($(OS),WINNT)
echo '@"%~dp0/'"$$(echo '$(call rel_path,$(BUILDROOT),$(JULIA_EXECUTABLE))')"'" %*' | tr / '\\' > $(BUILDROOT)/julia.bat
Expand Down Expand Up @@ -265,7 +269,7 @@ define stringreplace
endef


install: $(build_depsbindir)/stringreplace docs
install: $(build_depsbindir)/stringreplace $(BUILDROOT)/doc/_build/html/en/index.html
@$(MAKE) $(QUIET_MAKE) $(JULIA_BUILD_MODE)
@for subdir in $(bindir) $(datarootdir)/julia/stdlib/$(VERSDIR) $(docdir) $(man1dir) $(includedir)/julia $(libdir) $(private_libdir) $(sysconfdir) $(private_libexecdir); do \
mkdir -p $(DESTDIR)$$subdir; \
Expand All @@ -281,16 +285,14 @@ else ifeq ($(JULIA_BUILD_MODE),debug)
-$(INSTALL_M) $(build_libdir)/libjulia-debug.dll.a $(DESTDIR)$(libdir)/
-$(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.
# We have a single exception; we want 7z.dll to live in private_libexecdir,
# not bindir, so that 7z.exe can find it.
-mv $(DESTDIR)$(bindir)/7z.dll $(DESTDIR)$(private_libexecdir)/
-$(INSTALL_M) $(build_bindir)/libopenlibm.dll.a $(DESTDIR)$(libdir)/
-$(INSTALL_M) $(build_libdir)/libssp.dll.a $(DESTDIR)$(libdir)/
# The rest are compiler dependencies, as an example memcpy is exported by msvcrt
# These are files from mingw32 and required for creating shared libraries like our caches.
-$(INSTALL_M) $(build_libdir)/libgcc_s.a $(DESTDIR)$(libdir)/
-$(INSTALL_M) $(build_libdir)/libgcc.a $(DESTDIR)$(libdir)/
-$(INSTALL_M) $(build_libdir)/libmsvcrt.a $(DESTDIR)$(libdir)/
else

# Copy over .dSYM directories directly for Darwin
Expand Down Expand Up @@ -525,7 +527,7 @@ app:
darwinframework:
$(MAKE) -C $(JULIAHOME)/contrib/mac/framework

light-source-dist.tmp: docs
light-source-dist.tmp: $(BUILDROOT)/doc/_build/html/en/index.html
ifneq ($(BUILDROOT),$(JULIAHOME))
$(error make light-source-dist does not work in out-of-tree builds)
endif
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Language changes
define methods to explicitly handle Union{} without the ambiguities that commonly would
result previously. This also lets the runtime optimize certain method lookups in a way
that significantly improves load and inference times for heavily overloaded methods that
dispatch on Types (such as traits and constructors).
dispatch on Types (such as traits and constructors). ([#49349])
* The "h bar" `ℏ` (`\hslash` U+210F) character is now treated as equivalent to `ħ` (`\hbar` U+0127).
* The `@simd` macro now has more limited and clearer semantics: it only enables reordering and contraction
of floating-point operations, instead of turning on all "fastmath" optimizations.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.10.0
1.10.3+RAI
1 change: 1 addition & 0 deletions base/Base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@ function __init__()
init_load_path()
init_active_project()
append!(empty!(_sysimage_modules), keys(loaded_modules))
empty!(explicit_loaded_modules)
if haskey(ENV, "JULIA_MAX_NUM_PRECOMPILE_FILES")
MAX_NUM_PRECOMPILE_FILES[] = parse(Int, ENV["JULIA_MAX_NUM_PRECOMPILE_FILES"])
end
Expand Down
11 changes: 7 additions & 4 deletions base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,20 @@ end
has_offset_axes(A, B, ...)

Return `true` if the indices of `A` start with something other than 1 along any axis.
If multiple arguments are passed, equivalent to `has_offset_axes(A) | has_offset_axes(B) | ...`.
If multiple arguments are passed, equivalent to `has_offset_axes(A) || has_offset_axes(B) || ...`.

See also [`require_one_based_indexing`](@ref).
"""
has_offset_axes() = false
has_offset_axes(A) = _any_tuple(x->Int(first(x))::Int != 1, false, axes(A)...)
has_offset_axes(A::AbstractVector) = Int(firstindex(A))::Int != 1 # improve performance of a common case (ranges)
# Use `_any_tuple` to avoid unneeded invoke.
# note: this could call `any` directly if the compiler can infer it
has_offset_axes(As...) = _any_tuple(has_offset_axes, false, As...)
has_offset_axes(::Colon) = false
has_offset_axes(::Array) = false
# note: this could call `any` directly if the compiler can infer it. We don't use _any_tuple
# here because it stops full elision in some cases (#49332) and we don't need handling of
# `missing` (has_offset_axes(A) always returns a Bool)
has_offset_axes(A, As...) = has_offset_axes(A) || has_offset_axes(As...)


"""
require_one_based_indexing(A::AbstractArray)
Expand Down
4 changes: 2 additions & 2 deletions base/boot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -624,8 +624,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
15 changes: 14 additions & 1 deletion base/checked.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ return both the unchecked results and a boolean value denoting the presence of a
module Checked

export checked_neg, checked_abs, checked_add, checked_sub, checked_mul,
checked_div, checked_rem, checked_fld, checked_mod, checked_cld,
checked_div, checked_rem, checked_fld, checked_mod, checked_cld, checked_pow,
checked_length, add_with_overflow, sub_with_overflow, mul_with_overflow

import Core.Intrinsics:
Expand Down Expand Up @@ -358,6 +358,19 @@ The overflow protection may impose a perceptible performance penalty.
"""
checked_cld(x::T, y::T) where {T<:Integer} = cld(x, y) # Base.cld already checks

"""
Base.checked_pow(x, y)

Calculates `^(x,y)`, checking for overflow errors where applicable.

The overflow protection may impose a perceptible performance penalty.
"""
checked_pow(x::Integer, y::Integer) = checked_power_by_squaring(x, y)

checked_power_by_squaring(x_, p::Integer) = Base.power_by_squaring(x_, p; mul = checked_mul)
# For Booleans, the default implementation covers all cases.
checked_power_by_squaring(x::Bool, p::Integer) = Base.power_by_squaring(x, p)

"""
Base.checked_length(r)

Expand Down
72 changes: 38 additions & 34 deletions base/compiler/abstractinterpretation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -785,11 +785,7 @@ end
function abstract_call_method_with_const_args(interp::AbstractInterpreter,
result::MethodCallResult, @nospecialize(f), arginfo::ArgInfo, si::StmtInfo,
match::MethodMatch, sv::AbsIntState, invokecall::Union{Nothing,InvokeCall}=nothing)
if !const_prop_enabled(interp, sv, match)
return nothing
end
if bail_out_const_call(interp, result, si)
add_remark!(interp, sv, "[constprop] No more information to be gained")
if !const_prop_enabled(interp, match, sv) || bail_out_const_call(interp, result, si, sv)
return nothing
end
eligibility = concrete_eval_eligible(interp, f, result, arginfo, sv)
Expand Down Expand Up @@ -822,7 +818,7 @@ function abstract_call_method_with_const_args(interp::AbstractInterpreter,
return const_prop_call(interp, mi, result, arginfo, sv, concrete_eval_result)
end

function const_prop_enabled(interp::AbstractInterpreter, sv::AbsIntState, match::MethodMatch)
function const_prop_enabled(interp::AbstractInterpreter, match::MethodMatch, sv::AbsIntState)
if !InferenceParams(interp).ipo_constant_propagation
add_remark!(interp, sv, "[constprop] Disabled by parameter")
return false
Expand All @@ -834,9 +830,11 @@ function const_prop_enabled(interp::AbstractInterpreter, sv::AbsIntState, match:
return true
end

function bail_out_const_call(interp::AbstractInterpreter, result::MethodCallResult, si::StmtInfo)
function bail_out_const_call(interp::AbstractInterpreter, result::MethodCallResult,
si::StmtInfo, sv::AbsIntState)
if is_removable_if_unused(result.effects)
if isa(result.rt, Const) || call_result_unused(si)
add_remark!(interp, sv, "[constprop] No more information to be gained (const)")
return true
end
end
Expand Down Expand Up @@ -937,7 +935,10 @@ function maybe_get_const_prop_profitable(interp::AbstractInterpreter,
match::MethodMatch, sv::AbsIntState)
method = match.method
force = force_const_prop(interp, f, method)
force || const_prop_entry_heuristic(interp, result, si, sv) || return nothing
if !const_prop_entry_heuristic(interp, result, si, sv, force)
# N.B. remarks are emitted within `const_prop_entry_heuristic`
return nothing
end
nargs::Int = method.nargs
method.isva && (nargs -= 1)
length(arginfo.argtypes) < nargs && return nothing
Expand All @@ -964,8 +965,17 @@ function maybe_get_const_prop_profitable(interp::AbstractInterpreter,
return mi
end

function const_prop_entry_heuristic(interp::AbstractInterpreter, result::MethodCallResult, si::StmtInfo, sv::AbsIntState)
if call_result_unused(si) && result.edgecycle
function const_prop_entry_heuristic(interp::AbstractInterpreter, result::MethodCallResult,
si::StmtInfo, sv::AbsIntState, force::Bool)
if result.rt isa LimitedAccuracy
# optimizations like inlining are disabled for limited frames,
# thus there won't be much benefit in constant-prop' here
# N.B. don't allow forced constprop' for safety (xref #52763)
add_remark!(interp, sv, "[constprop] Disabled by entry heuristic (limited accuracy)")
return false
elseif force
return true
elseif call_result_unused(si) && result.edgecycle
add_remark!(interp, sv, "[constprop] Disabled by entry heuristic (edgecycle with unused result)")
return false
end
Expand All @@ -978,27 +988,21 @@ function const_prop_entry_heuristic(interp::AbstractInterpreter, result::MethodC
if rt === Bottom
add_remark!(interp, sv, "[constprop] Disabled by entry heuristic (erroneous result)")
return false
else
return true
end
return true
elseif isa(rt, PartialStruct) || isa(rt, InterConditional) || isa(rt, InterMustAlias)
# could be improved to `Const` or a more precise wrapper
return true
elseif isa(rt, LimitedAccuracy)
# optimizations like inlining are disabled for limited frames,
# thus there won't be much benefit in constant-prop' here
add_remark!(interp, sv, "[constprop] Disabled by entry heuristic (limited accuracy)")
return false
else
if isa(rt, Const)
if !is_nothrow(result.effects)
# Could still be improved to Bottom (or at least could see the effects improved)
return true
end
elseif isa(rt, Const)
if is_nothrow(result.effects)
add_remark!(interp, sv, "[constprop] Disabled by entry heuristic (nothrow const)")
return false
end
add_remark!(interp, sv, "[constprop] Disabled by entry heuristic (unimprovable result)")
return false
# Could still be improved to Bottom (or at least could see the effects improved)
return true
end
add_remark!(interp, sv, "[constprop] Disabled by entry heuristic (unimprovable result)")
return false
end

# determines heuristically whether if constant propagation can be worthwhile
Expand Down Expand Up @@ -2021,10 +2025,10 @@ function abstract_call_known(interp::AbstractInterpreter, @nospecialize(f),
elseif isa(f, Core.OpaqueClosure)
# calling an OpaqueClosure about which we have no information returns no information
return CallMeta(typeof(f).parameters[2], Effects(), NoCallInfo())
elseif f === TypeVar
elseif f === TypeVar && !isvarargtype(argtypes[end])
# Manually look through the definition of TypeVar to
# make sure to be able to get `PartialTypeVar`s out.
(la < 2 || la > 4) && return CallMeta(Bottom, EFFECTS_THROWS, NoCallInfo())
2 ≤ la ≤ 4 || return CallMeta(Bottom, EFFECTS_THROWS, NoCallInfo())
n = argtypes[2]
ub_var = Const(Any)
lb_var = Const(Union{})
Expand Down Expand Up @@ -2267,11 +2271,7 @@ function abstract_eval_value_expr(interp::AbstractInterpreter, e::Expr, vtypes::
end

function abstract_eval_special_value(interp::AbstractInterpreter, @nospecialize(e), vtypes::Union{VarTable,Nothing}, sv::AbsIntState)
if isa(e, QuoteNode)
merge_effects!(interp, sv, Effects(EFFECTS_TOTAL;
inaccessiblememonly = is_mutation_free_argtype(typeof(e.value)) ? ALWAYS_TRUE : ALWAYS_FALSE))
return Const(e.value)
elseif isa(e, SSAValue)
if isa(e, SSAValue)
return abstract_eval_ssavalue(e, sv)
elseif isa(e, SlotNumber)
if vtypes !== nothing
Expand All @@ -2293,7 +2293,11 @@ function abstract_eval_special_value(interp::AbstractInterpreter, @nospecialize(
elseif isa(e, GlobalRef)
return abstract_eval_globalref(interp, e, sv)
end

if isa(e, QuoteNode)
e = e.value
end
merge_effects!(interp, sv, Effects(EFFECTS_TOTAL;
inaccessiblememonly = is_mutation_free_argtype(typeof(e)) ? ALWAYS_TRUE : ALWAYS_FALSE))
return Const(e)
end

Expand Down Expand Up @@ -2561,7 +2565,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
4 changes: 2 additions & 2 deletions base/compiler/ssair/EscapeAnalysis/EscapeAnalysis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1615,7 +1615,7 @@ function escape_builtin!(::typeof(arrayref), astate::AnalysisState, pc::Int, arg
argtypes = Any[argextype(args[i], astate.ir) for i in 2:length(args)]
boundcheckt = argtypes[1]
aryt = argtypes[2]
if !array_builtin_common_typecheck(boundcheckt, aryt, argtypes, 3)
if !array_builtin_common_typecheck(𝕃ₒ, boundcheckt, aryt, argtypes, 3)
add_thrown_escapes!(astate, pc, args, 2)
end
ary = args[3]
Expand Down Expand Up @@ -1679,7 +1679,7 @@ function escape_builtin!(::typeof(arrayset), astate::AnalysisState, pc::Int, arg
boundcheckt = argtypes[1]
aryt = argtypes[2]
valt = argtypes[3]
if !(array_builtin_common_typecheck(boundcheckt, aryt, argtypes, 4) &&
if !(array_builtin_common_typecheck(𝕃ₒ, boundcheckt, aryt, argtypes, 4) &&
arrayset_typecheck(aryt, valt))
add_thrown_escapes!(astate, pc, args, 2)
end
Expand Down
8 changes: 5 additions & 3 deletions base/compiler/ssair/inlining.jl
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ function compileable_specialization(mi::MethodInstance, effects::Effects,
end
end
add_inlining_backedge!(et, mi) # to the dispatch lookup
push!(et.edges, method.sig, mi_invoke) # add_inlining_backedge to the invoke call
mi_invoke !== mi && push!(et.edges, method.sig, mi_invoke) # add_inlining_backedge to the invoke call, if that is different
return InvokeCase(mi_invoke, effects, info)
end

Expand Down Expand Up @@ -1408,7 +1408,7 @@ function compute_inlining_cases(@nospecialize(info::CallInfo), flag::UInt8, sig:
fully_covered &= split_fully_covered
end

fully_covered || (joint_effects = Effects(joint_effects; nothrow=false))
(handled_all_cases & fully_covered) || (joint_effects = Effects(joint_effects; nothrow=false))

if handled_all_cases && revisit_idx !== nothing
# we handled everything except one match with unmatched sparams,
Expand Down Expand Up @@ -1811,7 +1811,9 @@ function ssa_substitute!(insert_node!::Inserter,
spvals_ssa::Union{Nothing, SSAValue},
linetable_offset::Int32, boundscheck::Symbol)
subst_inst[:flag] &= ~IR_FLAG_INBOUNDS
subst_inst[:line] += linetable_offset
if subst_inst[:line] != 0
subst_inst[:line] += linetable_offset
end
return ssa_substitute_op!(insert_node!, subst_inst,
val, arg_replacements, spsig, spvals, spvals_ssa, boundscheck)
end
Expand Down
6 changes: 5 additions & 1 deletion base/compiler/ssair/passes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1205,8 +1205,12 @@ function try_inline_finalizer!(ir::IRCode, argexprs::Vector{Any}, idx::Int,
ssa_rename[ssa.id]
end
stmt′ = ssa_substitute_op!(InsertBefore(ir, SSAValue(idx)), inst, stmt′, argexprs, mi.specTypes, mi.sparam_vals, sp_ssa, :default)
newline = inst[:line]
if newline != 0
newline += linetable_offset
end
ssa_rename[idx′] = insert_node!(ir, idx,
NewInstruction(inst; stmt=stmt′, line=inst[:line]+linetable_offset),
NewInstruction(inst; stmt=stmt′, line=newline),
attach_after)
end

Expand Down
Loading