@@ -471,17 +471,11 @@ function cycle_fix_limited(@nospecialize(typ), sv::InferenceState, cycleid::Int)
471
471
return typ
472
472
end
473
473
474
- function adjust_effects (ipo_effects:: Effects , def:: Method , world :: UInt )
474
+ function adjust_effects (ipo_effects:: Effects , def:: Method )
475
475
# override the analyzed effects using manually annotated effect settings
476
476
override = decode_effects_override (def. purity)
477
- valid_worlds = WorldRange (0 , typemax (UInt))
478
477
if is_effect_overridden (override, :consistent )
479
- # See note on `typemax(Int)` instead of `deleted_world` in adjust_effects!
480
- override_valid_worlds = WorldRange (def. primary_world, typemax (Int))
481
- if world in override_valid_worlds
482
- ipo_effects = Effects (ipo_effects; consistent= ALWAYS_TRUE)
483
- valid_worlds = override_valid_worlds
484
- end
478
+ ipo_effects = Effects (ipo_effects; consistent= ALWAYS_TRUE)
485
479
end
486
480
if is_effect_overridden (override, :effect_free )
487
481
ipo_effects = Effects (ipo_effects; effect_free= ALWAYS_TRUE)
@@ -509,7 +503,7 @@ function adjust_effects(ipo_effects::Effects, def::Method, world::UInt)
509
503
if is_effect_overridden (override, :nortcall )
510
504
ipo_effects = Effects (ipo_effects; nortcall= true )
511
505
end
512
- return ( ipo_effects, valid_worlds)
506
+ return ipo_effects
513
507
end
514
508
515
509
function adjust_effects (sv:: InferenceState )
@@ -563,8 +557,7 @@ function adjust_effects(sv::InferenceState)
563
557
# override the analyzed effects using manually annotated effect settings
564
558
def = sv. linfo. def
565
559
if isa (def, Method)
566
- (ipo_effects, valid_worlds) = adjust_effects (ipo_effects, def, sv. world. this)
567
- update_valid_age! (sv, valid_worlds)
560
+ ipo_effects = adjust_effects (ipo_effects, def)
568
561
end
569
562
570
563
return ipo_effects
@@ -602,9 +595,9 @@ function finishinfer!(me::InferenceState, interp::AbstractInterpreter, cycleid::
602
595
end
603
596
end
604
597
result = me. result
598
+ result. valid_worlds = me. world. valid_worlds
605
599
result. result = bestguess
606
600
ipo_effects = result. ipo_effects = me. ipo_effects = adjust_effects (me)
607
- result. valid_worlds = me. world. valid_worlds
608
601
result. exc_result = me. exc_bestguess = refine_exception_type (me. exc_bestguess, ipo_effects)
609
602
me. src. rettype = widenconst (ignorelimited (bestguess))
610
603
me. src. ssaflags = me. ssaflags
@@ -1067,13 +1060,8 @@ function typeinf_edge(interp::AbstractInterpreter, method::Method, @nospecialize
1067
1060
update_valid_age! (caller, frame. world. valid_worlds)
1068
1061
local isinferred = is_inferred (frame)
1069
1062
local edge = isinferred ? edge_ci : nothing
1070
- local effects, valid_worlds
1071
- if isinferred
1072
- effects = frame. result. ipo_effects # effects are adjusted already within `finish` for ipo_effects
1073
- else
1074
- (effects, valid_worlds) = adjust_effects (effects_for_cycle (frame. ipo_effects), method, frame. world. this)
1075
- update_valid_age! (caller, valid_worlds)
1076
- end
1063
+ local effects = isinferred ? frame. result. ipo_effects : # effects are adjusted already within `finish` for ipo_effects
1064
+ adjust_effects (effects_for_cycle (frame. ipo_effects), method)
1077
1065
local bestguess = frame. bestguess
1078
1066
local exc_bestguess = refine_exception_type (frame. exc_bestguess, effects)
1079
1067
# propagate newly inferred source to the inliner, allowing efficient inlining w/o deserialization:
@@ -1096,8 +1084,7 @@ function typeinf_edge(interp::AbstractInterpreter, method::Method, @nospecialize
1096
1084
# return the current knowledge about this cycle
1097
1085
frame = frame:: InferenceState
1098
1086
update_valid_age! (caller, frame. world. valid_worlds)
1099
- (effects, valid_worlds) = adjust_effects (effects_for_cycle (frame. ipo_effects), method, frame. world. this)
1100
- update_valid_age! (caller, valid_worlds)
1087
+ effects = adjust_effects (effects_for_cycle (frame. ipo_effects), method)
1101
1088
bestguess = frame. bestguess
1102
1089
exc_bestguess = refine_exception_type (frame. exc_bestguess, effects)
1103
1090
return Future (MethodCallResult (interp, caller, method, bestguess, exc_bestguess, effects, nothing , edgecycle, edgelimited))
0 commit comments