-
Notifications
You must be signed in to change notification settings - Fork 38
Deforestation with nofib
s in the Benchmark Sub-project
#335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: hkmc2
Are you sure you want to change the base?
Changes from all commits
7d9ce98
4d337fd
b258545
2373e06
58cc209
35679fe
d65224e
4614a0d
d029daf
4ba1ea9
a855c0f
a666b60
8d8a83a
b61ea2e
7a3cb55
f4c693f
f86dc2c
f8c2fc5
b648936
5194522
4b27f05
0739bf6
8bcb753
a16a2b7
31bc090
0e68eec
2486b4d
f75d2be
b92abee
3a47e3b
33f4703
1553cc8
ca9a63f
a3b4308
ce79cb5
f0c022c
0e96f9e
418ee33
c91409c
987e7bd
2efe8c6
6ade5c3
8f7639d
aafc673
2519a80
7e835e1
dbd9173
3125840
15d1524
56e2373
04bdcfb
5e19b31
51485b3
1048529
d7ce214
48467a7
cadb80b
79e38c7
10c9d22
daf8749
793c57e
fd306ac
7edb825
e382b8e
8b2b77a
f5da463
e92a50f
a529545
f4f7f95
0e662c3
5d3c3ff
245a011
e56612e
ef9c008
028f5f4
0546800
0da2822
817d408
53bccba
c8455b9
b0b9c8d
0bbce59
06484e7
fc63b1a
ee34529
e26a234
c7fe134
3759331
5951318
f9c216b
b59f46c
c457613
fe02fa7
3a4f269
7c49c57
ee963ca
85cc27f
d9d9ace
90841f9
d693b26
f5065fa
a07b201
4fef072
5fa7a0d
82f7846
d59d322
f3b05d8
32696c5
d0b60e8
bb10714
31a56ae
771c0c9
22415f9
f41f9b4
dc03d25
702cdd7
db1e49a
83b5759
f491f7c
14d8a64
d489137
abc0333
de255e8
5a73860
1dfb527
2f281f4
ecb2842
e4a4d78
588c155
080c25e
1561322
ec3deae
84f9590
ac4ef44
0cc725d
1988f32
852cdc5
b48f3d4
208af14
5155e91
6a7392b
7548db4
677b9f0
7ae110f
6210ef2
c1acf12
8c424eb
f8ecafc
7d78d05
4702a5d
341730c
f15be70
96ba053
26e8ecb
705b0a3
7409fe7
53d915c
41de79b
cec7eed
74afb68
b67ff20
39cfebc
0f46035
477d19b
9854d01
a0c314c
6715757
c26bfab
168e1e1
9f85855
364298d
a72843f
555b7d1
dc083b4
1e2509d
cc9eb03
917aafa
2a11373
775cdf2
59aae7b
6a4ba76
690638e
d61976e
c47c53e
adffa62
18f273e
4dd8fad
b714f4a
84284d9
f134ef7
57110b0
0096663
49b6923
0b42e9e
ada7e68
0445418
3de91fa
e8f2b52
79de7ca
fce9895
cbe6210
a5cac6b
f970651
da46d27
00992c6
2127eaf
cb7f4f0
1e08caa
b7c3a1d
3ac3039
c9feaa5
e8b1510
9ac17f8
353ed8c
065ab56
5f643ef
5eb4f57
5f68982
676880f
dce4242
a5c7d07
5ab74a2
c66eaa1
d990850
8d31044
4a83c3c
90616ee
0655abc
60c572c
5097459
ed8f60b
c11eb72
7e83917
1879d79
34b4df1
adc4403
6962b1e
b39c79d
2a5bd6f
7cab662
ba5c7b8
423ca34
14190b1
362e212
99f34b5
beee8d5
68cff7e
1414f0e
cea03fc
eb18929
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,9 @@ object LambdaRewriter: | |
|
||
def rewriteOneBlk(b: Block) = b match | ||
case Assign(lhs, Lambda(params, body), rest) if !lhs.isInstanceOf[TempSymbol] => | ||
val newSym = BlockMemberSymbol(lhs.nme, Nil, | ||
// use dummy TermDef of kind syntax.Fun here so that we know this symbol refers to a function | ||
// for deforestation | ||
val newSym = BlockMemberSymbol(lhs.nme, syntax.Tree.DummyTermDef(syntax.Fun) :: Nil, | ||
nameIsMeaningful = true // TODO: lhs.nme is not always meaningful | ||
) | ||
val blk = blockBuilder | ||
|
@@ -26,7 +28,10 @@ object LambdaRewriter: | |
val lambdaRewriter = new BlockDataTransformer(SymbolSubst()): | ||
override def applyResult(r: Result): Result = r match | ||
case lam: Lambda => | ||
val sym = BlockMemberSymbol("lambda", Nil, nameIsMeaningful = false) | ||
val sym = BlockMemberSymbol( | ||
"lambda", | ||
syntax.Tree.DummyTermDef(syntax.Fun) :: Nil, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Document why the dummy Fun. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in ba5c7b8 |
||
nameIsMeaningful = false) | ||
lambdasList ::= (sym -> super.applyLam(lam)) | ||
Value.Ref(sym) | ||
case _ => super.applyResult(r) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,8 +86,8 @@ object Lifter: | |
def getVars(d: Defn)(using state: State): Set[Local] = d match | ||
case f: FunDefn => | ||
(f.body.definedVars ++ f.params.flatMap(_.paramSyms)).collect: | ||
case s: FlowSymbol if !(s is state.runtimeSymbol) => s | ||
case c: ClsLikeDefn => | ||
case s: FlowSymbol if !(s is state.runtimeSymbol) => s // FIXME: doesn't this test always fail? | ||
case c: ClsLikeDefn => | ||
val companionVars = c.companion.fold(Set.empty)(_.ctor.definedVars) | ||
(companionVars ++ c.preCtor.definedVars ++ c.ctor.definedVars).collect: | ||
case s: FlowSymbol if !(s is state.runtimeSymbol) => s | ||
|
@@ -552,7 +552,7 @@ class Lifter(handlerPaths: Opt[HandlerPaths])(using State, Raise): | |
case c: ClsLikeDefn if !modLocal.isDefined => S(BlockMemberSymbol(d.sym.nme + "$ctor", Nil)) | ||
case _ => N | ||
|
||
val singleCallBms = BlockMemberSymbol(d.sym.nme + "$", Nil) | ||
val singleCallBms = BlockMemberSymbol(d.sym.nme + "$", Tree.DummyTermDef(syntax.Fun) :: Nil) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👎 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 362e212 |
||
val info = LiftedInfo( | ||
includedCaptures, includedLocals, clsCaptures, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Document why the dummy Fun.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in ba5c7b8