We don't currently have any way for a cranelift embedder to register custom passes over a function, right? cc @Dan Gohman
@Nick Fitzgerald we don't, and the IR isn't stable.
thanks
stability is a bit of an orthogonal issue, since if you are translating to clif in the first place, you're already dealing with the instability, but I get the point of why we might not want to commit to supporting custom passes
There's an open question atm about whether we should keep the legalized form of instructions as the IR or have an explicitly MIR-like IR that doesn't require selecting an Encoding
The current design was made sort of on the assumption that there wouldn't be any real passes other than regalloc and instruction selection: all the LICM/GVN/etc things were intended to be done by the entity that emits the CLIF.
Switching from one IR (wasm) to another (CLIF) gives new optimization opportunities, so LICM/GVN etc. may be worth doing again, if data suggests they're relevant.
Last updated: Dec 23 2024 at 12:05 UTC