From 19b1276eec40900ccf27ae2976fe9a6821b0668c Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Wed, 10 Aug 2016 15:56:19 -0400 Subject: [PATCH] add model of special case ^ inliner to inference edges 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 --- base/inference.jl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/base/inference.jl b/base/inference.jl index cdbac8dc07792..350146c799c0d 100644 --- a/base/inference.jl +++ b/base/inference.jl @@ -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