diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18e83d9a4..c27883909 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/src/abstractinterpret/typeinfer.jl b/src/abstractinterpret/typeinfer.jl index 5e28a743b..cd44fbed2 100644 --- a/src/abstractinterpret/typeinfer.jl +++ b/src/abstractinterpret/typeinfer.jl @@ -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 diff --git a/src/analyzers/optanalyzer.jl b/src/analyzers/optanalyzer.jl index 24a1d0304..38c319ff3 100644 --- a/src/analyzers/optanalyzer.jl +++ b/src/analyzers/optanalyzer.jl @@ -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)