Jonathan Immanuel Brachthäuser
Jonathan Immanuel Brachthäuser
Hey, I am currently away from my computer. Where is the `l` coming from? What is the core before optimizations? btw. I typically use `println(util.show(...))` in random positions to understand...
Wouldn't `--ir-show core --no-optimize` work?
In the optimized core `b_k2_3529_5_221_654_652_22013083` is clearly defined. `b_k_0` is the shortened version of it (the JS backend renames and shortens ids for readability). I thus assume the problem is...
As always these days (after performing contification on CPS to help the LLVM backend), the problem is in `Contify`. This can be verified by commenting out this line: https://github.com/effekt-lang/effekt/blob/28ad596b9d03d24191ccc6b7b2ea2e7155401160/effekt/shared/src/main/scala/effekt/generator/js/JavaScript.scala#L55
Here is the contified version ``` module repro def main3431 = { | ks9117, k9118 => let tmp5036 = ref3413(make TVar3421 Unbound3435(0)) let tmp5037 = make Type3422 Type3438(tmp5036) let tmp5039...
Before contification: ``` def b_k2_3529_5_221_654_652_2208484 = { (x_6_222_655_653_2218727, b_7_223_656_654_2228658, tid_8_224_657_655_2238564) | ks9120, k9121 => ... case Unbound3435 (tid_10_54_270_703_701_269_6_49032) => { b_k2_3529_5_221_654_652_2208484(tmp5036, tmp5040, tid_10_54_270_703_701_269_6_49032) @ ks9117, k9118 } ``` After ```...
I could trace it to this case: https://github.com/effekt-lang/effekt/blob/28ad596b9d03d24191ccc6b7b2ea2e7155401160/effekt/shared/src/main/scala/effekt/generator/js/TransformerCps.scala#L218-L223 Commenting it out fixes the issue. Looks like we perform a direct style translation, but seem to forget the continuation.
Further analysis: At the `let cont` for b_k2, we deem the body can be in direct style. Here is the body ``` let b_k3_3539_27_243_676_674_2428717 = { (a_28_244_677_675_2438312, x_29_245_678_676_2448728, tid_30_246_679_677_2458415) |...
All of this is on the `optimizer-wishlist` and achievable by NbE :)
Can confirm, this exact thing happened to me. Even uninstalling and purging all configs doesn't seem to help.