Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: JuliaLang/julia
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: fe3e8c279fae0ff34bcaad01ae5b42dd88dc3e9d
Choose a base ref
..
head repository: JuliaLang/julia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 830cd9f1009731605d4a856445e2d22f7358862f
Choose a head ref
Showing with 3 additions and 6 deletions.
  1. +1 −1 base/compiler/abstractinterpretation.jl
  2. +2 −4 base/compiler/optimize.jl
  3. +0 −1 base/compiler/types.jl
2 changes: 1 addition & 1 deletion base/compiler/abstractinterpretation.jl
Original file line number Diff line number Diff line change
@@ -676,7 +676,7 @@ function const_prop_methodinstance_heuristic(interp::AbstractInterpreter, match:
cache_inf = code.inferred
if !(cache_inf === nothing)
# TODO maybe we want to respect callsite `@inline`/`@noinline` annotations here ?
cache_inlineable = inlining_policy(interp, cache_inf, nothing, match) !== nothing
cache_inlineable = inlining_policy(interp, cache_inf, 0x00, match) !== nothing
end
end
if !cache_inlineable
6 changes: 2 additions & 4 deletions base/compiler/optimize.jl
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ struct InliningState{S <: Union{EdgeTracker, Nothing}, T, I<:AbstractInterpreter
interp::I
end

function inlining_policy(interp::AbstractInterpreter, @nospecialize(src), stmt_flag::Union{Nothing,UInt8}, match::Union{MethodMatch,InferenceResult})
function inlining_policy(interp::AbstractInterpreter, @nospecialize(src), stmt_flag::UInt8, match::Union{MethodMatch,InferenceResult})
if isa(src, CodeInfo) || isa(src, Vector{UInt8})
src_inferred = ccall(:jl_ir_flag_inferred, Bool, (Any,), src)
src_inlineable = is_stmt_inline(stmt_flag) || ccall(:jl_ir_flag_inlineable, Bool, (Any,), src)
@@ -192,10 +192,8 @@ function isinlineable(m::Method, me::OptimizationState, params::OptimizationPara
return inlineable
end

is_stmt_inline(stmt_flag::UInt8) = stmt_flag & IR_FLAG_INLINE != 0
is_stmt_inline(::Nothing) = false
is_stmt_inline(stmt_flag::UInt8) = stmt_flag & IR_FLAG_INLINE != 0
is_stmt_noinline(stmt_flag::UInt8) = stmt_flag & IR_FLAG_NOINLINE != 0
is_stmt_noinline(::Nothing) = false # not used for now

# These affect control flow within the function (so may not be removed
# if there is no usage within the function), but don't affect the purity
1 change: 0 additions & 1 deletion base/compiler/types.jl
Original file line number Diff line number Diff line change
@@ -213,7 +213,6 @@ may_discard_trees(ni::NativeInterpreter) = true
verbose_stmt_info(ni::NativeInterpreter) = false

method_table(ai::AbstractInterpreter) = InternalMethodTable(get_world_counter(ai))
inlining_policy(ai::AbstractInterpreter) = default_inlining_policy

# define inference bail out logic
# `NativeInterpreter` bails out from inference when