Skip to content

Commit cbb9420

Browse files
committed
Add :nothrow_if_innbounds effect
1 parent d8413df commit cbb9420

File tree

14 files changed

+118
-49
lines changed

14 files changed

+118
-49
lines changed

base/boot.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,8 @@ eval(Core, :(LineInfoNode(mod::Module, @nospecialize(method), file::Symbol, line
418418
$(Expr(:new, :LineInfoNode, :mod, :method, :file, :line, :inlined_at))))
419419
eval(Core, :(CodeInstance(mi::MethodInstance, @nospecialize(rettype), @nospecialize(inferred_const),
420420
@nospecialize(inferred), const_flags::Int32,
421-
min_world::UInt, max_world::UInt, ipo_effects::UInt8, effects::UInt8) =
422-
ccall(:jl_new_codeinst, Ref{CodeInstance}, (Any, Any, Any, Any, Int32, UInt, UInt, UInt8, UInt8),
421+
min_world::UInt, max_world::UInt, ipo_effects::UInt32, effects::UInt32) =
422+
ccall(:jl_new_codeinst, Ref{CodeInstance}, (Any, Any, Any, Any, Int32, UInt, UInt, UInt32, UInt32),
423423
mi, rettype, inferred_const, inferred, const_flags, min_world, max_world, ipo_effects, effects)))
424424
eval(Core, :(Const(@nospecialize(v)) = $(Expr(:new, :Const, :v))))
425425
eval(Core, :(PartialStruct(@nospecialize(typ), fields::Array{Any, 1}) = $(Expr(:new, :PartialStruct, :typ, :fields))))

base/compiler/abstractinterpretation.jl

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,21 @@ function should_infer_for_effects(sv::InferenceState)
2828
sv.ipo_effects.effect_free === ALWAYS_TRUE
2929
end
3030

31+
function merge_statement_effect!(sv::InferenceState, effects::Effects)
32+
stmt_inbounds = get_curr_ssaflag(sv) & IR_FLAG_INBOUNDS != 0
33+
propagate_inbounds = sv.src.propagate_inbounds
34+
# Look at inbounds state and see what we need to do about :nothrow_if_inbounds
35+
adjusted_effects = Effects(
36+
effects.consistent,
37+
effects.effect_free,
38+
stmt_inbounds ? effects.nothrow_if_inbounds : effects.nothrow,
39+
propagate_inbounds ? effects.nothrow_if_inbounds :
40+
(effects.nothrow === ALWAYS_TRUE ? ALWAYS_TRUE : TRISTATE_UNKNOWN),
41+
effects.terminates
42+
)
43+
tristate_merge!(sv, adjusted_effects)
44+
end
45+
3146
function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f),
3247
arginfo::ArgInfo, @nospecialize(atype),
3348
sv::InferenceState, max_methods::Int = get_max_methods(sv.mod, interp))
@@ -40,7 +55,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f),
4055
# aren't any in the throw block either to enable other optimizations.
4156
add_remark!(interp, sv, "Skipped call in throw block")
4257
tristate_merge!(sv, Effects(ALWAYS_TRUE, TRISTATE_UNKNOWN,
43-
TRISTATE_UNKNOWN, TRISTATE_UNKNOWN))
58+
TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, TRISTATE_UNKNOWN))
4459
return CallMeta(Any, false)
4560
end
4661

@@ -106,7 +121,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f),
106121
rt = const_rt
107122
end
108123
end
109-
tristate_merge!(sv, effects)
124+
merge_statement_effect!(sv, effects)
110125
push!(const_results, const_result)
111126
if const_result !== nothing
112127
any_const_result = true
@@ -148,7 +163,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f),
148163
this_rt = const_this_rt
149164
end
150165
end
151-
tristate_merge!(sv, effects)
166+
merge_statement_effect!(sv, effects)
152167
push!(const_results, const_result)
153168
if const_result !== nothing
154169
any_const_result = true
@@ -185,7 +200,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f),
185200
tristate_merge!(sv, Effects())
186201
elseif !(atype <: merged_sig)
187202
# Account for the fact that we may encounter a non-covered signature.
188-
tristate_merge!(sv, Effects(ALWAYS_TRUE, ALWAYS_TRUE, TRISTATE_UNKNOWN, ALWAYS_TRUE))
203+
tristate_merge!(sv, Effects(ALWAYS_TRUE, ALWAYS_TRUE, TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, ALWAYS_TRUE))
189204
end
190205

