diff --git a/mlir/test/Transforms/cse.mlir b/mlir/test/Transforms/cse.mlir --- a/mlir/test/Transforms/cse.mlir +++ b/mlir/test/Transforms/cse.mlir @@ -493,3 +493,17 @@ // CHECK: } // CHECK-NOT: scf.if // CHECK: return %[[if]], %[[if]] + +// Operations with empty region CSE +// CHECK-LABEL: func @cse_ops_with_empty_region +// CHECK: %[[OP0:.*[0]]] = "test.any_cond" +// CHECK-NOT: %[[OP1:.*[0]]] = "test.any_cond" +// CHECK: return %[[OP0]], %[[OP0]] +func.func @cse_ops_with_empty_region() + -> (i32, i32) { + %0 = "test.any_cond"() ({ + }) : () -> i32 + %1 = "test.any_cond"() ({ + }) : () -> i32 + return %0, %1 : i32, i32 +}