[Mlir-commits] [mlir] Save unregistered attrs after type conversion. (PR #135084)

Bart Chrzaszcz llvmlistbot at llvm.org
Tue Aug 19 09:07:56 PDT 2025


bartchr808 wrote:

> > Like create a C++ Operation->Attribute map and re add them after the pass
> 
> Yes, but probably "Symbol Name -> Attribute" map instead for stability.

@joker-eph so actually I realized an issue with this. What if the attributes saved on each `CallOp` are different? For example:

```mlir
func @main(...) {
  %0 = call @foo(...) {my.first_attr = "foo"'}
  %1 = call @foo(...) {my.other_attr = "bar"'} 
}

func @foo(...) {
  ...
}
```

Then the mapping wouldn't suffice.

One thing we are looking at trying is defining our own `CallOp` conversion pattern. What do you think of that approach instead?

https://github.com/llvm/llvm-project/pull/135084


More information about the Mlir-commits mailing list