Skip to content

fix erase! call in src/gcn.jl #706

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

Merged
merged 3 commits into from
Jul 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "GPUCompiler"
uuid = "61eb1bfa-7361-4325-ad38-22787b887f55"
version = "1.6.0"
version = "1.6.1"
authors = ["Tim Besard <[email protected]>"]

[deps]
Expand Down
2 changes: 1 addition & 1 deletion src/gcn.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function lower_throw_extra!(mod::LLVM.Module)
# remove the call
nargs = length(parameters(f))
call_args = arguments(call)
erase!(LLVM.parent(call), call)
erase!(call)

# HACK: kill the exceptions' unused arguments
for arg in call_args
Expand Down
16 changes: 16 additions & 0 deletions test/gcn.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,22 @@ sink_gcn(i) = sink(i, Val(5))
end
end

@testset "bounds errors" begin
mod = @eval module $(gensym())
function kernel()
Base.throw_boundserror(1, 2)
return
end
end

@test @filecheck begin
check"CHECK-NOT: {{julia_throw_boundserror_[0-9]+}}"
check"CHECK: @gpu_report_exception"
check"CHECK: @gpu_signal_exception"
GCN.code_llvm(mod.kernel, Tuple{})
end
end

end

############################################################################################
Expand Down