Skip to content

Commit

Permalink
Merge b9c18a2 into d28a7d5
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson authored Sep 19, 2018
2 parents d28a7d5 + b9c18a2 commit d10df6c
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions base/compiler/optimize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -230,15 +230,19 @@ function optimize(opt::OptimizationState, @nospecialize(result))
if force_noinline
opt.src.inlineable = false
elseif isa(def, Method)
bonus = 0
if result Tuple && !isbitstype(widenconst(result))
bonus = opt.params.inline_tupleret_bonus
end
if opt.src.inlineable
# For functions declared @inline, increase the cost threshold 20x
bonus += opt.params.inline_cost_threshold*19
if opt.src.inlineable && isdispatchtuple(opt.linfo.specTypes)
# obey @inline declaration if a dispatch barrier would not help
else
bonus = 0
if result Tuple && !isbitstype(widenconst(result))
bonus = opt.params.inline_tupleret_bonus
end
if opt.src.inlineable
# For functions declared @inline, increase the cost threshold 20x
bonus += opt.params.inline_cost_threshold*19
end
opt.src.inlineable = isinlineable(def, opt, bonus)
end
opt.src.inlineable = isinlineable(def, opt, bonus)
end
nothing
end
Expand Down

0 comments on commit d10df6c

Please sign in to comment.