@@ -469,17 +469,11 @@ function cycle_fix_limited(@nospecialize(typ), sv::InferenceState, cycleid::Int)
469469    return  typ
470470end 
471471
472- function  adjust_effects (ipo_effects:: Effects , def:: Method , world :: UInt )
472+ function  adjust_effects (ipo_effects:: Effects , def:: Method )
473473    #  override the analyzed effects using manually annotated effect settings
474474    override =  decode_effects_override (def. purity)
475-     valid_worlds =  WorldRange (0 , typemax (UInt))
476475    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)
483477    end 
484478    if  is_effect_overridden (override, :effect_free )
485479        ipo_effects =  Effects (ipo_effects; effect_free= ALWAYS_TRUE)
@@ -507,7 +501,7 @@ function adjust_effects(ipo_effects::Effects, def::Method, world::UInt)
507501    if  is_effect_overridden (override, :nortcall )
508502        ipo_effects =  Effects (ipo_effects; nortcall= true )
509503    end 
510-     return  ( ipo_effects, valid_worlds) 
504+     return  ipo_effects
511505end 
512506
513507function  adjust_effects (sv:: InferenceState )
@@ -561,8 +555,7 @@ function adjust_effects(sv::InferenceState)
561555    #  override the analyzed effects using manually annotated effect settings
562556    def =  sv. linfo. def
563557    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)
566559    end 
567560
568561    return  ipo_effects
@@ -601,9 +594,9 @@ function finishinfer!(me::InferenceState, interp::AbstractInterpreter, cycleid::
601594        end 
602595    end 
603596    result =  me. result
597+     result. valid_worlds =  me. world. valid_worlds
604598    result. result =  bestguess
605599    ipo_effects =  result. ipo_effects =  me. ipo_effects =  adjust_effects (me)
606-     result. valid_worlds =  me. world. valid_worlds
607600    result. exc_result =  me. exc_bestguess =  refine_exception_type (me. exc_bestguess, ipo_effects)
608601    me. src. rettype =  widenconst (ignorelimited (bestguess))
609602    me. src. ssaflags =  me. ssaflags
@@ -1108,13 +1101,8 @@ function typeinf_edge(interp::AbstractInterpreter, method::Method, @nospecialize
11081101                update_valid_age! (caller, frame. world. valid_worlds)
11091102                local  isinferred =  is_inferred (frame)
11101103                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)
11181106                local  bestguess =  frame. bestguess
11191107                local  exc_bestguess =  refine_exception_type (frame. exc_bestguess, effects)
11201108                #  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
11371125    #  return the current knowledge about this cycle
11381126    frame =  frame:: InferenceState 
11391127    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)
11421129    bestguess =  frame. bestguess
11431130    exc_bestguess =  refine_exception_type (frame. exc_bestguess, effects)
11441131    return  Future (MethodCallResult (interp, caller, method, bestguess, exc_bestguess, effects, nothing , edgecycle, edgelimited))
0 commit comments