191206
rettype = from_interprocedural!(rettype, sv, arginfo, conditionals)
@@ -599,7 +614,7 @@ function abstract_call_method(interp::AbstractInterpreter, method::Method, @nosp
599614
# Some sort of recursion was detected. Even if we did not limit types,
600615
# we cannot guarantee that the call will terminate.
601616
edge_effects = tristate_merge(edge_effects,
602-
Effects(ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, TRISTATE_UNKNOWN))
617+
Effects(ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, TRISTATE_UNKNOWN))
603618
end
604619
return MethodCallResult(rt, edgecycle, edgelimited, edge, edge_effects)
605620
end
@@ -1472,7 +1487,7 @@ function abstract_call_known(interp::AbstractInterpreter, @nospecialize(f),
14721487
return abstract_modifyfield!(interp, argtypes, sv)
14731488
end
14741489
rt = abstract_call_builtin(interp, f, arginfo, sv, max_methods)
1475-
tristate_merge!(sv, builtin_effects(f, argtypes, rt))
1490+
tristate_merge!(sv, builtin_effects(f, arginfo, rt))
14761491
return CallMeta(rt, false)
14771492
elseif isa(f, Core.OpaqueClosure)
14781493
# calling an OpaqueClosure about which we have no information returns no information
@@ -1792,7 +1807,9 @@ function abstract_eval_statement(interp::AbstractInterpreter, @nospecialize(e),
17921807
end
17931808
tristate_merge!(sv, Effects(
17941809
!ismutabletype(t) ? ALWAYS_TRUE : ALWAYS_FALSE,
1795-
ALWAYS_TRUE, is_nothrow ? ALWAYS_TRUE : ALWAYS_FALSE, ALWAYS_TRUE))
1810+
ALWAYS_TRUE, is_nothrow ? ALWAYS_TRUE : ALWAYS_FALSE,
1811+
is_nothrow ? ALWAYS_TRUE : ALWAYS_FALSE,
1812+
ALWAYS_TRUE))
17961813
elseif ehead === :splatnew
17971814
t, isexact = instanceof_tfunc(abstract_eval_value(interp, e.args[1], vtypes, sv))
17981815
is_nothrow = false # TODO: More precision
@@ -1812,6 +1829,7 @@ function abstract_eval_statement(interp::AbstractInterpreter, @nospecialize(e),
18121829
tristate_merge!(sv, Effects(
18131830
ismutabletype(t) ? ALWAYS_FALSE : ALWAYS_TRUE,
18141831
ALWAYS_TRUE, is_nothrow ? ALWAYS_TRUE : ALWAYS_FALSE,
1832+
is_nothrow ? ALWAYS_TRUE : ALWAYS_FALSE,
18151833
ALWAYS_TRUE))
18161834
elseif ehead === :new_opaque_closure
18171835
tristate_merge!(sv, Effects()) # TODO
@@ -1850,6 +1868,7 @@ function abstract_eval_statement(interp::AbstractInterpreter, @nospecialize(e),
18501868
effects.consistent ? ALWAYS_TRUE : TRISTATE_UNKNOWN,
18511869
effects.effect_free ? ALWAYS_TRUE : TRISTATE_UNKNOWN,
18521870
effects.nothrow ? ALWAYS_TRUE : TRISTATE_UNKNOWN,
1871+
effects.nothrow_if_inbounds ? ALWAYS_TRUE : TRISTATE_UNKNOWN,
18531872
effects.terminates ? ALWAYS_TRUE : TRISTATE_UNKNOWN,
18541873
))
18551874
else
@@ -1931,10 +1950,10 @@ function abstract_eval_global(M::Module, s::Symbol, frame::InferenceState)
19311950
if isconst(M,s)
19321951
return Const(getfield(M,s))
19331952
else
1934-
tristate_merge!(frame, Effects(ALWAYS_FALSE, ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE))
1953+
tristate_merge!(frame, Effects(ALWAYS_FALSE, ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE))
19351954
end
19361955
else
1937-
tristate_merge!(frame, Effects(ALWAYS_FALSE, ALWAYS_TRUE, ALWAYS_FALSE, ALWAYS_TRUE))
1956+
tristate_merge!(frame, Effects(ALWAYS_FALSE, ALWAYS_TRUE, ALWAYS_FALSE, ALWAYS_FALSE, ALWAYS_TRUE))
19381957
end
19391958
return Any
19401959
end
@@ -2020,7 +2039,7 @@ end
20202039

