[Mlir-commits] [mlir] [mlir][vector] Fix attaching write effects on transfer_write's base (PR #142940)

Simone Pellegrini llvmlistbot at llvm.org
Thu Jun 5 04:03:24 PDT 2025


================
@@ -0,0 +1,17 @@
+// RUN: mlir-opt %s --test-side-effects --verify-diagnostics
+
+func.func @test_side_effects(%arg0: memref<8xf32>) {
+  // expected-remark @below {{operation has no memory effects}}
+  %c0 = arith.constant 0 : index
+  // expected-remark @below {{operation has no memory effects}}
+  %c4 = arith.constant 4 : index
+  // expected-remark @below {{operation has no memory effects}}
+  %cst = arith.constant 0.0 : f32
+  // expected-remark @below {{operation has no memory effects}}
+  %vec_cst = arith.constant dense<0.0> : vector<4xf32>
+  // expected-remark @below {{found an instance of 'read' on op operand 0, on resource '<Default>'}}
+  %0 = vector.transfer_read %arg0[%c0], %cst : memref<8xf32>, vector<4xf32>
+  // expected-remark @below {{found an instance of 'write' on op operand 1, on resource '<Default>'}}
----------------
simpel01 wrote:

Without the changes to the `TransferWriteOp::getEffects(...)` function the write effect would be attached to op operand `0` rather than on `1`.

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


More information about the Mlir-commits mailing list