[Mlir-commits] [mlir] [mlir][emitc] Inline constant when translate (PR #143485)
Jianjian Guan
llvmlistbot at llvm.org
Tue Jun 17 23:36:46 PDT 2025
jacquesguan wrote:
> > I've thought about side effects in the past and I don't know if we want to simply mark the ops as pure as you might target overloaded C++ classes that do whatever. But especially on the call_opaque op I want to be able to mark an instance as pure with an attribute for example and then override getMemoryEffects accordingly.
>
> Wouldn't the constant op be able to check for that with the new interface proposed here #142771 ? We can check if the type is scalar and then e.g. say that it doesn't have side effects.
I think not only for constantOp but also other ops, we should mark it have no side effect only for builtin types. Because the op with opaque type may use overloaded operator that may access memory or have other side effect.
https://github.com/llvm/llvm-project/pull/143485
More information about the Mlir-commits
mailing list