[Mlir-commits] [mlir] [mlir][linalg] Vectorize unpack op without masking (PR #89067)

Han-Chung Wang llvmlistbot at llvm.org
Thu Apr 25 09:53:33 PDT 2024


================
@@ -1753,8 +1764,14 @@ vectorizeUnPackOpPrecondition(tensor::UnPackOp unpackOp,
     LDBG("Inner-tiles must be constant: " << unpackOp << "\n");
     return failure();
   }
-  llvm::ArrayRef<int64_t> resultShape = unpackOp.getDestType().getShape();
-  if (!inputVectorSizes.empty() &&
+  ArrayRef<int64_t> resultShape = unpackOp.getDestType().getShape();
+  bool satisfyEmptyCond = true;
+  if (inputVectorSizes.empty()) {
+    if (!unpackOp.getDestType().hasStaticShape() ||
+        !unpackOp.getSourceType().hasStaticShape())
+      satisfyEmptyCond = false;
+  }
----------------
hanhanW wrote:

I think we don't need the `if` here.. so maybe just put the conditions together in the initialization. E.g.,

```
bool satisfyEmptyCond = inputVectorSizes.empty() && .. &&..;
```

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


More information about the Mlir-commits mailing list