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

OptAnalyzer should not report duplicated error from inlined callees #335

Closed
aviatesk opened this issue Mar 22, 2022 · 0 comments · Fixed by #373
Closed

OptAnalyzer should not report duplicated error from inlined callees #335

aviatesk opened this issue Mar 22, 2022 · 0 comments · Fixed by #373

Comments

@aviatesk
Copy link
Owner

julia> using JET

julia> callf(f, args...) = f(args...)
callf (generic function with 1 method)

julia> @inline function untyped_call(val)
           return undefinedf(val)
       end
untyped_call (generic function with 1 method)

julia> @report_opt callf(untyped_call, 42)
═════ 2 possible errors found ═════ (either one is better to be excluded)
┌ @ none:1 f(args...)
│┌ @ none:2 %1(val)
││ runtime dispatch detected: %1::Any(val::Int64)
│└──────────
┌ @ none:2 %2(%1)
│ runtime dispatch detected: %2::Any(%1::Int64)
└──────────


julia> @code_typed callf(untyped_call, 42)
CodeInfo(
1%1 = Core.getfield(args, 1)::Int64%2 = Main.undefinedf::Any%3 = (%2)(%1)::Any
└──      return %3
) => Any

julia> @noinline function untyped_call(val)
           undefinedf(val)
       end
untyped_call (generic function with 1 method)

julia> @report_opt callf(untyped_call, 42)
═════ 1 possible error found ═════
┌ @ none:1 f(args...)
│┌ @ none:2 %1(val)
││ runtime dispatch detected: %1::Any(val::Int64)
│└──────────


julia> @code_typed callf(untyped_call, 42)
CodeInfo(
1%1 = Core.getfield(args, 1)::Int64%2 = invoke f(%1::Int64)::Any
└──      return %2
) => Any
@aviatesk aviatesk changed the title optimization analysis should not report duplicated error from inlined callees OptAnalyzer should not report duplicated error from inlined callees Jul 4, 2022
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

Successfully merging a pull request may close this issue.

1 participant