[Mlir-commits] [mlir] [mlir][Vector][NFC] Move canonicalizers for DenseElementsAttr to folders (PR #127995)

Kunwar Grover llvmlistbot at llvm.org
Thu Feb 20 04:02:27 PST 2025


================
@@ -310,12 +310,12 @@ func.func @test_vector_insert_scalable(%arg0: vector<2x8x[4]xf32>, %arg1: vector
 // -----
 
 // ALL-LABEL: test_vector_extract_scalar
-func.func @test_vector_extract_scalar() {
+func.func @test_vector_extract_scalar(%idx : index) {
   %cst = arith.constant dense<[1, 2, 3, 4]> : vector<4xi32>
   // ALL-NOT: vector.shuffle
   // ALL:     vector.extract
   // ALL-NOT: vector.shuffle
-  %0 = vector.extract %cst[0] : i32 from vector<4xi32>
+  %0 = vector.extract %cst[%idx] : i32 from vector<4xi32>
----------------
Groverkss wrote:

This now folds, which makes this test not check what it was checking. Instead, this PR makes this test a dynamic index, so that this extract doesn't fold.

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


More information about the Mlir-commits mailing list