[Mlir-commits] [mlir] [mlir][emitc] Mark emitc.literal with CExpression (PR #155582)
Vlad Lazar
llvmlistbot at llvm.org
Wed Aug 27 07:28:47 PDT 2025
================
@@ -851,7 +851,7 @@ def EmitC_IncludeOp
let hasCustomAssemblyFormat = 1;
}
-def EmitC_LiteralOp : EmitC_Op<"literal", [Pure]> {
+def EmitC_LiteralOp : EmitC_Op<"literal", [Pure, CExpressionInterface]> {
----------------
Vladislave0-0 wrote:
> I think we need to overwrite hasSideEffects to return false because literals are always inlined on their own. See also my comment about a test for that.
Thanks. Then, I will allow myself to repeat the question from the above block, as it is more appropriate here. In the case where `literalOp` has a method `bool hasSideEffects() { return false; }` in `Emitc.td`, does the `LiteralOp` really need the `Pure` trait?
https://github.com/llvm/llvm-project/pull/155582
More information about the Mlir-commits
mailing list