diff --git a/base/inference.jl b/base/inference.jl index 7f735c5c19e77..9a4adb61ee19d 100644 --- a/base/inference.jl +++ b/base/inference.jl @@ -2298,7 +2298,7 @@ function inlineable(f, e::Expr, atypes, sv, enclosing_ast) end end free = effect_free(aei,sv,true) - if ((occ==0 && is(aeitype,None)) || islocal || (occ > 1 && !inline_worthy(aei, occ)) || + if ((occ==0 && is(aeitype,None)) || islocal || (occ > 1 && !inline_worthy(aei, occ*2)) || (affect_free && !free) || (!affect_free && !effect_free(aei,sv,false))) if occ != 0 # islocal=true is implied by occ!=0 vnew = unique_name(enclosing_ast, ast) @@ -2401,14 +2401,14 @@ function inlineable(f, e::Expr, atypes, sv, enclosing_ast) end inline_worthy(body, cost::Real) = true -function inline_worthy(body::Expr, cost::Real=1) # precondition: 0true, symlim) < symlim return true end