252
|
1 // RUN: mlir-opt %s -pass-pipeline="builtin.module(convert-vector-to-llvm,func.func(convert-arith-to-llvm),convert-func-to-llvm,reconcile-unrealized-casts)" | mlir-translate -mlir-to-llvmir | FileCheck %s
|
221
|
2
|
236
|
3 func.func @genbool_1d() -> vector<8xi1> {
|
221
|
4 %0 = vector.constant_mask [4] : vector<8xi1>
|
|
5 return %0 : vector<8xi1>
|
|
6 }
|
|
7 // CHECK-LABEL: @genbool_1d()
|
|
8 // CHECK-NEXT: ret <8 x i1> <i1 true, i1 true, i1 true, i1 true, i1 false, i1 false, i1 false, i1 false>
|
|
9
|
236
|
10 func.func @genbool_2d() -> vector<4x4xi1> {
|
221
|
11 %v = vector.constant_mask [2, 2] : vector<4x4xi1>
|
|
12 return %v: vector<4x4xi1>
|
|
13 }
|
|
14 // CHECK-LABEL: @genbool_2d()
|
|
15 // CHECK-NEXT: ret [4 x <4 x i1>] [<4 x i1> <i1 true, i1 true, i1 false, i1 false>, <4 x i1> <i1 true, i1 true, i1 false, i1 false>, <4 x i1> zeroinitializer, <4 x i1> zeroinitializer]
|
|
16
|
236
|
17 func.func @genbool_3d() -> vector<2x3x4xi1> {
|
221
|
18 %v = vector.constant_mask [1, 1, 3] : vector<2x3x4xi1>
|
|
19 return %v: vector<2x3x4xi1>
|
|
20 }
|
|
21 // CHECK-LABEL: @genbool_3d()
|
|
22 // CHECK-NEXT: ret [2 x [3 x <4 x i1>]] {{\[+}}3 x <4 x i1>] [<4 x i1> <i1 true, i1 true, i1 true, i1 false>, <4 x i1> zeroinitializer, <4 x i1> zeroinitializer], [3 x <4 x i1>] zeroinitializer]
|
|
23 // note: awkward syntax to match [[
|
|
24
|
236
|
25 func.func @genbool_1d_var_but_constant() -> vector<8xi1> {
|
|
26 %i = arith.constant 0 : index
|
221
|
27 %v = vector.create_mask %i : vector<8xi1>
|
|
28 return %v : vector<8xi1>
|
|
29 }
|
|
30 // CHECK-LABEL: @genbool_1d_var_but_constant()
|
|
31 // CHECK-NEXT: ret <8 x i1> zeroinitializer
|