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

Chao Chen llvmlistbot at llvm.org
Wed Oct 9 09:37:17 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(),
----------------
chencha3 wrote:

Should be aware that, there is not boundary check for 1D load. 

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


More information about the Mlir-commits mailing list