@@ -788,7 +788,7 @@ function cleanup_kernel_state!(mod::LLVM.Module)
788788end
789789CleanupKernelStatePass () = NewPMModulePass (" CleanupKernelStatePass" , cleanup_kernel_state!)
790790
791- function custom_intr (mod:: LLVM.Module , T:: LLVMType , name:: String )
791+ function custom_noarg_readnone_intr (mod:: LLVM.Module , T:: LLVMType , name:: String )
792792 custom_intr = if haskey (functions (mod), name)
793793 functions (mod)[name]
794794 else
@@ -800,7 +800,7 @@ function custom_intr(mod::LLVM.Module, T::LLVMType, name::String)
800800end
801801
802802# run-time equivalent
803- function call_custom_intrinsic (T:: Type , name:: String , call_name:: String )
803+ function call_custom_noarg_readnone_intrinsic (T:: Type , name:: String , call_name:: String )
804804 @dispose ctx= Context () begin
805805 T_llvm = convert (LLVMType, T)
806806
@@ -809,15 +809,15 @@ function call_custom_intrinsic(T::Type, name::String, call_name::String)
809809 mod = LLVM. parent (llvm_f)
810810
811811 # get intrinsic
812- _custom_intr = custom_intr (mod, T_llvm, name)
813- custom_intr_ft = function_type (_custom_intr )
812+ custom_intr = custom_noarg_readnone_intr (mod, T_llvm, name)
813+ custom_intr_ft = function_type (custom_intr )
814814
815815 # generate IR
816816 @dispose builder= IRBuilder () begin
817817 entry = BasicBlock (llvm_f, " entry" )
818818 position! (builder, entry)
819819
820- val = call! (builder, custom_intr_ft, _custom_intr , Value[], call_name)
820+ val = call! (builder, custom_intr_ft, custom_intr , Value[], call_name)
821821
822822 ret! (builder, val)
823823 end
@@ -826,8 +826,8 @@ function call_custom_intrinsic(T::Type, name::String, call_name::String)
826826 end
827827end
828828
829- kernel_state_intr (mod:: LLVM.Module , T:: LLVMType ) = custom_intr (mod, T, " julia.gpu.state_getter" )
830- kernel_state_value (T:: Type ) = call_custom_intrinsic (T, " julia.gpu.state_getter" , " state" )
829+ kernel_state_intr (mod:: LLVM.Module , T:: LLVMType ) = custom_noarg_readnone_intr (mod, T, " julia.gpu.state_getter" )
830+ kernel_state_value (T:: Type ) = call_custom_noarg_readnone_intrinsic (T, " julia.gpu.state_getter" , " state" )
831831
832832# convert kernel state argument from pass-by-value to pass-by-reference
833833#
0 commit comments