diff --git a/docs/src/optanalysis.md b/docs/src/optanalysis.md index ae17c6948..0ea1c2628 100644 --- a/docs/src/optanalysis.md +++ b/docs/src/optanalysis.md @@ -175,6 +175,10 @@ report = @report_opt sumup(sin); rpts = JET.get_reports(report) ``` +!!! tip + If `rpts` is a long list, consider using `urpts = unique(reportkey, rpts)` to trim it. + See [`reportkey`](@ref). + Now you can `ascend` individual reports: ``` diff --git a/src/JET.jl b/src/JET.jl index ed823d7b3..a97d82274 100644 --- a/src/JET.jl +++ b/src/JET.jl @@ -6,7 +6,7 @@ module JET export # jetanalyzer @report_call, report_call, @test_call, test_call, - report_file, test_file, report_package, test_package, report_text, test_text, + report_file, test_file, report_package, test_package, report_text, reportkey, test_text, watch_file, # optanalyzer @report_opt, report_opt, @test_opt, test_opt, diff --git a/src/abstractinterpret/inferenceerrorreport.jl b/src/abstractinterpret/inferenceerrorreport.jl index cd0c59771..ecec9e5c0 100644 --- a/src/abstractinterpret/inferenceerrorreport.jl +++ b/src/abstractinterpret/inferenceerrorreport.jl @@ -580,6 +580,16 @@ end # utility # ------- +""" + reportkey(report::InferenceErrorReport) + +Returns an identifier for the runtime-dispatched call site of `report`. + +If you have a long list of reports to analyze, `urpts = unique(reportkey, rpts)` may remove "duplicates" +that arrive at the same runtime dispatch from different entry points. +""" +reportkey(report::InferenceErrorReport) = (report.sig.tt, report.vst[end].linfo) + # TODO parametric definition? """