#1994·warp

Tune LLVM inlining for CPU kernels

Author: c0d1f1edCreated Sep 25, 2026Updated Sep 28, 2026
Labelsfeature request

Description

Warp's CPU JIT emits C++ helpers for @wp.func calls. LLVM can leave helpers that accept Warp structs by value out of line. In hot loops, those calls can repeatedly copy large structs and prevent optimization across the call boundary. Kernel execution time can therefore be sensitive to LLVM's inlining decisions.

Context

Preliminary benchmarking has confirmed the potential for substantial CPU kernel speedups from tuning the inliner. The policy still needs evaluation across representative workloads, including kernels that may not benefit from additional inlining.

Proposed approach

Tune LLVM's finite generic and cold-callsite inlining budgets for optimized CPU kernels in Warp's native compiler setup. Let LLVM decide which generated helpers to inline, while preserving explicit @wp.func inline hints. Measure steady-state execution, JIT cost, and code size to choose a policy that avoids meaningful regressions. Validate correctness and check the effect of any process-global LLVM setting on CUDA code generation.