Feature Category
SQL Function / Operator
Problem / Use Case
Writing JIT code in bolt currently requires using the LLVM IRBuilder API directly, which is verbose (e.g., RowContainerCodeGenerator is ~400 lines for row comparison) and hard to maintain.
Proposed Solution
Introduce a pre-built JIT IR framework that compiles C++ kernel functions to LLVM bitcode at build time and inlines them into JIT-composed modules at runtime.
Key components:
- Build pipeline: kernels.cpp → clang -emit-llvm -c -O2 → xxd -i → embedded byte array. Compile flags are extracted from ninja build commands via gen_kernel_flags.sh to support bolt headers (e.g., DecodedVector.h).
- Runtime linking: PrebuiltIR::load() parses embedded bitcode, ThrustJITv2::linkPrebuiltModule() links it into JIT modules with internal linkage to avoid symbol conflicts.
- IR optimization: AlwaysInlinerLegacyPass + InstCombine/GVN/CFGSimplification in ThrustJITv2's IR transform layer.
References / Prior Art
No response
Importance
High (Needed for production)
Willingness to Contribute
Yes, I can submit a PR
Feature Category
SQL Function / Operator
Problem / Use Case
Writing JIT code in bolt currently requires using the LLVM IRBuilder API directly, which is verbose (e.g., RowContainerCodeGenerator is ~400 lines for row comparison) and hard to maintain.
Proposed Solution
Introduce a pre-built JIT IR framework that compiles C++ kernel functions to LLVM bitcode at build time and inlines them into JIT-composed modules at runtime.
Key components:
References / Prior Art
No response
Importance
High (Needed for production)
Willingness to Contribute
Yes, I can submit a PR