Skip to content

Commit 6c987db

Browse files
EtoAndruwamarbre
andauthored
Update mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
Co-authored-by: Marius Brehler <[email protected]>
1 parent 0179aa5 commit 6c987db

File tree

1 file changed

+3
-5
lines changed
  • mlir/include/mlir/Dialect/EmitC/IR

1 file changed

+3
-5
lines changed

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -802,14 +802,12 @@ def EmitC_LiteralOp : EmitC_Op<"literal", [Pure]> {
802802
Example:
803803

804804
```mlir
805-
%x = "emitc.variable"() <{value = #emitc.opaque<"">}> : () -> !emitc.lvalue<i32>
806-
%one = literal "1" : i32
807-
"emitc.assign"(%x, %one) : (!emitc.lvalue<i32>, i32) -> ()
805+
%p0 = emitc.literal "M_PI" : f32
806+
%1 = "emitc.add" (%arg0, %p0) : (f32, f32) -> f32
808807
```
809808
```c++
810809
// Code emitted for the operation above.
811-
int32_t v1;
812-
v1 = 1;
810+
float v2 = v1 + M_PI;
813811
```
814812
}];
815813

0 commit comments

Comments
 (0)