[Mlir-commits] [mlir] [mlir][vector] Remove redundant tests (PR #159804)

Andrzej WarzyƄski llvmlistbot at llvm.org
Fri Sep 19 08:57:46 PDT 2025


https://github.com/banach-space created https://github.com/llvm/llvm-project/pull/159804

We ended up with a duplicate test case post #150284 - this PR removes
that. I am also renaming the corresponding test function name, which is
no longer valid (*).

(*) `@extract_from_0d_splatlike_broadcast_regression` implies that all
the tested vectors are rank-0, but that is not the case.


>From a8b886032af8be6873ae6b5350fbc3b9adfedf04 Mon Sep 17 00:00:00 2001
From: Andrzej Warzynski <andrzej.warzynski at arm.com>
Date: Fri, 19 Sep 2025 15:53:39 +0000
Subject: [PATCH] [mlir][vector] Remove redundant tests

We ended up with a duplicate test case post #150284 - this PR removes
that. I am also renaming the corresponding test function name, which is
no longer valid (*).

(*) `@extract_from_0d_splatlike_broadcast_regression` implies that all
the tested vectors are rank-0, but that is not the case.
---
 mlir/test/Dialect/Vector/canonicalize.mlir | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/mlir/test/Dialect/Vector/canonicalize.mlir b/mlir/test/Dialect/Vector/canonicalize.mlir
index 05c88b8abfbb0..a4f63d5b5e9c9 100644
--- a/mlir/test/Dialect/Vector/canonicalize.mlir
+++ b/mlir/test/Dialect/Vector/canonicalize.mlir
@@ -3236,23 +3236,19 @@ func.func @rank_1_shuffle_to_interleave(%arg0: vector<6xi32>, %arg1: vector<6xi3
 
 // -----
 
-// CHECK-LABEL: func @extract_from_0d_splatlike_broadcast_regression(
+// CHECK-LABEL: func @extract_from_splatlike_broadcast(
 //  CHECK-SAME:     %[[A:.*]]: f32, %[[B:.*]]: vector<f32>, %[[C:.*]]: vector<2xf32>)
-func.func @extract_from_0d_splatlike_broadcast_regression(%a: f32, %b: vector<f32>, %c: vector<2xf32>) -> (f32, f32, f32, f32, f32, vector<6x7xf32>, vector<3xf32>) {
-  // Splat/broadcast scalar to 0D and extract scalar.
+func.func @extract_from_splatlike_broadcast(%a: f32, %b: vector<f32>, %c: vector<2xf32>) -> (f32, f32, f32, f32, vector<6x7xf32>, vector<3xf32>) {
+  // Broadcast scalar to 0D and extract scalar.
   %0 = vector.broadcast %a : f32 to vector<f32>
   %1 = vector.extract %0[] : f32 from vector<f32>
 
-  // Broadcast scalar to 0D and extract scalar.
-  %2 = vector.broadcast %a : f32 to vector<f32>
-  %3 = vector.extract %2[] : f32 from vector<f32>
-
   // Broadcast 0D to 3D and extract scalar.
   // CHECK: %[[EXTRACT1:.*]] = vector.extract %[[B]][] : f32 from vector<f32>
   %4 = vector.broadcast %b : vector<f32> to vector<1x2x4xf32>
   %5 = vector.extract %4[0, 0, 1] : f32 from vector<1x2x4xf32>
 
-  // Splat/broadcast scalar to 2D and extract scalar.
+  // Broadcast scalar to 2D and extract scalar.
   %6 = vector.broadcast %a : f32 to vector<2x3xf32>
   %7 = vector.extract %6[0, 1] : f32 from vector<2x3xf32>
 
@@ -3268,8 +3264,8 @@ func.func @extract_from_0d_splatlike_broadcast_regression(%a: f32, %b: vector<f3
   // CHECK: %[[EXTRACT3:.*]] = vector.broadcast %[[A]] : f32 to vector<3xf32>
   %11 = vector.extract %6[1] : vector<3xf32> from vector<2x3xf32>
 
-  // CHECK:   return %[[A]], %[[A]], %[[EXTRACT1]], %[[A]], %[[A]], %[[EXTRACT2]], %[[EXTRACT3]]
-  return %1, %3, %5, %7, %9, %10, %11 : f32, f32, f32, f32, f32, vector<6x7xf32>, vector<3xf32>
+  // CHECK:   return %[[A]], %[[EXTRACT1]], %[[A]], %[[A]], %[[EXTRACT2]], %[[EXTRACT3]]
+  return %1, %5, %7, %9, %10, %11 : f32, f32, f32, f32, vector<6x7xf32>, vector<3xf32>
 }
 
 // -----



More information about the Mlir-commits mailing list