Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Experiment] set max_methods=1 for JETAnalyzer #458

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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