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 14, 2023
1 parent 9f997fc commit 2e9d09e
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 2e9d09e

Please sign in to comment.