Skip to content

Commit

Permalink
adjustments to v1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk committed Nov 29, 2023
1 parent 223f464 commit 7838948
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 7 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ jobs:
fail-fast: false # don't stop CI even when one of them fails
matrix:
version:
- '1.9.0' # lowest version supported
- '1'
- '1.9.0' # lowest version supported
- '1' # current stable
- '1.10-nightly' # next stable
- 'nightly'
os:
- ubuntu-latest
Expand Down
5 changes: 0 additions & 5 deletions src/abstractinterpret/typeinfer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ let # overload `const_prop_call`
# successful constant prop', we need to update reports
collect_callee_reports!(analyzer, sv)
end
@static if VERSION v"1.11.0-DEV.233" || v"1.11.0-DEV" > VERSION v"1.10.0-beta1.11"
if concrete_eval_result !== nothing
filter_lineages!(analyzer, sv.result, mi)
end
end
return const_result
end
end
Expand Down
29 changes: 29 additions & 0 deletions src/analyzers/optanalyzer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,35 @@ struct OptAnalysisPass <: ReportPass end

optanalyzer_function_filter(@nospecialize f) = true

@static if VERSION v"1.11.0-DEV.233" || VERSION v"1.10.0-beta1.11"
function CC.const_prop_call(analyzer::OptAnalyzer,
mi::MethodInstance, result::MethodCallResult, arginfo::ArgInfo, sv::InferenceState,
concrete_eval_result::Union{Nothing,CC.ConstCallResults})
ret = @invoke CC.const_prop_call(analyzer::AbstractAnalyzer,
mi::MethodInstance, result::MethodCallResult, arginfo::ArgInfo, sv::InferenceState,
concrete_eval_result::Union{Nothing,CC.ConstCallResults})
if concrete_eval_result !== nothing
# HACK disable the whole `OptAnalyzer` analysis as far as the frame has been concretized
# (otherwise we may end up with useless reports from recursive calls)
filter_lineages!(analyzer, sv.result, result.edge::MethodInstance)
end
return ret
end

function CC.const_prop_call(analyzer::OptAnalyzer,
mi::MethodInstance, result::MethodCallResult, arginfo::ArgInfo, sv::CC.IRInterpretationState,
concrete_eval_result::Union{Nothing,CC.ConstCallResults})
if concrete_eval_result !== nothing
# HACK disable the whole `OptAnalyzer` analysis as far as the frame has been concretized
# (otherwise we may end up with useless reports from recursive calls)
return concrete_eval_result
end
return @invoke CC.const_prop_call(analyzer::AbstractInterpreter,
mi::MethodInstance, result::MethodCallResult, arginfo::ArgInfo, sv::CC.IRInterpretationState,
nothing::Nothing)
end
end

# TODO better to work only `finish!`
function CC.finish(frame::InferenceState, analyzer::OptAnalyzer)
ret = @invoke CC.finish(frame::InferenceState, analyzer::AbstractAnalyzer)
Expand Down

0 comments on commit 7838948

Please sign in to comment.