Skip to content

Commit

Permalink
[Experiment] set max_methods=1 for JETAnalyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk committed Jan 18, 2023
1 parent 6c44f2e commit 79670f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/analyzers/jetanalyzer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ end
report_pass::Union{Nothing,ReportPass} = nothing,
mode::Symbol = :basic,
# default `InferenceParams` tuning
max_methods::Int = 1,
aggressive_constant_propagation::Bool = true,
unoptimize_throw_blocks::Bool = false,
jetconfigs...)
Expand All @@ -96,7 +97,8 @@ end
elseif mode !== :basic
throw(ArgumentError("either of `report_pass` and `mode` configurations can be specified"))
end
state = AnalyzerState(; aggressive_constant_propagation,
state = AnalyzerState(; max_methods,
aggressive_constant_propagation,
unoptimize_throw_blocks,
jetconfigs...)
cache_key = compute_hash(state.inf_params, report_pass)
Expand Down
5 changes: 1 addition & 4 deletions test/analyzers/test_jetanalyzer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -956,10 +956,7 @@ end
result = report_call((Any,Symbol); mode = :sound) do a, b
a == b ? 0 : 1
end
@test any(get_reports_with_test(result)) do r
isa(r, NonBooleanCondErrorReport) &&
r.t == Type[Missing]
end
@test any(r->isa(r,NonBooleanCondErrorReport), get_reports_with_test(result))
end

let # `!(t ⊑ Bool)` -> error
Expand Down

0 comments on commit 79670f8

Please sign in to comment.