[Mlir-commits] [mlir] [MLIR][AMDGPU] Added l2-prefetch op to AMDGPU (PR #188457)

Ravil Dorozhinskii llvmlistbot at llvm.org
Fri Mar 27 03:50:29 PDT 2026


================
@@ -1302,5 +1302,38 @@ LogicalResult DsBarrierArriveOp::verify() {
   return verifyDsBarrierOpCommon(*this);
 }
 
+//===----------------------------------------------------------------------===//
+// GlobalPrefetchOp
+//===----------------------------------------------------------------------===//
+
+LogicalResult GlobalPrefetchOp::verify() {
+  auto src = cast<MemRefType>(getSrc().getType());
+
+  Attribute memSpace = src.getMemorySpace();
+  if (!memSpace)
+    return this->emitOpError("the source must have address space attribute");
+  if (!hasGlobalMemorySpace(memSpace))
+    return this->emitOpError("the source must reside in global address space");
+
+  ArrayRef<int64_t> srcShape = src.getShape();
+  const size_t numIndices = getIndices().size();
+  if (srcShape.size() != numIndices)
+    return this->emitOpError(
+        "the number of indices must match the source shape size");
+
+  const TemporalHint temporalHint = getTemporalHint();
+  const bool isSpeculative = getSpeculative();
+  if (temporalHint == TemporalHint::NT)
----------------
ravil-mobile wrote:

Wrote a comment about it. Actually, thanks for noticing! I realized that LU mode was also not supported for the prefetch op. From what I understood, NT and LU were dropped and the extra bits were used to encode `speculative` and `non-speculative` modes.

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


More information about the Mlir-commits mailing list