egraphs-good / eggcc

MIT License
52 stars 11 forks source link

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

Closed ajpal closed 5 months ago

ajpal commented 5 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_;
}