20212040
function handle_backedge!(frame::InferenceState, from, to)
20222041
if from > to
2023-
tristate_merge!(frame, Effects(ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, TRISTATE_UNKNOWN))
2042+
tristate_merge!(frame, Effects(ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, TRISTATE_UNKNOWN))
20242043
end
20252044
end
20262045

@@ -2176,7 +2195,7 @@ function typeinf_local(interp::AbstractInterpreter, frame::InferenceState)
21762195
if isa(lhs, SlotNumber)
21772196
changes = StateUpdate(lhs, VarState(t, false), changes, false)
21782197
elseif isa(lhs, GlobalRef)
2179-
tristate_merge!(frame, Effects(ALWAYS_TRUE, ALWAYS_FALSE, TRISTATE_UNKNOWN, ALWAYS_TRUE))
2198+
tristate_merge!(frame, Effects(ALWAYS_TRUE, ALWAYS_FALSE, TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, ALWAYS_TRUE))
21802199
elseif !isa(lhs, SSAValue)
21812200
tristate_merge!(frame, Effects())
21822201
end

base/compiler/inferencestate.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ mutable struct InferenceState
129129
Vector{InferenceState}(), # callers_in_cycle
130130
#=parent=#nothing,
131131
cache === :global, false, false,
132-
Effects(ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE),
132+
Effects(ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE),
133133
CachedMethodTable(method_table(interp)),
134134
interp)
135135
result.result = frame

