[Mlir-commits] [mlir] [MLIR][NVVM] Add prefetch Ops (PR #141737)
Durgadoss R
llvmlistbot at llvm.org
Wed Jun 4 03:24:51 PDT 2025
================
@@ -1734,6 +1768,55 @@ NVVM::IDArgPair DotAccumulate2WayOp::getIntrinsicIDAndArgs(
return {ids[type], args};
}
+llvm::Intrinsic::ID PrefetchOp::getIntrinsicID(Operation &op) {
+ auto curOp = llvm::cast<NVVM::PrefetchOp>(op);
+ NVVM::PrefetchCacheLevel cacheLevel = curOp.getCacheLevel();
+ std::optional<NVVM::CacheEvictionPriority> evictPriority =
+ curOp.getEvictPriority();
+ unsigned as = llvm::cast<LLVM::LLVMPointerType>(curOp.getAddr().getType())
+ .getAddressSpace();
+
+ if (curOp.getUniform()) {
+ if (cacheLevel == NVVM::PrefetchCacheLevel::L1)
+ return llvm::Intrinsic::nvvm_prefetchu_L1;
+ else
+ llvm_unreachable("Invalid uniform cache level");
+ }
----------------
durga4github wrote:
This can be simplified since we already have a verifier check for this (invalid) case here..
https://github.com/llvm/llvm-project/pull/141737
More information about the Mlir-commits
mailing list