Files
clang-p2996/mlir/test/Integration/Dialect/Vector/CPU/constant-mask.mlir
Andrzej Warzyński 435114f9fe [mlir][test] Rename Vector integration tests for CPU (nfc) (#93521)
To keep the test filenames consistent, this patch:
  * removes "test-" from  file names (there used to be a mix of
    "test-feature-1.mlir" and "feature-2.mlir"),
  * replaces "_" with "-" (there used to be a mix of "feature-3.mlir"
    and "feature_4.mlir").

Only files under test/Integration/Dialect/Vector/CPU are updated.
2024-05-30 18:06:43 +01:00

50 lines
2.0 KiB
MLIR

// RUN: mlir-opt %s -convert-vector-to-scf -convert-scf-to-cf -convert-vector-to-llvm -convert-func-to-llvm -reconcile-unrealized-casts | \
// RUN: mlir-cpu-runner -e entry -entry-point-result=void \
// RUN: -shared-libs=%mlir_c_runner_utils | \
// RUN: FileCheck %s
func.func @entry() {
%0 = vector.constant_mask [4] : vector<8xi1>
vector.print %0 : vector<8xi1>
// CHECK: ( 1, 1, 1, 1, 0, 0, 0, 0 )
%1 = vector.constant_mask [1, 3] : vector<4x4xi1>
vector.print %1 : vector<4x4xi1>
// CHECK: ( ( 1, 1, 1, 0 ), ( 0, 0, 0, 0 ), ( 0, 0, 0, 0 ), ( 0, 0, 0, 0 ) )
%2 = vector.constant_mask [2, 2] : vector<4x4xi1>
vector.print %2 : vector<4x4xi1>
// CHECK: ( ( 1, 1, 0, 0 ), ( 1, 1, 0, 0 ), ( 0, 0, 0, 0 ), ( 0, 0, 0, 0 ) )
%3 = vector.constant_mask [2, 4] : vector<4x4xi1>
vector.print %3 : vector<4x4xi1>
// CHECK: ( ( 1, 1, 1, 1 ), ( 1, 1, 1, 1 ), ( 0, 0, 0, 0 ), ( 0, 0, 0, 0 ) )
%4 = vector.constant_mask [3, 1] : vector<4x4xi1>
vector.print %4 : vector<4x4xi1>
// CHECK: ( ( 1, 0, 0, 0 ), ( 1, 0, 0, 0 ), ( 1, 0, 0, 0 ), ( 0, 0, 0, 0 ) )
%5 = vector.constant_mask [3, 2] : vector<4x4xi1>
vector.print %5 : vector<4x4xi1>
// CHECK: ( ( 1, 1, 0, 0 ), ( 1, 1, 0, 0 ), ( 1, 1, 0, 0 ), ( 0, 0, 0, 0 ) )
%6 = vector.constant_mask [4, 3] : vector<4x4xi1>
vector.print %6 : vector<4x4xi1>
// CHECK: ( ( 1, 1, 1, 0 ), ( 1, 1, 1, 0 ), ( 1, 1, 1, 0 ), ( 1, 1, 1, 0 ) )
%7 = vector.constant_mask [4, 4] : vector<4x4xi1>
vector.print %7 : vector<4x4xi1>
// CHECK: ( ( 1, 1, 1, 1 ), ( 1, 1, 1, 1 ), ( 1, 1, 1, 1 ), ( 1, 1, 1, 1 ) )
%8 = vector.constant_mask [1, 2, 3] : vector<2x3x4xi1>
vector.print %8 : vector<2x3x4xi1>
// CHECK: ( ( ( 1, 1, 1, 0 ), ( 1, 1, 1, 0 ), ( 0, 0, 0, 0 ) ), ( ( 0, 0, 0, 0 ), ( 0, 0, 0, 0 ), ( 0, 0, 0, 0 ) ) )
%9 = vector.constant_mask [2, 2, 3] : vector<2x3x4xi1>
vector.print %9 : vector<2x3x4xi1>
// CHECK: ( ( ( 1, 1, 1, 0 ), ( 1, 1, 1, 0 ), ( 0, 0, 0, 0 ) ), ( ( 1, 1, 1, 0 ), ( 1, 1, 1, 0 ), ( 0, 0, 0, 0 ) ) )
return
}