Skip to content

Commit e97a32f

Browse files
authored
Merge branch 'master' into jb/interactive0
2 parents c374808 + 39fd7dd commit e97a32f

Some content is hidden

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

94 files changed

+1342
-580
lines changed

Make.inc

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ WITH_GC_DEBUG_ENV := 0
8989
# Enable DTrace support
9090
WITH_DTRACE := 0
9191

92+
# Enable ITTAPI integration
93+
WITH_ITTAPI := 0
94+
9295
# Enable Tracy support
9396
WITH_TRACY := 0
9497

@@ -452,7 +455,11 @@ endif
452455

453456
# Compiler specific stuff
454457

455-
CC_VERSION_STRING = $(shell $(CC) --version)
458+
CC := $(CROSS_COMPILE)$(CC) # attempt to add cross-compiler prefix, if the user
459+
# is not overriding the default, to form target-triple-cc (which
460+
# may not exist), and use that to decide what compiler the user
461+
# is using for the target build (or default to gcc)
462+
CC_VERSION_STRING = $(shell $(CC) --version 2>/dev/null)
456463
ifneq (,$(findstring clang,$(CC_VERSION_STRING)))
457464
USECLANG := 1
458465
USEGCC := 0
@@ -724,6 +731,12 @@ JCFLAGS += -DUSE_DTRACE
724731
DTRACE := dtrace
725732
endif
726733

734+
ifeq ($(WITH_ITTAPI), 1)
735+
JCXXFLAGS += -DUSE_ITTAPI
736+
JCFLAGS += -DUSE_ITTAPI
737+
LIBITTAPI:=-littnotify
738+
endif
739+
727740
ifeq ($(WITH_TRACY), 1)
728741
JCXXFLAGS += -DUSE_TRACY -DTRACY_ENABLE
729742
JCFLAGS += -DUSE_TRACY -DTRACY_ENABLE

Makefile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ all: debug release
2929
DIRS := $(sort $(build_bindir) $(build_depsbindir) $(build_libdir) $(build_private_libdir) $(build_libexecdir) $(build_includedir) $(build_includedir)/julia $(build_sysconfdir)/julia $(build_datarootdir)/julia $(build_datarootdir)/julia/stdlib $(build_man1dir))
3030
ifneq ($(BUILDROOT),$(JULIAHOME))
3131
BUILDDIRS := $(BUILDROOT) $(addprefix $(BUILDROOT)/,base src src/flisp src/support src/clangsa cli doc deps stdlib test test/clangsa test/embedding test/gcext test/llvmpasses)
32-
BUILDDIRMAKE := $(addsuffix /Makefile,$(BUILDDIRS)) $(BUILDROOT)/sysimage.mk
32+
BUILDDIRMAKE := $(addsuffix /Makefile,$(BUILDDIRS)) $(BUILDROOT)/sysimage.mk $(BUILDROOT)/pkgimage.mk
3333
DIRS += $(BUILDDIRS)
3434
$(BUILDDIRMAKE): | $(BUILDDIRS)
3535
@# add Makefiles to the build directories for convenience (pointing back to the source location of each)
@@ -104,7 +104,10 @@ julia-sysimg-release julia-sysimg-debug : julia-sysimg-% : julia-sysimg-ji julia
104104

105105
julia-debug julia-release : julia-% : julia-sysimg-% julia-src-% julia-symlink julia-libccalltest julia-libllvmcalltest julia-base-cache
106106

107-
debug release : % : julia-%
107+
stdlibs-cache-release stdlibs-cache-debug : stdlibs-cache-% : julia-%
108+
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) -f pkgimage.mk all-$*
109+
110+
debug release : % : julia-% stdlibs-cache-%
108111

109112
docs: julia-sysimg-$(JULIA_BUILD_MODE)
110113
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/doc JULIA_EXECUTABLE='$(call spawn,$(JULIA_EXECUTABLE_$(JULIA_BUILD_MODE))) --startup-file=no'
@@ -349,11 +352,6 @@ else ifeq ($(JULIA_BUILD_MODE),debug)
349352
$(INSTALL_M) $(build_private_libdir)/sys-debug.$(SHLIB_EXT) $(DESTDIR)$(private_libdir)
350353
endif
351354

