-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
Just opening this to discuss how we want to add it. I thought I can do it in an afternoon, but apparently there are some issues here...
- Just add the patch to cranelift in this repo, or do we want to upstream the code that serialize the egraph?
- How should we deal with root e-class? The main issue is that in cranelift, they don't extract a single thing, but they compute the best extraction cost for each e-class (yeah, they don't care about sharing...).
If someone wants to have a look, here is their code: https://github.com/bytecodealliance/wasmtime/blob/8ea25906f561d6d2e16e6152963f3a87af5a4e46/cranelift/codegen/src/egraph/elaborate.rs#L221
There are some minor annoyance, e.g. they use union nodes instead of e-classes, and e-nodes may belong to one union node or no union node. Haven't yet checked if they can belong to multiple union nodes or something else can reference an e-node with a union node without going through that union node. But this can be canonicalized easily.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels