yjshen commented on pull request #1975: URL: https://github.com/apache/arrow-datafusion/pull/1975#issuecomment-1067481669
After searching and discussing with @houqp, it seems complicated to make `cranelift` to [inline rust function into JIT code](https://bytecodealliance.zulipchat.com/#narrow/stream/217117-cranelift/topic/Inlining.20external.20rust.20functions/near/237438866). I want to try LLVM out with both assembly and IR inline capabilities. I will report here if I make some progress. Quote Postgres JIT docs here: > One big advantage of JITing expressions is that it can significantly reduce the overhead of PostgreSQL's extensible function/operator mechanism, by inlining the body of called functions/operators. > It obviously is undesirable to maintain a second implementation of commonly used functions, just for inlining purposes. Instead we take advantage of the fact that the Clang compiler can emit LLVM IR. > The ability to do so allows us to get the LLVM IR for all operators (e.g. int8eq, float8pl etc), without maintaining two copies. These bitcode files get installed into the server's $pkglibdir/bitcode/postgres/ Using existing LLVM functionality (for parallel LTO compilation), additionally an index is over these is stored to $pkglibdir/bitcode/postgres.index.bc https://github.com/postgres/postgres/blob/7e12256b478b89518ff410f29192af21de37d070/src/backend/jit/README#L192-L219 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
