From 27418008d4b492aff432c44fc92cd8485bcd5cf7 Mon Sep 17 00:00:00 2001 From: WormHeamer Date: Sun, 10 Aug 2025 23:36:33 -0400 Subject: add idempotent optimizations --- peephole.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'peephole.c') diff --git a/peephole.c b/peephole.c index 947ab1a..4b39cf8 100644 --- a/peephole.c +++ b/peephole.c @@ -522,11 +522,11 @@ zero_no_effect: if (node_eql_i64(CAR(n), 0)) return CDR(n); case N_PROJ: if (T(CTRL(n), N_IF_ELSE) && CTRL(n)->type.t == T_TUPLE) { - /*if (CTRL(n)->val.tuple.data[n->val.i].type.lvl == T_XCTRL) { + if (CTRL(n)->val.tuple.data[n->val.i].type.lvl == T_XCTRL) { return node_new_lit(p, (Value) { .type = { .lvl = T_XCTRL, .t = T_NONE } }); - }*/ + } if (CTRL(n)->val.tuple.data[(n->val.i + 1) % CTRL(n)->val.tuple.len].type.lvl == T_XCTRL) { return CTRL(CTRL(n)); } -- cgit v1.2.3