Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ __pycache__
__pycache__/*
*.so
.lirien_cache/
*.swt_env
89 changes: 50 additions & 39 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
</div>

> [!NOTE]
> **Project Status: Concluded Proof of Concept / Archived**
> Lirien started as a proof of concept to demonstrate path-aware liquid type verification for JIT-compiled Python. Having successfully proven this architecture (implementing ADTs, SIMD, monomorphization, and a verified numerical stdlib), active development has been concluded. The repository remains archived for research, study, and educational reference.
> **Project Status: Personal Experimental Compiler**
>
> Lirien is a personal research and development project demonstrating path-aware liquid type verification for JIT-compiled Python (implementing ADTs, SIMD, monomorphization, and a verified numerical stdlib). Feature additions, RFC implementations, and maintenance are driven as an ongoing personal endeavor.

> [!WARNING]
> Lirien is an experimental research compiler. It is not production-ready and should not be used in critical systems.
Expand Down
20 changes: 20 additions & 0 deletions crates/lirien-backend/src/cranelift/lower/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -998,10 +998,30 @@ pub fn lower<M: Module>(
ctx.values.insert(*dest, res);
}
}
InstructionKind::PointerLoadOffset(dest, ptr, offset) => {
let ptr_val = get_val(&ctx.values, ptr);
let dest_ty = ctx.ssa_func.get_type(*dest);
if dest_ty.is_composite() {
// For a composite structure at offset, add the offset to the base pointer
let res = ctx.builder.ins().iadd_imm(ptr_val, *offset as i64);
ctx.values.insert(*dest, res);
} else {
let cl_ty = translate_type(&dest_ty);
let res = ctx
.builder
.ins()
.load(cl_ty, MemFlagsData::new(), ptr_val, *offset);
ctx.values.insert(*dest, res);
}
}
InstructionKind::PointerStore(ptr, val) => {
let ptr_val = get_val(&ctx.values, ptr);
super::store_to_memory(ctx, *val, ptr_val, 0);
}
InstructionKind::PointerStoreOffset(ptr, offset, val) => {
let ptr_val = get_val(&ctx.values, ptr);
super::store_to_memory(ctx, *val, ptr_val, *offset);
}
_ => {
return Err(LoweringError::InstructionNotSupported(
format!("{:?}", kind),
Expand Down
2 changes: 2 additions & 0 deletions crates/lirien-backend/src/cranelift/lower/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ fn lower_instruction_internal<M: Module>(
| InstructionKind::EnumExtract(_, _, _)
| InstructionKind::Alloc(_, _)
| InstructionKind::PointerLoad(_, _)
| InstructionKind::PointerLoadOffset(_, _, _)
| InstructionKind::PointerStore(_, _)
| InstructionKind::PointerStoreOffset(_, _, _)
| InstructionKind::TensorFused(_, _, _) => memory::lower(ctx, &inst.kind),

InstructionKind::TupleCreate(_, _) | InstructionKind::TupleExtract(_, _, _) => {
Expand Down
3 changes: 2 additions & 1 deletion crates/lirien-bridge/src/bridge/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ pub fn verify_and_compile(
let mut main_code_ptr = 0;
let mut native_entries = Vec::new();

for ssa in ssa_list {
for mut ssa in ssa_list {
lirien_ir::optimization::unroll_verified_loops(&mut ssa);
let mut arg_types = Vec::new();
let mut arg_refinements = HashMap::new();
for i in 0..ssa.arg_count {
Expand Down
Loading