base/compiler/ssair/inlining.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ function ir_inline_unionsplit!(compact::IncrementalCompact, idx::Int,
514514
if isa(case, InliningTodo)
515515
val = ir_inline_item!(compact, idx, argexprs′, linetable, case, boundscheck, todo_bbs)
516516
elseif isa(case, InvokeCase)
517-
effect_free = is_removable_if_unused(case.effects)
517+
effect_free = is_removable_if_unused(case.effects, boundscheck === :off)
518518
val = insert_node_here!(compact,
519519
NewInstruction(Expr(:invoke, case.invoke, argexprs′...), typ, nothing,
520520
line, effect_free ? IR_FLAG_EFFECT_FREE : IR_FLAG_NULL, effect_free))
@@ -867,6 +867,8 @@ function handle_single_case!(
867867
elseif isa(case, InvokeCase)
868868
if is_total(case.effects)
869869
inline_const_if_inlineable!(ir[SSAValue(idx)]) && return nothing
870+
elseif is_removable_if_unused(case.effects, ir[SSAValue(idx)][:flag] & IR_FLAG_INBOUNDS != 0)
871+
ir[SSAValue(idx)][:flag] |= IR_FLAG_EFFECT_FREE
870872
end
871873
isinvoke && rewrite_invoke_exprargs!(stmt)
872874
stmt.head = :invoke

base/compiler/ssair/show.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,8 @@ function Base.show(io::IO, e::Core.Compiler.Effects)
799799
print(io, ',')
800800
printstyled(io, string(tristate_letter(e.nothrow), 'n'); color=tristate_color(e.nothrow))
801801
print(io, ',')
802+
printstyled(io, string(tristate_letter(e.nothrow_if_inbounds), 'i'); color=tristate_color(e.nothrow_if_inbounds))
803+
print(io, ',')
802804
printstyled(io, string(tristate_letter(e.terminates), 't'); color=tristate_color(e.terminates))
803805
print(io, ')')
804806
end

base/compiler/tfuncs.jl

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,7 +1603,7 @@ function array_type_undefable(@nospecialize(arytype))
16031603
end
16041604

16051605
function array_builtin_common_nothrow(argtypes::Vector{Any}, first_idx_idx::Int)
1606-
length(argtypes) >= 4 || return false
1606+
length(argtypes) >= first_idx_idx || return false
16071607
boundscheck = argtypes[1]
16081608
arytype = argtypes[2]
16091609
array_builtin_common_typecheck(boundscheck, arytype, argtypes, first_idx_idx) || return false
@@ -1733,21 +1733,22 @@ const _SPECIAL_BUILTINS = Any[
17331733
Core._apply_iterate
17341734
]
17351735

1736-
function builtin_effects(f::Builtin, argtypes::Vector{Any}, rt)
1736+
function builtin_effects(f::Builtin, arginfo::ArgInfo, rt)
17371737
if isa(f, IntrinsicFunction)
1738-
return intrinsic_effects(f, argtypes)
1738+
return intrinsic_effects(f, arginfo.argtypes)
17391739
end
1740+
(;argtypes, fargs) = arginfo
17401741

17411742
@assert !contains_is(_SPECIAL_BUILTINS, f)
17421743

17431744
if (f === Core.getfield || f === Core.isdefined) && length(argtypes) >= 2
17441745
# consistent if the argtype is immutable
17451746
if isvarargtype(argtypes[2])
1746-
return Effects(TRISTATE_UNKNOWN, ALWAYS_TRUE, TRISTATE_UNKNOWN, ALWAYS_TRUE)
1747+
return Effects(TRISTATE_UNKNOWN, ALWAYS_TRUE, TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, ALWAYS_TRUE)
17471748
end
17481749
s = widenconst(argtypes[2])
17491750
if isType(s) || !isa(s, DataType) || isabstracttype(s)
1750-
return Effects(TRISTATE_UNKNOWN, ALWAYS_TRUE, TRISTATE_UNKNOWN, ALWAYS_TRUE)
1751+
return Effects(TRISTATE_UNKNOWN, ALWAYS_TRUE, TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, ALWAYS_TRUE)
17511752
end
17521753
s = s::DataType
17531754
ipo_consistent = !ismutabletype(s)
@@ -1758,10 +1759,19 @@ function builtin_effects(f::Builtin, argtypes::Vector{Any}, rt)
17581759
nothrow = isvarargtype(argtypes[end]) ? false :
17591760
builtin_nothrow(f, argtypes[2:end], rt)
17601761

1762+
nothrow_if_inbounds = nothrow
1763+
1764+
if !nothrow && f === Core.arrayref && fargs !== nothing && isexpr(fargs[2], :boundscheck) && !isvarargtype(argtypes[end])
1765+
new_argtypes = argtypes[3:end]
1766+
pushfirst!(new_argtypes, Const(false))
1767+
nothrow_if_inbounds = builtin_nothrow(f, new_argtypes, rt)
1768+
end
1769+
17611770
return Effects(
17621771
ipo_consistent ? ALWAYS_TRUE : ALWAYS_FALSE,
17631772
effect_free ? ALWAYS_TRUE : ALWAYS_FALSE,
17641773
nothrow ? ALWAYS_TRUE : TRISTATE_UNKNOWN,
1774+
nothrow_if_inbounds ? ALWAYS_TRUE : TRISTATE_UNKNOWN,
17651775
ALWAYS_TRUE)
17661776
end
17671777

@@ -1926,7 +1936,7 @@ function intrinsic_effects(f::IntrinsicFunction, argtypes::Vector{Any})
19261936
if f === Intrinsics.llvmcall
19271937
# llvmcall can do arbitrary things
19281938
return Effects(TRISTATE_UNKNOWN, TRISTATE_UNKNOWN,
1929-
TRISTATE_UNKNOWN, TRISTATE_UNKNOWN)
1939+
TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, TRISTATE_UNKNOWN)
19301940
end
19311941

19321942
ipo_consistent = !(f === Intrinsics.pointerref || # this one is volatile
@@ -1944,6 +1954,7 @@ function intrinsic_effects(f::IntrinsicFunction, argtypes::Vector{Any})
19441954
ipo_consistent ? ALWAYS_TRUE : ALWAYS_FALSE,
19451955
effect_free ? ALWAYS_TRUE : ALWAYS_FALSE,
19461956
nothrow ? ALWAYS_TRUE : TRISTATE_UNKNOWN,
1957+
nothrow ? ALWAYS_TRUE : TRISTATE_UNKNOWN,
19471958
ALWAYS_TRUE)
19481959
end
19491960

base/compiler/typeinfer.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ function rt_adjust_effects(@nospecialize(rt), ipo_effects::Effects)
422422
# Fix that up here to improve precision.
423423
if rt === Union{}
424424
return Effects(ALWAYS_TRUE, ipo_effects.effect_free,
425-
ipo_effects.nothrow, ipo_effects.terminates)
425+
ipo_effects.nothrow, ipo_effects.nothrow_if_inbounds, ipo_effects.terminates)
426426
end
427427
return ipo_effects
428428
end
@@ -797,6 +797,8 @@ function tristate_merge(old::Effects, new::Effects)
797797
old.effect_free, new.effect_free),
798798
tristate_merge(
799799
old.nothrow, new.nothrow),
800+
tristate_merge(
801+
old.nothrow_if_inbounds, new.nothrow_if_inbounds),
800802
tristate_merge(
801803
old.terminates, new.terminates))
802804
end

