[Mlir-commits] [mlir] [mlir][vector] ND vectors linearization pass (PR #81159)

Ivan Butygin llvmlistbot at llvm.org
Mon Feb 12 15:43:46 PST 2024


================
@@ -0,0 +1,15 @@
+// RUN: mlir-opt %s -split-input-file -test-vector-linearize | FileCheck %s
+
+// CHECK-LABEL: test_linearize
+//  CHECK-SAME: (%[[ORIG_ARG:.*]]: vector<2x2xf32>)
+//       CHECK: %[[ARG:.*]] = vector.shape_cast %[[ORIG_ARG]] : vector<2x2xf32> to vector<4xf32>
+func.func @test_linearize(%arg0: vector<2x2xf32>) -> vector<2x2xf32> {
+//       CHECK: %[[C1:.*]] = arith.constant dense<[1.000000e+00, 2.000000e+00, 3.000000e+00, 4.000000e+00]> : vector<4xf32>
+  %0 = arith.constant dense<[[1.0, 2.0], [3.0, 4.0]]> : vector<2x2xf32>
+// Arith and math ops are handled in generic way, check some of them
+//       CHECK: %{{.*}} =  math.sin %[[ARG]] : vector<4xf32>
----------------
Hardcode84 wrote:

Added more checks for `shape_cast` on the boundaries and check for `return` op unchanged, not sure what else to check.

https://github.com/llvm/llvm-project/pull/81159


More information about the Mlir-commits mailing list