// RUN: mlir-opt -split-input-file %s | FileCheck %s // ----- func.func @condif_cond_type_check(%arg0: tensor, %arg1: tensor, %arg2: tensor) -> tensor { // CHECK: tosa.cond_if %[[ARG2:.*]] : tensor -> tensor { %0 = tosa.cond_if %arg2 : tensor -> tensor { %1 = tosa.add %arg0, %arg1 : (tensor, tensor) -> tensor tosa.yield %1 : tensor // CHECK: } else { } else { %1 = tosa.sub %arg0, %arg1 : (tensor, tensor) -> tensor tosa.yield %1 : tensor } return %0 : tensor } // ----- func.func @condif_block_args_check(%arg0: tensor, %arg1: tensor, %arg2: tensor) -> tensor { // CHECK: tosa.cond_if %[[ARG2:.*]] (%[[ARG3:.*]] = %[[ARG0:.*]], %[[ARG4:.*]] = %[[ARG1:.*]]) : tensor (tensor, tensor) -> tensor { // CHECK-NEXT: ^bb0(%[[ARG3]]: tensor, %[[ARG4]]: tensor): %0 = tosa.cond_if %arg2 (%arg3 = %arg0, %arg4 = %arg1) : tensor (tensor, tensor) -> tensor { ^bb0(%arg3: tensor, %arg4: tensor): %1 = tosa.add %arg3, %arg4 : (tensor, tensor) -> tensor tosa.yield %1 : tensor // CHECK: } else { // CHECK-NEXT: ^bb0(%[[ARG3]]: tensor, %[[ARG4]]: tensor): } else { ^bb0(%arg3: tensor, %arg4: tensor): %1 = tosa.sub %arg3, %arg4 : (tensor, tensor) -> tensor tosa.yield %1 : tensor } return %0 : tensor }