optimize: enable lto
This commit is contained in:
@@ -11,9 +11,15 @@ name = "repl"
|
||||
required-features = ["repl"]
|
||||
|
||||
[profile.perf]
|
||||
debug = 1
|
||||
debug = 2
|
||||
strip = false
|
||||
inherits = "release"
|
||||
|
||||
[profile.release]
|
||||
lto = true
|
||||
codegen-units = 1
|
||||
strip = true
|
||||
|
||||
[dependencies]
|
||||
rnix = "0.12"
|
||||
thiserror = "2.0"
|
||||
|
||||
@@ -135,9 +135,13 @@ pub struct JITContext<'ctx> {
|
||||
|
||||
impl<'vm, 'ctx: 'vm> JITContext<'ctx> {
|
||||
pub fn new(context: &'ctx Context) -> Self {
|
||||
// force linker to link JIT engine
|
||||
unsafe {
|
||||
inkwell::llvm_sys::execution_engine::LLVMLinkInMCJIT();
|
||||
}
|
||||
let module = context.create_module("nixjit");
|
||||
let execution_engine = module
|
||||
.create_jit_execution_engine(OptimizationLevel::Default)
|
||||
.create_jit_execution_engine(OptimizationLevel::Aggressive)
|
||||
.unwrap();
|
||||
let helpers = Helpers::new(context, &module, &execution_engine);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user