Skip to content

Commit 8dc09a1

Browse files
committed
rename custom_intr functions
1 parent 07a039a commit 8dc09a1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/irgen.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ function cleanup_kernel_state!(mod::LLVM.Module)
790790
end
791791
CleanupKernelStatePass() = NewPMModulePass("CleanupKernelStatePass", cleanup_kernel_state!)
792792

793-
function custom_intr(mod::LLVM.Module, T::LLVMType, name::String)
793+
function custom_noarg_readnone_intr(mod::LLVM.Module, T::LLVMType, name::String)
794794
custom_intr = if haskey(functions(mod), name)
795795
functions(mod)[name]
796796
else
@@ -802,7 +802,7 @@ function custom_intr(mod::LLVM.Module, T::LLVMType, name::String)
802802
end
803803

804804
# run-time equivalent
805-
function call_custom_intrinsic(T::Type, name::String, call_name::String)
805+
function call_custom_noarg_readnone_intrinsic(T::Type, name::String, call_name::String)
806806
@dispose ctx=Context() begin
807807
T_llvm = convert(LLVMType, T)
808808

@@ -811,15 +811,15 @@ function call_custom_intrinsic(T::Type, name::String, call_name::String)
811811
mod = LLVM.parent(llvm_f)
812812

813813
# get intrinsic
814-
_custom_intr = custom_intr(mod, T_llvm, name)
815-
custom_intr_ft = function_type(_custom_intr)
814+
custom_intr = custom_noarg_readnone_intr(mod, T_llvm, name)
815+
custom_intr_ft = function_type(custom_intr)
816816

817817
# generate IR
818818
@dispose builder=IRBuilder() begin
819819
entry = BasicBlock(llvm_f, "entry")
820820
position!(builder, entry)
821821

822-
val = call!(builder, custom_intr_ft, _custom_intr, Value[], call_name)
822+
val = call!(builder, custom_intr_ft, custom_intr, Value[], call_name)
823823

824824
ret!(builder, val)
825825
end
@@ -828,8 +828,8 @@ function call_custom_intrinsic(T::Type, name::String, call_name::String)
828828
end
829829
end
830830

831-
kernel_state_intr(mod::LLVM.Module, T::LLVMType) = custom_intr(mod, T, "julia.gpu.state_getter")
832-
kernel_state_value(T::Type) = call_custom_intrinsic(T, "julia.gpu.state_getter", "state")
831+
kernel_state_intr(mod::LLVM.Module, T::LLVMType) = custom_noarg_readnone_intr(mod, T, "julia.gpu.state_getter")
832+
kernel_state_value(T::Type) = call_custom_noarg_readnone_intrinsic(T, "julia.gpu.state_getter", "state")
833833

834834
# convert kernel state argument from pass-by-value to pass-by-reference
835835
#

0 commit comments

Comments
 (0)