xdslproject/xdsl

core: We need more variadic inference for compatibility

PapyChacal opened this issue · 0 comments

Symptom: xDSL's memref.extract_strided_metadata is incompatible with MLIR's

(I wasn't sure which one should be title or subtitle)

Introduced by:

  • #2748
    (The op was not defined before so at least handlable as unregistered - not possible to interoperate it in custom syntax now.)

This operation has two variadic results, which in xDSL enforces to have

    irdl_options = [AttrSizedResultSegments()]

And thus expect the related attribute.

Except MLIR prints it without it:

%1:6 = "memref.extract_strided_metadata"(%0) : (memref<512x384xi32>) -> (memref<i32>, index, index, index, index, index)

What trickery is this, you might ask 🧙

Well they provide an internal trait SameVariadicResultSize, bypassing the need of an explicit encoding of each variadic result's size here, because as cleary stated by the name, one can just infer it easily.

Except xDSL cannot at the moment. 😢