mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
store closure data for bool/byte again
This commit is contained in:
parent
7416cc4e81
commit
77911cb68a
3 changed files with 43 additions and 31 deletions
|
@ -2113,8 +2113,6 @@ fn update<'a>(
|
||||||
&mut state.procedures,
|
&mut state.procedures,
|
||||||
);
|
);
|
||||||
|
|
||||||
Proc::insert_refcount_operations(arena, &mut state.procedures);
|
|
||||||
|
|
||||||
// display the mono IR of the module, for debug purposes
|
// display the mono IR of the module, for debug purposes
|
||||||
if roc_mono::ir::PRETTY_PRINT_IR_SYMBOLS {
|
if roc_mono::ir::PRETTY_PRINT_IR_SYMBOLS {
|
||||||
let procs_string = state
|
let procs_string = state
|
||||||
|
@ -2128,6 +2126,8 @@ fn update<'a>(
|
||||||
println!("{}", result);
|
println!("{}", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Proc::insert_refcount_operations(arena, &mut state.procedures);
|
||||||
|
|
||||||
// This is not safe with the new non-recursive RC updates that we do for tag unions
|
// This is not safe with the new non-recursive RC updates that we do for tag unions
|
||||||
//
|
//
|
||||||
// Proc::optimize_refcount_operations(
|
// Proc::optimize_refcount_operations(
|
||||||
|
|
|
@ -618,7 +618,9 @@ impl<'a> LambdaSet<'a> {
|
||||||
use UnionVariant::*;
|
use UnionVariant::*;
|
||||||
match variant {
|
match variant {
|
||||||
Never => Layout::Union(UnionLayout::NonRecursive(&[])),
|
Never => Layout::Union(UnionLayout::NonRecursive(&[])),
|
||||||
Unit | UnitWithArguments | BoolUnion { .. } | ByteUnion(_) => {
|
BoolUnion { .. } => Layout::Builtin(Builtin::Int1),
|
||||||
|
ByteUnion { .. } => Layout::Builtin(Builtin::Int8),
|
||||||
|
Unit | UnitWithArguments => {
|
||||||
// no useful information to store
|
// no useful information to store
|
||||||
Layout::Struct(&[])
|
Layout::Struct(&[])
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,43 +1,53 @@
|
||||||
procedure Num.24 (#Attr.2, #Attr.3):
|
procedure Num.24 (#Attr.2, #Attr.3):
|
||||||
let Test.24 = lowlevel NumAdd #Attr.2 #Attr.3;
|
let Test.27 = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||||
ret Test.24;
|
ret Test.27;
|
||||||
|
|
||||||
procedure Num.26 (#Attr.2, #Attr.3):
|
procedure Num.26 (#Attr.2, #Attr.3):
|
||||||
let Test.19 = lowlevel NumMul #Attr.2 #Attr.3;
|
let Test.22 = lowlevel NumMul #Attr.2 #Attr.3;
|
||||||
ret Test.19;
|
|
||||||
|
|
||||||
procedure Test.1 ():
|
|
||||||
let Test.25 = 1i64;
|
|
||||||
ret Test.25;
|
|
||||||
|
|
||||||
procedure Test.2 ():
|
|
||||||
let Test.20 = 2i64;
|
|
||||||
ret Test.20;
|
|
||||||
|
|
||||||
procedure Test.3 (Test.6):
|
|
||||||
let Test.23 = CallByName Test.1;
|
|
||||||
let Test.22 = CallByName Num.24 Test.6 Test.23;
|
|
||||||
ret Test.22;
|
ret Test.22;
|
||||||
|
|
||||||
|
procedure Test.1 ():
|
||||||
|
let Test.28 = 1i64;
|
||||||
|
ret Test.28;
|
||||||
|
|
||||||
|
procedure Test.2 ():
|
||||||
|
let Test.23 = 2i64;
|
||||||
|
ret Test.23;
|
||||||
|
|
||||||
|
procedure Test.3 (Test.6):
|
||||||
|
let Test.26 = CallByName Test.1;
|
||||||
|
let Test.25 = CallByName Num.24 Test.6 Test.26;
|
||||||
|
ret Test.25;
|
||||||
|
|
||||||
procedure Test.4 (Test.7):
|
procedure Test.4 (Test.7):
|
||||||
let Test.18 = CallByName Test.2;
|
let Test.21 = CallByName Test.2;
|
||||||
let Test.17 = CallByName Num.26 Test.7 Test.18;
|
let Test.20 = CallByName Num.26 Test.7 Test.21;
|
||||||
ret Test.17;
|
ret Test.20;
|
||||||
|
|
||||||
procedure Test.5 (Test.8, Test.9):
|
procedure Test.5 (Test.8, Test.9):
|
||||||
let Test.14 = CallByName Test.3 Test.9;
|
joinpoint Test.15 Test.14:
|
||||||
ret Test.14;
|
ret Test.14;
|
||||||
|
in
|
||||||
|
switch Test.8:
|
||||||
|
case 0:
|
||||||
|
let Test.16 = CallByName Test.3 Test.9;
|
||||||
|
jump Test.15 Test.16;
|
||||||
|
|
||||||
|
default:
|
||||||
|
let Test.17 = CallByName Test.4 Test.9;
|
||||||
|
jump Test.15 Test.17;
|
||||||
|
|
||||||
|
|
||||||
procedure Test.0 ():
|
procedure Test.0 ():
|
||||||
joinpoint Test.16 Test.12:
|
joinpoint Test.19 Test.12:
|
||||||
let Test.13 = 42i64;
|
let Test.13 = 42i64;
|
||||||
let Test.11 = CallByName Test.5 Test.12 Test.13;
|
let Test.11 = CallByName Test.5 Test.12 Test.13;
|
||||||
ret Test.11;
|
ret Test.11;
|
||||||
in
|
in
|
||||||
let Test.21 = true;
|
let Test.24 = true;
|
||||||
if Test.21 then
|
if Test.24 then
|
||||||
let Test.3 = Struct {};
|
let Test.3 = false;
|
||||||
jump Test.16 Test.3;
|
jump Test.19 Test.3;
|
||||||
else
|
else
|
||||||
let Test.4 = Struct {};
|
let Test.4 = true;
|
||||||
jump Test.16 Test.4;
|
jump Test.19 Test.4;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue