@@ -469,17 +469,11 @@ function cycle_fix_limited(@nospecialize(typ), sv::InferenceState, cycleid::Int)
469
469
return typ
470
470
end
471
471
472
- function adjust_effects (ipo_effects:: Effects , def:: Method , world :: UInt )
472
+ function adjust_effects (ipo_effects:: Effects , def:: Method )
473
473
# override the analyzed effects using manually annotated effect settings
474
474
override = decode_effects_override (def. purity)
475
- valid_worlds = WorldRange (0 , typemax (UInt))
476
475
if is_effect_overridden (override, :consistent )
477
- # See note on `typemax(Int)` instead of `deleted_world` in adjust_effects!
478
- override_valid_worlds = WorldRange (def. primary_world, typemax (UInt))
479
- if world in override_valid_worlds
480
- ipo_effects = Effects (ipo_effects; consistent= ALWAYS_TRUE)
481
- valid_worlds = override_valid_worlds
482
- end
476
+ ipo_effects = Effects (ipo_effects; consistent= ALWAYS_TRUE)
483
477
end
484
478
if is_effect_overridden (override, :effect_free )
485
479
ipo_effects = Effects (ipo_effects; effect_free= ALWAYS_TRUE)
@@ -507,7 +501,7 @@ function adjust_effects(ipo_effects::Effects, def::Method, world::UInt)
507
501
if is_effect_overridden (override, :nortcall )
508
502
ipo_effects = Effects (ipo_effects; nortcall= true )
509
503
end
510
- return ( ipo_effects, valid_worlds)
504
+ return ipo_effects
511
505
end
512
506
513
507
function adjust_effects (sv:: InferenceState )
@@ -561,8 +555,7 @@ function adjust_effects(sv::InferenceState)
561
555
# override the analyzed effects using manually annotated effect settings
562
556
def = sv. linfo. def
563
557
if isa (def, Method)
564
- (ipo_effects, valid_worlds) = adjust_effects (ipo_effects, def, sv. world. this)
565
- update_valid_age! (sv, valid_worlds)
558
+ ipo_effects = adjust_effects (ipo_effects, def)
566
559
end
567
560
568
561
return ipo_effects
@@ -601,9 +594,9 @@ function finishinfer!(me::InferenceState, interp::AbstractInterpreter, cycleid::
601
594
end
602
595
end
603
596
result = me. result
597
+ result. valid_worlds = me. world. valid_worlds
604
598
result. result = bestguess
605
599
ipo_effects = result. ipo_effects = me. ipo_effects = adjust_effects (me)
606
- result. valid_worlds = me. world. valid_worlds
607
600
result. exc_result = me. exc_bestguess = refine_exception_type (me. exc_bestguess, ipo_effects)
608
601
me. src. rettype = widenconst (ignorelimited (bestguess))
609
602
me. src. ssaflags = me. ssaflags
@@ -1108,13 +1101,8 @@ function typeinf_edge(interp::AbstractInterpreter, method::Method, @nospecialize
1108
1101
update_valid_age! (caller, frame. world. valid_worlds)
1109
1102
local isinferred = is_inferred (frame)
1110
1103
local edge = isinferred ? edge_ci : nothing
1111
- local effects, valid_worlds
1112
- if isinferred
1113
- effects = frame. result. ipo_effects # effects are adjusted already within `finish` for ipo_effects
1114
- else
1115
- (effects, valid_worlds) = adjust_effects (effects_for_cycle (frame. ipo_effects), method, frame. world. this)
1116
- update_valid_age! (caller, valid_worlds)
1117
- end
1104
+ local effects = isinferred ? frame. result. ipo_effects : # effects are adjusted already within `finish` for ipo_effects
1105
+ adjust_effects (effects_for_cycle (frame. ipo_effects), method)
1118
1106
local bestguess = frame. bestguess
1119
1107
local exc_bestguess = refine_exception_type (frame. exc_bestguess, effects)
1120
1108
# propagate newly inferred source to the inliner, allowing efficient inlining w/o deserialization:
@@ -1137,8 +1125,7 @@ function typeinf_edge(interp::AbstractInterpreter, method::Method, @nospecialize
1137
1125
# return the current knowledge about this cycle
1138
1126
frame = frame:: InferenceState
1139
1127
update_valid_age! (caller, frame. world. valid_worlds)
1140
- (effects, valid_worlds) = adjust_effects (effects_for_cycle (frame. ipo_effects), method, frame. world. this)
1141
- update_valid_age! (caller, valid_worlds)
1128
+ effects = adjust_effects (effects_for_cycle (frame. ipo_effects), method)
1142
1129
bestguess = frame. bestguess
1143
1130
exc_bestguess = refine_exception_type (frame. exc_bestguess, effects)
1144
1131
return Future (MethodCallResult (interp, caller, method, bestguess, exc_bestguess, effects, nothing , edgecycle, edgelimited))
0 commit comments