xref: /llvm-project/mlir/test/Dialect/Builtin/ops.mlir (revision 79c83e12c8884fa46f2f2594836af93474f6ca5a)
1// RUN: mlir-opt %s -allow-unregistered-dialect | mlir-opt -allow-unregistered-dialect
2
3//===----------------------------------------------------------------------===//
4// UnrealizedConversionCastOp
5//===----------------------------------------------------------------------===//
6
7%operand = "foo.op"() : () -> !foo.type
8%tuple_operand = "foo.op"() : () -> !foo.tuple_type<!foo.type, !foo.type>
9
10// An unrealized 0-1 conversion.
11%result = unrealized_conversion_cast to !bar.tuple_type<>
12
13// An unrealized 1-1 conversion.
14%result1 = unrealized_conversion_cast %operand : !foo.type to !bar.lowered_type
15
16// An unrealized 1-N conversion.
17%results2:2 = unrealized_conversion_cast %tuple_operand : !foo.tuple_type<!foo.type, !foo.type> to !foo.type, !foo.type
18
19// An unrealized N-1 conversion.
20%result3 = unrealized_conversion_cast %operand, %operand : !foo.type, !foo.type to !bar.tuple_type<!foo.type, !foo.type>
21
22//===----------------------------------------------------------------------===//
23// VectorType
24//===----------------------------------------------------------------------===//
25
26// A basic 1D scalable vector
27%scalable_vector_1d = "foo.op"() : () -> vector<[4]xi32>
28
29// A 2D scalable vector
30%scalable_vector_2d = "foo.op"() : () -> vector<[2]x[2]xf64>
31
32// A 2D scalable vector with fixed-length dimensions
33%scalable_vector_2d_mixed = "foo.op"() : () -> vector<2x[4]xbf16>
34
35// A multi-dimensional vector with mixed scalable and fixed-length dimensions
36%scalable_vector_multi_mixed = "foo.op"() : () -> vector<2x2x[4]x[4]xi8>
37