File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -234,15 +234,19 @@ function optimize(opt::OptimizationState, @nospecialize(result))
234234 if force_noinline
235235 opt. src. inlineable = false
236236 elseif isa (def, Method)
237- bonus = 0
238- if result ⊑ Tuple && ! isbitstype (widenconst (result))
239- bonus = opt. params. inline_tupleret_bonus
240- end
241- if opt. src. inlineable
242- # For functions declared @inline, increase the cost threshold 20x
243- bonus += opt. params. inline_cost_threshold* 19
237+ if opt. src. inlineable && isdispatchtuple (opt. linfo. specTypes)
238+ # obey @inline declaration if a dispatch barrier would not help
239+ else
240+ bonus = 0
241+ if result ⊑ Tuple && ! isbitstype (widenconst (result))
242+ bonus = opt. params. inline_tupleret_bonus
243+ end
244+ if opt. src. inlineable
245+ # For functions declared @inline, increase the cost threshold 20x
246+ bonus += opt. params. inline_cost_threshold* 19
247+ end
248+ opt. src. inlineable = isinlineable (def, opt, bonus)
244249 end
245- opt. src. inlineable = isinlineable (def, opt, bonus)
246250 end
247251 nothing
248252end
You can’t perform that action at this time.
0 commit comments