Stream: cranelift

Topic: Can ISLE be used with recursive data-structures?


view this post on Zulip marin (Dec 13 2024 at 23:56):

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..

view this post on Zulip Chris Fallin (Dec 14 2024 at 00:01):

maybe, yeah; that path hasn't been well-trodden but you could probably hack it together :-)

view this post on Zulip Chris Fallin (Dec 14 2024 at 00:01):

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

view this post on Zulip Chris Fallin (Dec 14 2024 at 00:02):

to that end, the way that the mid-end rules work in ISLE is that we have extractors that match all the InstructionDatas 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