Skip to content

Commit

Permalink
rm unnecessary widenconst_bestguess call (#38871)
Browse files Browse the repository at this point in the history
the equivalent widening logic is imposed within `typeinf_local`,
and so as far as I understand we don't this need `widenconst_bestguess`
in `typeinf_edge`

(cherry picked from commit 341d6c9)
  • Loading branch information
aviatesk authored and vtjnash committed Jan 21, 2021
1 parent 2845d87 commit 38b3048
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions base/compiler/typeinfer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -759,20 +759,15 @@ function typeinf_edge(interp::AbstractInterpreter, method::Method, @nospecialize
end
typeinf(interp, frame)
update_valid_age!(frame, caller)
return widenconst_bestguess(frame.bestguess), frame.inferred ? mi : nothing
return frame.bestguess, frame.inferred ? mi : nothing
elseif frame === true
# unresolvable cycle
return Any, nothing
end
# return the current knowledge about this cycle
frame = frame::InferenceState
update_valid_age!(frame, caller)
return widenconst_bestguess(frame.bestguess), nothing
end

function widenconst_bestguess(bestguess)
!isa(bestguess, Const) && !isa(bestguess, PartialStruct) && !isa(bestguess, Type) && return widenconst(bestguess)
return bestguess
return frame.bestguess, nothing
end

#### entry points for inferring a MethodInstance given a type signature ####
Expand Down

0 comments on commit 38b3048

Please sign in to comment.