[Mlir-commits] [mlir] [mlir][vector] Add tests for `populateSinkVectorBroadcastPatterns` (1/n) (PR #102286)
Andrzej WarzyĆski
llvmlistbot at llvm.org
Tue Aug 13 03:37:09 PDT 2024
================
@@ -1,16 +1,32 @@
// RUN: mlir-opt %s -test-sink-vector-broadcast -split-input-file | FileCheck %s
+//-----------------------------------------------------------------------------
+// [Pattern: ReorderElementwiseOpsOnBroadcast]
+//-----------------------------------------------------------------------------
+
// CHECK-LABEL: func.func @broadcast_scalar_with_bcast(
// CHECK-SAME: %[[ARG_0:.*]]: index, %[[ARG_1:.*]]: index) -> vector<1x4xindex> {
// CHECK: %[[ADD:.*]] = arith.addi %[[ARG_0]], %[[ARG_1]] : index
// CHECK: %[[BCAST:.*]] = vector.broadcast %[[ADD]] : index to vector<1x4xindex>
// CHECK: return %[[BCAST]] : vector<1x4xindex>
-func.func @broadcast_scalar_with_bcast( %arg1: index, %arg2: index) -> vector<1x4xindex> {
+func.func @broadcast_scalar_with_bcast(%arg1: index, %arg2: index) -> vector<1x4xindex> {
%0 = vector.broadcast %arg1 : index to vector<1x4xindex>
%1 = vector.broadcast %arg2 : index to vector<1x4xindex>
- %2 = arith.addi %0, %1 : vector<1x4xindex>
- return %2 : vector<1x4xindex>
+ %2 = arith.addi %0, %1 : vector<1x4xindex> return %2 : vector<1x4xindex>
+}
----------------
banach-space wrote:
Thanks, fixed!
https://github.com/llvm/llvm-project/pull/102286
More information about the Mlir-commits
mailing list