Replies: 2 comments 9 replies
-
Hi! I use |
Beta Was this translation helpful? Give feedback.
-
Hi, I think @chandrakananandi is right. I don't think there is any major technical blocker stopping you from doing this today! The original eqsat paper you linked to contains a lot of good ideas on how to encode your problem into an e-graph. If I'm understanding your setting, you'll still want E-PEGs if you want to encode loops in a transparent way that you can optimize through. If you only care about optimizing one basic block (one DFG) at a time, then you don't need them. The egg paper (and tool) are mostly innovating in how equality saturation is done. How you encode your problem is still up to you! Despite there not being any huge blockers, I still think it's a large and challenging task, and one that I'd like to try to tackle at some point (if I can find the time), or see someone else take a stab at! One thing that I will add: you'll have a much easier time with a tree- or dag-like IR that a linear, mutating IR. All the rewrites that you do are over trees or dags, and just overall the e-graph doesn't do a lot for you if your language is heavily sequential. If that's your case, consider building def-use chains or some other method to make things more graph-like for the e-graph. |
Beta Was this translation helpful? Give feedback.
-
Hi! What are the prospects of utilizing
egg
to perform rewrite-driven transformations on SSA-based IRs (?)I read this paper (whose authors appear to be collaborators with y'all): https://www.cs.cornell.edu/~ross/publications/eqsat/ where they describe
E-PEG
-based program representation.On the other hand, I'm working on IRs which are closer to strict SSA (where all control flow is de-sugared to basic blocks and branching) and everything is linear (e.g. blocks are vectors of instructions) vs. strictly tree-like.
I'd love to find or understand how equality saturation could be applied to this representation structure -- it's likely that maybe this information can be gleaned from the above paper (but I expect that maintainers here might be able to unpack this more than I can).
Beta Was this translation helpful? Give feedback.
All reactions