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

Ravil Dorozhinskii llvmlistbot at llvm.org
Thu Mar 26 05:57:41 PDT 2026


================
@@ -3950,6 +3950,56 @@ struct AMDGPUTensorLoadStoreOpLowering
   }
 };
 
+struct GlobalPrefetchOpLowering
+    : public ConvertOpToLLVMPattern<GlobalPrefetchOp> {
+  GlobalPrefetchOpLowering(const LLVMTypeConverter &converter, Chipset chipset)
+      : ConvertOpToLLVMPattern<GlobalPrefetchOp>(converter), chipset(chipset) {}
+
+  LogicalResult
+  matchAndRewrite(GlobalPrefetchOp op, GlobalPrefetchOpAdaptor adaptor,
+                  ConversionPatternRewriter &rewriter) const override {
+    if (chipset < kGfx1250)
+      return op->emitOpError("is only supported on gfx1250+");
+
+    const TemporalHint hint = op.getTemporalHint();
+    const bool isSpeculative = op.getSpeculative();
+
+    int32_t llvmScopeValue = static_cast<int32_t>(hint);
+    if (hint == TemporalHint::RT || hint == TemporalHint::HT)
----------------
ravil-mobile wrote:

Sure. Added. The idea is that only regular and high temporary hints can operate in speculative and non-speculative modes. The others are operating only in the speculative one. It is how it is defined by hw

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


More information about the Mlir-commits mailing list