-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip: fix #203, allow configurations to ignore reports
This PR set-ups `ignored_patterns` interface to ignore certain patterns of reports, which can be configured by users extensively. `ignored_patterns` is supposed to be an iterator of predicate function and if any of given `ignored_patterns` matches a report in question, the report will just be ignored (and nor cached). The predicate function will be called _before_ a report is actually constructed for the possible cut-off of the computational cost to construct the report. Thus its signature is: `(T::Type{<:InferenceErrorReport}, interp::JETInterpreter, sv::InferenceState, spec_args::Tuple)`, where: - `T` specifies the kind of report - `interp` gives the context of whole analysis - `sv::InferenceState` gives the local context of analysis - and `spec_args` will be report-specific arguments To inject predicate checks, now each report is constructed via `@report!` macro, which first checks if the report matches any of `ignored_patterns`, and if not, constructs the report and pushes it to `JETInterpreter` as the previous `report!` function did. This PR also defines `DEFAULT_IGNORED_PATTERNS`, namely `ignored_patterns` applied by default. Currently it consists of `ignore_corecompiler_undefglobal`, which ignores undefined global names in `Core.Compiler`, and it should have some positive effects, like reduce false positive error reports involved with `Base.return_types` and its family in general, improve analysis performance for JET's self-profiling, etc. The support of user-predicate functions specified via .JET configuration file is somewhat tricky, but currently this PR uses RuntimeGeneratedFunctions.jl and it seems to work. I'm not sure if `@nospecialize` notations works correctly in `RuntimeGeneratedFunction`s, so some insights or benchmarks on it will be very welcomed.
- Loading branch information
Showing
8 changed files
with
124 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters