[Mlir-commits] [mlir] [mlir][Vectorizer] Added support to Vectorize tensor.unpack (PR #76087)

Diego Caballero llvmlistbot at llvm.org
Tue Feb 13 11:30:30 PST 2024


================
@@ -1420,16 +1420,28 @@ static Value createReadOrMaskedRead(OpBuilder &builder, Location loc,
   auto sourceShape = dyn_cast<ShapedType>(source.getType()).getShape();
   assert(sourceShape.size() == readShape.size());
   auto maskType = VectorType::get(readShape, builder.getI1Type());
-  auto vectorType = VectorType::get(readShape, padValue.getType());
+  Type vecElemType = padValue != nullptr
+                         ? padValue.getType()
+                         : cast<ShapedType>(source.getType()).getElementType();
----------------
dcaballe wrote:

Couldn't we always get the element type from `source`? Getting it from the pad value looks weird.

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


More information about the Mlir-commits mailing list