[Mlir-commits] [mlir] 11fdead - [mlir][emitc][NFC] Add an example to the description of the emitc.literal operation (#128005)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sun Feb 23 23:35:56 PST 2025


Author: Andrey Timonin
Date: 2025-02-24T08:35:52+01:00
New Revision: 11fdeadbdff245531f8d2ee9dd7141fe966a077f

URL: https://github.com/llvm/llvm-project/commit/11fdeadbdff245531f8d2ee9dd7141fe966a077f
DIFF: https://github.com/llvm/llvm-project/commit/11fdeadbdff245531f8d2ee9dd7141fe966a077f.diff

LOG: [mlir][emitc][NFC] Add an example to the description of the emitc.literal operation (#128005)

Co-authored-by: Marius Brehler <marius.brehler at gmail.com>

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/EmitC/IR/EmitC.td

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td b/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
index 196283fe2c7ad..f58dd4125003a 100644
--- a/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
+++ b/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
@@ -844,6 +844,17 @@ def EmitC_LiteralOp : EmitC_Op<"literal", [Pure]> {
   let description = [{
     The `emitc.literal` operation produces an SSA value equal to some constant
     specified by an attribute.
+
+    Example:
+
+    ```mlir
+    %p0 = emitc.literal "M_PI" : f32
+    %1 = "emitc.add" (%arg0, %p0) : (f32, f32) -> f32
+    ```
+    ```c++
+    // Code emitted for the operation above.
+    float v2 = v1 + M_PI;
+    ```
   }];
 
   let arguments = (ins StrAttr:$value);


        


More information about the Mlir-commits mailing list