[Mlir-commits] [mlir] [mlir][Vector] Support mixed mode vector.contract lowering (PR #117753)

Jakub Kuderski llvmlistbot at llvm.org
Fri Nov 29 09:58:33 PST 2024


================
@@ -80,6 +80,22 @@ static AffineMap adjustMap(AffineMap map, int64_t index,
   return AffineMap::get(map.getNumDims() - 1, 0, results, ctx);
 }
 
+Value promoteToElementType(Location loc, RewriterBase &rewriter, Value v,
+                           Type dstElementType) {
+  Type elementType = v.getType();
+  auto vecType = dyn_cast<VectorType>(elementType);
+  if (vecType)
+    elementType = vecType.getElementType();
+  if (elementType == dstElementType)
+    return v;
----------------
kuhar wrote:

Can we use `getElementTypeOrSelf` or do you need to check for vector specifically?

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


More information about the Mlir-commits mailing list