Skip to content

Commit b5453f8

Browse files
authored
Renormalize directly again (#1119)
While this might be achieved by the second or third normalizer run, normalizing directly showed a bit of an performance improvement (compile time) for me on average.
1 parent 0fa4d8f commit b5453f8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

effekt/shared/src/main/scala/effekt/core/optimizer/Normalizer.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ object Normalizer { normal =>
277277
normalizeVal(x2, tpe, els, Stmt.App(k, Nil, List(ValueVar(x2, tpe)), Nil)))
278278
}
279279

280-
281280
case Stmt.Match(sc, clauses, default) =>
282281
joinpoint(id, tpe, normalize(body)) { k =>
283282
Stmt.Match(sc, clauses.map {
@@ -308,7 +307,7 @@ object Normalizer { normal =>
308307
// Flatten vals. This should be non-leaking since we use garbage free refcounting.
309308
// [[ val x = { val y = stmt1; stmt2 }; stmt3 ]] = [[ val y = stmt1; val x = stmt2; stmt3 ]]
310309
case Stmt.Val(id2, tpe2, binding2, body2) =>
311-
normalizeVal(id2, tpe2, binding2, Stmt.Val(id, tpe, body2, body))
310+
normalizeVal(id2, tpe2, binding2, normalizeVal(id, tpe, body2, body))
312311

313312
// [[ val x = { var y in r = e; stmt2 }; stmt1 ]] = var y in r = e; [[ val x = stmt2; stmt1 ]]
314313
case Stmt.Alloc(id2, init2, region2, body2) =>

0 commit comments

Comments
 (0)