[Mlir-commits] [mlir] [mlir][EmitC] Model lvalues as a type in EmitC (PR #91475)

Matthias Gehre llvmlistbot at llvm.org
Tue Jun 11 07:12:54 PDT 2024


================
@@ -835,6 +835,21 @@ def EmitC_LogicalOrOp : EmitC_BinaryOp<"logical_or", [CExpression]> {
   let assemblyFormat = "operands attr-dict `:` type(operands)";
 }
 
+def EmitC_LValueLoadOp : EmitC_Op<"lvalue_load", [
+  TypesMatchWith<"result type matches value type of 'operand'",
+                  "operand", "result",
+                  "::llvm::cast<LValueType>($_self).getValue()">
+]> {
+  let summary = "load an lvalue by assigning it to a local variable";
----------------
mgehre-amd wrote:

```suggestion
  let summary = "Load an lvalue into an SSA value.";
```
I'm not to fixated on this, but I think `by assigning it to a local variable` is a property of the emitter and not the essence of this op within the dialect.

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


More information about the Mlir-commits mailing list