Open gussmith23 opened 3 years ago
I think I have the right intention (trying to shrink the number of classes by adding simplifying rewrites) but perhaps I'm not focusing on the right target. The thing that (probably) blows things up the most is the slice/concat rewrite, so we should target that.
I'm not going to merge this for now, as it doesn't seem to be doing anything good. I should take a look at this again after I try simplifying concatenates.
The intention here was to add simplifying rewrites so that flatten/unflatten wouldn't run rampant. If we could add more equivalences (i.e. saying that stacking flattens is equivalent to just one flatten, or that flatten-then-reshape is equal to just reshape) then we can compress the egraph down. However, we haven't seemed to improve much:
Without rewrites:
With rewrites:
It seems like the number of classes goes down somewhat, but overall performance degrades (we run fewer iterations, have more rebuilding). I'm not quite sure how to interpret this -- is it just that these rewrites aren't actually useful, and are just hurting us?