Skip to content

Conversation

@maleadt
Copy link
Member

@maleadt maleadt commented Aug 19, 2021

Fixes JuliaGPU/GPUCompiler.jl#229:

Base.Experimental.@MethodTable(my_method_table)
GPUCompiler.method_table(...) = my_method_table
Base.Experimental.@overlay my_method_table @noinline Base.sin(x::Float32) = x+1

kernel(x) = sin(x)

Before:

; Function Attrs: noinline
define internal fastcc float @julia_my_method_table_519(float %0) unnamed_addr #0 !dbg !36 {
top:
  call void @llvm.dbg.value(metadata float %0, metadata !43, metadata !DIExpression()), !dbg !44
  %1 = fadd float %0, 1.000000e+00, !dbg !45
  ret float %1, !dbg !52
}

define float @julia_kernel_516(float %0) local_unnamed_addr #1 !dbg !53 {
top:
  call void @llvm.dbg.value(metadata float %0, metadata !59, metadata !DIExpression()), !dbg !60
  %1 = call fastcc float @julia_my_method_table_519(float %0) #1, !dbg !61
  ret float %1, !dbg !61
}

After

; Function Attrs: noinline
define internal fastcc float @julia__sin_519(float %0) unnamed_addr #0 !dbg !36 {
top:
  %1 = fadd float %0, 1.000000e+00, !dbg !38
  ret float %1, !dbg !44
}

define float @julia_kernel_516(float %0) local_unnamed_addr #1 !dbg !45 {
top:
  %1 = call fastcc float @julia__sin_519(float %0) #1, !dbg !46
  ret float %1, !dbg !46
}

@maleadt maleadt added gpu Affects running Julia on a GPU backport 1.7 labels Aug 19, 2021
@maleadt maleadt merged commit 6e1bae4 into master Aug 23, 2021
@maleadt maleadt deleted the tb/external_mt_name branch August 23, 2021 07:12
KristofferC pushed a commit that referenced this pull request Aug 25, 2021
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Feb 22, 2022
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gpu Affects running Julia on a GPU

Projects

None yet

Development

Successfully merging this pull request may close these issues.

julia_method_table function names

3 participants