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

(cherry picked from commit 19b1276)
ref #17949
  • Loading branch information
vtjnash authored and tkelman committed Aug 20, 2016
1 parent 14854d7 commit 9a6e884
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 @@ -1052,6 +1052,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

3 comments on commit 9a6e884

@tkelman
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nanosoldier runbenchmarks(ALL, vs = "@0350e5769b43f56c4c570741b0f5b2edf9399dc7")
9a6e884 (right before backport of #18017) vs rc2

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @jrevels

@tkelman
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ this was partway through the PR so not too relevant

Please sign in to comment.