[Mlir-commits] [mlir] [mlir][xegpu] Allow out-of-bounds writes (PR #110811)

Adam Siemieniuk llvmlistbot at llvm.org
Wed Oct 9 09:58:30 PDT 2024


================
@@ -218,18 +218,15 @@ struct TransferWriteLowering
     if (failed(transferPreconditions(rewriter, writeOp)))
       return failure();
 
-    if (writeOp.hasOutOfBoundsDim())
-      return rewriter.notifyMatchFailure(writeOp,
-                                         "Unsupported out-of-bounds write");
     AffineMap map = writeOp.getPermutationMap();
     if (!map.isMinorIdentity())
       return rewriter.notifyMatchFailure(writeOp, "Expects identity map");
 
     VectorType vecTy = writeOp.getVectorType();
-    auto descType =
-        xegpu::TensorDescType::get(vecTy.getShape(), vecTy.getElementType(),
-                                   /*array_length=*/1, /*boundary_check=*/false,
-                                   xegpu::MemorySpace::Global);
+    auto descType = xegpu::TensorDescType::get(
+        vecTy.getShape(), vecTy.getElementType(),
+        /*array_length=*/1, /*boundary_check=*/writeOp.hasOutOfBoundsDim(),
----------------
adam-smnk wrote:

Good point, I'll open a separate PR that adds extra validation to both read and write on 1D shapes.

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


More information about the Mlir-commits mailing list