[Mlir-commits] [mlir] [mlir] Add direct vectorization lowering for `tensor.pack` ops (PR #78660)

Han-Chung Wang llvmlistbot at llvm.org
Thu Jan 18 23:55:59 PST 2024


================
@@ -1585,6 +1706,30 @@ vectorizeLinalgOpPrecondition(LinalgOp linalgOp,
   return success();
 }
 
+static LogicalResult
+vectorizePackOpPrecondition(tensor::PackOp packOp,
+                            ArrayRef<int64_t> inputVectorSizes) {
+  auto padValue = packOp.getPaddingValue();
+  if (padValue && getConstantIntValue(padValue) != std::nullopt) {
----------------
hanhanW wrote:

nit: I think using `.has_value` is better.

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


More information about the Mlir-commits mailing list