Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

Use new non-recursive codegen #162

Merged
merged 2 commits into from
Mar 27, 2020
Merged

Use new non-recursive codegen #162

merged 2 commits into from
Mar 27, 2020

Conversation

maleadt
Copy link
Member

@maleadt maleadt commented Feb 13, 2018

@maleadt maleadt force-pushed the tb/codegen-norecursion branch 2 times, most recently from 23a0c07 to 5d8dcca Compare February 16, 2018 10:15
@maleadt maleadt added the codegen label Apr 6, 2018
@maleadt maleadt force-pushed the tb/codegen-norecursion branch from 5d8dcca to b6e31f1 Compare May 7, 2018 08:43
@tshort
Copy link

tshort commented Jun 2, 2018

Is the non-recursive codegen still going to happen prior to 0.7/1.0?

@maleadt
Copy link
Member Author

maleadt commented Jun 3, 2018

Probably not. The scope of the upstream issue is much broader, and AFAIK Jameson isn't happy with the design yet.

@maleadt maleadt force-pushed the master branch 9 times, most recently from b52784c to f253041 Compare June 6, 2018 15:15
@maleadt maleadt force-pushed the master branch 2 times, most recently from 26686a4 to 8b6dde9 Compare June 20, 2018 11:00
@maleadt maleadt force-pushed the master branch 4 times, most recently from be7dbe4 to 830f144 Compare December 11, 2018 15:12
@maleadt maleadt force-pushed the master branch 8 times, most recently from 6ccb6b3 to 24c3cf7 Compare April 5, 2019 06:04
@maleadt maleadt force-pushed the master branch 4 times, most recently from caf8483 to 51ded70 Compare April 5, 2019 07:10
@maleadt maleadt force-pushed the tb/codegen-norecursion branch from b6e31f1 to 7f58c70 Compare April 10, 2019 11:45
@maleadt
Copy link
Member Author

maleadt commented Apr 10, 2019

Updated for JuliaLang/julia@2cd11c4; works pretty well but need to figure out how to deal with LLVM's contexts. There's an accessor (jl_get_llvm_context) but we can't use that during generated function -> llvmcall expansion because that happens before aotcompile.

@maleadt maleadt force-pushed the tb/codegen-norecursion branch from 7f58c70 to 6c3feb4 Compare April 10, 2019 13:07
@maleadt maleadt force-pushed the master branch 4 times, most recently from 17dfd92 to 3c9b279 Compare January 22, 2020 15:17
@maleadt maleadt force-pushed the tb/codegen-norecursion branch 4 times, most recently from 0ecfa88 to 289489c Compare March 2, 2020 12:51
@maleadt
Copy link
Member Author

maleadt commented Mar 4, 2020

Looks like the new codegen broak float16 multiplication:

julia> CUDAnative.code_llvm(*, Tuple{Float16, Float16}; strict=true)
ERROR: InvalidIRError: compiling *(Float16, Float16) resulted in invalid LLVM IR
Reason: unsupported call to an unknown function (call to jfptr_Float32_2275)

;  @ float.jl:398 within `*'
define dso_local i16 @_Z10julia_MUL_7Float167Float16(i16, i16) local_unnamed_addr {
top:
  %2 = call fastcc float @j_Float32_4187(i16 %0)
  %3 = call fastcc float @j_Float32_4188(i16 %1)


define internal fastcc float @j_Float32_4127(i16) unnamed_addr #0 {
top:
  %1 = alloca %jl_value_t addrspace(10)*, align 8
  %2 = call fastcc %jl_value_t addrspace(10)* @ptx_gc_pool_alloc(i64 2)
  %3 = bitcast %jl_value_t addrspace(10)* %2 to i16 addrspace(10)*
  store i16 %0, i16 addrspace(10)* %3, align 8
  store %jl_value_t addrspace(10)* %2, %jl_value_t addrspace(10)** %1, align 8
  %4 = call fastcc nonnull %jl_value_t addrspace(10)* @tojlinvoke4128(%jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 139691536025776 to %jl_value_t*) to %jl_value_t addrspace(10)*), %jl_value_t addrspace(10)** nonnull %1, i32 1)


define internal fastcc %jl_value_t addrspace(10)* @tojlinvoke4128(%jl_value_t addrspace(10)*, %jl_value_t addrspace(10)**, i32) unnamed_addr {
top:
  %3 = call %jl_value_t addrspace(10)* @jfptr_Float32_2275(%jl_value_t addrspace(10)* %0, %jl_value_t addrspace(10)** %1, i32 %2, %jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 139690687678928 to %jl_value_t*) to %jl_value_t addrspace(10)*))
  ret %jl_value_t addrspace(10)* %3
}

Whereas on 1.3:

;  @ float.jl:398 within `*'
define i16 @julia___29(i16, i16) {
top:
  %2 = call float @julia_Float32_17988(i16 %0)
  %3 = call float @julia_Float32_17988(i16 %1)

;  @ float.jl:209 within `Float32'
define internal float @julia_Float32_17988(i16) {
top:
; normal code

@maleadt maleadt force-pushed the tb/codegen-norecursion branch from 9447747 to 5bef492 Compare March 27, 2020 08:15
@maleadt maleadt changed the title WIP: use new non-recursive codegen Use new non-recursive codegen Mar 27, 2020
@maleadt maleadt merged commit 0a22ed5 into master Mar 27, 2020
@bors bors bot deleted the tb/codegen-norecursion branch March 27, 2020 09:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants