1 // RUN: mlir-opt %s --convert-vector-to-llvm='force-32bit-vector-indices=1' | FileCheck %s --check-prefix=CMP32
2 // RUN: mlir-opt %s --convert-vector-to-llvm='force-32bit-vector-indices=0' | FileCheck %s --check-prefix=CMP64
4 // CMP32-LABEL: @genbool_var_1d(
5 // CMP32-SAME: %[[ARG:.*]]: index)
6 // CMP32: %[[T0:.*]] = arith.constant dense<[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]> : vector<11xi32>
7 // CMP32: %[[T1:.*]] = arith.index_cast %[[ARG]] : index to i32
8 // CMP32: %[[T2:.*]] = llvm.insertelement %[[T1]], %{{.*}}[%{{.*}} : i32] : vector<11xi32>
9 // CMP32: %[[T3:.*]] = llvm.shufflevector %[[T2]], %{{.*}} [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] : vector<11xi32>
10 // CMP32: %[[T4:.*]] = arith.cmpi slt, %[[T0]], %[[T3]] : vector<11xi32>
11 // CMP32: return %[[T4]] : vector<11xi1>
13 // CMP64-LABEL: @genbool_var_1d(
14 // CMP64-SAME: %[[ARG:.*]]: index)
15 // CMP64: %[[T0:.*]] = arith.constant dense<[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]> : vector<11xi64>
16 // CMP64: %[[T1:.*]] = arith.index_cast %[[ARG]] : index to i64
17 // CMP64: %[[T2:.*]] = llvm.insertelement %[[T1]], %{{.*}}[%{{.*}} : i32] : vector<11xi64>
18 // CMP64: %[[T3:.*]] = llvm.shufflevector %[[T2]], %{{.*}} [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] : vector<11xi64>
19 // CMP64: %[[T4:.*]] = arith.cmpi slt, %[[T0]], %[[T3]] : vector<11xi64>
20 // CMP64: return %[[T4]] : vector<11xi1>
22 func.func @genbool_var_1d(%arg0: index) -> vector<11xi1> {
23 %0 = vector.create_mask %arg0 : vector<11xi1>
24 return %0 : vector<11xi1>
27 // CMP32-LABEL: @genbool_var_1d_scalable(
28 // CMP32-SAME: %[[ARG:.*]]: index)
29 // CMP32: %[[T0:.*]] = llvm.intr.stepvector : vector<[11]xi32>
30 // CMP32: %[[T1:.*]] = arith.index_cast %[[ARG]] : index to i32
31 // CMP32: %[[T2:.*]] = llvm.insertelement %[[T1]], %{{.*}}[%{{.*}} : i32] : vector<[11]xi32>
32 // CMP32: %[[T3:.*]] = llvm.shufflevector %[[T2]], %{{.*}} [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] : vector<[11]xi32>
33 // CMP32: %[[T4:.*]] = arith.cmpi slt, %[[T0]], %[[T3]] : vector<[11]xi32>
34 // CMP32: return %[[T4]] : vector<[11]xi1>
36 // CMP64-LABEL: @genbool_var_1d_scalable(
37 // CMP64-SAME: %[[ARG:.*]]: index)
38 // CMP64: %[[T0:.*]] = llvm.intr.stepvector : vector<[11]xi64>
39 // CMP64: %[[T1:.*]] = arith.index_cast %[[ARG]] : index to i64
40 // CMP64: %[[T2:.*]] = llvm.insertelement %[[T1]], %{{.*}}[%{{.*}} : i32] : vector<[11]xi64>
41 // CMP64: %[[T3:.*]] = llvm.shufflevector %[[T2]], %{{.*}} [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] : vector<[11]xi64>
42 // CMP64: %[[T4:.*]] = arith.cmpi slt, %[[T0]], %[[T3]] : vector<[11]xi64>
43 // CMP64: return %[[T4]] : vector<[11]xi1>
45 func.func @genbool_var_1d_scalable(%arg0: index) -> vector<[11]xi1> {
46 %0 = vector.create_mask %arg0 : vector<[11]xi1>
47 return %0 : vector<[11]xi1>