base/compiler/types.jl

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ struct Effects
3131
consistent::TriState
3232
effect_free::TriState
3333
nothrow::TriState
34+
nothrow_if_inbounds::TriState
3435
terminates::TriState
3536
end
36-
Effects() = Effects(TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, TRISTATE_UNKNOWN)
37+
Effects() = Effects(TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, TRISTATE_UNKNOWN, TRISTATE_UNKNOWN)
3738

3839
is_total_or_error(effects::Effects) =
3940
effects.consistent === ALWAYS_TRUE && effects.effect_free === ALWAYS_TRUE &&
@@ -42,24 +43,31 @@ is_total_or_error(effects::Effects) =
4243
is_total(effects::Effects) =
4344
is_total_or_error(effects) && effects.nothrow === ALWAYS_TRUE
4445

45-
is_removable_if_unused(effects::Effects) =
46+
is_removable_if_unused(effects::Effects, assume_inbounds::Bool) =
4647
effects.effect_free === ALWAYS_TRUE &&
4748
effects.terminates === ALWAYS_TRUE &&
48-
effects.nothrow === ALWAYS_TRUE
49+
(effects.nothrow === ALWAYS_TRUE ||
50+
(assume_inbounds && effects.nothrow_if_inbounds === ALWAYS_TRUE))
4951

50-
const EFFECTS_TOTAL = Effects(ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE)
52+
const EFFECTS_TOTAL = Effects(ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE, ALWAYS_TRUE)
5153

52-
encode_effects(e::Effects) = e.consistent.state | (e.effect_free.state << 2) | (e.nothrow.state << 4) | (e.terminates.state << 6)
53-
decode_effects(e::UInt8) =
54+
encode_effects(e::Effects) = e.consistent.state |
55+
(e.effect_free.state << 2) |
56+
(e.nothrow.state << 4) |
57+
(e.nothrow_if_inbounds.state << 6) |
58+
(UInt32(e.terminates.state) << 8)
59+
decode_effects(e::UInt32) =
5460
Effects(TriState(e & 0x3),
5561
TriState((e >> 2) & 0x3),
5662
TriState((e >> 4) & 0x3),
57-
TriState((e >> 6) & 0x3))
63+
TriState((e >> 6) & 0x3),
64+
TriState((e >> 8) & 0x3))
5865

