Make all layouts interned in mono

This commit is contained in:
Ayaz Hafiz 2023-01-03 19:49:07 -06:00
parent dc6b7003a8
commit fa8effd3e8
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
14 changed files with 932 additions and 866 deletions

View file

@ -2,7 +2,7 @@
use crate::borrow::Ownership;
use crate::ir::{CallType, Expr, JoinPointId, Param, Stmt};
use crate::layout::{LambdaName, Layout};
use crate::layout::{InLayout, LambdaName};
use bumpalo::collections::Vec;
use bumpalo::Bump;
use roc_module::symbol::Symbol;
@ -34,8 +34,8 @@ pub fn make_tail_recursive<'a>(
id: JoinPointId,
needle: LambdaName,
stmt: Stmt<'a>,
args: &'a [(Layout<'a>, Symbol, Symbol)],
ret_layout: Layout,
args: &'a [(InLayout<'a>, Symbol, Symbol)],
ret_layout: InLayout<'a>,
) -> Option<Stmt<'a>> {
let allocated = arena.alloc(stmt);
@ -73,8 +73,8 @@ fn insert_jumps<'a>(
stmt: &'a Stmt<'a>,
goal_id: JoinPointId,
needle: LambdaName,
needle_arguments: &'a [(Layout<'a>, Symbol, Symbol)],
needle_result: Layout,
needle_arguments: &'a [(InLayout<'a>, Symbol, Symbol)],
needle_result: InLayout<'a>,
) -> Option<&'a Stmt<'a>> {
use Stmt::*;
@ -101,7 +101,7 @@ fn insert_jumps<'a>(
}),
_,
Stmt::Ret(rsym),
) if symbol == rsym && is_equal_function(*fsym, arg_layouts, **ret_layout) => {
) if symbol == rsym && is_equal_function(*fsym, arg_layouts, *ret_layout) => {
// replace the call and return with a jump
let jump = Stmt::Jump(goal_id, arguments);