Skip to content

Commit cdbc9cf

Browse files
committed
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
1 parent b52008a commit cdbc9cf

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

base/inference.jl

+17
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,23 @@ function abstract_call(f::ANY, fargs, argtypes::Vector{Any}, vtypes::VarTable, s
10371037
return Type
10381038
end
10391039

1040+
if sv.inlining
1041+
# need to model the special inliner for ^
1042+
# to ensure we have added the same edge
1043+
if isdefined(Main, :Base) &&
1044+
((isdefined(Main.Base, :^) && is(f, Main.Base.:^)) ||
1045+
(isdefined(Main.Base, :.^) && is(f, Main.Base.:.^))) &&
1046+
length(argtypes) == 3 && (argtypes[3] Int32 || argtypes[3] Int64)
1047+
1048+
a1 = argtypes[2]
1049+
basenumtype = Union{corenumtype, Main.Base.Complex64, Main.Base.Complex128, Main.Base.Rational}
1050+
if a1 basenumtype
1051+
ftimes = Main.Base.:*
1052+
ta1 = widenconst(a1)
1053+
abstract_call_gf_by_type(ftimes, Tuple{typeof(ftimes), ta1, ta1}, sv)
1054+
end
1055+
end
1056+
end
10401057
return abstract_call_gf_by_type(f, atype, sv)
10411058
end
10421059

0 commit comments

Comments
 (0)