[Mlir-commits] [mlir] [mlir][emitc] Inline constant when translate (PR #143485)

Jianjian Guan llvmlistbot at llvm.org
Wed Jun 18 20:09:42 PDT 2025


jacquesguan wrote:

> > 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.
> 
> The other op I think is `load` at this point, the rest already have checks in place. The point of this interface was to make it also for load when load uses primitive type, so it won't have side effect, instead of prohibiting everyload as we do now.

Yes, they have check but most just mark it as no sideeffect. By example, all binary operator such as add is set with no side effect, but in C++, we may have an overloaded operator add which may access memory. So I think any op with opaque type should be treated as sideeffect.

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


More information about the Mlir-commits mailing list