Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 54ebed6

Browse files
committedJul 20, 2020
inlining: remove bonus for Tuple return with heap references
Added in #22210 (and earlier begun in #20853), this is no longer necessary to avoid heap allocations, and thus serves little purpose now.
1 parent e6f13e9 commit 54ebed6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎base/compiler/optimize.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ function optimize(opt::OptimizationState, params::OptimizationParams, @nospecial
251251
# obey @inline declaration if a dispatch barrier would not help
252252
else
253253
bonus = 0
254-
if result Tuple && !isbitstype(widenconst(result))
254+
if result Tuple && !isconcretetype(widenconst(result))
255255
bonus = params.inline_tupleret_bonus
256256
end
257257
if opt.src.inlineable

‎base/compiler/types.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ struct OptimizationParams
4444
inlining::Bool # whether inlining is enabled
4545
inline_cost_threshold::Int # number of CPU cycles beyond which it's not worth inlining
4646
inline_nonleaf_penalty::Int # penalty for dynamic dispatch
47-
inline_tupleret_bonus::Int # extra willingness for non-isbits tuple return types
47+
inline_tupleret_bonus::Int # extra inlining willingness for non-concrete tuple return types (in hopes of splitting it up)
4848
inline_error_path_cost::Int # cost of (un-optimized) calls in blocks that throw
4949

5050
# Duplicating for now because optimizer inlining requires it.
@@ -57,7 +57,7 @@ struct OptimizationParams
5757
inlining::Bool = inlining_enabled(),
5858
inline_cost_threshold::Int = 100,
5959
inline_nonleaf_penalty::Int = 1000,
60-
inline_tupleret_bonus::Int = 400,
60+
inline_tupleret_bonus::Int = 250,
6161
inline_error_path_cost::Int = 20,
6262
max_methods::Int = 3,
6363
tuple_splat::Int = 32,

0 commit comments

Comments
 (0)
Please sign in to comment.