Skip to content

Commit

Permalink
add model of special case ^ inliner to inference edges
Browse files Browse the repository at this point in the history
required for the inliner to work, since all of the logic for computing edges is supposed to be handle by the inference step

fix #17759
  • Loading branch information
vtjnash committed Aug 11, 2016
1 parent c6c46b6 commit 19b1276
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions base/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,23 @@ function abstract_call(f::ANY, fargs, argtypes::Vector{Any}, vtypes::VarTable, s
return Type
end

if sv.inlining
# need to model the special inliner for ^
# to ensure we have added the same edge
if isdefined(Main, :Base) &&
((isdefined(Main.Base, :^) && is(f, Main.Base.:^)) ||
(isdefined(Main.Base, :.^) && is(f, Main.Base.:.^))) &&
length(argtypes) == 3 && (argtypes[3] Int32 || argtypes[3] Int64)

a1 = argtypes[2]
basenumtype = Union{corenumtype, Main.Base.Complex64, Main.Base.Complex128, Main.Base.Rational}
if a1 basenumtype
ftimes = Main.Base.:*
ta1 = widenconst(a1)
abstract_call_gf_by_type(ftimes, Tuple{typeof(ftimes), ta1, ta1}, sv)
end
end
end
return abstract_call_gf_by_type(f, atype, sv)
end

Expand Down

0 comments on commit 19b1276

Please sign in to comment.