[Mlir-commits] [mlir] [mlir][emitc] mark `emitc.load` with `CExpression` (PR #130802)

Kirill Chibisov llvmlistbot at llvm.org
Thu Mar 13 07:43:18 PDT 2025


kchibisov wrote:

I've just noticed one inconsistency in the handling of CExpression inlining. If you look at `hasSideEffects` impl it does prevent uses of `call_opaque` and e.g. `variable` to not result in inlining, however, not e.g. `subscript` Op and regular `call`.

In general, `variable` right now is assumed to read local storage variable and can not really load from memory that may result in undefined behavior. Thus, I think the `hasSideEffects` should probably disallow `subscript` as it has side effect, and allow `variable` as loading from it doesn't have a side effect.

As for the call, I'm not quite sure how to deal with it and maybe keep as is or disallow all together.

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


More information about the Mlir-commits mailing list