[Mlir-commits] [mlir] [mlir][emitc][NFC] Add an example to the description of the emitc.verbatim operation (PR #128004)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Feb 20 05:02:43 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir-emitc

Author: Andrey Timonin (EtoAndruwa)

<details>
<summary>Changes</summary>

The official page provides an explanation of the **new** functionality of `emitc.verbatim`, but a classic example in the `.td` file for this operation is still missing.

---
Full diff: https://github.com/llvm/llvm-project/pull/128004.diff


1 Files Affected:

- (modified) mlir/include/mlir/Dialect/EmitC/IR/EmitC.td (+7) 


``````````diff
diff --git a/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td b/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
index 4fbce995ce5b8..d0627992d0c7b 100644
--- a/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
+++ b/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
@@ -1222,6 +1222,13 @@ def EmitC_VerbatimOp : EmitC_Op<"verbatim"> {
     }
     #endif
     ```
+
+    Example:
+
+    ```mlir
+    emitc.verbatim "typedef float f32;"
+    emitc.verbatim "#pragma my var={} property" args %arg : f32
+    ```
   }];
 
   let arguments = (ins StrAttr:$value);

``````````

</details>


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


More information about the Mlir-commits mailing list