[Mlir-commits] [mlir] [mlir][tensor] Fold padding_value away for pack ops when possible. (PR #74005)

Han-Chung Wang llvmlistbot at llvm.org
Thu Nov 30 15:57:08 PST 2023


================
@@ -3800,17 +3800,37 @@ static bool haveSameTiles(PackOp packOp, UnPackOp unPackOp) {
   return true;
 }
 
-/// Fold an unpack(pack(x)) to x.
+/// Returns true if the pack op does not need a padding value.
+static bool paddingIsNotNeeded(PackOp op) {
+  auto srcType = op.getSourceType();
+  if (llvm::any_of(op.getInnerDimsPos(),
----------------
hanhanW wrote:

oh you meant dynamic inner tile sizes? Good catch, adding the case now...

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


More information about the Mlir-commits mailing list