[Mlir-commits] [mlir] [MLIR][XeVM] Add lowering for llvm load store ops with XeVM cache control (PR #156768)
Artem Kroviakov
llvmlistbot at llvm.org
Thu Sep 4 01:10:05 PDT 2025
================
@@ -568,6 +616,22 @@ class LoadStorePrefetchToOCLPattern : public OpConversionPattern<OpType> {
return success();
}
};
+template <typename OpType>
+class LLVMLoadStoreToOCLPattern : public OpConversionPattern<OpType> {
+ using OpConversionPattern<OpType>::OpConversionPattern;
+ LogicalResult
+ matchAndRewrite(OpType op, typename OpType::Adaptor adaptor,
+ ConversionPatternRewriter &rewriter) const override {
+ if (!op->hasAttr("cache_control"))
+ return failure();
+ constexpr bool isLoad = std::is_same_v<OpType, LLVM::LoadOp>;
----------------
akroviakov wrote:
Can it be pushed into `getCacheControlMetadata()` and get rid of the template argument there? Also applies to `LoadStorePrefetchToOCLPattern`
https://github.com/llvm/llvm-project/pull/156768
More information about the Mlir-commits
mailing list