egraphs-good / eggcc

MIT License
51 stars 11 forks source link

Another RVSDG conversion bug #454

Open glenn-sun opened 7 months ago

glenn-sun commented 7 months ago

Minimal example:

@main {
    num: int = const 12;
    ans: int = call @loop_with_early_ret num;
    print ans;
}

@loop_with_early_ret(n: int): int {
    f: bool = const false;
.loop:
    br f .break .continue;
.break:
    ret n;
.continue:
    br f .loop .done;
.done:
    ret n;
}

RVSDG output looks like this: test

Round trip is an error:

thread 'main' panicked at src/rvsdg/to_cfg.rs:285:46:
index out of bounds: the len is 2 but the index is 2