Skip to content

Commit

Permalink
add more test case for inference with overlayed method table
Browse files Browse the repository at this point in the history
This test case is particularily crafted for #48097, which has occurred
a couple of times. Although the issue doesn't reproduce on master,
having it here should help GPUCompiler keep working with the nightly.

closes #48097
  • Loading branch information
aviatesk committed Mar 13, 2023
1 parent 441c570 commit cfd7b64
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/compiler/AbstractInterpreter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,17 @@ Base.@assume_effects :total totalcall(f, args...) = f(args...)
end
end |> only === Nothing

# GPUCompiler needs accurate inference through kwfunc with the overlay of `Core.throw_inexacterror`
# https://github.com/JuliaLang/julia/issues/48097
@newinterp Issue48097Interp
@MethodTable Issue48097MT
CC.method_table(interp::Issue48097Interp) = CC.OverlayMethodTable(CC.get_world_counter(interp), Issue48097MT)
@overlay Issue48097MT @noinline Core.throw_inexacterror(f::Symbol, ::Type{T}, val) where {T} = return
issue48097(; kwargs...) = return 42
@test fully_eliminated(; interp=Issue48097Interp(), retval=42) do
issue48097(; a=1f0, b=1.0)
end

# AbstractLattice
# ===============

Expand Down

0 comments on commit cfd7b64

Please sign in to comment.