[Mlir-commits] [mlir] [mlir][emitc] Fix form-expressions inside expression (PR #86081)

Marius Brehler llvmlistbot at llvm.org
Thu Mar 21 02:18:53 PDT 2024


================
@@ -107,3 +107,20 @@ func.func @expression_with_address_taken(%arg0: i32, %arg1: i32, %arg2: !emitc.p
   %d = emitc.cmp lt, %c, %arg2 :(!emitc.ptr<i32>, !emitc.ptr<i32>) -> i1
   return %d : i1
 }
+
+// CHECK-LABEL: func.func @no_expression_in_expression(
+// CHECK-SAME:      %[[VAL_0:.*]]: i32, %[[VAL_1:.*]]: i32) -> i1 {
+// CHECK:         %[[VAL_2:.*]] = emitc.expression : i1 {
+// CHECK:           %[[VAL_3:.*]] = emitc.cmp lt, %[[VAL_0]], %[[VAL_1]] : (i32, i32) -> i1
+// CHECK:           emitc.yield %[[VAL_3]] : i1
+// CHECK:         }
+// CHECK:         return %[[VAL_2]] : i1
+// CHECK:       }
+
+func.func @no_expression_in_expression(%arg0: i32, %arg1: i32) -> i1 {
----------------
marbre wrote:

```suggestion
func.func @no_nested_expression(%arg0: i32, %arg1: i32) -> i1 {
```

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


More information about the Mlir-commits mailing list