[Mlir-commits] [mlir] Add a structured if operation (PR #67234)
Gil Rapaport
llvmlistbot at llvm.org
Tue Sep 26 12:58:30 PDT 2023
================
@@ -402,4 +403,102 @@ def EmitC_VariableOp : EmitC_Op<"variable", []> {
let hasVerifier = 1;
}
+def EmitC_AssignOp : EmitC_Op<"assign", [MemoryEffects<[MemWrite]>]> {
----------------
aniragil wrote:
W.R.T the underlying C variables to be emitted, the assign op takes an SSA Value as the value to assign, not necessarily another variable. The emitter may or may not generate a C variable for that value, e.g. emitc::literal, so a memread may or may not happen, which is consistent with all other ops taking SSA Values as operands.
So on second thought adding memory effects to the assign op at this point may be a bit premature, since as you point out allocation/reading/writing are currently not modeled explicitly in the dialect at all. Being an output dialect such semantics may be redundant, but that probably deserves a separate discussion.
Suggest to remove the MemoryEffects from this patch, leaving assign's memory semantics to be handled as part of the whole dialect. What do you think?
https://github.com/llvm/llvm-project/pull/67234
More information about the Mlir-commits
mailing list