llvm / llvm/llvm-project

[MLIR][IRDL] Unable to walk parameters of IRDL-defined types and attributes

Open
#181,773 3 comments 0 reactions 0 assignees View on GitHub
mlir:irdl
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

I'm trying to define a parameterized type with IRDL, and later use the APIs to inspect the parameters. I'm assuming the same issue occurs for attributes but I haven't actually tried it yet.

Here's some sample IRDL that I'm trying:
```mlir
module {
irdl.dialect @test {
irdl.type @type1 {
%0 = irdl.base "#builtin.integer"
%1 = irdl.base "!builtin.integer"
irdl.parameters(param1: %0, param2: %1)
}
}
}
```

I'm creating an instance of that type like this: `!test.type1<32 : i64, i32>`.

When I try to walk it, I'm not finding anything. I pushed a small unit test here to reproduce it, if that makes it more clear: https://github.com/mikeurbach/llvm-project/commit/677f520c93bfa97e62c6c9569457996d7a39927e. I'm using this to debug and see if I can get to the bottom of this myself, but curious if anyone has any ideas.

@Moxinilian or @math-fehr, have you seen anything like this? I didn't seem to see any open issue about it.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.