[Mlir-commits] [mlir] [mlir][memref][spirv] Add SPIR-V Image Lowering (PR #150978)
Jakub Kuderski
llvmlistbot at llvm.org
Wed Jul 30 05:09:54 PDT 2025
================
@@ -575,6 +575,82 @@ static Type convertMemrefType(const spirv::TargetEnv &targetEnv,
}
spirv::StorageClass storageClass = attr.getValue();
+ // Images are a special case since they are an opaque type from which elements
+ // may be accessed via image specific ops or directly through a texture
+ // pointer.
+ if (storageClass == spirv::StorageClass::Image) {
+ const int64_t rank = type.getRank();
+ if (rank < 1 || rank > 3) {
+ LLVM_DEBUG(llvm::dbgs()
+ << type << " illegal: cannot lower memref of rank " << rank
+ << " to a SPIR-V Image\n");
+ return nullptr;
+ }
+
+ const auto dim = [rank]() {
----------------
kuhar wrote:
Put this in a helper function?
https://github.com/llvm/llvm-project/pull/150978
More information about the Mlir-commits
mailing list