Support LLVM `-mllvm` options for CPU kernel compilation
Author: c0d1f1edCreated Sep 27, 2026Updated Sep 28, 2026
Labelsfeature request
Description
Honor LLVM -mllvm options supplied through warp.config.cpu_compiler_flags or the per-module cpu_compiler_flags option. Support a broad range of options that can safely affect CPU compilation, rather than adding support for individual options as they become useful.
Design guidance:
- Accept the usual
-mllvm <option>and-mllvm=<option>forms, with LLVM's expected value, ordering, and repeated-option behavior. - Apply an option only to the CPU compilation that requests it. Other modules and concurrent CPU or LLVM-CUDA compilations should retain their own settings.
- Preserve Warp's current behavior when no LLVM options are supplied. Where Warp sets an LLVM option itself, provide a way to request LLVM's original default without relying on a numeric value that may not reproduce the unset state.
- Document which kinds of LLVM options are supported. Reject unknown, invalid, or unsupported options clearly instead of silently ignoring them.
- Keep compiled artifacts distinct when their effective compiler flags differ.
Context
CPU compiler flags already let users select Clang options globally or per module, but -mllvm options do not currently take effect as users would expect. This prevents users from tuning LLVM for a particular workload through the existing flag interface. General support would make that interface useful for more than one specific optimization setting while keeping unrelated compilations predictable.
Source: NVIDIA/warp