egraphs-good / eggcc

MIT License
42 stars 8 forks source link

Rewrite if a </> b then a else b to min/max #618

Closed ajpal closed 3 months ago

ajpal commented 3 months ago

Doesn't result in big changes to benchmarks yet because of the branch thing that @Alex-Fischman is working on.

But I tested on the commit that Alex sent me, and min.bril correctly optimizes to

@main(v0: int, v1: int) {
.b2_:
  v3_: int = smin v0 v1;
  print v3_;
}