[Mlir-commits] [mlir] [mlir][spirv] Make `CooperativeMatrixType` a `ShapedType` (PR #142784)

Jakub Kuderski llvmlistbot at llvm.org
Fri Jun 6 13:00:31 PDT 2025


================
@@ -418,6 +419,23 @@ class CooperativeMatrixType
                      std::optional<StorageClass> storage = std::nullopt);
   void getCapabilities(SPIRVType::CapabilityArrayRefVector &capabilities,
                        std::optional<StorageClass> storage = std::nullopt);
+
+  operator ShapedType() const { return llvm::cast<ShapedType>(*this); }
+
+  ArrayRef<int64_t> getShape() const;
+
+  bool hasRank() const { return true; }
+
+  CooperativeMatrixType cloneWith(std::optional<ArrayRef<int64_t>> shape,
+                                  Type elementType) const {
+    if (shape == std::nullopt)
----------------
kuhar wrote:

```suggestion
    if (!shape)
```

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


More information about the Mlir-commits mailing list