egraphs-good / eggcc

MIT License
42 stars 8 forks source link

[Interval Analysis] Actually working on a bril program! #464

Closed ajpal closed 5 months ago

ajpal commented 5 months ago
# ARGS: 1
@main(input: int) {
  zero: int = const 0;
  cond: bool = le input zero;
  br cond .then .else;
  .then:
    y: int = id input;
    jmp .end;
  .else:
    neg: int = const -1;
    y: int = mul input neg;
    jmp .end;
  .end:
    z: bool = le y zero;
    print z;
}

Becomes

@main(v0: int) {
  v2: bool = const true;
  print v2;
}
Alex-Fischman commented 5 months ago

@ajpal I did the passthrough stuff in #466 so that I'm not blocked on this one, rebase on main before requesting review.