-
-
Notifications
You must be signed in to change notification settings - Fork 55
Uncached JIT breaks recursion #122
Comments
Sorry for the delayed response, I've been extremely busy. This is due to recursion in f = sum
tt = Tuple{Vector{Int}}
# works equally well with f(x) = f(x)
params = Base.CodegenParams(cached=false)
Base._dump_function(f, tt,
#=native=#false, #=wrapper=#false, #=strip=#false,
#=dump_module=#true, #=syntax=#:att, #=optimize=#false,
params)
# ERROR: StackOverflowError A pure code generator, not relying on global state (ie. the cache we disable) should fix this, and @vtjnash has been slowly working towards this. |
Thanks, Tim. As a tangent, I've been hacking together my own version of code generation using your great LLVM package: https://github.com/tshort/CodeGen.jl It'll compile basic stuff right now, but there are plenty of holes (the tests in the package should give you some idea of what works). I'm aiming for static compilation (Emscripten), but this might also be of interest for GPU code generation. |
Sweet! I recall @SimonDanisch starting something similar at https://github.com/SimonDanisch/StaticJulia.jl but yours looks much more advanced already. I'm afraid you'll quickly bump into limitations of the LLVM C API though, but do know that's why we have the entire |
Thanks for the link. I wish I'd seen Simon's StaticJulia earlier. |
This is fixed :-) |
This probably isn't a problem for you because I think it only overflows for code you shouldn't use.
I also have this issue at tshort/ExportWebAssembly.jl#3 -- that repo is almost entirely based on your code.
Here's the last part of the stack trace:
The text was updated successfully, but these errors were encountered: