Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
1360b3a
Restrict `path` to be an `AbstractString` in `lbt_forward()`
staticfloat Feb 7, 2023
d0a7175
Update LLVM build to 14.0.6+2 (#48544)
vchuravy Feb 8, 2023
ceacba1
Update checksums for llvm 14.0.6+2 (#48659)
vchuravy Feb 12, 2023
6213bb8
[REPL] Meta-e: Don't execute the edited code when exiting editor (#46…
fredrikekre Feb 13, 2023
d43d055
Disable frame-pointer-optimiation on Linux (#48660)
vchuravy Feb 13, 2023
b3d42d1
Fix Base.libllvm_path and jl_get_libllvm don't support non-ASCII char…
wesjenkins Feb 14, 2023
25bad18
fix #47658, state stack overflow on unions containing typevars (#48221)
JeffBezanson Jan 24, 2023
f7c4f59
restore kwcall_mt optimizations
Feb 20, 2023
5e39fc6
lattice: fix minor lattice issues (#47570)
aviatesk Nov 16, 2022
84e3545
Put back getfield :boundscheck hack (#48677)
Keno Feb 15, 2023
2324310
make `insert_extension_triggers` idempotent
KristofferC Feb 8, 2023
7734b34
fix printing of parents to extensions in `@time_imports`
KristofferC Feb 10, 2023
6545919
julia_cmd() docstring: include pkgimages (#48392)
fonsp Feb 13, 2023
1121d25
Allow for use 60% of constrained/total system memory (#48614)
gbaraldi Feb 10, 2023
a66d092
update loading test to best-practices (#48429)
vtjnash Jan 31, 2023
5453936
only load extension triggers from the evnironment where the parent pa…
KristofferC Feb 20, 2023
86b9df2
effects: taint `:nothrow` effect on unknown `:static_parameter` (#46791)
aviatesk Feb 8, 2023
af0e4c1
force singlethreading during precompilation (#48592)
IanButterworth Feb 10, 2023
0cb0bb4
Bump LLD to get dsymutil and use it for pkgimgs (#48628)
gbaraldi Feb 11, 2023
624c665
put back DelimitedFiles as a non-sysimage "stdlib" (#48671)
KristofferC Feb 21, 2023
956f54b
[OpenBLAS_jll] Upgrade to new build optimised for PowerPC (#48689)
giordano Feb 20, 2023
b5d9781
staticdata: encode link_id in tagged linkage (#48673)
vtjnash Feb 17, 2023
50b8c13
Add world argument to jl_create_native. (#48746)
maleadt Feb 21, 2023
1c22e77
[compiler] Teach type inference that `GotoIfNot` can throw (#48583)
staticfloat Feb 7, 2023
d2de99d
Stop renumbering statements in inference proper (#48022)
Keno Dec 29, 2022
a6a19e4
inference: fix the correctness of inference bail out interface (#48826)
aviatesk Mar 1, 2023
09757f7
effects: taint `nonoverlayed` when bailing out inference (#48838)
aviatesk Mar 1, 2023
2761b06
effects: handle va-method properly when refining `:inaccessiblememonl…
aviatesk Mar 3, 2023
e25fcc9
Test: add space after test failure for visual clarity (#48526)
IanButterworth Feb 21, 2023
54bdee8
[Make.inc] Define new variable `PATCHELF_SET_RPATH_ARG`
giordano Feb 25, 2023
a671f0c
Accept weakdeps as a source for UUIDS for Preferences
vchuravy Feb 26, 2023
b5243af
add a type assert to logging to prevent Base.require invalidation (#4…
KristofferC Feb 28, 2023
2497f83
Add libjulia-internal to ORCJIT symbol resolution (#48712)
topolarity Feb 28, 2023
8ba214d
Update MbedTLS to 2.28.2 (#48806)
mkitti Feb 28, 2023
b710bd2
Always use `-Wl,--warn-unresolved-symbols` in MSAN builds (#48835)
giordano Mar 1, 2023
3f040ca
Calculate a checksum for the system image (#48869)
timholy Mar 3, 2023
df3f686
fixup! effects: taint `nonoverlayed` when bailing out inference (#48838)
vchuravy Mar 3, 2023
44085f9
Atomically order specsigflags, specptr, and invoke (#47832)
pchintalapudi Feb 22, 2023
570251e
enable re-using external code in pkgimages (#48723)
vtjnash Feb 25, 2023
4710009
Fix final gc lowering on dynamically sized allocation (#48620)
wsmoses Feb 10, 2023
b07fb40
gf: cache cache_with_orig decision (#48833)
vtjnash Mar 1, 2023
d57c4ea
bump Pkg to latest 1.9
Mar 3, 2023
ec5e702
fixup! fixup! effects: taint `nonoverlayed` when bailing out inferenc…
KristofferC Mar 3, 2023
65a025f
staticdata: make hookup of code instances correct (#48751)
vtjnash Mar 3, 2023
c1cb058
staticdata: make completeinfo memory-/gc-safe (#48832)
vtjnash Mar 1, 2023
fcde569
fixup! gf: cache cache_with_orig decision (#48833)
vchuravy Mar 6, 2023
be9df3f
Merge pull request #48881 from JuliaLang/vc/backports-1.9
KristofferC Mar 6, 2023
8024dd6
Add note to NEWS about keywords in tab completion (#48863)
pbouffard Mar 3, 2023
fd1108b
staticdata: set method.nroots_sysimg in `jl_write_values` (#48875)
timholy Mar 3, 2023
96b3fe3
staticdata: check ci->relocatability before caching external speciali…
timholy Mar 3, 2023
9f3b747
Initialize JIT bytes
pchintalapudi Mar 5, 2023
e6249e7
Fix sorting missing values with offset indices (#48864)
LilithHafner Mar 6, 2023
9ced070
Fix heapsize hint and use a line for max memory (#48747)
gbaraldi Mar 3, 2023
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
Prev Previous commit
Next Next commit
inference: fix the correctness of inference bail out interface (#48826)
Since we allow overloading of the `bail_out_xxx` hooks, we need to make
sure that we widen both type and effects to the top when bailing on
inference regardless of the condition presumed by a hook.

This commit particularly fixes the correctness of `bail_out_apply`
(fixes #48807). I wanted to make a simplified test case for this, but
it turns out to be a bit tricky since it relies on the details of
multiple match analysis and the bail out logic.
  • Loading branch information
aviatesk authored and KristofferC committed Mar 3, 2023
commit a6a19e44993fbefd8bc49849fade5802154a6332
28 changes: 18 additions & 10 deletions base/compiler/abstractinterpretation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,9 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f),
match = applicable[i]::MethodMatch
method = match.method
sig = match.spec_types
if bail_out_toplevel_call(interp, sig, sv)
if bail_out_toplevel_call(interp, InferenceLoopState(sig, rettype, all_effects), sv)
# only infer concrete call sites in top-level expressions
add_remark!(interp, sv, "Refusing to infer non-concrete call site in top-level expression")
rettype = Any
break
end
this_rt = Bottom
Expand Down Expand Up @@ -191,7 +190,8 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f),
conditionals[2][i] = tmerge(conditionals[2][i], cnd.elsetype)
end
end
if bail_out_call(interp, rettype, sv)
if bail_out_call(interp, InferenceLoopState(sig, rettype, all_effects), sv)
add_remark!(interp, sv, "Call inference reached maximally imprecise information. Bailing on.")
break
end
end
Expand All @@ -201,7 +201,9 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f),
info = ConstCallInfo(info, const_results)
end

if seen != napplicable
if seen ≠ napplicable
# there is unanalyzed candidate, widen type and effects to the top
rettype = Any
# there may be unanalyzed effects within unseen dispatch candidate,
# but we can still ignore nonoverlayed effect here since we already accounted for it
all_effects = merge_effects(all_effects, EFFECTS_UNKNOWN)
Expand Down Expand Up @@ -1529,7 +1531,9 @@ function abstract_apply(interp::AbstractInterpreter, argtypes::Vector{Any}, si::
end
retinfos = ApplyCallInfo[]
retinfo = UnionSplitApplyCallInfo(retinfos)
for i = 1:length(ctypes)
napplicable = length(ctypes)
seen = 0
for i = 1:napplicable
ct = ctypes[i]
arginfo = infos[i]
lct = length(ct)
Expand All @@ -1543,17 +1547,21 @@ function abstract_apply(interp::AbstractInterpreter, argtypes::Vector{Any}, si::
end
end
call = abstract_call(interp, ArgInfo(nothing, ct), si, sv, max_methods)
seen += 1
push!(retinfos, ApplyCallInfo(call.info, arginfo))
res = tmerge(res, call.rt)
effects = merge_effects(effects, call.effects)
if bail_out_apply(interp, res, sv)
if i != length(ctypes)
# No point carrying forward the info, we're not gonna inline it anyway
retinfo = NoCallInfo()
end
if bail_out_apply(interp, InferenceLoopState(ct, res, effects), sv)
add_remark!(interp, sv, "_apply_iterate inference reached maximally imprecise information. Bailing on.")
break
end
end
if seen ≠ napplicable
# there is unanalyzed candidate, widen type and effects to the top
res = Any
effects = Effects()
retinfo = NoCallInfo() # NOTE this is necessary to prevent the inlining processing
end
# TODO: Add a special info type to capture all the iteration info.
# For now, only propagate info if we don't also union-split the iteration
return CallMeta(res, effects, retinfo)
Expand Down
21 changes: 15 additions & 6 deletions base/compiler/inferencestate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,23 @@ is_effect_overridden(override::EffectsOverride, effect::Symbol) = getfield(overr

add_remark!(::AbstractInterpreter, sv::Union{InferenceState, IRCode}, remark) = return

function bail_out_toplevel_call(::AbstractInterpreter, @nospecialize(callsig), sv::Union{InferenceState, IRCode})
return isa(sv, InferenceState) && sv.restrict_abstract_call_sites && !isdispatchtuple(callsig)
struct InferenceLoopState
sig
rt
effects::Effects
function InferenceLoopState(@nospecialize(sig), @nospecialize(rt), effects::Effects)
new(sig, rt, effects)
end
end

function bail_out_toplevel_call(::AbstractInterpreter, state::InferenceLoopState, sv::Union{InferenceState, IRCode})
return isa(sv, InferenceState) && sv.restrict_abstract_call_sites && !isdispatchtuple(state.sig)
end
function bail_out_call(::AbstractInterpreter, @nospecialize(rt), sv::Union{InferenceState, IRCode})
return rt === Any
function bail_out_call(::AbstractInterpreter, state::InferenceLoopState, sv::Union{InferenceState, IRCode})
return state.rt === Any
end
function bail_out_apply(::AbstractInterpreter, @nospecialize(rt), sv::Union{InferenceState, IRCode})
return rt === Any
function bail_out_apply(::AbstractInterpreter, state::InferenceLoopState, sv::Union{InferenceState, IRCode})
return state.rt === Any
end

was_reached(sv::InferenceState, pc::Int) = sv.ssavaluetypes[pc] !== NOT_FOUND
Expand Down