diff --git a/test/Project.toml b/test/Project.toml index d01c6e6e..d82dab81 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -6,7 +6,6 @@ GPUCompiler = "61eb1bfa-7361-4325-ad38-22787b887f55" InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" LLVM = "929cbde3-209d-540e-8aea-75f648917ca0" LLVMDowngrader_jll = "f52de702-fb25-5922-94ba-81dd59b07444" -LLVM_jll = "86de99a1-58d6-5da7-8064-bd56ce2e322c" Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" NVPTX_LLVM_Backend_jll = "ef6e0fe3-e6ef-59c0-bde6-4989574699e0" ParallelTestRunner = "d3525ed8-44d0-4b2c-a655-542cee43accc" @@ -21,5 +20,4 @@ demumble_jll = "1e29f10c-031c-5a83-9565-69cddfc27673" [compat] Aqua = "0.8" -LLVM_jll = "15,16,18,20" ParallelTestRunner = "2" diff --git a/test/gcn.jl b/test/gcn.jl index 99dae742..c61fe5ca 100644 --- a/test/gcn.jl +++ b/test/gcn.jl @@ -458,11 +458,8 @@ end @testset "float boxes" begin mod = @eval module $(gensym()) function kernel(a,b) + # Int32(a) may fail, boxing the Float32 for the @nospecialize ctor c = Int32(a) - # the conversion to Int32 may fail, in which case the input Float32 is boxed in order to - # pass it to the @nospecialize exception constructor. we should really avoid that (eg. - # by avoiding @nospecialize, or optimize the unused arguments away), but for now the box - # should just work. unsafe_store!(b, c) return end @@ -470,8 +467,10 @@ end @test @filecheck begin @check_label "define void @{{(julia|j)_kernel_[0-9]+}}" - @check "jl_box_float32" - GCN.code_llvm(mod.kernel, Tuple{Float32,Ptr{Float32}}) + # box: a jl_box_float32 call <1.14; 1.14+ inlines it into the devirt'd ctor + @check cond=(VERSION < v"1.14-") "jl_box_float32" + @check cond=(VERSION >= v"1.14-") "gpu_gc_pool_alloc" + GCN.code_llvm(mod.kernel, Tuple{Float32,Ptr{Float32}}; dump_module=true) end GCN.code_native(devnull, mod.kernel, Tuple{Float32,Ptr{Float32}}) end diff --git a/test/ptx.jl b/test/ptx.jl index 2d93f3d5..c5d1be99 100644 --- a/test/ptx.jl +++ b/test/ptx.jl @@ -371,11 +371,8 @@ end @testset "float boxes" begin mod = @eval module $(gensym()) function kernel(a,b) + # Int32(a) may fail, boxing the Float32 for the @nospecialize ctor c = Int32(a) - # the conversion to Int32 may fail, in which case the input Float32 is boxed in - # order to pass it to the @nospecialize exception constructor. we should really - # avoid that (eg. by avoiding @nospecialize, or optimize the unused arguments - # away), but for now the box should just work. unsafe_store!(b, c) return end @@ -383,8 +380,10 @@ end @test @filecheck begin @check_label "define void @{{(julia|j)_kernel_[0-9]+}}" - @check "jl_box_float32" - PTX.code_llvm(mod.kernel, Tuple{Float32,Ptr{Float32}}) + # box: a jl_box_float32 call <1.14; 1.14+ inlines it into the devirt'd ctor + @check cond=(VERSION < v"1.14-") "jl_box_float32" + @check cond=(VERSION >= v"1.14-") "gpu_gc_pool_alloc" + PTX.code_llvm(mod.kernel, Tuple{Float32,Ptr{Float32}}; dump_module=true) end PTX.code_native(devnull, mod.kernel, Tuple{Float32,Ptr{Float32}}) end