[Mlir-commits] [mlir] [mlir][memref-to-spirv]: Reverse Image Load Coordinates (PR #160495)

Jakub Kuderski llvmlistbot at llvm.org
Wed Sep 24 05:26:40 PDT 2025


================
@@ -758,8 +758,10 @@ ImageLoadOpPattern::matchAndRewrite(memref::LoadOp loadOp, OpAdaptor adaptor,
   if (memrefType.getRank() != 1) {
     auto coordVectorType = VectorType::get({loadOp.getMemRefType().getRank()},
                                            adaptor.getIndices().getType()[0]);
+    auto indices = llvm::to_vector(adaptor.getIndices());
+    auto indicesReversed = llvm::to_vector(llvm::reverse(indices));
----------------
kuhar wrote:

If you don't need both, reverse `indices` in-place

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


More information about the Mlir-commits mailing list