352-
# Cache stdlibs
353-
@$(call PRINT_JULIA, $(call spawn,$(JULIA_EXECUTABLE)) --startup-file=no $(JULIAHOME)/contrib/cache_stdlibs.jl)
354-
# CI uses `--check-bounds=yes` which impacts the cache flags
355-
@$(call PRINT_JULIA, $(call spawn,$(JULIA_EXECUTABLE)) --startup-file=no --check-bounds=yes $(JULIAHOME)/contrib/cache_stdlibs.jl)
356-
357355
# Copy in all .jl sources as well
358356
mkdir -p $(DESTDIR)$(datarootdir)/julia/base $(DESTDIR)$(datarootdir)/julia/test
359357
cp -R -L $(JULIAHOME)/base/* $(DESTDIR)$(datarootdir)/julia/base

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ Standard library changes
6969
`Factorization` ([#46874]).
7070
* New functions `hermitianpart` and `hermitianpart!` for extracting the Hermitian
7171
(real symmetric) part of a matrix ([#31836]).
72+
* The `norm` of the adjoint or transpose of an `AbstractMatrix` now returns the norm of the
73+
parent matrix by default, matching the current behaviour for `AbstractVector`s ([#49020]).
7274

7375
#### Printf
7476
* Format specifiers now support dynamic width and precision, e.g. `%*s` and `%*.*g` ([#40105]).

THIRDPARTY.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ own licenses:
2424
- [LLVM](https://releases.llvm.org/12.0.1/LICENSE.TXT) [APACHE 2.0 with LLVM Exception]
2525
- [UTF8PROC](https://github.com/JuliaStrings/utf8proc) [MIT]
2626

27+
and optionally:
28+
29+
- [ITTAPI](https://github.com/intel/ittapi/blob/master/LICENSES/BSD-3-Clause.txt) [BSD-3]
30+
2731
Julia's `stdlib` uses the following external libraries, which have their own licenses:
2832

2933
- [DSFMT](https://github.com/MersenneTwister-Lab/dSFMT/blob/master/LICENSE.txt) [BSD-3]

base/Base.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ in_sysimage(pkgid::PkgId) = pkgid in _sysimage_modules
479479
for match = _methods(+, (Int, Int), -1, get_world_counter())
480480
m = match.method
481481
delete!(push!(Set{Method}(), m), m)
482-
copy(Core.Compiler.retrieve_code_info(Core.Compiler.specialize_method(match)))
482+
copy(Core.Compiler.retrieve_code_info(Core.Compiler.specialize_method(match), typemax(UInt)))
483483

484484
empty!(Set())
485485
push!(push!(Set{Union{GlobalRef,Symbol}}(), :two), GlobalRef(Base, :two))

base/abstractdict.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,12 +536,12 @@ function hash(a::AbstractDict, h::UInt)
536536
hash(hv, h)
537537
end
538538

539-
function getindex(t::AbstractDict, key)
539+
function getindex(t::AbstractDict{<:Any,V}, key) where V
540540
v = get(t, key, secret_table_token)
541541
if v === secret_table_token
542542
throw(KeyError(key))
543543
end
544-
return v
544+
return v::V
545545
end
546546

547547
# t[k1,k2,ks...] is syntactic sugar for t[(k1,k2,ks...)]. (Note

base/array.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ end
267267
"""
268268
unsafe_copyto!(dest::Array, do, src::Array, so, N)
269269
270-
Copy `N` elements from a source array to a destination, starting at offset `so` in the
270+
Copy `N` elements from a source array to a destination, starting at the linear index `so` in the
271271
source and `do` in the destination (1-indexed).
272272
273273
The `unsafe` prefix on this function indicates that no validation is performed to ensure
@@ -307,8 +307,8 @@ unsafe_copyto!(dest::Array, doffs, src::Array, soffs, n) =
307307
"""
308308
copyto!(dest, do, src, so, N)
309309
310-
Copy `N` elements from collection `src` starting at offset `so`, to array `dest` starting at
311-
offset `do`. Return `dest`.
310+
Copy `N` elements from collection `src` starting at the linear index `so`, to array `dest` starting at
311+
the index `do`. Return `dest`.
312312
"""
313313
function copyto!(dest::Array, doffs::Integer, src::Array, soffs::Integer, n::Integer)
314314
return _copyto_impl!(dest, doffs, src, soffs, n)

base/boot.jl

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -590,28 +590,25 @@ println(@nospecialize a...) = println(stdout, a...)
590590

591591
struct GeneratedFunctionStub
592592
gen
593-
argnames::Array{Any,1}
594-
spnames::Union{Nothing, Array{Any,1}}
595-
line::Int
596-
file::Symbol
597-
expand_early::Bool
593+
argnames::SimpleVector
594+
spnames::SimpleVector
598595
end
599596

600-
# invoke and wrap the results of @generated
601-
function (g::GeneratedFunctionStub)(@nospecialize args...)
597+
# invoke and wrap the results of @generated expression
598+
function (g::GeneratedFunctionStub)(world::UInt, source::LineNumberNode, @nospecialize args...)
599+
# args is (spvals..., argtypes...)
602600
body = g.gen(args...)
603-
if body isa CodeInfo
604-
return body
605-
end
606-
lam = Expr(:lambda, g.argnames,
607-
Expr(Symbol("scope-block"),
601+
file = source.file
602+
file isa Symbol || (file = :none)
603+
lam = Expr(:lambda, Expr(:argnames, g.argnames...).args,
604+
Expr(:var"scope-block",
608605
Expr(:block,
609-
LineNumberNode(g.line, g.file),
610-
Expr(:meta, :push_loc, g.file, Symbol("@generated body")),
606+
source,
607+
Expr(:meta, :push_loc, file, :var"@generated body"),
611608
Expr(:return, body),
612609
Expr(:meta, :pop_loc))))
613610
spnames = g.spnames
614-
if spnames === nothing
611+
if spnames === svec()
615612
return lam
616613
else
617614
return Expr(Symbol("with-static-parameters"), lam, spnames...)

base/compiler/abstractinterpretation.jl

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ function abstract_call_method(interp::AbstractInterpreter, method::Method, @nosp
572572
break
573573
end
574574
topmost === nothing || continue
575-
if edge_matches_sv(infstate, method, sig, sparams, hardlimit, sv)
575+
if edge_matches_sv(interp, infstate, method, sig, sparams, hardlimit, sv)
576576
topmost = infstate
577577
edgecycle = true
578578
end
@@ -680,12 +680,13 @@ function abstract_call_method(interp::AbstractInterpreter, method::Method, @nosp
680680
return MethodCallResult(rt, edgecycle, edgelimited, edge, effects)
681681
end
682682

683-
function edge_matches_sv(frame::InferenceState, method::Method, @nospecialize(sig), sparams::SimpleVector, hardlimit::Bool, sv::InferenceState)
683+
function edge_matches_sv(interp::AbstractInterpreter, frame::InferenceState, method::Method, @nospecialize(sig), sparams::SimpleVector, hardlimit::Bool, sv::InferenceState)
684684
# The `method_for_inference_heuristics` will expand the given method's generator if
685685
# necessary in order to retrieve this field from the generated `CodeInfo`, if it exists.
686686
# The other `CodeInfo`s we inspect will already have this field inflated, so we just
687687
# access it directly instead (to avoid regeneration).
688-
callee_method2 = method_for_inference_heuristics(method, sig, sparams) # Union{Method, Nothing}
688+
world = get_world_counter(interp)
689+
callee_method2 = method_for_inference_heuristics(method, sig, sparams, world) # Union{Method, Nothing}
689690

690691
inf_method2 = frame.src.method_for_inference_limit_heuristics # limit only if user token match
691692
inf_method2 isa Method || (inf_method2 = nothing)
@@ -722,11 +723,11 @@ function edge_matches_sv(frame::InferenceState, method::Method, @nospecialize(si
722723
end
723724

724725
# This function is used for computing alternate limit heuristics
725-
function method_for_inference_heuristics(method::Method, @nospecialize(sig), sparams::SimpleVector)
726-
if isdefined(method, :generator) && method.generator.expand_early && may_invoke_generator(method, sig, sparams)
726+
function method_for_inference_heuristics(method::Method, @nospecialize(sig), sparams::SimpleVector, world::UInt)
727+
if isdefined(method, :generator) && !(method.generator isa Core.GeneratedFunctionStub) && may_invoke_generator(method, sig, sparams)
727728
method_instance = specialize_method(method, sig, sparams)
728729
if isa(method_instance, MethodInstance)
729-
cinfo = get_staged(method_instance)
730+
cinfo = get_staged(method_instance, world)
730731
if isa(cinfo, CodeInfo)
731732
method2 = cinfo.method_for_inference_limit_heuristics
732733
if method2 isa Method
@@ -2060,7 +2061,7 @@ function most_general_argtypes(closure::PartialOpaque)
20602061
if !isa(argt, DataType) || argt.name !== typename(Tuple)
20612062
argt = Tuple
20622063
end
2063-
return most_general_argtypes(closure.source, argt, false)
2064+
return most_general_argtypes(closure.source, argt, #=withfirst=#false)
20642065
end
20652066

20662067
# call where the function is any lattice element

base/compiler/bootstrap.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ let interp = NativeInterpreter()
3636
else
3737
tt = Tuple{typeof(f), Vararg{Any}}
3838
end
39-
for m in _methods_by_ftype(tt, 10, typemax(UInt))::Vector
39+
for m in _methods_by_ftype(tt, 10, get_world_counter())::Vector
4040
# remove any TypeVars from the intersection
4141
m = m::MethodMatch
4242
typ = Any[m.spec_types.parameters...]

0 commit comments

Comments
 (0)