brenhinkeller / StaticTools.jl

Enabling StaticCompiler.jl-based compilation of (some) Julia code to standalone native binaries by avoiding GC allocations and llvmcall-ing all the things!
MIT License
168 stars 12 forks source link

Use correct julia<->llvm pointer conversion convention, support Julia 1.9 #12

Closed brenhinkeller closed 2 years ago

brenhinkeller commented 2 years ago

Julia pointers are LLVM ints, so technically we need to be converting back and forth with inttoptr/ptrtoint on the LLVM side before handing any pointers to Julia. These conversions should get optimized out anyways at the end of the day, but Julia 1.9 actually enforces correctness on this front even if you never do anything with that pointer on the native Julia side, and crashes if you ever omit the conversion.

It turns out fixing this was the only thing holding us back on Julia 1.9, so nightly tests should pass now (though note that StaticCompiler.jl itself doesn't support 1.9 yet, so you won't be able to do much with StaticTools there anyways at the moment)