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

skip_unoptimized_throw_blocks does not ignore error exceptions #647

Open
kbarros opened this issue Jul 10, 2024 · 0 comments
Open

skip_unoptimized_throw_blocks does not ignore error exceptions #647

kbarros opened this issue Jul 10, 2024 · 0 comments

Comments

@kbarros
Copy link

kbarros commented Jul 10, 2024

This is a follow-up to #643. As discussed on that issue, it seems that skip_unoptimized_throw_blocks does not always detect throw blocks. An example is below.

using JET

function g(x)
    error("Please ignore this: $x")
end

@test_opt g(1/3)
Output
[ Info: tracking Base
  ═════ 4 possible errors found ═════
  ┌ g(x::Float64) @ Main ./REPL[2]:2
  │┌ string(::String, ::Float64) @ Base ./strings/io.jl:189
  ││┌ print_to_string(::String, ::Float64) @ Base ./strings/io.jl:150
  │││┌ _unsafe_take!(io::IOBuffer) @ Base ./iobuffer.jl:504
  ││││┌ wrap(::Type{Array}, m::MemoryRef{UInt8}, l::Int64) @ Base ./array.jl:3099
  │││││ failed to optimize due to recursion: Base.wrap(::Type{Array}, ::MemoryRef{UInt8}, ::Int64)
  ││││└────────────────────
  │││┌ print_to_string(::String, ::Vararg{Any}) @ Base ./strings/io.jl:143
  ││││ runtime dispatch detected: Base._str_sizehint(%17::Any)::Int64
  │││└────────────────────
  │││┌ print_to_string(::String, ::Vararg{Any}) @ Base ./strings/io.jl:148
  ││││ runtime dispatch detected: print(%59::IOBuffer, %97::Any)::Any
  │││└────────────────────
  │││┌ string(::String, ::Int64, ::String, ::Tuple{Int64}, ::String, ::Int64, ::String, ::Int64, ::String) @ Base ./strings/io.jl:189
  ││││ failed to optimize due to recursion: string(::String, ::Int64, ::String, ::Tuple{Int64}, ::String, ::Int64, ::String, ::Int64, ::String)
  │││└────────────────────

There was partial progress toward implementing this feature in 447c7a3.

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