[Mlir-commits] [mlir] [mlir][SPIRV] Add decorateType method for MatrixType (PR #112018)

Jakub Kuderski llvmlistbot at llvm.org
Sun Oct 27 18:59:47 PDT 2024


================
@@ -138,6 +140,25 @@ Type VulkanLayoutUtils::decorateType(spirv::ArrayType arrayType,
   return spirv::ArrayType::get(memberType, numElements, elementSize);
 }
 
+Type VulkanLayoutUtils::decorateType(spirv::MatrixType matrixType,
+                                     VulkanLayoutUtils::Size &size,
+                                     VulkanLayoutUtils::Size &alignment) {
+  const auto numColumns = matrixType.getNumColumns();
+  const auto columnType = matrixType.getColumnType();
+  const auto numElements = matrixType.getNumElements();
+  auto elementType = matrixType.getElementType();
----------------
kuhar wrote:

> you mean `Type elementType = matrixType.getElementType();` would be better?
Yes.

> I think it's not bad, but the code in other similar places also uses `auto`. Should I replace them all?
I'd rather have larger cleanups in a separate PR. It's fine if things are not exactly uniform, but we should converge towards code that follows the mlir coding standards.


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


More information about the Mlir-commits mailing list