Skip to content

Commit 284860b

Browse files
wthollidayclaude
andcommitted
Thread no_recursion through compile_program for the FFI
`Compiler::compile_program()` was the only `LLVMJIT::new()` site that forgot to copy `self.no_recursion` onto the JIT before calling `compile_only`, so the call-depth prologue/epilogue was still emitted on every function regardless of the compiler-level flag. That codepath is what `lyte_compiler_compile` calls, which is the only LLVM entry the xcframework uses, so flipping the FFI default to `no_recursion = true` in 2df4d9d had no effect on the actual LLVM backend — Audulus DSP code was still paying the full ~2x reverb regression documented in docs/LLVM_CALL_DEPTH_REGRESSION.md. The CLI (`run_llvm` / `print_llvm_ir`) was unaffected because those sites do thread the flag, which is why the bug was invisible to CLI smoke tests. Verified end-to-end with a C harness against `liblyte.dylib` driving `lyte_compiler_compile` on the regressed reverb script: 10000 process() calls drop from ~0.43s to ~0.21s once the line is added. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d5a634a commit 284860b

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/compiler.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,7 @@ impl Compiler {
878878
{
879879
let mut jit = crate::llvm_jit::LLVMJIT::new();
880880
jit.print_ir = self.print_ir;
881+
jit.no_recursion = self.no_recursion;
881882
let llvm_prog = jit.compile_only(&self.decls, &entry_points)?;
882883
return Ok(CompiledProgram::Llvm(llvm_prog));
883884
}

0 commit comments

Comments
 (0)