[Mlir-commits] [mlir] [mlir][arith.constant]Fix element type of the dense attributes in target attributes to be consistent with result type in LLVM::detail::oneToOneRewrite() (PR #149787)

Diego Caballero llvmlistbot at llvm.org
Mon Jul 21 10:52:36 PDT 2025


dcaballe wrote:

I think the lowering and dialect mix-up is orthogonal to the actual problem here. For me, the question is: why the attribute type is not being converted when converting an `arith.constant` to `llvm.mlir.constant`. That is, why do we allow something like:
```
%4 = llvm.mlir.constant(dense<0> : index) : i32
```
instead of:
```
%4 = llvm.mlir.constant(dense<0> : i32) : i32
```
?
Are there scenarios where the attribute-return type mismatch is needed? Is this something that was needed in the past but it's no longer needed?

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


More information about the Mlir-commits mailing list