5966
struct EffectsOverride
6067
consistent::Bool
6168
effect_free::Bool
6269
nothrow::Bool
70+
nothrow_if_inbounds::Bool
6371
terminates::Bool
6472
terminates_locally::Bool
6573
end
@@ -69,8 +77,9 @@ function encode_effects_override(eo::EffectsOverride)
6977
eo.consistent && (e |= 0x01)
7078
eo.effect_free && (e |= 0x02)
7179
eo.nothrow && (e |= 0x04)
72-
eo.terminates && (e |= 0x08)
73-
eo.terminates_locally && (e |= 0x10)
80+
eo.nothrow_if_inbounds && (e |= 0x08)
81+
eo.terminates && (e |= 0x10)
82+
eo.terminates_locally && (e |= 0x20)
7483
e
7584
end
7685

@@ -80,7 +89,8 @@ decode_effects_override(e::UInt8) =
8089
(e >> 1) & 0x01 != 0x00,
8190
(e >> 2) & 0x01 != 0x00,
8291
(e >> 3) & 0x01 != 0x00,
83-
(e >> 4) & 0x01 != 0x00)
92+
(e >> 4) & 0x01 != 0x00,
93+
(e >> 5) & 0x01 != 0x00)
8494

8595
"""
8696
InferenceResult

src/dump.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,8 @@ static void jl_serialize_code_instance(jl_serializer_state *s, jl_code_instance_
516516

517517
write_uint8(s->s, TAG_CODE_INSTANCE);
518518
write_uint8(s->s, flags);
519-
write_uint8(s->s, codeinst->ipo_purity_bits);
520-
write_uint8(s->s, codeinst->purity_bits);
519+
write_uint32(s->s, codeinst->ipo_purity_bits);
520+
write_uint32(s->s, codeinst->purity_bits);
521521
jl_serialize_value(s, (jl_value_t*)codeinst->def);
522522
if (write_ret_type) {
523523
jl_serialize_value(s, codeinst->inferred);
@@ -1652,8 +1652,8 @@ static jl_value_t *jl_deserialize_value_code_instance(jl_serializer_state *s, jl
16521652
int flags = read_uint8(s->s);
16531653
int validate = (flags >> 0) & 3;
16541654
int constret = (flags >> 2) & 1;
1655-
codeinst->ipo_purity_bits = read_uint8(s->s);
1656-
codeinst->purity_bits = read_uint8(s->s);
1655+
codeinst->ipo_purity_bits = read_uint32(s->s);
1656+
codeinst->purity_bits = read_uint32(s->s);
16571657
codeinst->def = (jl_method_instance_t*)jl_deserialize_value(s, (jl_value_t**)&codeinst->def);
16581658
jl_gc_wb(codeinst, codeinst->def);
16591659
codeinst->inferred = jl_deserialize_value(s, &codeinst->inferred);

src/gf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ JL_DLLEXPORT jl_code_instance_t* jl_new_codeinst(
205205
jl_method_instance_t *mi, jl_value_t *rettype,
206206
jl_value_t *inferred_const, jl_value_t *inferred,
207207
int32_t const_flags, size_t min_world, size_t max_world,
208-
uint8_t ipo_effects, uint8_t effects);
208+
uint32_t ipo_effects, uint32_t effects);
209209
JL_DLLEXPORT void jl_mi_cache_insert(jl_method_instance_t *mi JL_ROOTING_ARGUMENT,
210210
jl_code_instance_t *ci JL_ROOTED_ARGUMENT JL_MAYBE_UNROOTED);
211211

@@ -367,7 +367,7 @@ JL_DLLEXPORT jl_code_instance_t *jl_new_codeinst(
367367
jl_method_instance_t *mi, jl_value_t *rettype,
368368
jl_value_t *inferred_const, jl_value_t *inferred,
369369
int32_t const_flags, size_t min_world, size_t max_world,
370-
uint8_t ipo_effects, uint8_t effects
370+
uint32_t ipo_effects, uint32_t effects
371371
/*, jl_array_t *edges, int absolute_max*/)
372372
{
373373
jl_task_t *ct = jl_current_task;

0 commit comments

Comments
 (0)