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

Option to suppress inference failure with world-splitting #331

Open
timholy opened this issue Mar 15, 2022 · 0 comments
Open

Option to suppress inference failure with world-splitting #331

timholy opened this issue Mar 15, 2022 · 0 comments

Comments

@timholy
Copy link
Collaborator

timholy commented Mar 15, 2022

One of the bigger sources of "noise" I've noticed comes from cases where one is analyzing internal methods designed to work with little help from inference and for which therefore there is only one applicable method. In such cases JET will still warn you, for the obvious reason that Julia generates a fallback call. (This is after JuliaLang/julia#43923, but that applies to Union-splitting but not "world-splitting.")

It's not wrong to warn, but it can be inconvenient. It might be nice to have an option to avoid printing these. It looks a bit complicated to suppress this case, so I thought I'd start with an issue/discussion first.

julia> f(::Int) = 1
f (generic function with 1 method)

julia> g(c) = f(c[1])
g (generic function with 1 method)

julia> @code_typed g(Any[0])
CodeInfo(
1%1 = Base.arrayref(true, c, 1)::Any%2 = (isa)(%1, Int64)::Bool
└──      goto #3 if not %2
2 ─      goto #4
3%5 = Main.f(%1)::Int64
└──      goto #4
4%7 = φ (#2 => 1, #3 => %5)::Int64
└──      return %7
) => Int64

julia> using JET

julia> @report_opt g(Any[0])
═════ 1 possible error found ═════
┌ @ REPL[2]:1 Main.f(%1)
│ runtime dispatch detected: Main.f(%1::Any)
└─────────────
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant