cfallin opened PR #21 from isle-extended-patterns to main:
This RFC proposes an extension to the ISLE pattern-matching DSL used by Cranelift's code generation
backends. The extension is a backward-compatible proposal that is meant to make certain lowering
patterns easier to express. The ideas are informed by our experience so far with the DSL, and aim
to replace some awkward uses of extractors with in-arguments with clearer, more direct idioms
using a new language form.cc @abrown @fitzgen @jlb6740 @akirilov-arm @sparker-arm @uweigand
cfallin updated PR #21 from isle-extended-patterns to main.
cfallin updated PR #21 from isle-extended-patterns to main.
avanhatt submitted PR review.
avanhatt submitted PR review.
avanhatt created PR review comment:
Can we expand on this a bit? I.e., if any
givenclause is unable to match, the rule does not match? Also, including the case of a boolean predicate more explicitly here?
avanhatt created PR review comment:
To this end, would it make sense to name this something like
if-letinstead ofgiven? I ask both for clarity in my own understanding and as an actual naming suggestion :)
avanhatt created PR review comment:
The "with no
givenclauses" bit here doesn't make sense to me---presumably, the elided RHS here uses variables bound in thegivenclauses, so what does it mean to behave the same as before?
avanhatt created PR review comment:
Might be helpful here to explicitly call out the difference between RHS expressions and LHS patterns again, since "expression" could be read in a less-specific way.
cfallin submitted PR review.
cfallin created PR review comment:
Ah, I think this is just ambiguous wording. This isn't saying that one can strip clauses from a particular rule and have it behave the same as before; this is saying that rules with no
givenclauses behave the same as before. (In other words, meanings of rules with nogivenclauses do not change.)
cfallin submitted PR review.
cfallin created PR review comment:
It's basically the same as an
if letin Rust, indeed! I do kind of like this suggestion. @fitzgen @abrown thoughts?
avanhatt submitted PR review.
avanhatt created PR review comment:
Makes sense! The singular
the rulewas what tripped me, maybe better as(rules withoutgivenclauses behave the same as before)
fitzgen created PR review comment:
I like
if-letinstead ofgiven
fitzgen submitted PR review.
cfallin updated PR #21 from isle-extended-patterns to main.
cfallin submitted PR review.
cfallin created PR review comment:
Alright, I've gone ahead and find-replaced everything to
if-letinstead. Thanks for the idea!
cfallin submitted PR review.
cfallin created PR review comment:
Fixed, hopefully clearer now.
cfallin created PR review comment:
Updated, hopefully more descriptive now.
cfallin submitted PR review.
cfallin submitted PR review.
cfallin created PR review comment:
Expanded this with a more explicit discussion of how the evaluation proceeds.
bjorn3 submitted PR review.
bjorn3 submitted PR review.
bjorn3 created PR review comment:
Maybe this should just be
(if (magic_simd_extension_enabled))?
cfallin submitted PR review.
cfallin created PR review comment:
Hmm, yeah, that's a nice shorthand. I'll play with this a bit more in the prototype, thanks!
cfallin merged PR #21.
cfallin edited PR #21 from isle-extended-patterns to main:
This RFC proposes an extension to the ISLE pattern-matching DSL used by Cranelift's code generation
backends. The extension is a backward-compatible proposal that is meant to make certain lowering
patterns easier to express. The ideas are informed by our experience so far with the DSL, and aim
to replace some awkward uses of extractors with in-arguments with clearer, more direct idioms
using a new language form.cc @abrown @fitzgen @jlb6740 @akirilov-arm @sparker-arm @uweigand
Last updated: Dec 06 2025 at 06:05 UTC