I'm curious about ISLE, it's being used to lower instructions, but instruction are flat datastructures. The README mentions that only copy types are allowed for primitives. But my intuition is that maybe you could handle the indirection in recursive datastrutures with external extractor?
More concretely, could ISLE be used to perform rewrites in an expression AST for example? How does cranelift perform those optimisations, like constant folding etc..
maybe, yeah; that path hasn't been well-trodden but you could probably hack it together :-)
the idea with ISLE is that all of the compiler interface -- that includes dealing with the AST in any nontrivial way -- is pushed to Rust FFI, so I think you're basically on the right track with that
to that end, the way that the mid-end rules work in ISLE is that we have extractors that match all the InstructionData
s for the enodes associated with a given value, and we have a top-level driver loop so we don't need ISLE itself to recurse
Last updated: Dec 23 2024 at 12:05 UTC