Skip to content

Commit cbebf22

Browse files
authored
Merge branch 'master' into kf/constpropbig
2 parents ead2227 + c97adbb commit cbebf22

File tree

11 files changed

+237
-164
lines changed

11 files changed

+237
-164
lines changed

base/compiler/optimize.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,15 @@ code_cache(state::InliningState) = WorldView(code_cache(state.interp), state.wor
126126

127127
include("compiler/ssair/driver.jl")
128128

129-
mutable struct OptimizationState{IState<:InliningState}
129+
mutable struct OptimizationState{Interp<:AbstractInterpreter}
130130
linfo::MethodInstance
131131
src::CodeInfo
132132
ir::Union{Nothing, IRCode}
133133
stmt_info::Vector{CallInfo}
134134
mod::Module
135135
sptypes::Vector{Any}
136136
slottypes::Vector{Any}
137-
inlining::IState
137+
inlining::InliningState{Interp}
138138
cfg::Union{Nothing,CFG}
139139
end
140140
function OptimizationState(frame::InferenceState, params::OptimizationParams,

base/compiler/ssair/EscapeAnalysis/EscapeAnalysis.jl

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import ._TOP_MOD: # Base definitions
2727
pop!, push!, pushfirst!, empty!, delete!, max, min, enumerate, unwrap_unionall,
2828
ismutabletype
2929
import Core.Compiler: # Core.Compiler specific definitions
30-
Bottom, InferenceResult, IRCode, IR_FLAG_NOTHROW,
30+
Bottom, OptimizerLattice, InferenceResult, IRCode, IR_FLAG_NOTHROW,
3131
isbitstype, isexpr, is_meta_expr_head, println, widenconst, argextype, singleton_type,
3232
fieldcount_noerror, try_compute_field, try_compute_fieldidx, hasintersect, ,
3333
intrinsic_nothrow, array_builtin_common_typecheck, arrayset_typecheck,
@@ -1596,12 +1596,16 @@ function escape_builtin!(::typeof(setfield!), astate::AnalysisState, pc::Int, ar
15961596
add_escape_change!(astate, val, ssainfo)
15971597
# compute the throwness of this setfield! call here since builtin_nothrow doesn't account for that
15981598
@label add_thrown_escapes
1599-
argtypes = Any[]
1600-
for i = 2:length(args)
1601-
push!(argtypes, argextype(args[i], ir))
1599+
if length(args) == 4 && setfield!_nothrow(OptimizerLattice(),
1600+
argextype(args[2], ir), argextype(args[3], ir), argextype(args[4], ir))
1601+
return true
1602+
elseif length(args) == 3 && setfield!_nothrow(OptimizerLattice(),
1603+
argextype(args[2], ir), argextype(args[3], ir))
1604+
return true
1605+
else
1606+
add_thrown_escapes!(astate, pc, args, 2)
1607+
return true
16021608
end
1603-
setfield!_nothrow(argtypes) || add_thrown_escapes!(astate, pc, args, 2)
1604-
return true
16051609
end
16061610

16071611
function escape_builtin!(::typeof(arrayref), astate::AnalysisState, pc::Int, args::Vector{Any})

0 commit comments

Comments
 (0)