Skip to content

Commit 755611c

Browse files
committed
Precommit test for mlir tosa i1 true to i32
1 parent e685e4a commit 755611c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

mlir/test/Dialect/Tosa/constant-op-fold.mlir

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,16 @@ func.func @cast_int_to_int_sign() -> tensor<i32> {
594594
return %cast : tensor<i32>
595595
}
596596

597+
598+
// CHECK: func.func @cast_i1_true_to_i32
599+
func.func @cast_i1_true_to_i32() -> tensor<i32> {
600+
%splat = "tosa.const"() {values = dense<true> : tensor<i1>} : () -> tensor<i1>
601+
// CHECK: %[[SPLAT:.+]] = "tosa.const"() <{values = dense<-1> : tensor<i32>}
602+
%cast = tosa.cast %splat : (tensor<i1>) -> tensor<i32>
603+
// CHECK: return %[[SPLAT]]
604+
return %cast : tensor<i32>
605+
}
606+
597607
// -----
598608

599609
// CHECK-LABEL: @reverse_splat

0 commit comments

Comments
 (0)