pub fn compile(
    program: &SirProgram,
    conf: &ParsedConf,
    stats: &mut CompilationStats,
) -> WeldResult<Box<dyn Runnable + Send + Sync>> {
    use crate::runtime;
    use crate::util::dump::{write_code, DumpCodeFormat};

    info!("Compiling using single thread runtime");

    let codegen = unsafe { LlvmGenerator::generate(conf.clone(), &program)? };

    nonfatal!(write_code(
        codegen.to_string(),
        DumpCodeFormat::LLVM,
        &conf.dump_code
    ));

    unsafe {
        runtime::ffi::weld_init();
    }

    let mappings = &codegen.intrinsics.mappings();
    let module = unsafe { jit::compile(codegen.context, codegen.module, mappings, conf, stats)? };

    nonfatal!(write_code(
        module.asm()?,
        DumpCodeFormat::Assembly,
        &conf.dump_code
    ));
    nonfatal!(write_code(
        module.llvm()?,
        DumpCodeFormat::LLVMOpt,
        &conf.dump_code
    ));

    Ok(Box::new(module))
}
Compile Weld SIR into a runnable module.

The runnable module is wrapped as a trait object which the `CompiledModule` struct in `codegen`
calls.
weld/src/codegen/llvm2/mod.rs